I can get it working if I try:
params:{"id":"\"6ce3ef04cb2cb750d4ce0d0f9648066f\""}



On Thursday, January 30, 2014 4:34:55 PM UTC-5, Giraldo Rosales wrote:
>
> Weird. I tried using version 1.6.3 and the latest and both had the same 
> results, both inserting an incorrect value of "6" instead of 
> "6ce3ef04cb2cb750d4ce0d0f9648066f". Is there a way to test this out via a 
> REST call?
>
> We are sending the following to the binary call, REQUEST_COMMAND:
> - operation (bytes) = *41*
> - session id (int) 
> - mode (bytes) = *s*
> - class name (string) = 
> *com.orientechnologies.orient.core.sql.OCommandSQL*
> - sql query (string) = *INSERT INTO V SET id=:id*
> - params present (boolean) - *true*
> - params (string) = *params:{"id":"6ce3ef04cb2cb750d4ce0d0f9648066f"}*
> - composite key params present (boolean) - *false*
>
> Is there anything wrong with what is being sent? Not sure how it works in 
> the Java API but not via a socket call in NodeJS. 
>
>
>
>
>
> On Thursday, January 30, 2014 10:52:30 AM UTC-5, [email protected] wrote:
>>
>> Giraldo Rosales wrote:
>>>
>>> Sure. 
>>>
>>> It works perfectly when placing the value in the SQL directly. Where it 
>>> inserts it incorrectly is when used with a prepared query. So in 
>>> the GratefulDeadConcerts database, try:
>>> INSERT INTO V SET id=:id
>>>
>>> Then add the params:
>>> {"id":"6ce3ef04cb2cb750d4ce0d0f9648066f"}
>>>
>>> Then get the resulting record:
>>> SELECT * FROM V WHERE id ="6"
>>>
>>> You'll get back the incorrect record. Which is why I'm assuming it has 
>>> something to do with the parsing of the prepared query.
>>>
>>
>> When I try with the java driver in 1.6.4, it works:
>>
>>     ODatabaseDocument db = ODatabaseDocumentPool.global().acquire(
>> "remote:localhost/test", "admin", "admin");
>>
>>     Map<String,Object> parms = new HashMap<>();
>>     parms.put("hash", "6ce3ef04cb2cb750d4ce0d0f9648066f");
>>
>>     Object result = db.command(new OCommandSQL("insert into test set 
>> hash=:hash")).execute(parms);
>>     System.out.println(result);
>>
>> And the test class is created with "create class test".
>>
>> regards,
>> Finn
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to