Home » Developer & Programmer » Forms » Compare Column Data
Compare Column Data [message #174817] Tue, 30 May 2006 12:08 Go to next message
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 #174919 is a reply to message #174817] Wed, 31 May 2006 00:58 Go to previous messageGo to next message
jowahl
Messages: 82
Registered: May 2006
Member
i hope do understand: on pressing button "check" you want to go through all records and compare (update) some data?
Re: Compare Column Data [message #174982 is a reply to message #174817] Wed, 31 May 2006 05:57 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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?

Re: Compare Column Data [message #175039 is a reply to message #174817] Wed, 31 May 2006 08:39 Go to previous message
sikorsky05
Messages: 40
Registered: October 2005
Member
Information can be obtained from a table too...

I have uploaded a screen shot of tables that I used...
/forum/fa/1138/0/

1st one is called Temp_residual where I get all my info from
the 2nd one is called temp_residual_altpn which contains the alternate part #s along w/ alternate cage code (FSCM)

Reason I know cage code 78286 is correct is b/c it's our companies part #.. so anything w/ this cage code out company makes so we know that it should have a correct standard Part #..
Reason for this form is to validate part # that come into the database.. and have logic in form to correct the incoming part # and have it save the part # w/ the correct standard part # into another table....

REMOLDPN in table is the incoming part # 1058-00-1
Alt_pn is
70358-26004-102
92550-01820-101

Alternate cage code is 78286 and S7549

Cage code for # 1058-00-1 is 59057

So if you take a look @ the image i attached ...
# 1058-00-1 has std pn 105800-1 and has alt_pn
70358-26004-102
92550-01820-101

now what I would like to do is figure out a way to create a trigger so that once the data is loaded into the datablock like on the website I posted earlier.. then once the person hits the check button it will enter into crt std pn whatever standard part # that has cage code 78286. I am not sure how to compare the data in either the datablock or in the table.. I wasn't sure if I should just use a dummy datablock or store this info into a temp table.. Not sure which would be easier to do..Any suggestions????


There was 3 condition i needed to use to figure out what the crt part # should be .. I posted that earlier... How can I compare data in different rows in same table???

Thanks


  • Attachment: new.JPG
    (Size: 59.48KB, Downloaded 1361 times)
Previous Topic: display values in control block
Next Topic: Text Item Change
Goto Forum:
  


Current Time: Fri Sep 20 06:55:20 CDT 2024