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

Re: dynamic variables



If, as it sounds may be the case, you want to get the first 10 of every
set matching some attribute, then the way to do it will be somewhat
database dependent. In Oracle 8i, you can

SELECT x, y
FROM
  (select x, y, rownumber() over (partition by y order by x) as rn
   from z
   where)
WHERE  rn <= 10

Otherwise, if x  has no ties, you can

SELECT x, y
FROM z
WHERE 10 <
  (SELECT COUNT(*) FROM z z2
   WHERE z2.y = z.y
        AND z2.x < z.x)



>>> KnappR@UMSYSTEM.EDU 09/19/02 06:15PM >>>
If I understand, you want to change the select once it has been shipped
of to the database, yes?

I don't think this is possible.  I would branch to another procedure
after ten rows and setup another cursor with the new value.  Put this
value in [square brackets].

Richard Knapp
Database Programmer/Analyst
Administrative Systems Project
University of Missouri System
573-884-3157
knappr@umsystem.edu


-----Original Message-----
From: Vallabhu, Bindu [mailto:Bindu.Vallabhu@STAPLES.COM]
Sent: Thursday, September 19, 2002 4:51 PM
To: SQR-USERS@list.iex.net
Subject: dynamic variables


Hi everybody,
Is it possible to change the value of a dynamic variable during
runtime.

I have set the value of a variable $name = 'XXX'

i pass it to a SQL select statement. after the select statement
executes for
10 times i want to change the value of $name ='YYY'. I am doing it in
the
select statement but it does not seem to take the value of 'YYY'.
Please
advise.
Thanks in advance.
Bindu

-----Original Message-----
From: Poonam Auluck [mailto:poonam.auluck@AMS.COM]
Sent: 09/19/2002 3:37 PM
To: SQR-USERS@list.iex.net
Subject: page-counts


Hi All -

Just had a quick question which hopefully someone can answer for me!
Is it possible for me to go between pages in the a report?

I have some fields that continue on to another page.  But after
printing
the rows on the new-page, I would like to print fields on the first
page of
my form.  I thought about using the page-count function.  Once I
created
the new-page, my #page-count displays 2.  I would like to reset this
#page-count to 1 if I can.  Do you think that's possible?

In terms of SQR, I was able to get this:

show #page-count              !this displays 2
let #page-count = 1
show #page-count              !now, this reads 1

Since I'm on the first page, I would like to have some print
statements
print on the first page, but SQR still thinks it's on page 2, rather
than
1.

Any ideas??

Thanks for all the help!
Poonam