By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,226 Members | 1,032 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,226 IT Pros & Developers. It's quick & easy.

LOAD via a Stored Procedure

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.