• JDELIST is celebrating its 20 year anniversary today!
  • Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

[JDE APIs] Function C with JDE APIs

Dear JDE Technical,
I have a proplem,

In JDE APIs, Can code subqueries
SQL?
This sql statement, I want code Business Function C

UPDATE JDE_TABLE_TEST
SET
AADL01 = (SELECT WADOCO FROM F4801 WHERE WADOCO = AAURAB)

WHERE
AAURAB = (SELECT WADOCO FROM f4801 WHERE WADOCO = AAURAB)

AND AADCTO = 'WS'

Thanks!

__________________________________
>> Enterprise Resource Planning
>> JD Edwards® Enterprise One
>> Mail: thienduong584@gmail.com

 
Hi thienduong58,

I have not tried but I hope that we can achieve it by using below steps.

1. Open table F4801 twice by using different hRequest variables.
2. Use these hRequest variables to select the records.

Kindly sharing the results.

Thanks.
 

BOster

Legendary Poster
I have not found a way to do subqueries in the exact manner used in your example using the JDBASE api. Having said that, you can often accomplish what you would normally do with ad-hoc SQL and subqueries using different approaches that can be very comparable in terms of effectiveness.
 

Kim Schmidt

Active Member
You can also use event rules:
1. Create a new business view (example V55MYVIEW) joining your test table with F4801 on WADOCO = AAURAB
2. Make a Select/Fetch Next loop for V55MYVIEW selecting on AADCTO = 'WS' and fetching the primary keys of your test table plus WADOCO
3. In the loop, do an Update of the test table making AADL01 = WADOCO

Your example SQL above just effectively copies AAURAB to AADL01 for the just rows that are also found in F4801.
 
Top