Alexey Gaidukov wrote:
>
> In 7.6.00.12 I get the same error
>
>
>
>
> Testcase. Executing it I get
> ---- Error -------------------------------
> Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed
> General error;-9111 POS(1)
> call pr('2005-08-01',0)
>
>
>
>
> CREATE TABLE "TTT"."DOCTOR_ACCESS"
> (
> "OS_USER" Varchar (50) UNICODE NOT NULL,
> "RESID" Varchar(10) UNICODE NOT NULL,
> "LIFETIME" smallint,
> UNIQUE("OS_USER", "RESID")
> )
> //
> CREATE DBPROC ttt.pr(
> IN d date,
> IN nv smallint)
> RETURNS CURSOR AS
> VAR
> sqlText varchar(1000);
> BEGIN
> TRY
> TRY
> SET sqlText = 'DECLARE INVEST_ARM CURSOR FOR
> select * from
> ttt.DOCTOR_ACCESS a where a.os_user=''USER'' FOR REUSE';
>
> EXECUTE sqlText;
> CATCH
> IF $rc <> 100 THEN
> STOP($rc, 'INVEST_ARM '||$errmsg);
>
> TRY
> $CURSOR = 'GET_RES_CURSOR';
> SET sqlText = 'DECLARE ' || $CURSOR || ' CURSOR FOR
> select * from
> INVEST_ARM where ';
> CASE nv
> WHEN 0 THEN
> sqlText = sqlText;
> WHEN 1 THEN
> sqlText = sqlText||'
> utils.smuready(V.counter,utils.did_res(V.counter),V.dateres)=2 and ';
> WHEN 2 THEN
> sqlText = sqlText||' dd.not_ready=true and ';
> WHEN 3 THEN
> sqlText = sqlText||' dd.zav_control=1 and ';
> END CASE;
> EXECUTE sqlText;
> CATCH
> IF $rc <> 100 THEN
> STOP($rc, $CURSOR||' '||$errmsg);
> CATCH
> STOP($rc, $errmsg);
> END;
> //
> call pr('2005-08-01',0)
>
>
> knldiag.err
>
> 2005-08-01 19:35:41 0x41C ERR 11012 MOVECODE VKB71:9
> 2005-08-01 19:35:41 0x41C ERR 11012 MOVECODE 2005-08-01 19:35:41
> MOVECODE Error 11012
> 2005-08-01 19:35:41 0x41C ERR 11012 MOVECODE Bad parameter: limit
> source 8192000 destination 2001, source [0X7836BF5A]+1, destination
> [0X7836BF5A]+1, 2001 bytes
> 2005-08-01 19:35:41 0x41C ERR 51080 SYSERROR Move error
> 2005-08-01 19:35:41 0x41C ERR 11012 MOVECODE VKB71:9
> 2005-08-01 19:35:41 0x41C ERR 11012 MOVECODE 2005-08-01 19:35:41
> MOVECODE Error 11012
> 2005-08-01 19:35:41 0x41C ERR 11012 MOVECODE Bad parameter: limit
> source 8192000 destination 2001, source [0X7836BF5A]+1, destination
> [0X7836BF5A]+1, 2001 bytes
> 2005-08-01 19:35:41 0x41C ERR 11012 MOVECODE +
> SAPDB_PascalMoveKernel.cpp:96
> 2005-08-01 19:35:41 0x41C ERR 11012 MOVECODE + 2005-08-01
> 19:35:41 MOVECODE Error 11014
> 2005-08-01 19:35:41 0x41C ERR 11012 MOVECODE - Module VKB71
> call index 9
>
>
There are 2 problems concerning this dbproc:
1. the assignment sqlText = sqlText causes the move error to occur
--> avoid assigning a text (without any change/concat/substr/...) to
itself.
We will handle it better with the next versions of the kernel.
2. the resulting sql-statements would look like this:
DECLARE <cursorname> CURSOR FOR select * from INVEST_ARM where
Or
DECLARE <cursorname> CURSOR FOR select * from INVEST_ARM where
utils.smuready(V.counter,utils.did_res(V.counter),V.dateres)=2 and
--> ending of where resp. and and will cause trouble.
I hope, your example is only a shortened one and in reality the
resulting statements look correctly after concatenating.
Elke
SAP Labs Berlin
>
> --
> MaxDB Discussion Mailing List
> For list archives: http://lists.mysql.com/maxdb
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]