Results 1 to 3 of 3

Thread: Recordset form Stored Procedure that call other Stored Procedure

  1. #1

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Unhappy

    Hi


    I call a Stored Procedure from VB that return a recordsets and values:

    select field1,field2 from mytables
    return (value)

    But It call other stored procedure that too return
    recordset and value

    How do I do to received this in the recordset in the VB, When I look in my recordset , It is with value of the internal procedure:
    example
    in my vb code I call procedure sp_se_ag06, this procedure call the procedure sp_ge_ag15 that return recordsets and value, when I look in my recordset It is with value of the procedure sp_ge_ag15, and not with values of the procedure sp_se_ag06, that I want. I tried rs.nextrecordset, but do not work

    thank you in advance

  2. #2
    Lively Member
    Join Date
    Jun 2000
    Location
    A caravan park in the Midlands (UK)
    Posts
    101

    Question

    How are you calling the embedded SPROC? It depends on how you are handling the returned values within your initial SPROC.

    I had a problem where an embedded SPROC was doing some work but returning no values. However this caused probs because it still returned 'n records affected'. The way around this is to suppress that message at the beginning of the SPROC and then re-enabling it at the end.
    Anakim

    It's a small world but I wouldn't like to paint it.

  3. #3

    Thread Starter
    Fanatic Member mutley's Avatar
    Join Date
    Apr 2000
    Location
    Sao Paulo - Brazil
    Posts
    709

    Unhappy VB call Stored Procedure that call other Stored Procedure

    Hi

    I call as:

    CREATE procedure dbo.sp2_se_ag06_05(@Pcd_proc varchar(08),
    @Pcd_cat varchar(03),
    @Pcd_tab varchar(01) = NULL,
    @Pcd_grp varchar(02) = NULL,
    @Pcd_sbgrp varchar(02) = NULL,
    @Pcd_pes varchar(06) = NULL)
    AS

    declare @Vcd_cat varchar(03)
    declare @Vcd_cob varchar(01)
    declare @Vcd_pre varchar(03)
    declare @Vperfil varchar(01)
    declare @Vpz_entreg smallint
    declare @Vhr_dur varchar(05)
    declare @Vvl_pr_atu float
    declare @Vhr_retorno datetime
    declare @Vst_part varchar(1)
    declare @Voutput varchar(254)
    declare @Vret integer
    if (@Pcd_tab is null or @Pcd_grp is null or
    @Pcd_sbgrp is null or @Pcd_pes is null)
    begin
    select @Pcd_tab = NULL
    select @Pcd_grp = NULL
    select @Pcd_sbgrp = NULL
    select @Pcd_pes = NULL
    end
    -- Obtem codigo de categoria particular
    exec @Vret = sp2_ge_ag15_01 "PARTICULAR", "N", @Vcd_cat output
    if @Vret <> 0
    begin
    select 0, NULL, NULL, NULL, NULL
    return(0)
    end
    -- Obtem codigo de cobertura
    exec @Vret = sp2_ge_ag15_01 "COBERTURA", "N", @Vcd_cob output
    if @Vret <> 0
    begin
    select 0, NULL, NULL, NULL, NULL
    return(0)
    end
    -- Obtem codigo de preco
    exec @Vret = sp2_ge_ag15_01 "PRECO", "N", @Vcd_pre output
    ..
    ..
    etc

    thank you in advance

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