V4RB 1.1 Beginner's question

olivier vidal_olivier at yahoo.fr
Thu May 13 12:58:58 CDT 2004


Valentina (1.1) for realbasic (5.5)
Mac os X 3.3

Hello,

As I begin with Valentina, I am not sure that my cursor is good.
I have a database with two tables:

Table ITEM

- Price1 vfloat
-TaxPrice1_A vobjectptr (database.tax)
-TaxPrice1_B vobjectptr (database.tax)

- Price2 vfloat
-TaxPrice2_A vobjectptr (database.tax)
-TaxPrice2_B vobjectptr (database.tax)

- Price3 vfloat
-TaxPrice3_A vobjectptr (database.tax)
-TaxPrice3_B vobjectptr (database.tax)

- Price4 vfloat
-TaxPrice4_A vobjectptr (database.tax)
-TaxPrice4_B vobjectptr (database.tax)

on the whole 16 prices, with each two different taxes !

many of the other fields are also in the table.


Table TAX

-rate vfloat

to obtain all the data, cursor :

cur=new cursor(database, "SELECT I.Price1, t1a.rate, t1b.rate, 
I.Price2, t2a.rate, t2b.rate, I.Price3, t3a.rate, t3b.rate, I.Price4, 
t4a.rate, t4b.rate,
....... FROM item I, tax t1a, tax t1b, tax t2a, tax t2b,  tax t3a, tax 
t3b,  tax t4a, tax t4b....... WHERE I.TaxPrice1_A=t1a.recID and
I.TaxPrice1_B=t1b.recID  and I.TaxPrice2_A=t2a.recID and  
I.TaxPrice2_B=t2B.recID and  I.TaxPrice3_A=t3a.recID and
  I.TaxPrice3_B=t3b.recID and  I.TaxPrice4_A=t4a.recID and  
I.TaxPrice4_B=t1b.recID.......)

As you imagine it, the result is not fast...

The cursor seems to me complicated. Is it the good solution ?

Thank you very much

olivier








More information about the Valentina mailing list