Links
Home
Oracle DBA Forum
Frequent Oracle Errors
TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found'>ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated
sql loader problem

sql loader problem

2004-07-22       - By Mercadante, Thomas F

Reply:     1     2  

David,

About the only thing that I can think of is to create a function that does
this:

CREATE OR REPLACE FUNCTION tom_get_val
RETURN NUMBER IS

ret_val NUMBER;

BEGIN

BEGIN
SELECT tom_seq.CURRVAL INTO ret_val FROM dual;
EXCEPTION
    WHEN OTHERS THEN
    SELECT tom_seq.NEXTVAL INTO ret_val FROM dual;
END;
       RETURN ret_val;
END;


And then in your sqlldr file:

(BATCHID
EXPRESSION
"tom_get_val "


Havn 't tried this, but I have used functions withing sqlldr before.

Good Luck.

Tom Mercadante
Oracle Certified Professional


-- --Original Message-- --
From: david wendelken [mailto:davewendelken@(protected)]
Sent: Thursday, July 22, 2004 10:58 AM
To: oracle-l@(protected)
Subject: RE: sql loader problem


(Sorry, sent this out under the wrong header)

Now that data loads, I can 't figure out how to do one thing.

Two batch identification columns,

batchid
batchrecnum

batchid should have the same value for each record loaded in the same sqlldr
run. batchrecnum should start at 1 for each sqlldr run, and increment by 1.

So, here 's the relevant portion of the control file:


(BATCHID
EXPRESSION
"NVL(BATCHID_SEQ.CURRVAL,BATCHID_SEQ.NEXTVAL) "
,BATCHRECNUM
RECNUM

batchrecnum works like a charm.

I didn 't actually expect a reference to the sequence currval to work like
this (before a reference to nextval first), but it didn 't raise an error.
(I just hoped to illustrate clearly what I wanted.) However, the data
loaded! But, it gives me the next value from the sequence for each new
record.

So, instead of getting, in one load (where the next value of batchid_seq
would be
5:

5,1
5,2
5,3
5,4

I 'm getting,

5,1
6,2
7,3
8,4

Any ideas, besides hard-coding the batchid value for the run into the sqlldr
control file? I don 't want to do that...

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected) put
'unsubscribe ' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe send email to: oracle-l-request@(protected)
put 'unsubscribe ' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --