
SQL in PROIV SL
#1
Posted 29 September 2004 - 06:38 AM
SELECT FROM SO_DEL DEL
WHERE DEL.SALES_CCN = :SALES_CCN
AND EXISTS (SELECT 'X' FROM SO LIN
WHERE LIN.SALES_CCN = DEL.SALES_CCN)
guys...
any idea on the select 'X' part?
why I change it to select TRUE from SO LIN and is still works fine?
is that just a dummy variable?
#2
Posted 29 September 2004 - 06:48 AM
Yes its just a dummy value, so that the EXISTS statement gets something to test against.
Rob D.
#7
Posted 30 September 2004 - 12:55 PM
Most of the times I get the result in the first trail. I have used very complex queries to multiple tables, unions, dummy tables, sorting and so forth, and they work great, saving a few LS and gaining noticeable response time.
Claudio Suarez del Real "It is not the strongest of the species that survive, nor the most intelligent, but the ones most responsive to change."
#8
Posted 30 September 2004 - 01:08 PM
By "in any Before Read Logic" do you mean the SQL SELECT can be put in NON PRIMARY file?In theory you can replace any SEL-XXX by a SQL SELECT statement that might return rows or in any Before Read logic, where you might define table keys.
I thought SEL-XXX or SQL SELECT only works in DEFAULT Logic (which means it affect only the primary file).
In fact, I found that SEL-XXX works also in BEFORE logic (which made me confused at the first time when I found this) I do not know if SQL SELECT can be put in BEFORE logic though. (Primary and Secondary file???)
#9
Posted 30 September 2004 - 01:22 PM
Yes, I use often SQL select in BEFORE READ logic for secondary files, and again, that saves a few nestings and gains time.
Claudio Suarez del Real "It is not the strongest of the species that survive, nor the most intelligent, but the ones most responsive to change."
#11
Posted 30 September 2004 - 09:16 PM
If you are using a RDBMS (Oracle, for instance) ANY request for data MUST BE translated into a SQL SELECT statement (this is the unique interface any application can talk to a RDBMS). If you use (a) SEL-XXX, (

Giving that, I can hardly imagine a case where a SQL SELECT statement adds overhead to a Pro IV function.
If you create the SQL SELECT statement by yourself, it is up to you to make it fit to the referred table, though,
Claudio Suarez del Real "It is not the strongest of the species that survive, nor the most intelligent, but the ones most responsive to change."
#13
Guest_Pinoy Ako_*
Posted 01 October 2004 - 03:50 AM
The internet is a very useful source of information, please use it. ;-)
http://www.1keydata.com/sql/sql.html
Cheers
Reply to this topic

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users