Greetings for the day!
How can i execute an insert query using sqlalchemy, the call query is generating fine means when i manually run that query in oracle it inserts the price but not happening via python.
import wind32com.client
from sqlalchemy.engine import create_engine
import datetime
DIALECT = 'oracle'
SQL_DRIVER = 'cx_oracle'
USERNAME = 'xxx' # enter your username
PASSWORD = 'xxx' # enter your password
HOST = 'pv-prod-orc-01.xxx.com' # enter the oracle db host url
PORT = 1521 # enter the oracle port number
SERVICE = 'PVL01PD_APP.ec2.internal' # enter the oracle db service name
ENGINE_PATH_WIN_AUTH = DIALECT + '+' + SQL_DRIVER + '://' + USERNAME + ':' + PASSWORD + '@' + HOST + ':' + str(
PORT) + '/?service_name=' + SERVICE
engine = create_engine(ENGINE_PATH_WIN_AUTH)
conn = engine.connect()
date = datetime.datetime.strptime(Date,"%Y-%m-%d").strftime("'%d%b%Y'")
sql_query = 'call CORE_VALUATIONS.VALUATIONS.INSERTEQCLOSINGPRICE(%d, %s, %f, NULL, NULL)' % (int(Pkey), date, float(price))
print(sql_query)
conn.execute(sql_query)
conn.close()