Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

Here's just a small snippet of code that might save you a bit of a headache as your try to work out the correct syntax for SELECT... INTO... when it comes to scalar variables and tables.

As you'll note, the syntax isn't the same nor is it interchangeable.

Cheers,

Jody

DROP TABLE "EXTAB";

CREATE COLUMN TABLE "EXTAB" ("FIELD" INTEGER);

CREATE PROCEDURE "EXPROC" AS

"EXFIELD" INTEGER;

BEGIN

          -- following syntax doesn't work

          -- SELECT 5 INTO "EXTAB" FROM DUMMY;

          -- SELECT 5 FROM DUMMY INTO "EXFIELD";

          SELECT 5 INTO "EXFIELD" FROM DUMMY;

          SELECT 5 FROM DUMMY INTO "EXTAB";

END;

2 Comments