Solved TD-4829: SP3: SqlPLSQLCommand - Error: 2214 String too long

Post found bugs and possible workarounds.
-tommi
Finland
Posts: 53
Joined: 03 May 2017, 08:00
Location: Finland

TD-4829: SP3: SqlPLSQLCommand - Error: 2214 String too long

Post by -tommi » 04 Jun 2008, 10:02

When calling Oracle PLSQL-procedure with SqlPLSQLCommand we get error:
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;
TD code to test:

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 )

-tommi
Finland
Posts: 53
Joined: 03 May 2017, 08:00
Location: Finland

Re: TD-4829: SP3: SqlPLSQLCommand - Error: 2214 String too long

Post by -tommi » 04 Jun 2008, 10:06

Forgot to mention: Oracle native router.

-tommi

IPS-Support

Re: TD-4829: SP3: SqlPLSQLCommand - Error: 2214 String too long

Post by IPS-Support » 06 Jun 2008, 10:28

Hello,

we have the same problem.

I tried SqlOraPLSQLPrepare und SqlOraPLSQLExecute and it works without an error.

The stored procedures have out-parameters. How can I get the values?

Thank you

Andrea

Jean-Marc Gemperle

Re: TD-4829: SP3: SqlPLSQLCommand - Error: 2214 String too long

Post by Jean-Marc Gemperle » 25 Jun 2008, 14:33

Hi

Yes bug with SqlPLSQLCommand though OK with SqlORA***
the the size of the %TYPE parameters has to be doubled...unicode issue it sees..

TD-4829

JM
You do not have the required permissions to view the files attached to this post.

Return to “Bug Reports”

Who is online

Users browsing this forum: [Ccbot] and 0 guests