Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to hardcode a column of value in SQL Loader

Status
Not open for further replies.

boxzzz

Programmer
Mar 8, 2005
4
US
Hi,

I'm trying to load a file using sql loader. Is there a way to create a column where I can hardcode and assign a specific value.

options (rows=500)
load data
infile '/d04/1249.dat'
badfile '/home/cdb_buslink.bad'
into table cdb_buslink
truncate
(bus_link position(74:89) char,
listcode)


is there a syntax on how I can harcode a value for the listcode field?

Thanks

 
Use the CONSTANT keyword e.g.

LOAD DATA
INFILE *
INTO TABLE users
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(rownumber, user_string constant 'XXX')
BEGINDATA
1,
2,
3,
4
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top