Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.

Topic-icon Question Call a procedure and get the return

More
02 Sep 2015 13:04 #1 by TAOUILI
TAOUILI created the topic: Call a procedure and get the return
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
Thomas BLETON replied the 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
TAOUILI replied the 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
Thomas BLETON replied the 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.