GMSC Discussions

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Regular Contributor
Posts: 195
Registered: ‎07-07-2016
Accepted Solution

How to execute oracle procedure from trigger

Hi,

 

In GMSC 2020 I've created sql trigger that should execute oracle procedure:

 

<WorkflowTrigger name="UtworzKonsultacjeSqlTrigger" method="action" type="SqlTrigger">
<Param name="Sql" value="execute GCW.UTWORZ_KONSULTACJE('a', 'a', 's');" />
</WorkflowTrigger>

 

Unfortunatelly when I call trigger, I get the following error:

 

29.04.2020 14:04:57 ERROR - Controller Trigger has raised an exception in Action FireData.
Oracle.DataAccess.Client.OracleException: ORA-00900: invalid SQL statement
at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable, OracleLogicalTransaction m_OracleLogicalTransaction)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, Boolean bCheck, OracleLogicalTransaction m_OracleLogicalTransaction)
at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery(

...

 

How to execute Oracle procedure correctly?

Highlighted
Technical Evangelist
Posts: 1,307
Registered: ‎09-11-2015

Re: How to execute oracle procedure from trigger

I think you need a custom trigger as you need to tell it that the Oracle command type is a stored procedure and not a plain query. Similar was discussed here:

https://community.hexagongeospatial.com/t5/GMSC-Discussions/Stored-Procedure/m-p/32796#M2344

 

Which leads to the older (no longer maintained) blog:

https://geomediasmartclient.wordpress.com/2013/06/11/execute-stored-procedures-in-gmsc-workflows/

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Highlighted
Regular Contributor
Posts: 195
Registered: ‎07-07-2016

Re: How to execute oracle procedure from trigger

Thanks for the reply.

 

According to https://geomediasmartclient.wordpress.com/2013/06/11/execute-stored-procedures-in-gmsc-workflows/ I need to write my own extension to GMSC, I mean write c# code, compile it and put dll library file somewhere in GMSC folder. Am I right?

Highlighted
Technical Evangelist
Posts: 1,307
Registered: ‎09-11-2015

Re: How to execute oracle procedure from trigger

Yes, see more info here:

 

https://community.hexagongeospatial.com/t5/SDK-API/Starting-with-2018-Update-3/ta-p/9

https://support.hexagongeospatial.com/API/GMSC/Server/index.html#topic_00000000000013F6.html

 

Or, looking for "Custom trigger" term here on Community yields into some results too.

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial