[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Multiple synced SQL statements



Gordon,

Can you accomplish your objective using an OUTER JOIN from the
table in Set1 to the table in Set2?  Or, can you simply call
a procedure to fetch the corresponding row from set 2 for
each row you retrieve from Set 1?

I tried creating a procedure which had two active queries
using GOTO to jump into and out of the begin-select paragraphs,
but this is not possible; you cannot jump outside or into the
begin-select paragraph.

HTH.

Ray

> All,
>
> I'm trying to write a report in which it would be very handy to 'sync'
> two sql statements.  That is, I have one primary result set, and as I
> step through the set fetching rows, I want to jump out to a second
> result set and grab row(s).   I only want to execute each SQL
> statement once.  Some rows in the second set may not be needed
> for the report.
>
> Set 1   Set 2
> 1         3
> 3         4
> 4         5
> 6         8
> 9         11
> 10
> 11
>
> I'd like to read each row in set 1, and then jump over to set 2 and read
> the next (or several, if necessary) row(s) without starting over at the
> first row in set 2.
>
> Short of defining set 2 as a table in the from clause of set 1 (and thus
> producing one ugly SQL statement), is there a way to do what I want
> in SQR?
>
> Thanks in advance!
>
> -Gordon Korbel
>

----------------------------------------------------------------------
Ray Ontko       |  Ray Ontko & Co  |  "Time for a new signature line."
rayo@ontko.com  |  Richmond, In    |  See us at http://www.ontko.com/