"load from" and stored procedures
Posted in 2000
Topics: Stored Procedures & SPL, Connectivity: ODBC / JDBC / .NET
I would like to be able to use "load from filename insert into..." in a SP but can see that this cannot be done as it isn't "SQL". Can anyone suggest a way around this? That is, I have an ascii delimited file that I need to load into a table. I must do it via ODBC and so must used a stored procedure.... Kate Sent via Deja.com http://www.deja.com/ Before you buy.
If I understand what you're trying to do correctly, you're trying to
take a ascii text file from a client machine and load it into the
database on your server via ODBC? If not, ignore the rest of this...
You can open the file for reading on the client, parse it apart, and
send the columns to the database and call a stored procedure. The
procedure would have a straight insert statement using the passed
arguments. That's the only way that I can think of to load via a stored
procedure and ODBC. Depending on how many records you have to load, it
could be pretty slow though.
The stored procedure would look something like this:
create procedure loadrecord(col1 CHAR(10),...)
insert into table1 (column1, ...) values (col1, ...)
end procedure
In article <8cte8q$p0b$1@nnrp1.deja.com>,
Kate Juliff <kcj@mechoshade.com> wrote:
> I would like to be able to use "load from filename insert into..." in
a
> SP but can see that this cannot be done as it isn't "SQL".
>
> Can anyone suggest a way around this?
>
> That is, I have an ascii delimited file that I need to load into a
> table. I must do it via ODBC and so must used a stored procedure....
>
> Kate
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
--
# unrm /
ksh: unrm: not found
# man cpio
Sent via Deja.com http://www.deja.com/
Before you buy.