ORDER BY in Dynamic SQL problem

ORDER BY in Dynamic SQL problem

Post by Ewan Humphr » Wed, 23 Aug 1995 04:00:00



I have a problem when I dynamically change the SQL for
a datawindow.

The SQL changed is the WHERE clause and the ORDER BY clause
(ie. sort of returned data) The columns retrieved does not change.
The correct data is always returned, by the ORDER BY clause
is ignored. We have no sort set on the Datawindow, and although
this is an option, we would prefer to have the database do the
work, and return the data in the correct order, rather than
retrieving and then sorting.

We are using PB 3.0a03, SQL*Net 2.1, and Oracle 7.1.

Has anybody had similar problems, or can think of a solution?

TIA,
Ewan

--
--------------------------------------------------
Ewan Humphrey,  BComp(InfoSys), AACS, PCP
Telstra Corporation,                        Voice: +61-3-9865-7477



"Any opinions are mine, No one else wanted them" - Unknown

 
 
 

ORDER BY in Dynamic SQL problem

Post by eri » Sun, 27 Aug 1995 04:00:00




Quote:

>I have a problem when I dynamically change the SQL for
>a datawindow.

>The SQL changed is the WHERE clause and the ORDER BY clause
>(ie. sort of returned data) The columns retrieved does not change.
>The correct data is always returned, by the ORDER BY clause
>is ignored. We have no sort set on the Datawindow, and although
>this is an option, we would prefer to have the database do the
>work, and return the data in the correct order, rather than
>retrieving and then sorting.

>We are using PB 3.0a03, SQL*Net 2.1, and Oracle 7.1.

>Has anybody had similar problems, or can think of a solution?

>TIA,
>Ewan

This should work. Check the return code from dwmodify. If it is -1,
then you have a syntax problem.

 
 
 

1. SQL server release=4.2 & dynamic SQL (App Lib)

Greetings.

This is similar to a previous posting I placed. I'm using the
application library that came w/PB and SQL Server. If I set the DbParam
to include the Release='4.2' statment, it seems the dynamic SQL bombs.
The application library's wf_Check_row_count in w_select uses dynamic
SQL to get a count of rows. I get a 999 error returned. If I use the
same code in a module and don't use the dynamic sql but instead use
Select count(*) into :..... I have no problem. Does this imply that if
I want to make use of the additional data types and features of sql
release 4.2 & can't use dynamic SQL?

Anyone had any similar troubles?

Thanks in advance for any help.

K. Alexander Lawrence
Analyst / Programmer
Duke University
Fuqua School of Business

2. PCI HELP Wanted

3. Dynamic SQL problem

4. isdn in Los Angeles?

5. dynamic generated pdfs to browsers with acrobat plug-ins

6. Will RISC be compatable with AA

7. LibraryImport Problems (Dynamic Child dddws of Dynamic DWs)

8. FREE OO Seminar in Dallas - Aug. 7

9. Dynamic user object tab order

10. Sort table with dynamic order of fields

11. Dynamic SQL variables in SAS?

12. Q: tagsort for SQL order by

13. proc sql, outer union and order by