Search code examples
phpsqlodbcsap-ase

Cannot fetch result from a variable in update query


I'm using odbc to execute queries to Sybase ASE and fetch the results to screen in my PHP code. What I'm trying to do:

declare @status char(6)
set @status = 'false'
UPDATE table SET field = 'newvalue', @status = 'true'
select @status as status

I'm getting the result using this query in Aquadata, but via php I'm getting nothing.

If I use SELECT statement everything works fine. What could cause this? Thanks.


Solution

  • I solved it by my own. Should add to my code the following:

    select @status as status into #isupdate from table;
    select * from #isupdate; // make it as a new query;