query Qs_02 = simple : S {
from ce:cot_event
where ce.servertime = "201705071635"
attributes
cot_type -> ce.cot_type
how -> ce.how
}
query Qs_02 = simple : S {
from ce:cot_event
where ce.servertime = ?
attributes
cot_type -> ce.cot_type
how -> ce.how
}
--
You received this message because you are subscribed to the Google Groups "categoricaldata" group.
To unsubscribe from this group and stop receiving emails from it, send an email to categoricaldata+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
query Qs_prepared = simple : S {
from ce:cot_event, myservertime:date
where ce.servertime = myservertime
attributes
cot_type -> ce.cot_type
how -> ce.how
}
query Qs_active = simple : S {import Qs_prepared
where myservertime = "201705071635"}
You could almost do this using imports (applied to the frozen instance of a query).That is, the prepared query is:
query Qs_prepared = simple : S {
from ce:cot_event, myservertime:date
where ce.servertime = myservertime
attributes
cot_type -> ce.cot_type
how -> ce.how
}Then you could activate it by filling in myservertime
query Qs_active = simple : S {
import Qs_prepared
where myservertime = "201705071635"
}Is that useful?PS. How did you get those neato boxes?
On Tue, Jan 16, 2018 at 2:36 PM, Ryan Wisnesky <wisn...@gmail.com> wrote:
I think we'd have to create a new 'kind', say 'parameterized query', whose inhabitants consists of a pair of a typing context and a query. Then add an operation 'subst' that yields a query from a parameterized query and a choice of parameters, as well as a way to inject a query as a parameterized query. Finally, we'd add special support to emit the SQL you want.
On Jan 16, 2018 2:28 PM, "Fred Eisele" <fredric...@gmail.com> wrote:
https://en.wikipedia.org/wiki/Prepared_statement--Is there a mechanism where AQL could generate prepared SQL statements?I do not see a fundamental problem as the values belong to the typeside and not the schema.
query Qs_02 = simple : S {
from ce:cot_event
where ce.servertime = "201705071635"
attributes
cot_type -> ce.cot_type
how -> ce.how
}Would become something like...
query Qs_02 = simple : S {
from ce:cot_event
where ce.servertime = ?
attributes
cot_type -> ce.cot_type
how -> ce.how
}...with the value "201705071635" replaced by a '?'.
You received this message because you are subscribed to the Google Groups "categoricaldata" group.
To unsubscribe from this group and stop receiving emails from it, send an email to categoricalda...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "categoricaldata" group.
To unsubscribe from this group and stop receiving emails from it, send an email to categoricalda...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to categoricaldata+unsubscribe@googlegroups.com.
Do you have any plans for adding support for prepared statements?
--