>public gcPublicOrderBy >gcPublicOrderBy = "eqno" >create sql view "equip_lv" as ; > select eqno,* from equip order by ?gcPublicOrderBy >*** then >gcPublicOrderBy = "vendor" >= requery("equip_lv") >> but this does not seem to work, giving me an error message like "Column " " not found".
>gcPublicOrderBy = "eqno" >create sql view "equip_lv" as ; > select eqno,* from equip order by eval(gcPublicOrderBy) >>what does work is
>gcPublicOrderBy = "eqno" >create sql view "equip_lv" as ; > select padr(left(eval(gcEQLVOrderBy),30),30) as SortField,; > eqno,* from equip order by 1 >>However I am afraid of a speed problem using eval() in the SQL command since it evaluates for each record. Also it does not seem to allow me to order by columns from child tables I have in the view. For example the column "Vendor" is provided to the view from a join with table vendors. Setting gcEQLVOrderBy = "vendors.vn_name" does not seem to do it either.
>gcPublicOrderBy = "eqno" >create sql view "equip_lv" as ; > select padr(left(&gcEQLVOrderBy,30),30) as SortField,; > eqno,* from equip order by 1 >>is the same as making the view
>create sql view "equip_lv" as ; > select padr(left(eqno,30),30) as SortField,; > eqno,* from equip order by 1 >>and requires me to rebuild the view everytime the value gcPublicOrderBy changes. Since the view is stored in a shared database on the network there is the possibility that the User #1 would change the view, then User #2 changes the view and then User #1's requery() gets the result User #2 wanted. I do not know how to prevent this other than to build the view in a local DBC on the user's drive.