Home | Trees | Indices | Help |
|
---|
|
object --+ | base.structure.StructureBase --+ | object --+ | | | base.common.Parser --+ | base.structure.ParseableStructure --+ | base.structure.Structure --+ | object --+ | | | base.structure.RestrictionMixin --+ | rscdef.procdef.ProcDef --+ | rscdef.procdef.ProcApp --+ | PhraseMaker
A procedure application for generating SQL expressions from input keys.
PhraseMaker code must *yield* SQL fragments that can occur in WHERE clauses, i.e., boolean expressions (thus, they must be generator bodies). The clauses yielded by a single condDesc are combined with the joiner set in the containing CondDesc (default=OR).
The following names are available to them:
To get the standard SQL a single key would generate, say:
yield base.getSQLForField(inputKeys[0], inPars, outPars)
To insert some value into outPars, do not simply use some key into outParse, since, e.g., the condDesc might be used multiple times. Instead, use getSQLKey, maybe like this:
ik = inputKeys[0] yield "%s BETWEEN %%(%s)s AND %%(%s)s"%(ik.name, base.getSQLKey(ik.name, inPars[ik.name]-10, outPars), base.getSQLKey(ik.name, inPars[ik.name]+10, outPars))
getSQLKey will make sure unique names in outPars are chosen and enters the values there.
Nested Classes | |
Inherited from |
Instance Methods | |
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
Class Methods | |
Inherited from |
Class Variables | |
name_ =
hash(x) |
|
requiredType =
hash(x) |
|
formalArgs =
|
|
Inherited from Inherited from Inherited from |
Properties | |
Inherited from |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu May 2 07:29:09 2019 | http://epydoc.sourceforge.net |