![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
This should be so simple, yet it is not working. I am trying to do an insert into a table where the values inserted are gathered from a select from another table. This form works: insert into table2 (select fld1, fld2, fld3 from table1 where blah) However, I do not want to be dependent upon the order of the fields in table2 so, I tried this: insert into table2 (fld1, fld2, fld3) values( select fld1, fld2, fld3 from table1 where blah) ) This gave me a not enough values error coming from the first set of parentheses. I don't understand that error. It should not care how many fields are inserted, so long as the two sets match. Also, in this case, all the fields of table2 are named. |
#3
| |||
| |||
|
|
This should be so simple, yet it is not working. I am trying to do an insert into a table where the values inserted are gathered from a select from another table. This form works: insert into table2 (select fld1, fld2, fld3 from table1 where blah) However, I do not want to be dependent upon the order of the fields in table2 so, I tried this: insert into table2 (fld1, fld2, fld3) values( select fld1, fld2, fld3 from table1 where blah) ) This gave me a not enough values error coming from the first set of parentheses. I don't understand that error. It should not care how many fields are inserted, so long as the two sets match. Also, in this case, all the fields of table2 are named. |
#4
| |||
| |||
|
|
This should be so simple, yet it is not working. I am trying to do an insert into a table where the values inserted are gathered from a select from another table. This form works: insert into table2 (select fld1, fld2, fld3 from table1 where blah) However, I do not want to be dependent upon the order of the fields in table2 so, I tried this: insert into table2 (fld1, fld2, fld3) values( select fld1, fld2, fld3 from table1 where blah) ) This gave me a not enough values error coming from the first set of parentheses. I don't understand that error. It should not care how many fields are inserted, so long as the two sets match. Also, in this case, all the fields of table2 are named. |
#5
| |||
| |||
|
|
This should be so simple, yet it is not working. I am trying to do an insert into a table where the values inserted are gathered from a select from another table. This form works: insert into table2 (select fld1, fld2, fld3 from table1 where blah) However, I do not want to be dependent upon the order of the fields in table2 so, I tried this: insert into table2 (fld1, fld2, fld3) values( select fld1, fld2, fld3 from table1 where blah) ) This gave me a not enough values error coming from the first set of parentheses. I don't understand that error. It should not care how many fields are inserted, so long as the two sets match. Also, in this case, all the fields of table2 are named. |
#6
| |||
| |||
|
|
This should be so simple, yet it is not working. I am trying to do an insert into a table where the values inserted are gathered from a select from another table. This form works: insert into table2 (select fld1, fld2, fld3 from table1 where blah) However, I do not want to be dependent upon the order of the fields in table2 so, I tried this: insert into table2 (fld1, fld2, fld3) values( select fld1, fld2, fld3 from table1 where blah) ) This gave me a not enough values error coming from the first set of parentheses. I don't understand that error. It should not care how many fields are inserted, so long as the two sets match. Also, in this case, all the fields of table2 are named. |
#7
| |||
| |||
|
|
This should be so simple, yet it is not working. I am trying to do an insert into a table where the values inserted are gathered from a select from another table. This form works: insert into table2 (select fld1, fld2, fld3 from table1 where blah) However, I do not want to be dependent upon the order of the fields in table2 so, I tried this: insert into table2 (fld1, fld2, fld3) values( select fld1, fld2, fld3 from table1 where blah) ) This gave me a not enough values error coming from the first set of parentheses. I don't understand that error. It should not care how many fields are inserted, so long as the two sets match. Also, in this case, all the fields of table2 are named. |
#8
| |||
| |||
|
|
This should be so simple, yet it is not working. I am trying to do an insert into a table where the values inserted are gathered from a select from another table. This form works: insert into table2 (select fld1, fld2, fld3 from table1 where blah) However, I do not want to be dependent upon the order of the fields in table2 so, I tried this: insert into table2 (fld1, fld2, fld3) values( select fld1, fld2, fld3 from table1 where blah) ) This gave me a not enough values error coming from the first set of parentheses. I don't understand that error. It should not care how many fields are inserted, so long as the two sets match. Also, in this case, all the fields of table2 are named. |
#9
| |||
| |||
|
|
This should be so simple, yet it is not working. I am trying to do an insert into a table where the values inserted are gathered from a select from another table. This form works: insert into table2 (select fld1, fld2, fld3 from table1 where blah) However, I do not want to be dependent upon the order of the fields in table2 so, I tried this: insert into table2 (fld1, fld2, fld3) values( select fld1, fld2, fld3 from table1 where blah) ) This gave me a not enough values error coming from the first set of parentheses. I don't understand that error. It should not care how many fields are inserted, so long as the two sets match. Also, in this case, all the fields of table2 are named. |
#10
| |||
| |||
|
|
This should be so simple, yet it is not working. I am trying to do an insert into a table where the values inserted are gathered from a select from another table. This form works: insert into table2 (select fld1, fld2, fld3 from table1 where blah) However, I do not want to be dependent upon the order of the fields in table2 so, I tried this: insert into table2 (fld1, fld2, fld3) values( select fld1, fld2, fld3 from table1 where blah) ) This gave me a not enough values error coming from the first set of parentheses. I don't understand that error. It should not care how many fields are inserted, so long as the two sets match. Also, in this case, all the fields of table2 are named. |
![]() |
| Thread Tools | |
| Display Modes | |
| |