Solved

SQLLDR with a constant in the control file

Posted on 2006-10-23
2
3,268 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 31

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to recover a database from a user managed backup

744 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

13 Experts available now in Live!

Get 1:1 Help Now