I am not sure if I this is the right forum for this question, but I didn't know where else to post it.
How do I invoke SQL*Loader with all the parameters (like control and log) from VB .
I feel you can best create a batch file to Invoke sql*loaderr and define all the parameters on the OS like the control file,data file and call this batch file from VB.I think you can call a file from VB
You can have VB write the control file/parameter file(s) with the appropirate parms, then issue the shell("command line") command thru VB to execute .
Joseph R.P. Maloney, CSP,CDP,CCP
'The answer is 42'
I tried the foll. command from VB:
sqlldr userid=scott/tiger@optxdb control="C:\temp\testheader.ctl" log="C:\temp\testheader.log"")
I even tried giving the path name for sqlldr like:
retval=shell("C:\oracle\ora81\bin\sqlldr.exe .........rest of the parameters here) , but both these formats do not work.
I tried it your way by using the batch file. It works perfectly fine.
But, I think there should be a way to call SQL*Loader from VB directly.
I have VB 5 professional, SP3 and personal Oracle 8.1.6. on my PC at home. I just started a new "Standard EXE" project in VB, added one button with the following code:
Private Sub Command1_Click()
retval = Shell("c:\oradb\bin\sqlldr.exe userid=user/pwd@mydb control=c:\temp\testdat.ctl bad=c:\temp\testdat.bad log=c:\temp\testdat.log")
I then clicked the button and the rows were inserted as expected.
into table loadtest
fields terminated by ','
What are you doing differently than this, and what exactly do you mean when you state:
"but both these formats do not work."
What doesn't work? What exactly happens? Do you see a momentary DOS window open? Does your log or bad file get populated?
I made a mistake of adding double quotes for the control and log files.
It works now.
Click Here to Expand Forum to Full Width