Home » RDBMS Server » Server Utilities » Passing parameters to sqlldr
Passing parameters to sqlldr [message #73000] Tue, 13 January 2004 03:59 Go to next message
Femi Adigun
Messages: 6
Registered: June 2002
Junior Member
How can I pass parameters to sqlldr in a Windows environment?

thanks.

 
Re: Passing parameters to sqlldr [message #73001 is a reply to message #73000] Tue, 13 January 2004 05:09 Go to previous messageGo to next message
Frank Naude
Messages: 4580
Registered: April 1998
Senior Member
Hi,

One possible solution is to create a *.CMD or *.BAT file and enter the "sqlldr" command with its parameter into it.

Best regards.

Frank
Re: Passing parameters to sqlldr [message #73005 is a reply to message #73000] Tue, 13 January 2004 10:39 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
as Frank told, this batch script runsqlldr will take an argument...name of control file...
C:>runsqlldr member.ctl

SQL*Loader: Release 8.1.6.0.0 - Production on Tue Jan 13 15:39:57 2004

(c) Copyright 1999 Oracle Corporation.  All rights reserved.

Commit point reached - logical record count 3

C:>query member

Table: member

CONTROL_ID NAME         ADDRESS
---------- ------------ ------------------------------
        80 Charlie       250 yonge st
        80 Peter         5 Brookbanks dr
        80 Ben           123 King st

3 rows selected.

C:>cat runsqlldr.bat
@echo off
:loop
if "%1"=="" GOTO continue
        sqlldr userid=mag/mag@mutation control=%1
        goto End
        :End
SHIFT
GOTO Loop
:continue

C:>cat member.ctl
load data
infile 'member.dat'
insert into table member
fields terminated by ','
(
control_id constant '80',
name,
address
)
C:>cat member.dat
Charlie, 250 yonge st
Peter, 5 Brookbanks dr
Ben, 123 King st

Re: Passing parameters to sqlldr [message #73008 is a reply to message #73001] Wed, 14 January 2004 00:18 Go to previous message
Femi Adigun
Messages: 6
Registered: June 2002
Junior Member
Thanks a lot for your response. However, i am still not clear. Can you give me a specific example (for a Windows environment)?
The problem i have is that i have a number of text data files for the branches of an organization to be loaded into an oracle table. At the point of loading, i want the user to specify for which branch he intends to do the loading, so that that value could be incorporated into the oracle table.

Regards
Previous Topic: Passing parameter to sqlloader
Next Topic: sequence
Goto Forum:
  


Current Time: Wed Jun 26 12:49:29 CDT 2024