I have the below oracle sql procedure which is called by python using an sql file. When I run the below procedure with actual value for account number, it gives as pop-up -> enter binds where I get to enter customer name value.
Declare
Accountnum varchar2(200);
Startdtm date;
Customername varchar2(200);
Begin
Accountnum := null;
Startdtm := null;
Procedurename( Accountnum => ‘$$ACCNUM’, —- value is ‘19283-1’ Startdtm => Startdtm, Customername => Customername);
:Customername := Customername; —-value is ‘19283’
End;
/
Commit;
This sql procedure file is called in python as below:
def executeSQL(self, accnum, custname, sqlfile):
f = open(sqlfile)
fullSql = f.read()
replacedSQL = fullSql.replace(“$$ACCNUM”, str(accnum))
self.cur.callproc(“dbms_output.enable”)
var1 = self.cur.var(str)
self.cur.execute(replacedSQL, var1 = custname)
self.cur.execute(“commit”)
After running this in python, the account num is getting replaced but for customer name it is printing the below error:
ORA-01036: illegal variable name/number.
Could someone please explain where I went wrong.