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 > Table creation inside a stored proc.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-11, 02:30
kayal kayal is offline
Registered User
 
Join Date: Sep 2011
Posts: 8
Table creation inside a stored proc.

Hi,


I have a requirement to create a table by selecting values from another table from inside a stored procedure. Can I do that?

I tried this statement:

create table db2inst1.cust_kpi_Wtd_temp1 as(select * from db2inst1.cust_kpi_Wtd_temp);


It gives me the error:

SQL0104N An unexpected token ";" was found following "1.cust_cust_kpi_wtd_temp)". Expected tokens may include: <definition_Only>".

I could create a table like
"create table db2inst1.cust_kpi_Wtd_temp1(cust_id varchar(12), b_date date)"


Thanks,
Kayal.
Reply With Quote
  #2 (permalink)  
Old 10-14-11, 04:15
tonkuma tonkuma is offline
Registered User
 
Join Date: Feb 2008
Location: Japan
Posts: 2,193
See discussions in this thread
Create a table from another table with data
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