Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

dblink - void functions

$
0
0
Hi

Sorry for yet another post.

I'm trying to run a function from within another function using dblink, this is so I can create an autonomous transaction. My understanding is that PostgreSQL doesn't support autonomous transactions and this is the suggested workaround for this.

I can't seem to work this out and fire a function that returns a void

I'm very new to dblink so probably doing something very stupid! And if I've missed a trick do let me know!

my dblink code that sit within the function is as follows
Code:

PERFORM dblink_connect('dbconn','dbname=xxx user=xxx password=xxx'); 
PERFORM dblink_exec('dbconn','PERFORM public.usp_sendemailtemplate(''a65885ef-7904-4553-a6da-94041e98ff9c'', ''test'', 1, ''test2'');');
PERFORM dblink_exec('dbconn','commit;'); 
PERFORM dblink_disconnect('dbconn');

The signature for usp_sendemailtemplate is
Code:

CREATE OR REPLACE FUNCTION public.usp_sendemailtemplate(p_apisessionid uuid, p_sessionid CHARACTER VARYING, p_websiteuserid BIGINT, p_templatedesc emailtemplatedesc)
 RETURNS void


Viewing all articles
Browse latest Browse all 13329

Trending Articles