Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Below example 1 how you create a READ ONLY procedure.

EXAMPLE 1

/*** Procedure Script ***/

CREATE PROCEDURE "KN227869"."TEST_READONLY"()

LANGUAGE SQLSCRIPT READS SQL DATA AS

BEGIN

Q_OUT = SELECT YEAR FROM "KN227869"."CAL";

END;

When writing a read only procedure DML statements are not allowed. Below example 2 is a read only procedure with a DML statement. When the procedure is executed you will receive an error message as denoted below

EXAMPLE 2

/*** Procedure Script ***/

CREATE PROCEDURE "KN227869"."TEST_READONLY"()

LANGUAGE SQLSCRIPT READS SQL DATA AS

BEGIN

Q_OUT = SELECT YEAR FROM "KN227869"."CAL";

insert into "KN227869"."CAL" values ('2012','4','3','10');

insert into "KN227869"."CAL" values ('2012','4','3','11');

END;


/*** ERROR MESSAGE: ***/


/**** SAP DBTech JDBC: [7] (at 138): feature not supported:  INSERT/UPDATE/DELETE are not supported in the READ ONLY procedure/function: line 5 col 1 (at pos 138)

****/

2 Comments
Labels in this area