467,877 Members | 1,130 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

LOAD via a Stored Procedure

Can you use a the load or import command in a stored procedure??? I
tried to LOAD FROM blah blah...within a stored procedure but i get a
error that was not expecting the worD LOAD! Any ideas??? TIA!

i.e

CREATE PROCEDURE LOAD_DATA()
SPECIFIC LOAD_DATA
LANGUAGE SQL

BEGIN
LOAD FROM C:\TEMP\DATA.DAT...... <<<< I GET THE ERROR ON THIS
LINE???
......
.....
END
Nov 12 '05 #1
  • viewed: 3571
Share:
1 Reply
Thanos wrote:
Can you use a the load or import command in a stored procedure??? I
tried to LOAD FROM blah blah...within a stored procedure but i get a
error that was not expecting the worD LOAD! Any ideas??? TIA!
Yes, you can but you have to use an external programming language like C and
the DB2 APIs.
CREATE PROCEDURE LOAD_DATA()
SPECIFIC LOAD_DATA
LANGUAGE SQL

BEGIN
LOAD FROM C:\TEMP\DATA.DAT...... <<<< I GET THE ERROR ON THIS
LINE???
.....
....
END


LOAD is not an SQL statement but rather a DB2 command. Thus, you cannot
embed it into a LANGUAGE SQL procedure.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Dino L. | last post: by
reply views Thread by David Beardsley | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.