Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

using a cursor to calculate order logic

selvi mAug 26 2022

Hello,
Need assistance implementing logic for the needs listed below using a cursor
Implementing the logic by using cursors to retrieve data from source tables store_info and order_info (as mentioned scenario) The display as a screenshot as an output format.
Business rule: s1_qty more than the total of need_qty or need_qty, then status(need qty -1) and de_status(1) for least need_qty
scenario 1 : s1 qty > sum of need qty, status(need qty-1), and **de_**status (1)
ex:13456 s1_qty(50) >sumof need_qty(30) then status(29) and de_status(1)
scenaro 2: s1_qty >sumof need_qty then status(need_query-1) and de_status(1) for least need_qty
ex:17890 s1_qty(50) >sumof need_qty(40) then status(40) and and de_status(0)
17890 s1_qty(50) >sumof need_qty(10) then status(10) and and de_status(0)
17890 s1_qty(50) >sumof need_qty(10) then status(9) and and de_status(1)
scenario 3: s1 qty <sum of need qty, status(s1_qty), and **de_**status (0)
ex:12345 s1_qty(20) <sumof need_qty(30) then status(20) and de_status(0)
scenario 4: s1 qty < sum of need qty, status(s1_qty), and **de_**status (0)
ex:14567 s1_qty(50) <sumof need_qty(40) then status(40) and de_status(0)
ex:14567 s1_qty(50) <sumof need_qty(30) then status(10) and de_status(0)

the source table and output format are shown below.
with store_info as
(select 12345 item,9999 det_num,20 s1_qty from dual union all
select 13456 item,9999 det_num,50 s1_qty from dual union all
select 14567 item,9999 det_num,50 s1_qty from dual union all
select 17890 item,9999 det_num,50 s1_qty from dual union all
select 18900 item,9999 det_num,50 s1_qty from dual )
select * from store_info
with order_info as
(select 12345 item,9999 det_num,30 need_qty from dual union all
select 13456 item,9999 det_num,30 need_qty from dual union all
select 14567 item,9999 det_num,40 need_qty from dual union all
select 14567 item,9999 det_num,30 need_qty from dual union all
select 17890 item,9999 det_num,40 need_qty from dual union all
select 17890 item,9999 det_num,5 need_qty from dual union all
select 17890 item,9999 det_num,5 need_qty from dual
) select * from order_info;
output
output.JPG

Comments

HAJMEL

Hi
You can add mail.smtps.ssl.protocols property (not specified in API) but its referenced implementation.

User_UW1FS

Hi,
Thank you for your reply. Will that property works for javamail1.4.2?
Thanks,
Juni.

HAJMEL

Hi,
I don't know the complete context of your project but Only tests can confirm this.
I suggest also upgrading to Javamail1.6 that already support TLS1.2.
A

HAJMEL

Hi
this worked ?

User_UW1FS

I can't use javamail 1.6. Must stay with javamail1.4.x to be compatible with EE6.
That is why I am asking if you know if there is javamail1.4.x that works.

HAJMEL

I'll give a try and come back !

HAJMEL
look here
https://stackoverflow.com/questions/411331/using-javamail-with-tls
Kristof Neirynck's answer ( on the bottom)
User_UW1FS

I took a look that link but not seeing any information of what javamail version of 1.4 that I can use with TLSv1.2.
I am trying to find out what javamail1.4.x version that support/work with TLSv1.2 as I have to stay with javamail1.4.x
Try to figure out the x. I know javamail1.4.2 does not work with TLSv1.2.

HAJMEL

There no explicit and official documentation of support of TLS1.2+ by javamail 1.4.x but 1.5.x does.
Java SE 6 Advanced (0 Bytes)Path 1 : Workaround: can you use an alternative JCE implementation (Bouncy Castle)
INFO: If your application runs on Java 1.6 prior to update 111, or earlier, TLS 1.1 and 1.2 are not supported.
Q: any error or debug information to help spot it?
Warning: EE6 is full of vulnerabilities, I hope your app is not exposed.

1 - 9

Post Details

Added on Aug 26 2022
9 comments
367 views