getting a value from an unrelated table ...

Questions, tips and tricks and techniques for scripting in Servoy

getting a value from an unrelated table ...

Postby wim » Wed Jul 02, 2003 1:37 am

In an invoicing solution I have a table named "taxes". Fields are taxDescription, taxRate, taxID.

2 records:
GST, 8%
PST, 7%

In your collective wisdom, what's the fastest method of getting a tex rate:
- using the getDataSetByQuery to query the taxes table?
- doing it the FileMaker way and creating a relationship to that table?

Personnaly I prefer the Query method, but I want to make sure I don't do anything that will bite me in the behind later.

Wim
wim
 
Posts: 4
Joined: Wed Jul 02, 2003 1:13 am
Location: Toronto, ON

Re: getting a value from an unrelated table ...

Postby bcusick » Wed Jul 02, 2003 6:55 am

wim wrote:In an invoicing solution I have a table named "taxes". Fields are taxDescription, taxRate, taxID.

2 records:
GST, 8%
PST, 7%

In your collective wisdom, what's the fastest method of getting a tex rate:
- using the getDataSetByQuery to query the taxes table?
- doing it the FileMaker way and creating a relationship to that table?

Personnaly I prefer the Query method, but I want to make sure I don't do anything that will bite me in the behind later.

Wim


Hey Wim!

Either method will be FAST. The getDataSetByQuery is the most flexible - since you can change your schema. Since you can iterate through the resultset - you can also populate global variables with the result - and use it for the entire session.

I *believe* it's a little faster since Servoy won't have to make the join every time the form is displayed - it would be just a onetime operation.

Just my thoughts,

Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Postby Jan Blok » Wed Jul 02, 2003 12:12 pm

-A related foundset is 1 query (if not yet cached and triggered by requesting a value via the relation)
-getDataSetByQuery is 1 query (when invoked the function)

So there is no real difference in performance, only a related foundset is lazy loading, cached and automatic
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam


Return to Methods

Who is online

Users browsing this forum: No registered users and 9 guests