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

    Unanswered: Problems with a store procedure and its ResultSet


    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)
    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,
    FullCode as FullCode,
    City as City,
    Phone as Phone,
    Address as Address,
    FoldID as FoldID
    from #tResult

    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 !!!

  2. #2
    Join Date
    Jul 2007
    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