Solved

SQLLDR with a constant in the control file

Posted on 2006-10-23
2
3,475 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
migration MS SQL database to Oracle 30 82
Read XML values 8 68
Cannot connect to Oracle database, python not recognizing cx_Oracle 2 70
Automate an Oracle update in Excel 7 70
Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to take different types of Oracle backups using RMAN.

734 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