|
Posted by Helmut Woess on 11/20/07 13:31
Am Tue, 20 Nov 2007 02:57:06 -0800 (PST) schrieb Ben:
> Hello,
>
> im having a problem integrating an SQL statement with my program,
> it works fine when theres a result but throws an error when there is
> no result,
.... and what is the error message ??
> Does anyone know of any SQL syntax for MS SQL that when no row is
> returned it makes on up and parses it back
I don't see any sense in this, but anyway, you can do something like:
if (select count(*) from persontable where id < 17) > 0
select id, lastname, street1, city from persontable where id < 17
else select 0 as id, 'testperson' as lastname, 'noStreet' as street1,
'noCity' as city
bye,
Helmut
Navigation:
[Reply to this message]
|