Computing.Net > Forums > Programming > oracle sql insert statement

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

oracle sql insert statement

Reply to Message Icon

Name: fleetmack
Date: July 26, 2005 at 08:33:29 Pacific
OS: 8i
CPU/Ram: 3.2/gig
Comment:

i have an excel file i'm converting to an oracle temp table. i have a file of 900 last names i need in a table ... 1 field called "last_name" ... i figured this'd be simple.

create table temp_last_name
as
(last_name varchar2(80) null);
commit;


so then i go to do the insert ....

insert into temp_kim_names
values ('Aabak',
'Adams'...

'Zephyr');
commit;

...and I get an "ORA-00913: Too Many Values" error. Now I don't get why this is when there's only one column ... that error is for when you're putting values into several columns. How can i populate this table?



Sponsored Link
Ads by Google

Response Number 1
Name: MarkM
Date: July 27, 2005 at 10:14:30 Pacific
Reply:

One observation, the create table command only has one field defined, but your insert statment has data for two fields??


0

Response Number 2
Name: MarkM
Date: July 27, 2005 at 10:18:40 Pacific
Reply:

Sorry, just to be clear the insert statment:

insert into temp_kim_names
values ('Aabak',
'Adams')

will put the value 'Aabak' into one column, and 'Adams' into another column into a single row.

If Aabak and Adams are the values for one column and 2 rows, then you'll need two insert statements.


0

Response Number 3
Name: fleetmack
Date: July 28, 2005 at 12:32:11 Pacific
Reply:

what i ended up doing was putting it in columns in excel, i created one column that says

insert into temp_kim names values (

then the next column had all the values

then the next column just had ");" in it (minus the quotes, of course)...

so basically i used excel to create 900 insert statements for me then copied them over to dbartisan (my sql editor, similar to sql plus)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: oracle sql insert statement

ASP - Ms Access SQL Insert Problem www.computing.net/answers/programming/asp-ms-access-sql-insert-problem/898.html

SQL Insert Query question www.computing.net/answers/programming/sql-insert-query-question/13461.html

Sql insert query www.computing.net/answers/programming/sql-insert-query/12475.html