Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    29

    Unanswered: returning values from a stored procedure

    i have a vb6 app which accesses a sql db. i'm using stored procedures to retun valus and recordsets. my question is can i return both a full recordset from one table and a single value from another table with in one stored procedure?.

    example:
    i have tblcustomers and tblitems, i want to return a full recordset from tblcustomers for a specific customer and i want to retun the item price for a selected item.

    can retrive both values in one stored procedure or do i need to create on stored procedure for each.

    Thank You,
    Thomas

  2. #2
    Join Date
    Sep 2003
    Posts
    8

    Re: returning values from a stored procedure

    Originally posted by thomas eicondev
    i have a vb6 app which accesses a sql db. i'm using stored procedures to retun valus and recordsets. my question is can i return both a full recordset from one table and a single value from another table with in one stored procedure?.

    example:
    i have tblcustomers and tblitems, i want to return a full recordset from tblcustomers for a specific customer and i want to retun the item price for a selected item.

    can retrive both values in one stored procedure or do i need to create on stored procedure for each.

    Thank You,
    Thomas
    If it is OK with you to return two record sets one for tblcustomers table and one for the price selected from tblitems, yes is possible.
    In this case the return set for the price will be a table with one field and one record...

  3. #3
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621

    Re: returning values from a stored procedure

    Originally posted by ioana
    If it is OK with you to return two record sets one for tblcustomers table and one for the price selected from tblitems, yes is possible.
    In this case the return set for the price will be a table with one field and one record...
    Also, you can use UNION in stored procedure - just add special field where you can set from what table row is.
    Last edited by snail; 09-16-03 at 13:34.

Posting Permissions

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