Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00947: not enough values
ORA-00947: not enough values [message #271976] Wed, 03 October 2007 09:21 Go to next message
loonab
Messages: 7
Registered: October 2007
Junior Member
No Message Body

[Updated on: Wed, 03 October 2007 12:54]

Report message to a moderator

Re: ORA-00947: not enough values [message #271977 is a reply to message #271976] Wed, 03 October 2007 09:31 Go to previous messageGo to next message
BlackSwan
Messages: 25042
Registered: January 2009
Location: SoCal
Senior Member
>Please suggest if there is better way to do it.
Use correct syntax.
Re: ORA-00947: not enough values [message #271978 is a reply to message #271976] Wed, 03 October 2007 09:34 Go to previous messageGo to next message
Ronald Beck
Messages: 121
Registered: February 2003
Senior Member
What is the table structure for table aa?
Re: ORA-00947: not enough values [message #271984 is a reply to message #271976] Wed, 03 October 2007 10:13 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#i2163698

Regards
Michel
Re: ORA-00947: not enough values [message #271989 is a reply to message #271984] Wed, 03 October 2007 10:28 Go to previous messageGo to next message
loonab
Messages: 7
Registered: October 2007
Junior Member
>Please suggest if there is better way to do it.
Use correct syntax.

could you point out what is worng with the syntax.
I believe its not the syntax error, error is beacause of unequal rows in both tables

[mod-edit] removed illiterate IM speak.

[Updated on: Wed, 03 October 2007 12:29] by Moderator

Report message to a moderator

Re: ORA-00947: not enough values [message #271993 is a reply to message #271989] Wed, 03 October 2007 10:37 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
could you plz point out what is worng with the syntax.

Check with the link I gave

Quote:
is beacause of unequal rows in both tables

Number of columns in the 2 parts.

Regards
Michel
Re: ORA-00947: not enough values [message #271996 is a reply to message #271993] Wed, 03 October 2007 10:48 Go to previous messageGo to next message
loonab
Messages: 7
Registered: October 2007
Junior Member
Thank you for the link.
Re: ORA-00947: not enough values [message #272007 is a reply to message #271976] Wed, 03 October 2007 11:29 Go to previous messageGo to next message
Ronald Beck
Messages: 121
Registered: February 2003
Senior Member

Try this...


insert into aa (bis_id)
select bis_id
from stg_contract_eligibility;



and see what happens...
Re: ORA-00947: not enough values [message #272011 is a reply to message #272007] Wed, 03 October 2007 11:37 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why?

Regards
Michel
Re: ORA-00947: not enough values [message #272017 is a reply to message #272007] Wed, 03 October 2007 12:02 Go to previous messageGo to next message
loonab
Messages: 7
Registered: October 2007
Junior Member
thanks a lot. it works.
Re: ORA-00947: not enough values [message #272018 is a reply to message #271976] Wed, 03 October 2007 12:04 Go to previous messageGo to next message
BlackSwan
Messages: 25042
Registered: January 2009
Location: SoCal
Senior Member
>I believe its not the syntax error, error is beacause of unequal rows in both tables
If you really knew what you are/were doing, then you would not be here asking how to create valid SQL statements.
Re: ORA-00947: not enough values [message #272023 is a reply to message #272018] Wed, 03 October 2007 12:19 Go to previous messageGo to next message
Michel Cadot
Messages: 64121
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Can you explain what was your error?

Regards
Michel
Re: ORA-00947: not enough values [message #272026 is a reply to message #272023] Wed, 03 October 2007 12:31 Go to previous messageGo to next message
loonab
Messages: 7
Registered: October 2007
Junior Member
missing brackets,

also ORA-00947: not enough values
Cause: This error occurs when a SQL statement requires two sets of values equal in number, but the second set contains fewer items than the first set.
Re: ORA-00947: not enough values [message #272029 is a reply to message #272023] Wed, 03 October 2007 12:58 Go to previous messageGo to next message
Ronald Beck
Messages: 121
Registered: February 2003
Senior Member
Proper syntax for what he was trying to do was...

insert into aa (bis_id)
select bis_id
from stg_contract_eligibility;


He needed parenthesis around the bis_id column name for his insert statement.

If table AA only contained one column, bis_id, the statement:

insert into aa
select bis_id
from stg_contract_eligibility;


would have worked fine. This is why I originally asked what his table structure was. Since his table apparently had more than one column, he needed to specify, in paranthesis, the list of columns he was populating.

The error "not enough values" was correct in that he was only providing one value to a table that apparently had multiple columns. Had the error message said "column value not in parenthesis", it might have been more obivous to a beginner who sometimes forget things.

The information anacedent provided ("Use correct syntax.") while technically correct, didn't provide much of an answer. The link to the "insert" statement documentation, IMHO might have been a bit overkill for this problem.

Sometimes a simple "you forgot your parenthesis" would help. I know I've overlooked simple errors on multiple occassions, and a "second" set of eyes find the problem immediately.

Ron
Re: ORA-00947: not enough values [message #272095 is a reply to message #272026] Thu, 04 October 2007 00:44 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Why why why did you remove the original post?
Now look what's left in this thread. A useless set of replies to a question no-one can see anymore.
Previous Topic: sysdate
Next Topic: Selecting data from a Package that returns a Table Set
Goto Forum:
  


Current Time: Wed Dec 07 03:04:03 CST 2016

Total time taken to generate the page: 0.23365 seconds