how to use variables in where clause of orientdb query using python
<p>code</p>

<pre><code>import pyorient

# create connection 
client = pyorient.OrientDB("localhost", 2424) 

# open databse 
client.db_open( "Apple", "admin", "admin" ) 
requiredObj = client.command(" select out().question as qlist,out().seq as qseq,out().pattern as pattern,out().errormsg as errormsg from chat where app_cat='%s' and module='%s' and type='%s' and prob_cat='%s' ",(appCategory,module,type,problemCategory))

for data in requiredObj :
    print data
</code></pre>

<p>the above one is not working please suggest alternative way</p>

<p>You could use this command</p>

<pre><code>requiredObj = client.command("select from chat where name='%s'" % "chat 1");
</code></pre>

<p>or </p>

<pre><code>requiredObj = client.command("select from chat where name='%s' and room='%s'" % ("chat 1","1"));
</code></pre>

<p>Hope it helps</p>

python orientdb