Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A couple of questions on views
Message
 
To
03/09/2002 13:52:11
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00696311
Message ID:
00696340
Views:
12
I would say that you shouldn't use alltrim() in the join condition of the INNER JOIN.

If fields "codigo" and "tipo" are the same size on both tables (I and A) then you don't need the alltrim. If they are not the same size, then you might need the alltrim.

Keep in mind that in order for Rushmore to optimize the query, the index expression and the join condition must match. In other words, if you use alltrim in the join condition but not in the index (and you must not in the index) then Rushmore will not use the index.





>Ok, maybe I just dreamt about this, anyway, I'd like to get rid of the doubt.
>I have a view deifned like this:
>
>CREATE SQL VIEW "V_A" ;
> AS SELECT A.*, I.d, I.c FROM DBC!I;
> INNER JOIN DBC!A ON allt(I.tipo)+allt(I.codigo) = allt(A.tipo)+allt(A.codigo)
>
>From what I remember if I inserted a new record and filled the fields V_A.codigo and V_A.tipo and then move to another record or field the fields V_A.d and V_A.c got filled automatically, so I want to know if this is true or If I have to create a some sort of routine to create this efect or execute requery() to achieve this.
>
>Another question, using alltrim() as in the view above is bad coding? if so, where should I use it, in the textbox's properties or in table designer?
>
>Last question, in order to make this view works faster, do I have to make an index on the underlying tables like these: INDEX ON table.tipo+table.Codigo TAG 'indice' ASCENDING
>
>TIA
Hector Correa
Previous
Reply
Map
View

Click here to load this message in the networking platform