Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

Topic-icon Question Call a procedure and get the return

More
02 Sep 2015 13:04 #1 by TAOUILI
Call a procedure and get the return was created by TAOUILI
Hi,

I'm trying to call a procedure in database (function) from stambia s18, I want get the parameters returned.
There is a way to make this.
Thanks in advance.
More
02 Sep 2015 14:27 #2 by Thomas BLETON
Replied by Thomas BLETON on topic Call a procedure and get the return
Hi,

Can you please specify more info on what you need to do :
- do you need to call this function from a mapping expression, a single call in a SqlOperation ?
- what rdbms are you working with ?
- do you have an example of the returned parameters and how you want to use them ?
More
02 Sep 2015 15:19 #3 by TAOUILI
Replied by TAOUILI on topic Call a procedure and get the return
I want to call this function not from a mapping but in sql operator.
I use Postgresql as RDBMS.


My function is just a simple one:
[


DECLARE
i integer;
BEGIN

select max(c1) into i from work.test;

insert into work.test (c1, c2) values (i+1, 'analytics');
RETURN 1 ;
END ;

]
The message error :
Calculator/SqlOperation
org.postgresql.util.PSQLException: Un résultat a été retourné alors qu'aucun n'était attendu.


By the way, how to get the result of select query.
Attachments:
More
02 Sep 2015 15:31 #4 by Thomas BLETON
Replied by Thomas BLETON on topic Call a procedure and get the return
Your SqlOperation is set to "DDL_DML" action type.
If you want to SELECT data, you need to set the action type to SELECT, and bind it to some action to treat the data.

If your need is to get the result in a process parameter, you can alternatively use a SqlToParameters action.