473,379 Members | 1,235 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

is an undefined name. SQLSTATE=42704

I am trying to create a table from an existing table and i need the existing tables data in my new table, So i submitted the following statement


insert into first (select * from <old_table>

but i am getting the following error

Error during Prepare
S0002(-204)[IBM][CLI Driver][DB2/AIX64] SQL0204N "RNOEL03.FIRST" is an undefined name. SQLSTATE=42704


can you please help

Thanks
Apr 24 '12 #1
7 14835
insert into first (select * from <old_table>)
Apr 24 '12 #2
Rabbit
12,516 Expert Mod 8TB
The correct syntax to create a table from a SELECT query is this:
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. INTO newTable
  3. FROM oldTable
Apr 24 '12 #3
i did that
select * into st from <old_table>

but i am getting this

error Error during Prepare
42601(-104)[IBM][CLI Driver][DB2/AIX64] SQL0104N An unexpected token "into st from <old_table>" was found following "select * ". Expected tokens may include: "<table_expr>". SQLSTATE=42601
Apr 24 '12 #4
I working on AQT tool on DB2
Apr 24 '12 #5
Rabbit
12,516 Expert Mod 8TB
You actually put in <>? I thought you were just doing that in place of the actual table name. Remove them, they are not correct syntax.
Apr 24 '12 #6
No i did not put < > i just replaced the real table name with that.
Apr 24 '12 #7
Rabbit
12,516 Expert Mod 8TB
It looks like DB2 does not support the SELECT INTO syntax to create tables. You'll have to use two SQL statements. One create statement and one insert statement.
Apr 24 '12 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: xixi | last post by:
hi, we use db2 udb v8.1 on windows, i am trying to use federated database objects to create wrapper, even though i have update dbm cfg using federated yes, i still get error "the instance for the...
7
by: Laygo | last post by:
Hi I'm trying to set up an application that uses a DB2 database. I know nothing at all about DB2 (or Java) and have simply followed a set of bad instructions to try and run this application. ...
5
by: Jean-Marc Blaise | last post by:
Dear all, Could you explain why some SQL messages do not possess a SQLSTATE ? Why not transmitting the SQLSTATE of the original <sqlcode>, for example if you get a -911 on a RUNSTATS ? ...
6
by: yoyo | last post by:
Mabey I'm missing something very basic, but I can't seem to get it to work. I'm trying to follow along in the sample programs that tells how to do that, but mine still doesn't work. In my...
1
by: tmugavero | last post by:
Hello, This is my first time starting a topic here so I hope this is the right place. I am having problems running SQL queries on a Version 8 DB2 database for Windows Server using the type 4...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
138
by: Ian Boyd | last post by:
i've been thrown into a pit with DB2 and have to start writing things such as tables, indexes, stored procedures, triggers, etc. The online reference is only so helpful. The two pdf manuals are...
8
by: Brian Tkatch | last post by:
Server: DB2/SUN 8.1.6 Client: DB2 Connect Personal Edition (No 11) <URL:ftp://ftp.software.ibm.com/ps/products/db2/fixes2/english-us/db2winIA32v8/fixpak/FP11_WR21365/FP11_WR21365_CONPE.exe> ...
2
by: uday123 | last post by:
Hi, We are using DB2 in an enterprise J2EE application and extracting data from here. But i get the following exception when i try to retriece records from this database: ...
15
by: uwcssa | last post by:
I try to drop a table as: I got: During SQL processing it returned: SQL0478N The object type "TABLE" cannot be dropped because there is an object "sch.SQL070515104729271", of type "FUNCTION",...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.