{
StringBuilder sqlStart = new StringBuilder("INSERT INTO ").append("\""+ name +"\" (");
StringBuilder sqlEnd = new StringBuilder(" VALUES(");
JavaScriptObject encodedObject = encoded.getJavaScriptObject();
JsArrayMixed sqlValues = JsArrayMixed.createArray().cast();
if (!isAutoIncrement() || key != null)
{
getIndexesValuesForObject(encodedObject, indexAndKeyColumnNames, sqlValues);
for (int i=0; i< indexAndKeyColumnNames.size(); i++)
{
String k = indexAndKeyColumnNames.get(i);
sqlStart.append("\""+k +"\",");
sqlEnd.append("?,");
}
}
else
{
getIndexesValuesForObject(encodedObject, indexColumnNames, sqlValues);
for (int i=0; i< indexColumnNames.size(); i++)
{
String k = indexColumnNames.get(i);
sqlStart.append("\""+k +"\",");
sqlEnd.append("?,");
}
}
sqlStart.append("value)");
sqlEnd.append("?)");
sqlValues.push(encoded.toString());
String sqlStatement = sqlStart.toString()+" "+sqlEnd.toString() ;
runInsertQL(callback, tx, sqlValues, sqlStatement, key);
}