Closed
Description
Context
Hi, I'm currently trying to execute the code below using node-postgres
const config: QueryConfig = {
text: 'select * from theriaque.get_drugs($1)',
values: [`%${name}%`]
};
this._client.query(config)
.then((res) => {
console.log(res);
console.log('QUERY >>>>>', `fetch all from "${res.rows[0]['get_drugs']}"`);
this._client.query(`fetch all from "${res.rows[0]['get_drugs']}"`)
.then((fetchedData) => {
console.log(fetchedData);
})
.catch((err) => {
console.log(err);
});
})
.catch((err) => {
console.log(err);
});
theriaque.get_drugs()
is a stored procedure return a REFCURSORres.rows[0]['get_drugs']
is returning<unnamed portal 1>
Problem
When the second query is called to fecth data from the REFCURSOR unnamed portal 1, it goes to the catch and tells me that cursor "<unnamed portal 1>" does not exist
.
I tried using pg-cursor
but there is no result from the first query.
Any suggestions ?
Thanks
Metadata
Metadata
Assignees
Labels
No labels