Return Cursor Oracle #3759
Unanswered
ricardocarrer
asked this question in
Help
Replies: 1 comment
-
Hey guys! I still couldn't get it to work, do you know if it has CURSOR support with Adonis? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey Guys! How are doing?
I'm trying to return a CURSOR and I'm having a little trouble. I've looked for solutions, but I only find using Oracle's native lib.
Any suggestions on how to read the CURSOR returned in the binding?
My Code:
const query =
BEGIN SP_GET_TOTAL_TABELA_TESTE(:BIND1, :BIND2, :CURSOR); END;
const binds = {
BIND1: {
type: oracledb.NUMBER ,
dir : oracledb.BIND_OUT
},
BIND2: {
type: oracledb.STRING ,
dir : oracledb.BIND_OUT
},
CURSOR: {
type: oracledb.CURSOR ,
dir : oracledb.BIND_OUT
},
}
const result = await Database.rawQuery(query, binds)
Result:
[
134, -- return number ok
"BANANA", --return string ok
--this return SYS_REFCURSOR
{
"_rowCache": [
}
]
Thanks Guys!
Beta Was this translation helpful? Give feedback.
All reactions