dbTalk Databases Forums  

bad returned parameters

comp.database.oracle comp.database.oracle


Discuss bad returned parameters in the comp.database.oracle forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jarek
 
Posts: n/a

Default bad returned parameters - 08-31-2005 , 07:46 AM






I've procedure/function with IN OUT VARCHAR2 parameter.
Procedure changes IN variable to shorter but OUT parameter remebers end
of IN string.
why? is it bug?


procedure test(p IN OUT VARCHAR2) is
begin
p:='12345xxxxx';
end test;


p:='54321'
test(p);

and p='54321xxxxx'


Reply With Quote
  #2  
Old   
Hilarion
 
Posts: n/a

Default Re: bad returned parameters - 08-31-2005 , 10:53 AM






Jarek <jarek (AT) NOSPAM (DOT) krak.pl> wrote:
Quote:
I've procedure/function with IN OUT VARCHAR2 parameter.
Procedure changes IN variable to shorter but OUT parameter remebers end
of IN string.
why? is it bug?


procedure test(p IN OUT VARCHAR2) is
begin
p:='12345xxxxx';
end test;


p:='54321'
test(p);

and p='54321xxxxx'

What is the full type of "p" variable passed to the procedure
(not the "p" parameter)? Where does it come from? How do you
declare / define it?


Hilarion


Reply With Quote
  #3  
Old   
Jarek
 
Posts: n/a

Default Re: bad returned parameters - 09-01-2005 , 03:13 AM



Variable is passed from VB application by RDO,
Value of variable is changed in pl/sql procedure.
RDO and odbc return bad value.

From VB: v='1234567890' is passed

PL/SQL changes v to 'abcd'

and VB gets:

v='abcd567890'

I really don't know why. Maybe it's ODBC or Rdo problem



Hilarion napisał(a):
Quote:
Jarek <jarek (AT) NOSPAM (DOT) krak.pl> wrote:

I've procedure/function with IN OUT VARCHAR2 parameter.
Procedure changes IN variable to shorter but OUT parameter remebers
end of IN string.
why? is it bug?


procedure test(p IN OUT VARCHAR2) is
begin
p:='12345xxxxx';
end test;


p:='54321'
test(p);

and p='54321xxxxx'



What is the full type of "p" variable passed to the procedure
(not the "p" parameter)? Where does it come from? How do you
declare / define it?


Hilarion

Reply With Quote
  #4  
Old   
Hilarion
 
Posts: n/a

Default Re: bad returned parameters - 09-01-2005 , 04:16 AM




Jarek <jarek (AT) NOSPAM (DOT) krak.pl> wrote:
Quote:
I've procedure/function with IN OUT VARCHAR2 parameter.
Procedure changes IN variable to shorter but OUT parameter remebers
end of IN string.
why? is it bug?


procedure test(p IN OUT VARCHAR2) is
begin
p:='12345xxxxx';
end test;


p:='54321'
test(p);

and p='54321xxxxx'
Hilarion wrote:
Quote:
What is the full type of "p" variable passed to the procedure
(not the "p" parameter)? Where does it come from? How do you
declare / define it?

Jarek <jarek (AT) NOSPAM (DOT) krak.pl> wrote:
Quote:
Variable is passed from VB application by RDO,
Value of variable is changed in pl/sql procedure.
RDO and odbc return bad value.

From VB: v='1234567890' is passed

PL/SQL changes v to 'abcd'

and VB gets:

v='abcd567890'

I really don't know why. Maybe it's ODBC or Rdo problem
Yes, that's probably it. To make sure check the behavior
of the procedure in SQLPlus using code like this:

var p varchar2(100);
begin
test( );
end;
/
print p;

If it works OK, then Oracle is not the one to blame.
I'm affraid I can't help you with ODBC/RDO.


Hilarion


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.