Compare Column Data [message #174817] |
Tue, 30 May 2006 12:08  |
sikorsky05
Messages: 40 Registered: October 2005
|
Member |
|
|
I created this form...
http://www.cs.uofs.edu/~sa3/index.html
I want to be able to compare each record's in std pn (incoming standard part number) so that if they are different, then use the in std pn that has cage code 78286.. and assign it to all crt std pn (Correct standard part number) corresponding to to that residual part # ....
Data block I used is not tied in to any table..I am using a trigger to populate a dummy data Block
Thanks
The cursor I used to populate the form was
CURSOR I IS
SELECT MODELF,REMOLDPN,VAL_PN,HITS,STD_PN,NAME
from av3m.temp_residual
where Name like :TEMP_RESIDUAL.NAME
and REMOLDPN like :TEMP_RESIDUAL.REMOLDPN
and MODELF = :TEMP_RESIDUAL.MODELF
and val_pn is null and std_pn is null
order by REMOLDPN DESC;
II I%ROWTYPE;
[Updated on: Tue, 30 May 2006 12:22] Report message to a moderator
|
|
|
|
Re: Compare Column Data [message #174982 is a reply to message #174817] |
Wed, 31 May 2006 05:57   |
sikorsky05
Messages: 40 Registered: October 2005
|
Member |
|
|
Yes... I want to be able to go through records and compare in std pn and have it put the correct data into crt std pn.. Basically the whole purpose of this form is to validate part #s. Basically in a table I have part #s and standard part # assigned to each other... sometime a part # can be assigned mutiple standard part # and basically I need to create a form which will validate this information... in the example I have on this website .. http://www.cs.uofs.edu/~sa3/index.html
The incoming part # 1058-00-1 has 2 alternate part #s. what I want to be able to do is compare the in std pn and create logic to correct the in std pn... and place it in crt std pn.. Each incoming part # should only have one std pn and not anymore...
The logic I am trying to add is
#1) IF in std pn is blank, don't do anything
#2) if different in std pn exsists then use the in std pn that
has cage code = 78286 for all of them b/c this is the correct one...
Basically I don;t know how to make comparisions between records in the same table... Any suggestions??? Also currently this data block is being populated via a cursor....
Declare
CURSOR A IS
SELECT MODELF,REMOLDPN,VAL_PN,HITS,STD_PN,NAME
from av3m.temp_residual
where Name like :TEMP_RESIDUAL.NAME
and REMOLDPN like :TEMP_RESIDUAL.REMOLDPN
and MODELF = :TEMP_RESIDUAL.MODELF
and val_pn is null and std_pn is null
order by :TEMP_RESIDUAL.SORT_OPTIONS;
AA A%ROWTYPE;
Begin
For EE in E Loop
:TEMP.INCOMING := AA.REMOLDPN;
:TEMP.NAME := AA.NAME ;
:TEMP.CAGE := AA.VAL_PN;
:TEMP.IN_STD_PN := AA.STD_PN;
next_Record;
End Loop;
First_record;
End;
I don;t know how to compare text items in_std_pn with other data in the same datablock . Any suggestions????
|
|
|
Re: Compare Column Data [message #175000 is a reply to message #174817] |
Wed, 31 May 2006 06:33   |
jowahl
Messages: 82 Registered: May 2006
|
Member |
|
|
sorry, but for my understanding:
"The incoming part # 1058-00-1 has 2 alternate part #s." in your form i can seen only one Incoming with "1058-00-1" (first record).
why do you know that cage code 78286 is the right one? is this a constant?
does the data you want to insert/update only depends from records in the form or can you get the right information from the databse?
|
|
|
|