Accept 'null':true as bound parameter type
This commit is contained in:
parent
93652a137c
commit
bbbb243315
1 changed files with 7 additions and 0 deletions
|
@ -169,16 +169,23 @@ Scholar.DB = new function(){
|
||||||
|
|
||||||
if (statement && params){
|
if (statement && params){
|
||||||
for (var i=0; i<params.length; i++){
|
for (var i=0; i<params.length; i++){
|
||||||
|
// Int
|
||||||
if (typeof params[i]['int'] != 'undefined'){
|
if (typeof params[i]['int'] != 'undefined'){
|
||||||
Scholar.debug('Binding parameter ' + (i+1) + ' of type int: ' +
|
Scholar.debug('Binding parameter ' + (i+1) + ' of type int: ' +
|
||||||
params[i]['int'],5);
|
params[i]['int'],5);
|
||||||
statement.bindInt32Parameter(i,params[i]['int']);
|
statement.bindInt32Parameter(i,params[i]['int']);
|
||||||
}
|
}
|
||||||
|
// String
|
||||||
else if (typeof params[i]['string'] != 'undefined'){
|
else if (typeof params[i]['string'] != 'undefined'){
|
||||||
Scholar.debug('Binding parameter ' + (i+1) + ' of type string: "' +
|
Scholar.debug('Binding parameter ' + (i+1) + ' of type string: "' +
|
||||||
params[i]['string'] + '"',5);
|
params[i]['string'] + '"',5);
|
||||||
statement.bindUTF8StringParameter(i,params[i]['string']);
|
statement.bindUTF8StringParameter(i,params[i]['string']);
|
||||||
}
|
}
|
||||||
|
// Null
|
||||||
|
else if (typeof params[i]['null'] != 'undefined'){
|
||||||
|
Scholar.debug('Binding parameter ' + (i+1) + ' of type NULL', 5);
|
||||||
|
statement.bindNullParameter(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return statement;
|
return statement;
|
||||||
|
|
Loading…
Reference in a new issue