Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Posts
    2

    Question Unanswered: Calling Oracle Procedure in VB

    Hi all,

    How could I get the result from Oracle procedure returning OBJECT type in Visual Basic?

    Here's the detail:

    I wrote a procedure in Oracle which will get an OBJECT type as output parameter as follow:

    Oracle Procedure
    --------------------
    CREATE TYPE employee_obj AS OBJECT(
    EMPLOYEE_ID VARCHAR2(10),
    DEPT VARCHAR2(10));

    CRETAE PROCEDURE TEST_PROC1(p_emp_id OUT VARCHAR2) IS
    BEGIN
    p_emp_id := '001';
    END;

    CRETAE PROCEDURE TEST_PROC2(p_emp_rec OUT employee_obj) IS
    p_obj employee_obj := employee_obj('', '');
    BEGIN
    p_obj.EMPLOYEE_ID := '001';
    p_obj.DEPT := 'HR'
    p_emp_rec := p_obj;
    END;

    I will call this procedure in VB then. How could I get the OBJECT struct back using ADO calls?

    I tried to get the result from VARCHAR type and success, but I have no idea how to retrieve OBJECT type (from TEST_PROC2).

    VB Call
    ---------
    ' Calling TEST_PROC1
    Dim cmd as ADODB.Command
    cmd.CommandText = "{CALL TEST_PROC1(?)}"
    cmd.Parameters.Append cmd.CreateParameter("p_emp_id", adVarChar, adParamOutput)
    ...
    cmd.Execute


    Thanks in advance

  2. #2
    Join Date
    Apr 2003
    Posts
    2

    result

    your result should be in cmd(0).value

    Greetz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •