oracle空对象返回

时间:2018-06-20 10:21:44

标签: javascript database oracle

我在本地Oracle DB上进行的某些测试遇到问题。以下是我的JS代码。本质上,如果我“警告”或“写”从数据库返回的数据,我将得到我期望的结果。但是我找不到将数据放入数组或将其分配给变量的方法。当我注销控制台时,它看起来像一个空对象? -不确定我做错了什么,感谢您的帮助。

//Oracle Database 11g Release 11.2.0.3.0 64 bit Production ;

var connection = new ActiveXObject("ADODB.Connection") ;
var connectionstring=" My string is here...";
connection.Open(connectionstring);
var rs = new ActiveXObject("ADODB.Recordset");

sql="SELECT Tail_number FROM aircraft"
rs.Open(sql, connection);
rs.MoveFirst
while(!rs.eof)
{
var testthis = rs.fields(0);  //This does not work,
console.log(testthis); // Neither does this, just returns an empty object

document.write(rs.fields(0)); //This will successfully send the output to the 
screen
document.write("<br>");
rs.movenext;
}
rs.close;
connection.close;

</script>

This is what I am seeing

0 个答案:

没有答案