On Sunday, October 7, 2012 10:00:34 PM UTC+1, galvanash wrote:
>
>
> Anyway, it seems this essentially does the same thing (maybe without the 
> columntype support, but I find I rarely need that). Could you post or link 
> any example of "query json block"? 
>
>
There's no special trick here to determine how to build your JSON in such a 
way as to be deserialised as a query.  Just grab a query, serialise it with 
serializeJson(), then eyeball it: that's the format you need to use.

EG:
<cfscript>
    q = queryNew("");
    queryAddColumn(q, "id", "Integer", [1,2,3,4]);
    queryAddColumn(q, "english", "VarChar", ["one","two","three","four"]);
    queryAddColumn(q, "maori", "VarChar", ["tahi","rua","toru","wha"]);
    
    json = serializeJson(q);
    writeOutput(json);
</cfscript>

Output:
{"COLUMNS":["id","english","maori"],"DATA":[[1,"one","tahi"],[2,"two","rua"],[3,"three","toru"],[4,"four","wha"]]}

That's yer format.

(to answer your earlier question... yeah: "walks like a duck [etc]".

-- 
Adam

-- 
online documentation: http://openbd.org/manual/
 http://groups.google.com/group/openbd?hl=en

Reply via email to