Solved

SQLLDR with a constant in the control file

Posted on 2006-10-23
2
3,283 Views
Last Modified: 2012-08-13
Hi I am trying to setup a control file for sqlldr I write the file just before I do an import so the file is dynamic. When I write the file I want to set one of my parameters to a fixed value somthing like the following:

UNRECOVERABLE
LOAD DATA
INFILE *
APPEND INTO TABLE CD.TARGET_LOAD
(
MY_FIXED_VALUE 911 INTEGER EXTERNAL
MY_NBR POSITION(13:25) INTEGER EXTERNAL
, MY_ID POSITION(324:329) INTEGER EXTERNAL
)

The My_FIXED_VALUE is the part that doesn't work though what is the proper syntax for this command?
0
Comment
Question by:toby_lang
2 Comments
 
LVL 6

Accepted Solution

by:
Ritesh_Garg earned 50 total points
ID: 17792384
Use this:

LOAD DATA
INFILE *
APPEND INTO TABLE CD.TARGET_LOAD
(
  MY_FIXED_VALUE     constant   "911"
, MY_NBR POSITION(13:25) INTEGER EXTERNAL
, MY_ID POSITION(324:329) INTEGER EXTERNAL
)

Remember to put your value in double-quotes.

Thanks,
Ritesh
0
 
LVL 32

Expert Comment

by:awking00
ID: 17797330
Ritesh_Garg's solution is correct. However, it's not necessary to include the value in quotes unless it is a reserved keyword.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now