Hi all,
I am a newer to orientdb, I am now looking around one batch way to insert 
data into database using pyorient. I found that this 
url https://pypi.python.org/pypi/pyorient/1.1.1,
Then i used this way to realize my batch insert:

      client = pyorient.OrientDB("192.168.00.35", 2424)
      session_id = client.connect("root", "root")
      client.db_create(db_name, pyorient.DB_TYPE_GRAPH, 
pyorient.STORAGE_TYPE_MEMORY)
      client.db_exists(db_name, pyorient.STORAGE_TYPE_MEMORY)
      client.db_open(db_name, "admin", "admin")
      cmd = "begin:"
      for i in range(1,100):

        cmd = cmd + \
          "let a = create vertex set script = true;" + \
          "let b = select from v limit 1;" + \
          "let e = create edge from $a to $b;" + \
          "commit retry 1;"

    result = client.batch(cmd)


But I got the error: 
  File 
"/root/workplace/orientdb/env/lib/python2.7/site-packages/pyorient/messages/base.py",
 
line 200, in _encode_field
    buf = v.encode('utf-8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0x8d in position 77: 
invalid start byte, 

I think that maybe the string is too long, is there anybody encounter the 
same problem? Maybe i haven't found a proper way to implement the batch 
insert.

Regards

-- 

--- 
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/d/optout.

Reply via email to