Results 1 to 2 of 2

Thread: oracle table of number parameter = vb ?

  1. #1

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

    oracle table of number parameter = vb ?

    More Oracle woes..

    Ok so I have declared a type and a procedure header in a package like so:
    Code:
    type SeqNums is table of number;
    
     procedure GetSeqNums(l_user_id in CREDIT_CARD_LOG.USER_ID%TYPE, SeqGroup in OUT SeqNums);
    and in my package body the procedure looks like this:
    Code:
      procedure GetSeqNums(l_user_id in CREDIT_CARD_LOG.USER_ID%TYPE, SeqGroup in OUT SeqNums) IS
      begin
      
        declare
        cursor ccl_cursor is select seq_number from credit_card_log where user_id = l_user_id;
        ccl_req ccl_cursor%ROWTYPE;
        
        l_count NUMBER;
    
        begin
      
        l_count := 1;
          
        for ccl_req in ccl_cursor
        loop  
              SeqGroup.EXTEND;
              SeqGroup(l_count) := ccl_req.seq_number;
              l_count := l_count + 1;
        end loop;
      
      end;
      end GetSeqNums;
    What I want to do is call this procedure from VB, passing it a userID, and return an array of all the SEQ_NUMBER s for that user's records. The field SEQ_NUMBER is of type NUMBER.

    I can't figure out what type of parameter to create in VB though, I've tried adVariant, adArray Or adNumeric and various other combinations.

    So my first question is what VB type corresponds to table of number, and second, should I be using 'table of number' or something else to return an array?

    Thanks
    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.

  2. #2
    New Member
    Join Date
    Aug 2003
    Location
    Canada
    Posts
    8

    Lightbulb

    Hi,
    You can create a type Varchar2 parameter who contain all the numbers returned by the query, separeted by ";", return it to VB and use .split to retrieve all the numbers and put to an array.

    That's an easy way...

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