Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007
    Posts
    5

    Unanswered: Problems with a store procedure and its ResultSet

    Hi

    I have thr following procedure:


    create PROCEDURE sp_SEARCH_Contragents(@nSPFirmID integer,@nFilterID integer,@szName varchar(255)=null,@szTaxNum varchar(255)=null,@szBULSTAT varchar(255)=null,@szFullCode varchar(255)=null,@szCity varchar(255)=null,@szPhone varchar(255)=null,@szAddress varchar(255)=null)
    as
    begin
    declare @szNameSign varchar(2),
    @szTaxNumSign varchar(2),
    @szBULSTATSign varchar(2),
    @szFullCodeSign varchar(2),
    @szCitySign varchar(2),
    @szPhoneSign varchar(2),
    @szAddressSign varchar(2)


    create table #tResult(
    Name varchar(255) null,
    TaxNum varchar(30) null,
    BULSTAT varchar(10) null,
    FullCode varchar(100) null,
    City varchar(255) null,
    Phone varchar(100) null,
    Address varchar(255) null,
    FoldID integer null,
    )


    insert into #tResult( Name,TaxNum,BULSTAT,FullCode,City,Phone,Address,Fo ldID)
    select..........from <some tables> where.............

    insert into #tResult(Name,TaxNum,BULSTAT,FullCode,City,Phone,A ddress,FoldID)
    select.................. from <other tables> where..............


    select Name as Name,
    TaxNum as TaxNum,
    BULSTAT as BULSTAT,
    FullCode as FullCode,
    City as City,
    Phone as Phone,
    Address as Address,
    FoldID as FoldID
    from #tResult
    end

    If I execute the procedure from Iteractive SQL wtih some input values it is working correctly. But if I try to execute it from Java like this
    ResultSet res = stmt.executeQuery("exec sp_SEARCH_Contragents <the input values used in Interactive SQL>");

    or like this

    CallableStatement cs = conn.PreparedCall("{call sp_SEARCH_Contragents <the input values used in Interactive SQL>)}");

    I don't get any rows

    The fact that it is working correctly from Interactive SQL means the there is no error in the procedure.

    Please help me !!!
    http://www.dbforums.com/db_images_v3...milies/eek.gif

  2. #2
    Join Date
    Jul 2007
    Posts
    5
    I forgot to write you that i'm using ASE 15.0

Posting Permissions

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