Results 1 to 1 of 1

Thread: Oracle, stored proc,(...) *RESOLVED*

  1. #1

    Thread Starter
    Hyperactive Member brenaaro's Avatar
    Join Date
    Sep 2001
    Location
    Montreal, Canada
    Posts
    391

    Oracle, stored proc,(...) *RESOLVED*

    I created a package in oracle as such:
    Code:
    create or replace package tt.MyPack is
    
      -- Public type declarations
      type CCLRows is REF CURSOR RETURN CREDIT_CARD_LOG%ROWTYPE;
      
      -- Public function and procedure declarations
      procedure GetCCLRows(l_user_id in CREDIT_CARD_LOG.USER_ID%TYPE, CCLGroup in OUT CCLRows);
      
    end MyPack;
    and my package body...
    Code:
    create or replace package body MyPack as
    
      procedure GetCCLRows(l_user_id in CREDIT_CARD_LOG.USER_ID%TYPE, CCLGroup in OUT CCLRows) IS
      begin
      open CCLGroup for
      select * from CREDIT_CARD_LOG
               where USER_ID = l_user_id;
      end GetCCLRows;
        
    end MyPack;
    So far so good?

    So I want to call this stored proc from VB..this is how far I got..
    VB Code:
    1. Dim oConn As Connection
    2.     Dim oComm As Command
    3.     Dim oNewParam As Parameter
    4.     Dim oRS As Recordset
    5.    
    6.     ' open my connection
    7.     '   ...
    8.     ' ommited for brevity
    9.    
    10.     Set oComm = New Command
    11.    
    12.     Set oComm.ActiveConnection = oConn
    13.    
    14.     ' create my first parameter, correctly? the field is defined as VarChar2(35)...
    15.     Set oNewParam = oComm.CreateParameter("l_user_id", adVarChar, adParamInput, 35, "jchester1")
    16.    
    17.     oComm.Parameters.Append oNewParam
    18.    
    19.     Set oNewParam = Nothing
    20.    
    21.     ' Create my second param?...not sure if this is right...
    22.     Set oNewParam = oComm.CreateParameter("CCLGroup", adUserDefined, adParamReturnValue)
    23.            
    24.     oComm.Parameters.Append oNewParam
    25.        
    26.     With oComm
    27.        
    28.         .CommandText = "GetCCLRows"
    29.         .CommandType = adCmdStoredProc
    30.        
    31.         Set oRS = .Execute ' <- raises error "Invalid Type Name"
    32.        
    33.     End With
    34.    
    35.     ' do my stuff
    36.     ' ...
    37.     ' close my db
    38.     ' ...
    39.     ' blah blah blah

    And I get an "Invalid Type Name" error when I execute...

    I'm sure I'm doing something wrong since I'm pretty new to all this..can anyone help me out?

    Thanks


    *RESOLVED*
    Ok so I figured it out a grand total of 23 seconds after I submitted the post
    I just had to get rid of the second parameter in my vb code..
    and change my CommandText to the full user.package.procedure path name
    Last edited by brenaaro; Sep 30th, 2003 at 03:20 PM.
    And I, for one, welcome our new insect overlords. I'd like to remind them as a trusted TV personality, I can be helpful in rounding up others to toil in their underground sugar caves.

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