Hello to all list members,

I guess this database scripting question is really for Tod, but maybe it's 
already easily achievable with the existing Sambar database scripting.
How can I code a query based on as many as six user-selected options 
without a complex nested <RCif> structure and multiple hard-coded SQL 
statements?

I think this sort of thing is referred to as Query-by-Example. It's easily 
achievable using other scripting languages like PHP, where the query string 
is built incrementally and executed once and I'm hoping it might be a 
simple programming operation for Tod to give Sambar scripters the option of 
either hard-coding the string or using a <RC$sqlstring> variable that can 
be created incrementally, based on contents of other <RC$> variables passed 
to the .stm script.

An example
<RC$sqlstatement = "select workstationid, supplier, serialnumber, ram, hdd
                            from machine
                            where location = 'RC$location' and supplier = 
'RC$supplier' and ram = 'RC$ram' and hdd = 'RC$hdd'">

<RCQtest sql="$RC$sqlstatement"
         format="<TR><TD>%s<TD>%s</TD><TD>%s</TD><TR>" >

The above query was difficult to code and maintain and I do believe the 
suggested additional query method would **significantly enhance** Sambar 
Server functionality. What do you think list members, Tod?

Cheers
Ray Noel
-------------------------------------------------------
To unsubscribe please go to http://www.sambar.ch/list/



Reply via email to