mortemar Posted January 29, 2003 Posted January 29, 2003 Hi there, I got a little problem trying to run a script. Using two databases, I need to update one of my database using the values contained in the other base. So here goes I loop through the records in my first database, let's call it base1, for every record in the base, I have to see if it exists in the other base "base2". So far no problems. So I call an external script from base1 located in base2. Basically, what the second script does, is just looping through every record in base2 to see if I've got a match. My problem is this, when the second script is running, I have to check if two fields, one in each databases, are equal. But, it seems that when I try to access data from my first base, it only gives me access to my first record. As my explanation is unclear, even to me, I'll give an example. Here goes my first script (base1): Go to Record/Request/Page [First] loop Perform Script [sub-scripts; External: "base2"] Omit Record Go to Record/Request/Page [Exit after last, Next] end loop my second script is something like that : loop if [(field1 = base1::field1) and (field2 = base1::field2)] //some treatment end loop if ("1") //I just want to get off my loop...and script else Go to Record/Request/Page [Exit after last, Next] end if end loop it works fine, except it only compares the first record in base1 when running the script in base2. How do I get the script in base2 to actually check value in the other records in base1. Still not clear, just tell me, I'll do my best to explain it better (lack of english words is not helping ) Thanks to all who'll try to help me solve my problem, Jerry
mortemar Posted January 29, 2003 Author Posted January 29, 2003 Forget that, I found my answer by reading a recent post... global variables, that's all I needed. Thx
RussBaker Posted January 29, 2003 Posted January 29, 2003 Why not use a relationship. After all, what you appear to be doing is finding fields in records in base2 which match fields in records in base1. So if you set up the relationship based on these fields, then all you would have to do is loop through your base1 records, setting the relevant fields to relationship::base2 field.
mortemar Posted January 30, 2003 Author Posted January 30, 2003 That's what I did, using two global variables, and it worked. The solution was given to me in a previous message, but I didn't find it before writing my post. Thx a lot for your suggestion
Recommended Posts
This topic is 7972 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now