Home » SQL & PL/SQL » SQL & PL/SQL » SQL Loader+SQL queries.
SQL Loader+SQL queries. [message #250685] Tue, 10 July 2007 18:23 Go to next message
rikesh
Messages: 1
Registered: July 2007
Location: Irving
Junior Member
Hi All,

I have a requirement where I have to execute a series of SQLs and also load data using Sql loader.

i.e.

truncate table x
load data into table x using sql loader
update table x.

Is it possible to execute all these in just 1 call rather than executing it 1 by 1?
Re: SQL Loader+SQL queries. [message #250686 is a reply to message #250685] Tue, 10 July 2007 18:29 Go to previous messageGo to next message
DreamzZ
Messages: 1666
Registered: May 2007
Location: Dreamzland
Senior Member
YES..
Re: SQL Loader+SQL queries. [message #250693 is a reply to message #250686] Tue, 10 July 2007 21:39 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Not with SQL Loader. Take a look at Externally Organized Tables in the manual.

Ross Leishman
Re: SQL Loader+SQL queries. [message #251226 is a reply to message #250693] Thu, 12 July 2007 13:14 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8635
Registered: November 2002
Location: California, USA
Senior Member
You can do the truncate and load all at once with either SQL*Loader or external tables, but not an update. If using external tables, you would have to insert into another table and update that. If using SQL*Loader, you would have to either issue a separate update statement or, depending on how complex your update is, perhaps just call function(s) in your SQL*Loader control file. You could include your calls to run SQL*Loader and/or sql scripts all in one operating system batch file. Some more details as to what you are trying to accomplish might help.
Re: SQL Loader+SQL queries. [message #251272 is a reply to message #250685] Thu, 12 July 2007 15:15 Go to previous message
joy_division
Messages: 4641
Registered: February 2005
Location: East Coast USA
Senior Member
Like Barbara said, you can use a function right in your SQL Loader control file, but if you are updating the same table you are uploading, what did you have in mind? If you just want to "manipulate" the row you are on, then ok, but if it will be updating other rows, one thing you will have to do is set your BINDSIZE=1.
.
.
.
some_column "my_function(:some_column)"
.
.

shows how to use a function on single column of a row. Play with it. Maybe if you tell us what you want to do...
Previous Topic: Function Overloading
Next Topic: ORA-00937:not a single-group group function|ORA-06512:at"schema.procedure name)?
Goto Forum:
  


Current Time: Wed Dec 07 04:55:10 CST 2016

Total time taken to generate the page: 0.07136 seconds