If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > export table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-03, 15:41
haburai haburai is offline
Registered User
 
Join Date: Dec 2003
Posts: 10
export table

I tried to export table from SQL store procedure and I got this error.
SQL0104N An unexpected token "EXPORT TO lxxx OF DEL" was found following "UMMY1; END; ". Expected tokens may include: "<psm_for>". LINE NUMBER=20. SQLSTATE=42601

Here is my procedure:
CREATE PROCEDURE UFHDBTBL.Proc2 ( IN a_table_name VARCHAR(100),
IN a_table_column varchar(9000),
IN a_stmtSelect varchar(3000),
OUT stmt VARCHAR(4000),
OUT SQLSTATE_OUT char(5),
OUT SQLCODE_OUT int )
LANGUAGE SQL
------------------------------------------------------------------------
-- SQL Stored Procedure
------------------------------------------------------------------------
P1: BEGIN
DECLARE SQLSTATE CHAR(5) DEFAULT '00000';
DECLARE SQLCODE INT DEFAULT 0;

DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
SELECT SQLSTATE, SQLCODE INTO SQLSTATE_OUT, SQLCODE_OUT FROM SYSIBM.SYSDUMMY1;
END;

EXPORT TO lxxx OF DEL SELECT * FROM sample_table;


SET SQLSTATE_OUT = SQLSTATE;
SET SQLCODE_OUT = SQLCODE;
END P1

Where could be a problem?
Reply With Quote
  #2 (permalink)  
Old 12-01-03, 16:47
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Re: export table

Quote:
Originally posted by haburai
I tried to export table from SQL store procedure and I got this error.
SQL0104N An unexpected token "EXPORT TO lxxx OF DEL" was found following "UMMY1; END; ". Expected tokens may include: "<psm_for>". LINE NUMBER=20. SQLSTATE=42601

EXPORT is not a SQL statement - it's a CLP command and therefore cannot be used in a stored procedure.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On