or you can script this in a stored procedure
On Thu, 17 Jul 2003 12:13:16 -0400,
in powersoft.public.powerbuilder.database
Tom S <po...@messageboard.com> wrote:
>First the specs: Win 2K Pro
> P.B. 7.0.3 Build 10180
>
>I am trying to write an SQL statement that runs a SELECT based upon the
>results of another SELECT. The attached file is the code I've written.
>Everytime I run it though I get an error saying "Host variable may not be
>used within a batch". First, I dont' know what that means (although I think
>it may have something to do with the use of a retrevial argument in the
>first SELECT). And second, how can I fix this so that it does what I want?
>Thanks for the help.
>
>Tom
>
>
- - -
Andy [TeamSybase]
Techwave 2003 - http://www.sybase.com/techwave2003
International Sybase User Group (ISUG) - http://www.isug.com
CodeXchange - http://powerbuilder.codeXchange.sybase.com/
"Andy Turiansky [TeamSybase]" <aturi...@comcast.net> wrote in message
news:u4LXLFITDHA.342@forums-2-dub...
select [data based on invoice existence]
union
select [client data with hard coded amount]
If you need to know the source of a particular row (i.e., did it come from
the first select or the second), include a hardcoded column that
differentiates. You should also do this so you can sort the results,
forcing the row from the 2nd query to come last. This way, you always get
at least one row. If you get more than one row, you can safely ignore the
last one.
"Tom S" <po...@messageboard.com> wrote in message
news:%23PynHfITDHA.344@forums-2-dub...