Author |
Topic |
Swati Jain
Posting Yak Master
139 Posts |
Posted - 2007-12-18 : 01:41:33
|
Is there any query which copies the rows of the table and insert into same table with different id value?insert into ReportDetails(ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate ) values (Select ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate from ReportDetails Where ReportID=100) This is not working bcoz i get error at brackets of Select |
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2007-12-18 : 02:16:49
|
You dont require values when you are using Select Clause for inserting the values. insert into ReportDetails(ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate ) Select ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate from ReportDetails Where ReportID=100 Chiraghttp://www.chirikworld.com |
|
|
Swati Jain
Posting Yak Master
139 Posts |
Posted - 2007-12-18 : 02:20:10
|
quote: Originally posted by chiragkhabaria You dont require values when you are using Select Clause for inserting the values. insert into ReportDetails(ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate ) Select ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate from ReportDetails Where ReportID=100 Chiraghttp://www.chirikworld.com
Hi Chirag,Removing brackets also doesnt work |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2007-12-18 : 02:22:59
|
[code]Insert ReportDetails(ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate ) Select ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate from ReportDetails Where ReportID=100[/code]Chiraghttp://www.chirikworld.com |
|
|
mahesh_bote
Constraint Violating Yak Guru
298 Posts |
Posted - 2007-12-18 : 02:24:23
|
is it throwing any error? 1st try to execute the select statement separately and check whether the select is returning any record(s).thanks,Mahesh |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-18 : 03:26:48
|
quote: Originally posted by Swati Jain
quote: Originally posted by chiragkhabaria You dont require values when you are using Select Clause for inserting the values. insert into ReportDetails(ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate ) Select ReportID,Label,TableName,FieldNameID,FieldName,DisplayTableName,DisplayFieldName,DisplayType,FieldDataType,FieldOrder,UpdateDate,CreateDate from ReportDetails Where ReportID=100 Chiraghttp://www.chirikworld.com
Hi Chirag,Removing brackets also doesnt work
What was the error message you got?MadhivananFailing to plan is Planning to fail |
|
|
Swati Jain
Posting Yak Master
139 Posts |
Posted - 2007-12-18 : 09:05:15
|
Problem got solved. Only bcoz of 'values' error was thrown |
|
|
|
|
|