-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
This is my code:
var get_ddl = function(conn, cb) {
conn.execute(
ddl_cmd,
[178],
{
fetchInfo :
{
?ALL?: { type : oracledb.STRING }, // return the date as a string
}
},
function(err, result) {
console.log(result.rows);
});
};
This is the example code:
function(err, connection) {
if (err) {
console.error(err.message);
return;
}
connection.execute(
"SELECT last_name, hire_date, salary, commission_pct FROM employees WHERE employee_id = :id",
[178],
{
fetchInfo :
{
"HIRE_DATE": { type : oracledb.STRING }, // return the date as a string
"COMMISSION_PCT": { type : oracledb.DEFAULT } // override oracledb.fetchAsString
}
},
function(err, result) {
if (err) {
console.error(err.message);
doRelease(connection);
return;
}
console.log(result.rows);
doRelease(connection);
});
});
In the example, the columns have names: HIRE_DATE, and COMMISSION_PCT.
The column I am fetching, i assume has no name, the result is just some rows. I want to fetch all rows as strings. what should I replace ?ALL? with? Also, what is [178] and why did he put that there?
[Edite: code markdown added by @cjbj]