Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
datanibbler
Champion
Champion

Confused about a code I have developed - please help

Hi,

this is about a code rgd. our personell_data once more, so putting together sample_data would be kind of difficult - I have just written the critical question here, describing the code would be both time-consuming and quite difficult to grasp.

(I assume that the code is working, I have it running for about a week now, but I'm not so sure anymore)

The objective is to historize, on a day-to-day basis, the data about our personell (particularly, the joining_date and the leaving_date) that we get from the database - the database is not historized in a certain aspect, that's why we need this.

The critical question, upon which the functioning of the code hinges, would be:

=> Can I, in a RESIDENT LOAD, implement a WHERE NOT EXISTS() that refers to a field that is not in the table I'm currently loading, but in a previously loaded table?

=> Acc. to the help_file, it seems I can. That would explain it.

Thanks a lot!

Best regards,

DataNibbler

4 Replies
Anonymous
Not applicable

In response to this bit of your post :

=> Can I, in a RESIDENT LOAD, implement a WHERE NOT EXISTS() that refers to a field that is not in the table I'm currently loading, but in a previously loaded table?


The field needs to be in both :

  • The load statement with the WHERE NOT EXISTS()
  • A previously loaded statement


alexandros17
Partner - Champion III
Partner - Champion III

The answer is:

YES, you may use EXISTS and refer to fields in previously loaded tables

hic
Former Employee
Former Employee

If you use

     Where Exists( A, B )

then B must exist in the table you are currently loading, and A must exist - but it doesn't matter where.

HIC

datanibbler
Champion
Champion
Author

Hi all,

thanks a lot! That is all I wanted to know - so I did do it right, which is good 😉 I will just insert one line of comment to make it clear what is done in that clause (I generally stick to inserting roughly 1 line every 5 lines of code, or wherever some explanation is needed)

Best regards,

DataNibbler