2214 - String too long
Reason: Attempting to concatenate two strings and the resulting string is greater than 254 characters.
Remedy: Correct the SQL statement concatenation.
This happens if parameter is long enough:
If PLSQL parameter is defined as colun%type that is varchar2(20) then we can call it with 10 chars long string with no errors, but with 11 chars long we get error.
Does not matter if it is defined in DB as varchar2(20 byte) or varchar2(20 char).
With SqlOraPLSQLPrepare/Execute works fine with all lengths.
Below is sample code for this problem.
-tommi
Table and PLSQL package:
Code: Select all
CREATE TABLE TKO_TEST3
(COMPANY VARCHAR2(4),
ID1 VARCHAR2(20),
ID2 VARCHAR2(20),
NAME1 VARCHAR2(20));
CREATE OR REPLACE PACKAGE TKO_TEST_003 AS
PROCEDURE TEST(
astrCompany TKO_TEST3.COMPANY%TYPE,
astrId1 TKO_TEST3.ID1%TYPE,
astrId2 TKO_TEST3.ID2%TYPE,
astrName1 IN OUT TKO_TEST3.NAME1%TYPE,
anError IN OUT NUMBER );
END TKO_TEST_003;
CREATE OR REPLACE PACKAGE BODY TKO_TEST_003 AS
PROCEDURE TEST(
astrCompany TKO_TEST3.COMPANY%TYPE,
astrId1 TKO_TEST3.ID1%TYPE,
astrId2 TKO_TEST3.ID2%TYPE,
astrName1 IN OUT TKO_TEST3.NAME1%TYPE,
anError IN OUT NUMBER )
IS
BEGIN
anError := 0;
EXCEPTION
WHEN OTHERS THEN
anError := 99999;
END TEST;
END TKO_TEST_003;
Code: Select all
Set str1 = 'TEST'
Set str2 = '123456789012345'
Set SqlBuf = "TKO_TEST_003.TEST(str1, str2, str3, str4, nError)"
If Not SqlPLSQLCommand ( hSql, SqlBuf )
Call SalMessageBox( SqlBuf, 'ERR', 0 )
Return FALSE
Else
Call SalMessageBox( 'OK', 'OK', 0 )