dbTalk Databases Forums  

Use "lookup" to sset a control value

comp.databases comp.databases


Discuss Use "lookup" to sset a control value in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Use "lookup" to sset a control value - 05-24-2006 , 01:16 PM






I am not sure If I can do this with a lookup, but what I would like to
do is perhaps use lookup to retrieve a control date from an
unassociated table to control what date is entered in another table.
For example :
the main table , table 1 has many entries with a field called date_
enter which is the date the record was entered.
table 2 has a control_date
If the date entered in table 1 is less than or = to the control date we
want to give the user a error message.
I am thinking of using display only field and lookup to set it
Would need to have the date value from the control table available to
the active table of table 1 when entering the the date_enter.
However as there is no join field between the two tables am not sure
how to do it. Was thinking might have to add a key field that was
allways null and in the BEFORE EDITADD EDITUPDATE section set it so
that the key would be null

Am using Informix 5 , Any help would be appreciated

..


Reply With Quote
  #2  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Use "lookup" to sset a control value - 05-25-2006 , 11:01 PM







jim.murphy (AT) travelinsurance (DOT) ca wrote:
Quote:
I am not sure If I can do this with a lookup, but what I would like to
do is perhaps use lookup to retrieve a control date from an
unassociated table to control what date is entered in another table.
For example :
the main table , table 1 has many entries with a field called date_
enter which is the date the record was entered.
table 2 has a control_date
If the date entered in table 1 is less than or = to the control date we
want to give the user a error message.
I am thinking of using display only field and lookup to set it
Would need to have the date value from the control table available to
the active table of table 1 when entering the the date_enter.
However as there is no join field between the two tables am not sure
how to do it. Was thinking might have to add a key field that was
allways null and in the BEFORE EDITADD EDITUPDATE section set it so
that the key would be null

Am using Informix 5 , Any help would be appreciated

.
Often, by describing the business need, posters can get better answers.
I am not 100% clear on what you want to do.

If the control table has only one row, something like:
create table control_date (
ref_date DATE );

And it sounds like you are doing the data constraint in the application
code. It should work. such a design won't stop a background load
process from putting in rows to table 1 that violate your constraint.

sorry that isn't much help.
ed



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.