Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Execute a stored procedure before rendering?
megabri
I'm attempting to execute a stored procedure in my initialize script. I can't seem to get it to fire. When I look in my log it seems to get past the stored procedure just fine but it doesn't execute it. Any ideas? Here's the current code I have in my initialize script:
importPackage(Packages.com.ibm.tivoli.maximo.report.script);
mxReportScriptContext = MXReportScriptContext.initialize(reportContext);
mxReportScriptContext.setDefaultLogLevel("DEBUG");
mxReportScriptContext.setDefaultLogFile("c:/Temp/myreport.log");
scriptLogger = mxReportScriptContext.getReportScriptLogger();
storedprocDataSet = MXReportDataSetProvider.create("maximoDataSource", "storedprocDataSet");
storedprocDataSet.open();
scriptLogger.debug(">>>>>>>>>>>>>>>BEFORE INITIALIZE<<<<<<<<<<<<<<<");
var mysql = new String();
mysql = "call lirr_rpt_es_brg_ins_proc('" + params["wonum"] + "', 'APPR')";
scriptLogger.debug(mysql);
storedprocDataSet.setQuery(mysql);
scriptLogger.debug(">>>>>>>>>>>>>>>AFTER<<<<<<<<<<<<<<<");
storedprocDataset.close();
Find more posts tagged with
Comments
Hans_vd
Shouldn't there be curly brackets around the call statement?
Like this:
mysql = "{call lirr_rpt_es_brg_ins_proc('" + params["wonum"] + "', 'APPR')}";
megabri
I tried adding brackets and it didn't work. I know birt has a stored procedure data source type (which works in the report designer by the way). The issue I'm having is when I upload my birt reports to my Maximo environment the only thing that seems to work are scripted data sources. Does anyone know how to call a stored procedure from a scripted data source? The call I reference above doesn't seem to work