#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?

Are you looking to drop or add any of the statements if the statement is
empty or not selected?

#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>" >

This example works (with the exception of the front $ on
$RC$sqlsatement) - is this a current or future example?

#The above query was difficult to code and maintain

Why is the above example difficult to maintain and code?

#and I do believe the suggested additional query method would
#**significantly enhance** Sambar Server functionality. What do you
think #list members, Tod?

I guess I don't understand what you mean :(

I've been using Sambar query to do everything including very complex and
long procedures without running into any problems.

Matt.
-------------------------------------------------------
To unsubscribe please go to http://www.sambar.ch/list/



Reply via email to