Skip to content

PLS-00201: identifier must be declared #232

Closed Answered by anthony-tuininga
urosdigital asked this question in Q&A
Discussion options

You must be logged in to vote

You actually need to bind the output variable! Like this:

cursor_var = cursor.var(int)
cursor.execute("""
    DECLARE
        output INTEGER;
    begin
        output := user.package.myfunction(:1, :2, :3);
        :output := output;
    end;""", (msisdn, carrier, username, cursor_var))
connection.commit()
return cursor_var.getvalue()

You can do the same with a call to a function, but there is a shortcut that is included with the driver:

return_value = cursor.callfunc("myfunction", int, [carrier, username, reservation_date])

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@anthony-tuininga
Comment options

Answer selected by urosdigital
@urosdigital
Comment options

@anthony-tuininga
Comment options

@anthony-tuininga
Comment options

@urosdigital
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants