ac_davis2002
asked on
Executing a stored procedure through cognos
Hi
I am trying to execute a store procedure from Cognos 8. When i validate the statement it does not generate any erros and it creates the data item. But when I run the report I get the error error near word execute. The command i am using is
Execute compcount (cumpcount is the procedure name)
Can anyone tell me if I am doing this correctly please?
Adam
I am trying to execute a store procedure from Cognos 8. When i validate the statement it does not generate any erros and it creates the data item. But when I run the report I get the error error near word execute. The command i am using is
Execute compcount (cumpcount is the procedure name)
Can anyone tell me if I am doing this correctly please?
Adam
What kind of report are you running? If it's from Crystal Reports won't work. This kind of report aren't able to run SP's.
VMontalvao -
They are using Cognos according to the subject line and question. Crystal Reports is different. Judging by the error they are getting the SQL is going through. Probably can't find a proc name.
They are using Cognos according to the subject line and question. Crystal Reports is different. Judging by the error they are getting the SQL is going through. Probably can't find a proc name.
ASKER
Yep Cognos 8, it seems to be finding the procedure as it creates the data itm when i run the query in validation its
when i run the entire report it crashes with the error?
when i run the entire report it crashes with the error?
Tty and Fully Qualify it as I proposed above and let us know if that changes behavior..
ASKER
Hi mike
I fully qualified the execute comand as you suggested and when I validate it creates the data items. But when I compile the report I get the following
UDA-SQL-0115 Inappropriate SQL request. UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Deferred prepare could not be completed. UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Statement(s) could not be prepared. (SQLSTATE=42000, SQLERRORCODE=8180) UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Line 1: Incorrect syntax near ')'. (SQLSTATE=42000, SQLERRORCODE=170) UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Incorrect syntax near the keyword 'EXECUTE'. (SQLSTATE=42000, SQLERRORCODE=156) RSV-SRV-0042 Trace back: RSReportService.cpp(610): QFException: CCL_CAUGHT: RSReportService::process() RSReportServiceMethod.cpp( 177): QFException: CCL_RETHROW: RSReportServiceMethod::pro cess(): asynchWait_Request RSASyncExecutionThread.cpp (520): QFException: RSASyncExecutionThread::ch eckExcepti on RSASyncExecutionThread.cpp (173): QFException: CCL_CAUGHT: RSASyncExecutionThread::ru n(): promptPagingForward_Reques t RSASyncExecutionThread.cpp (570): QFException: CCL_RETHROW: RSASyncExecutionThread::pr ocessComma nd(): promptPagingForward_Reques t Execution/RSRenderExecutio n.cpp(514) : QFException: CCL_RETHROW: RSRenderExecution::execute Execution/RSRenderExecutio n.cpp(784) : QFException: CCL_RETHROW: RSRenderExecution::process ActiveDocu ments Assembly/RSDocAssemblyDisp atch.cpp(2 35): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchAssem bly Assembly/RSLayoutAssembly. cpp(135): QFException: CCL_RETHROW: RSLayoutAssembly::assemble Assembly/RSDocAssemblyDisp atch.cpp(2 95): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchChild renAssembl yForward Assembly/RSReportPagesAsse mbly.cpp(1 13): QFException: CCL_RETHROW: RSReportPagesAssembly::ass emble Assembly/RSDocAssemblyDisp atch.cpp(2 54): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchAssem bly Assembly/RSPageAssembly.cp p(236): QFException: CCL_RETHROW: RSPageAssembly::assemble Assembly/RSDocAssemblyDisp atch.cpp(2 54): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchAssem bly Assembly/RSTableRowAssembl y.cpp(115) : QFException: CCL_RETHROW: RSTableRowAssembly::assemb le Assembly/RSDocAssemblyDisp atch.cpp(2 54): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchAssem bly Assembly/RSTableCellAssemb ly.cpp(94) : QFException: CCL_RETHROW: RSTableCellAssembly::assem ble Assembly/RSDocAssemblyDisp atch.cpp(2 95): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchChild renAssembl yForward Assembly/RSTableAssembly.c pp(89): QFException: CCL_RETHROW: RSTableAssembly::assemble Assembly/RSDocAssemblyDisp atch.cpp(2 95): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchChild renAssembl yForward Assembly/RSTableRowAssembl y.cpp(115) : QFException: CCL_RETHROW: RSTableRowAssembly::assemb le Assembly/RSDocAssemblyDisp atch.cpp(2 54): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchAssem bly Assembly/RSTableCellAssemb ly.cpp(94) : QFException: CCL_RETHROW: RSTableCellAssembly::assem ble Assembly/RSDocAssemblyDisp atch.cpp(2 95): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchChild renAssembl yForward Assembly/RSDocAssemblyDisp atch.cpp(2 95): QFException: CCL_RETHROW: RSDocAssemblyDispatch::dis patchChild renAssembl yForward Assembly/RSAssembly.cpp(48 8): QFException: CCL_RETHROW: RSAssembly::createListIter ator RSQueryMgr.cpp(744): QFException: CCL_RETHROW: RSQueryMgr::getListIterato r RSQueryMgr.cpp(809): QFException: CCL_RETHROW: RSQueryMgr::getResultSetIt erator RSQueryMgr.cpp(961): QFException: CCL_RETHROW: RSQueryMgr::createIterator RSQueryMgr.cpp(1591): QFException: CCL_RETHROW: RSQueryMgr::executeRsapiCo mmand RSQueryMgr.cpp(1574): QFException: CCL_RETHROW: RSQueryMgr::executeRsapiCo mmand QFSSession.cpp(1424): QFException: CCL_RETHROW: QFSSession::ProcessDoReque st() QFSSession.cpp(1422): QFException: CCL_CAUGHT: QFSSession::ProcessDoReque st() QFSSession.cpp(1393): QFException: CCL_RETHROW: QFSSession::ProcessDoReque st() QFSConnection.cpp(750): QFException: CCL_RETHROW: QFSConnection::Execute QFSQuery.cpp(112): QFException: CCL_RETHROW: QFSQuery::Execute v2 CoordinationQFSQuery.cpp(3 471): QFException: CCL_THROW: CoordinationPlanner
I beleave its complaining about syntax. again the query works ok sql query analyser but not in the report. i am running the query in cognos as native sql?
I fully qualified the execute comand as you suggested and when I validate it creates the data items. But when I compile the report I get the following
UDA-SQL-0115 Inappropriate SQL request. UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Deferred prepare could not be completed. UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Statement(s) could not be prepared. (SQLSTATE=42000, SQLERRORCODE=8180) UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Line 1: Incorrect syntax near ')'. (SQLSTATE=42000, SQLERRORCODE=170) UDA-SQL-0564 [Microsoft OLE DB Provider for SQL Server]Incorrect syntax near the keyword 'EXECUTE'. (SQLSTATE=42000, SQLERRORCODE=156) RSV-SRV-0042 Trace back: RSReportService.cpp(610): QFException: CCL_CAUGHT: RSReportService::process()
I beleave its complaining about syntax. again the query works ok sql query analyser but not in the report. i am running the query in cognos as native sql?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here's a cognos KB that talks about it:
http://support.cognos.com/knowledgebase/googlesearch?load_kb_document=1&dr=kb1&uniqueid=137076
http://support.cognos.com/knowledgebase/googlesearch?load_kb_document=1&dr=kb1&uniqueid=137076
ASKER
hoooraahhhhh
It works thanks RWrighley been pulling my hair our with this!!!!
Now I need to know if it is possible to pass the start and end report prompts from the reports to the stored proc so will raise as a new questions if you would be so kind to look at chaps
It works thanks RWrighley been pulling my hair our with this!!!!
Now I need to know if it is possible to pass the start and end report prompts from the reports to the stored proc so will raise as a new questions if you would be so kind to look at chaps
ASKER
Thanks again
So I would try:
EXECUTE databasename.owner.compcou
Owner is probably just DBO if you haven't made any changes to default behavior.