DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Calling PL/SQL procedure from VB

  1. #1
    Join Date
    Aug 2001
    Location
    Waterloo, On
    Posts
    547
    I have a question concerning VB with Oracle.
    How do we call PL/SQL procedures having IN & OUT Variables from VB?
    For example, I make a simple PL/SQL procedure:

    CREATE OR REPLACE PROCEDURE PROCTEST(A IN NUMBER, B OUT NUMBER)
    IS
    BEGIN
    B:=A*A;
    END;

    Now I try to call it from VB:

    Private Sub Command1_Click()
    Dim x As Integer
    con.Execute ("BEGIN PROCTEST (2, " + x + ");END;")
    Text1.Text = x
    End Sub

    I get a runtime error : Type Mismatch. How do I go ahead?
    Do I necessarily have to use OO4O or use Global temporary tables to keep the OUT values and then transfer to VB?

    Raminder Singh

    Oracle Certified DBA: Oracle 8i, 9i


    Mail me at raminderahluwalia@rediffmail.com.

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    As you didn't mention the connection type I assume it's ADO.
    For an example of executing stored procedures through ADO and getting values of OUT parameters you can look here:

    http://www.dbasupport.com/forums/sho...threadid=16129

  3. #3
    Join Date
    Aug 2001
    Location
    Waterloo, On
    Posts
    547
    Yes it was ADO, and yes, I got it. I had asked about it earlier but it just went off my mind, since I do not use it very frequently.

    Thanks.

    Raminder Singh

    Oracle Certified DBA: Oracle 8i, 9i


    Mail me at raminderahluwalia@rediffmail.com.

Posting Permissions

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


Click Here to Expand Forum to Full Width