Hi,

I have the following simple stored prcedure, 
which returns 1 on any error or 0 on success:

create procedure insert_update_sub @sub  varchar (20),
                                   @path varchar (255)
as
    begin tran

        if exists (select * from SUBSYSTEMS where SUB = @sub)
            update SUBSYSTEMS set PATH = @path where SUB = @sub
        else
            insert SUBSYSTEMS (SUB, PATH) values (@sub, @path)

    if @@error != 0 or @@rowcount != 1
    begin
        rollback tran
        return 1
    end
    commit tran

What is the preferred/easiest way to fetch that
integer number (1 or 0) using DBD::Sybase? Do I 
have to declare a variable and the select it:

  declare @result int
  exec @result = insert_update_sub sub1, path1
  select @result

Or is it better just to run the insert_update_sub and 
then check the CS_STATUS_RESULT == $sth -> {syb_result_type} ?

Or is there maybe some better way, that I'm missing?

Thank you in advance
Alex

Reply via email to