You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 REFCURSOR
res.rows[0]['get_drugs'] is returning <unnamed portal 1>
Problem
When the second query is called to fecth data from the REFCURSORunnamed 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
The text was updated successfully, but these errors were encountered:
Context
Hi, I'm currently trying to execute the code below using
node-postgres
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
The text was updated successfully, but these errors were encountered: