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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Help needed in writing the SQL

4057554Aug 2 2019 — edited Aug 2 2019

Hi ,

firstly glad to be here in this Oracle forum , amazed by the knowledge shared and helping from fellow community members.

I need help on building SQL logic from below

Data to be present in the table :

Insert into TEMP (DOC_ID,TRAN_CODE,AMOUNT,VAT_RATE,LINE_NUMBER_TYPE) values (894769179,'TAX',21932.9712,16,'2');

Insert into TEMP (DOC_ID,TRAN_CODE,AMOUNT,VAT_RATE,LINE_NUMBER_TYPE) values (894769179,'TAX',0,0,'1');

Insert into TEMP (DOC_ID,TRAN_CODE,AMOUNT,VAT_RATE,LINE_NUMBER_TYPE) values (894769179,'VCT',0,0,null);

Insert into TEMP (DOC_ID,TRAN_CODE,AMOUNT,VAT_RATE,LINE_NUMBER_TYPE) values (894769179,'REASON',0,0,null);

Insert into TEMP (DOC_ID,TRAN_CODE,AMOUNT,VAT_RATE,LINE_NUMBER_TYPE) values (894769179,'UNR',37317.36,0,'2');

Insert into TEMP (DOC_ID,TRAN_CODE,AMOUNT,VAT_RATE,LINE_NUMBER_TYPE) values (894769179,'REASON',-105.1152,16,null);

Insert into TEMP (DOC_ID,TRAN_CODE,AMOUNT,VAT_RATE,LINE_NUMBER_TYPE) values (894769179,'UNR',12297.6,0,'1');

Table looks like below

pastedImage_1.png

SQL/PLSQL logic to build from below logic

a) Row number (1,5) and row number (2,7) are related as they have same LINE_NUMBER_TYPE values

b) Row number 1,6 are related with VAT_RATE value , but here 1, 5 already related with LINE_NUMBER_TYPE value ,so here 6,5 rows are indirecly related

c) I want to calculate (row_no_5.amount-row_no_6.amount) * row_no_6.vat_rate , after the calculation I need to update result back to row_no_1.amount value

Appreciate your help on this

Thank you

Comments

StanislavL
Use your action event getSource() method/
801416
I know that I can use getSource() method to identify action event... but how can I identify the main panel it belongs to?
kleopatra-JavaNet
what's wrong with getSource().getParent() ? (apart from the missing type cast, obviously ;-)

Cheers
Jeanette
darrylburke
user1202074 wrote:
I have ‘n’ numbers of JPanel. And each panel contains certain number of sub-panels. Those sub-panels have actionlisteners.
:
Note that ‘n’ is unknown and main panels will be created dynamically. Now, if I attach actionListener with all of those sub_panels,
<tt>JPanel</tt>s can't have <tt>ActionListeners</tt>. What class of GUI component are you really talking about?

db
darrylburke
Cross posted
http://www.java-forums.org/awt-swing/36424-swing-how-indentify-certain-actions-sub-panels.html

Any more?

db
801416
when I said sub-panels, I meant Jtextfield, Jcombobox.
1 - 6

Post Details

Added on Aug 2 2019
10 comments
316 views