RE: SELECT INTO
"Becker, Holger" <[email protected]> Wed, 17 Sep 2003 09:36:51 +0200
| Newsgroups | gmane.comp.db.sapdb.general |
|---|---|
| Message-ID | <[email protected]> |
[email protected] wrote: > Why my SELECT INTO does'nt work? Just a oversight? > > SELECT (Customer.CNO,'1', 'Luxus') INTO RESERVATION FROM Customer, > RESERVATION WHERE Customer.Guid='10AOPGH' > > > ---- Error ------------------------------- > Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed > General error;-5016 POS(23) Missing delimiter: ). > SELECT ((Customer.CNO),'1', 'Luxus') INTO RESERVATION FROM Customer, > RESERVATION WHERE Customer.Guid='10AOPGH' Select into is a way to retrieve a single tuple from the database. The syntax is described here http://www.sapdb.org/7.4/htmhelp/40/1311fd2fa511d3a98100a0c9449261/frameset.htm in your case it could look like SELECT (Customer.CNO,'1', 'Luxus') INTO :a, :b, :c FROM Customer, RESERVATION WHERE Customer.Guid='10AOPGH' But I assume you want to insert the result of the join into the table reservation, don't you? Then you should have a look at insert select like INSERT [INTO] <table_name> [(<column_name>,...)] <query_expression> [<duplicates_clause>] You'll find the complete insert syntax here: http://www.sapdb.org/7.4/htmhelp/34/ee7fb7293911d3a97d00a0c9449261/frameset.htm Best regards, Holger SAP Labs Berlin