Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8635

reference parameters to oracle char doubles in size

$
0
0

Hi

 

We need to do some changes in an application that hasn't been touched for some years.

 

During regression testing we discovered an error in the existing code that puzzled us: when a PB ref string is passed to an oracle procedure defined as an in out CHAR variable, the length of the string is doubled.

 

Considering this example:

 

Oracle function

 

CREATE OR REPLACE FUNCTION TEST_CHECK_MY_LENGTH

(

p  IN OUT CHAR

) RETURN NUMBER AS

BEGIN

 

     RETURN length(p);

 

END TEST_CHECK_MY_LENGTH;

 

PB Code

 

long ll_length

string ls

 

ls = space(4)

ll_length = sqlca.TEST_CHECK_MY_LENGTH (ls );

 

messagebox("test", string(ll_length))

 

 

The PL-SQL function returns 8 not 4 as we would expect, changing the PL-SQL parameter to Varchar2 solves the issue.

 

Unfortunately, our customer’s database is under an extremely strict change regime, so we are looking for a solution on the client side if possible.

 

The only significant change we are aware of from the previous version is that it was deployed on XP while we now are using Win7 as our development environment.

 

Is there anyone who has experienced something like this?


Viewing all articles
Browse latest Browse all 8635

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>