-
sqlloader question
I've 2 columns in my data file: A1, A2.
I want to insert the contents in a table wich h've as Primary Key: A1,A2 and B3.
I want in the control file to insert a default value for column B3.
How can i do?
Thank's
-
instead why dont you define a default for the column?
funky...
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
-
I can't add default value for this column, cause B3 is a year value. every year, we load data with the current year. So if we make default in table level.... it'll not work.
Is there no default value in the Load data clause?
-
Code:
SQL> create table t (year number default to_char(sysdate,'yyyy'),
2 name varchar(2));
Table created.
SQL> insert into t (name) values ('Th');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from t;
YEAR NA
---------- --
2004 Th
-
Originally posted by bensmail
I can't add default value for this column, cause B3 is a year value. every year, we load data with the current year. So if we make default in table level.... it'll not work.
Why cant you set default.. you can do just by
Trunc(Sysdate, 'YEAR')
Abhay.
funky...
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
-
Re: sqlloader question
Originally posted by bensmail
I want in the control file to insert a default value for column B3.
How can i do?
Use SQL*Loader's control file parameter CONSTANT.
http://download-west.oracle.com/docs...06.htm#1008262
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|