On Tue, May 29, 2012 at 8:03 AM, Mohit Srivastava
<srivastavamohi...@gmail.com> wrote:
> "INSERT INTO anothertable VALUES ( <number>, "This text is not valid JSON",
> "Neither is this")
> # Will fail but must not crash server.
> GET <number from above> from anothertable"

....

> When I send query , which has a invalid json , then also it will change the
> table because there is no data type "json" exists like xml . It checking for
> TEXT and yeah it is text. So It wont fails

The insert will succeed, but then the HTTP GET will fail. The lesson
here is that you can do anything with SQL, but for the JSON API the
content must be valid JSON.

So for instance some random words are not valid json. You can insert
them into a TEXT column of course, but you won't be able to query that
with JSON API. To make it valid JSON they must be quoted:
INSERT INTO tablename VALUES (3, '"this is a string to the json parser"');

henrik
-- 
henrik.i...@avoinelama.fi
+358-40-8211286 skype: henrik.ingo irc: hingo
www.openlife.cc

My LinkedIn profile: http://www.linkedin.com/profile/view?id=9522559

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : drizzle-discuss@lists.launchpad.net
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to