Clarion Browse using SQL doing a SELECT ASC and then SELECT DESC 
Author Message
 Clarion Browse using SQL doing a SELECT ASC and then SELECT DESC

Using generated code, open up a browse on the primary key. It seems that
the SELECT statements generated  are ok until step 4.  Why is step 4
occurring?

1. sp_cursoropen SELECT in ASC to fill the browse
2. get the two records
3. then close
4. then sp_cursoropen SELECT in DESC order.

Why the DESC order?

sp_cursoropen NULL, "SELECT  A."AccountParkId", A."AccountNumber",
A."MemberParkId", A."MemberNumber", A."MemberType", A."Salutation",
A."LastName", A."FirstName", A."MiddleName", A."CompanyName",
A."MemberTemplate" FROM "dbo"."MemberAccount" A WHERE  A."MemberParkId" >=
'LG' AND (  A."MemberParkId" > 'LG' OR (  A."MemberNumber" >= 1)) ORDER BY
A."MemberParkId" ASC, A."MemberNumber" ASC                                

                          ", 4, 4, NULL

sp_cursorfetch 30233392, 2, 1, 1
sp_cursorfetch 30233392, 2, 1, 1
sp_cursorclose 30233392

sp_cursoropen NULL, "SELECT  A."AccountParkId", A."AccountNumber",
A."MemberParkId", A."MemberNumber", A."MemberType", A."Salutation",
A."LastName", A."FirstName", A."MiddleName", A."CompanyName",
A."MemberTemplate" FROM "dbo"."MemberAccount" A WHERE  A."MemberParkId" <=
'LG' AND (  A."MemberParkId" < 'LG' OR (  A."MemberNumber" <  1)) ORDER BY
A."MemberParkId" DESC, A."MemberNumber" DESC                              

                            ", 4, 4, NULL

Rick Hoffmann



Tue, 25 Jan 2000 03:00:00 GMT  
 Clarion Browse using SQL doing a SELECT ASC and then SELECT DESC



Quote:

> Using generated code, open up a browse on the primary key. It seems that
> the SELECT statements generated  are ok until step 4.  Why is step 4
> occurring?

> 1. sp_cursoropen SELECT in ASC to fill the browse
> 2. get the two records
> 3. then close
> 4. then sp_cursoropen SELECT in DESC order.

> Why the DESC order?

I'm guessing it's to see if there are records "above" the first one shown.

--
Tom Ruby
--------------------------------------------------------------------

http://www.netins.net/showcase/tomruby/
Find resources mentioned in this newsgroup:
   http://www.netins.net/showcase/tomruby/clarion/



Wed, 26 Jan 2000 03:00:00 GMT  
 Clarion Browse using SQL doing a SELECT ASC and then SELECT DESC



Quote:
> 1. sp_cursoropen SELECT in ASC to fill the browse
> 2. get the two records
> 3. then close
> 4. then sp_cursoropen SELECT in DESC order.

> Why the DESC order?

Most likely a call to PREVIOUS(), which isn't directly supported by most
SQL backends. The solution is to requery the table in reverse order and get
the next record.

Steve
--
Steven C. Gallafent - The Computer Guy



Thu, 27 Jan 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dynamically selecting a table in browse using SQL

2. Using PROP:SQL to selecting records for Browse

3. tcl sql selecting and retrieving selected fields

4. Select Distinct, Prop:SQL in a Browse (ABC)

5. Clarion 5b | Browse Select button control template

6. using menu ring to select data out of database with SQL

7. SQL Select Statement Help - SQL Gurus!

8. How To restrict child browse to selected parent browse record

9. select and select

10. ASSOCIATE, SELECT TYPE, and SELECT CASE

11. select.select question

12. select.select example?

 

 
Powered by phpBB® Forum Software