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)
****/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
12 | |
12 | |
7 | |
5 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |