on 11-20-2015 11:07 AM
Hi, i'm writing a stored procedure in Hana;
When i call the procedure, you encounter the following error : "
Could not execute 'CALL Stored_P in 1.218 seconds .
SAP DBTech JDBC: [1301]: numeric or value error: [1301] "Stored_P": line 209 col 4 (at pos 7656): [1301] (range 3) numeric or value error exception ".
I think that the line in question is the red ( CampiT := 'T.' || :CCorr || ', ' || :CampiT; ) (if I comment this line the error is generated) but I can not understand the error.
Have you ideas about possible causes?
Thanks in advance,
Michele
DECLARE object NVARCHAR(4000);
DECLARE CampiT varchar(8000);
DECLARE CCorr varchar(30);
DECLARE CURSOR Cur (obj NVARCHAR(4000))FOR
SELECT C."COLUMN_NAME"
FROM "SYS"."TABLE_COLUMNS" as C INNER JOIN "SYS"."TABLES" as O on (O."TABLE_OID" = C."TABLE_OID")
WHERE O."TABLE_NAME" = 'O' || :obj
ORDER BY C."COLUMN_NAME";
. . .
IF (ObjectId=13) THEN SELECT 'INV' INTO object FROM DUMMY;
ELSEIF (ObjectId=14) THEN SELECT 'RIN' INTO object FROM DUMMY;
END IF
. . .
OPEN Cur (:object);
CampiT := '';
FOR r1 AS Cur (:object) DO
BEGIN
CCorr := r1."COLUMN_NAME";
IF CCorr = '"VatSum"' THEN CCorr := :CCorr || ' AS "VatSumT"';
END IF;
IF CCorr = '"VatSumSy"' THEN CCorr := :CCorr || ' AS "VatSumSyT"';
END IF;
CampiT := 'T.' || :CCorr || ', ' || :CampiT;
END;
END FOR;
Hello Michele,
This may be difficult to analyse from SCN seeing as to reproduce the issue SAP will need a copy of the view , with all dependencies.
Have you tried casting the result of the of the SELECT to NCHAR?
Also what revision are you running on?
BR
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.