|
|
|
|
Re: ORA-00947: not enough values [message #271989 is a reply to message #271984] |
Wed, 03 October 2007 10:28   |
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 #272026 is a reply to message #272023] |
Wed, 03 October 2007 12:31   |
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   |
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
|
|
|
|