I'm not sure if this post belongs here or in the VB forum, but haven't heard anything in VB, so here I am...
I have a VB6 program on a Win2000 box which is calling an Oracle stored procedure. The problem is that the IN/OUT parameter is returning the correct string, but with garbage on the end of the string up to the buffer size. This code works fine with 7.3.4, but does not work with 8.1.7.
Stored Proc:
VB Code:
After the execution, cmd.Parameters("p_key"
contains the proper 18 character sequence number, plus 2 garbage characters. If I change the parm buffer size to 17, it works, but then I get an error message on the 7.3.4 version that the buffer is too small. I'd like the upgrade of this program to be independent of our oracle upgrade, if possible.
I've tried running this stored procedure from outside this VB program and it works fine. Thanks in advance for your help.
I have a VB6 program on a Win2000 box which is calling an Oracle stored procedure. The problem is that the IN/OUT parameter is returning the correct string, but with garbage on the end of the string up to the buffer size. This code works fine with 7.3.4, but does not work with 8.1.7.
Stored Proc:
Code:
PROCEDURE get_seqkey(p_key IN OUT VARCHAR2) AS
n_key NUMBER(18);
BEGIN
SELECT abc_seq.nextval
INTO n_key
FROM DUAL;
p_key := LTRIM(TO_CHAR(n_key,'000000000000000000'));
END get_seqkey;
VB Code:
Code:
Dim cmd As New ADODB.Command
cmd.ActiveConnection = cn
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "get_seqkey"
cmd.Parameters.Append cmd.CreateParameter("p_key", adVarChar, adParamInputOutput, 19, "")
cmd.Execute
After the execution, cmd.Parameters("p_key"
I've tried running this stored procedure from outside this VB program and it works fine. Thanks in advance for your help.