PDA

View Full Version : SQLLoader in an API?


Guest
03-23-2005, 02:25 PM
Preamble: I did post this initially to comp.databases.oracle, but found
an article indicating that it was basically a dead group, serving as a
pointer to the more defined groups. Thus, I posted in error, and
believe this is the appropriate group to ask the following question. I
apologize in advance; I do not mean to cross-post.

Hi all-

I have a windows service (like a Unix daemon) that loads flat files
into an 8.1.7 database. I use Oracle Objects for this, but it takes a
very long time, especially with CLOBs to do > 10,000 records. I would
use SQL Loader, but because this is a service, I can't spawn SQLLoader
to do the load for me.

Is there a SQLLoader-type API that I can call to do the same
functionality from within my program?

Thanks,

Ron

Rauf Sarwar
03-24-2005, 01:31 AM
tachoknight@gmail.com wrote: Preamble: I did post this initially to comp.databases.oracle, but
found an article indicating that it was basically a dead group, serving as
a pointer to the more defined groups. Thus, I posted in error, and believe this is the appropriate group to ask the following question.
I apologize in advance; I do not mean to cross-post. Hi all- I have a windows service (like a Unix daemon) that loads flat files into an 8.1.7 database. I use Oracle Objects for this, but it takes a very long time, especially with CLOBs to do > 10,000 records. I would use SQL Loader, but because this is a service, I can't spawn
SQLLoader to do the load for me. Is there a SQLLoader-type API that I can call to do the same functionality from within my program? Thanks, Ron

What is preventing you from spawning SQL Loader from a service?

Regards
/Rauf

Guest
03-24-2005, 06:49 AM
No one is logged into the machine, so there is no user context in which
to run SQL Loader. In other words, you can't run a console app if you
have no console to run it on.

GreyBeard
03-24-2005, 10:07 AM
On Wed, 23 Mar 2005 14:25:50 -0800, tachoknight@gmail.com wrote:

Is there a SQLLoader-type API that I can call to do the same functionality from within my program?

Realizing this is not applicable, but perhaps this will add some fuel to
the 'time to upgrade to a supported version' thought process....

Effective Oracle9i, you can use the 'External Table' capability as the
SQL*Loader API.

In a nutshell, you can now create read-only tables that use the
SQL*Loader syntax to map between the external file contents and the
table's columns. Then you can use that table directly in SELECTs, JOINs
and even MERGE statements.

/FGB

Rauf Sarwar
03-24-2005, 10:46 AM
tachoknight@gmail.com wrote: No one is logged into the machine, so there is no user context in
which to run SQL Loader. In other words, you can't run a console app if you have no console to run it on.

Services run in their own environment in which they have access to a
sort of virtual desktop. You don't actually have to be logged into the
machine yet spawn any process from a service via CreateProcess()
function. That is one of the benefits of running stuff as service.

Just google on "CreateProcess from service".

Regards
/Rauf

Guest
03-24-2005, 01:40 PM
Thank's Rauf, I'll check that out.

Guest
03-24-2005, 01:42 PM
Yep, I remembered that you could do that, but couldn't remember the
name they called it. The problem, of course, is that while we are
planning on moving to 10g, it won't happen before this app goes live,
so there will be a lot more options at some point, but not right now.

Sybrand Bakker
03-26-2005, 02:46 AM
On 24 Mar 2005 13:42:04 -0800, "tachoknight@gmail.com"
<tachoknight@gmail.com> wrote:
Yep, I remembered that you could do that, but couldn't remember thename they called it. The problem, of course, is that while we areplanning on moving to 10g, it won't happen before this app goes live,so there will be a lot more options at some point, but not right now.

However, it would simply be a waste of time to start building a
service, as sqlldr is not a service, but just an O/S command.


--
Sybrand Bakker, Senior Oracle DBA


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service