Data Warehousing Community Forum
October 24, 2019, 01:23:08 am

Pages: [1]   Go Down
  Print  
Author Topic: Need Urgent help pls on PL/SQL coding  (Read 3145 times)
haria_kishore
DW Fresher
*

Reputation: +2/-1
Offline Offline

Posts: 2


View Profile
« on: February 24, 2009, 05:59:09 pm »

Hello everyone

I need a solution for my problem. The solution can be a simple PL/SQL block or a trigger

I have a table called T_SBSTTN_VLTG_MSTR with following data

SBSTTN_CD   VLTG   STTS   DT_ENTRY   FK_TM_ID
10111111   11   Existing   2/9/2009 19:32   10144
10111111   33   Existing   2/9/2009 19:32   10144
10111111   132   Existing   2/9/2009 19:32   10144
10111112   132   Existing   2/9/2009 19:32   10144
10111112   65   Existing   2/9/2009 19:32   10144

My requirement is that I need to insert the above data (based on SBSTTN_CD) into a new table called T_SBSTTN_RTNG_MSTR

The table would be almost similar but except that VLTG column will be replaced by a column RTNG. The values of RTNG should be populated based on the below methodology

The rating should be 'Higher Value' / 'Next higher value'. Keeping the above table in mind the output would be

SBSTTN_CD   RTNG   STTS   DT_ENTRY   FK_TM_ID
10111111   132 / 33   Existing   2/9/2009 19:32   10144
10111111   33 / 11   Existing   2/9/2009 19:32   10144
10111112   132 / 65   Existing   2/9/2009 19:32   10144

Admin -
Editted the Subject as it sounds vague.... & moved to PL/SQL board. Undecided
« Last Edit: February 26, 2009, 02:55:34 pm by Sipra » Logged
advertisement
Whoever
Administrator
*****

Reputation: +55/-0
Offline Offline

Posts: 145



View Profile WWW
« Reply #1 on: March 02, 2009, 10:23:52 am »

The table would be almost similar but except that VLTG column will be replaced by a column RTNG. The values of RTNG should be populated based on the below methodology

The rating should be 'Higher Value' / 'Next higher value'. Keeping the above table in mind the output would be

SBSTTN_CD   RTNG   STTS   DT_ENTRY   FK_TM_ID
10111111   132 / 33   Existing   2/9/2009 19:32   10144
10111111   33 / 11   Existing   2/9/2009 19:32   10144
10111112   132 / 65   Existing   2/9/2009 19:32   10144
So RTNG is 'Higher Value' / 'Next higher value'.

I'm assuming SBSTTN_CD is the grouping column here.

What about the rest of the columns ?

Infact, can you give us the T_SBSTTN_RTNG_MSTR for the following  T_SBSTTN_VLTG_MSTR ?

SBSTTN_CD   VLTG   STTS   DT_ENTRY   FK_TM_ID
10111111   11   Missing   2/15/2009 19:32   10143
10111111   33   Existing   2/10/2009 19:32   10144
10111111   132   Missing   2/9/2009 19:32   10149
10111112   132   Existing   2/6/2009 19:32   10144
10111112   65   Missing   2/9/2009 19:32   10150

What do you put in STTS, DT_ENTRY, FK_TM_ID in the T_SBSTTN_RTNG_MSTR table ?

Or is this data not likely to be present in this table ?
Logged

Wenn ist das Nunstück git und Slotermeyer? Ja! … Beiherhund das Oder die Flipperwaldt gersput.
Pages: [1]   Go Up
  Print  
Jump to: