Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong here ?
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00818378
Message ID:
00818388
Views:
15
Hi Marina,

If you want to insert records from one table into another, you would use INSERT INTO commnad
INSERT INTO TRANSACTIONS (fac_id, rcpfeedt,trans_id)
  SELECT fac_id, date_issue, corp_id FROM FACILITY
If it's not what you're after, please provide more details.

>Dear Sergey !
>Could you please help me ?
>I write this little code in SQL Query Analyzer:
>BEGIN
>
>DECLARE @oldFacID char(9) ,
>	@oldDate datetime,
>	@TransId char(9)
>SELECT @oldFacID= fac_id, @oldDate=date_issue, @TransId=corp_id
>FROM FACILITY
>INSERT TRANSACTIONS (fac_id, rcpfeedt,trans_id)
>VALUES (@oldFacID,@oldDate,@TransId)	
>END
>But it runs only for one record in table FACILITY.
>after that I've got a message:
>"Violation of PRIMARY KEY constraint 'PK_transactions'. Cannot insert duplicate key in object 'transactions'.
>The statement has been terminated."
>
>What i'm doing wrong ?
>Thank you in advance
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform