Re: [SQL] Help on Procedure running external function

2005-07-05 Thread Din Adrian
1. the function get_me_next_number is runing from this procedure (same trans) but it's an external one ... 2. the second solution I'am using now (using temp a table to store each maxnrdoc value - but the temp table give me sometimes a relation with OID # does not exist - problem that I ca

[SQL] Create connection with Oracle database from Postgres plpgsql function

2005-07-05 Thread Dinesh Pandey
How can we create connection with Oracle database from Postgres plpgsql function and execute some oracle stored procedure? Thanks Dinesh    

Re: [SQL] Create connection with Oracle database from Postgres plpgsql function

2005-07-05 Thread Michael Glaesemann
On Jul 5, 2005, at 6:40 PM, Dinesh Pandey wrote: How can we create connection with Oracle database from Postgres plpgsql function and execute some oracle stored procedure? I don't think it's possible with plpgsql. Try DBI-link. Michael Glaesemann gr

Re: [SQL] Help on Procedure running external function

2005-07-05 Thread Zac
I think you should use 'FOR UPDATE' clause in your first "select": select into vnrBon maxnrbon+1 from MagMaxNrBon where magazie = dsgroup.magazie_implicita_lansare FOR UPDATE; In this way you lock the rows eventually returned and no one can update them (or select them "for update") until your

Re: [SQL] Help on Procedure running external function

2005-07-05 Thread Din Adrian
I 'solved' my 'relation with OID # does not exist' problem using only execute on temp table ... Is no need for me to 'lock'(for update) the temp table - is temporary (lock at 'create temp table MagMaxNrBon')- everybody has his own copy Your right I should change the get_number proce

Re: [SQL] Help on Procedure running external function

2005-07-05 Thread Bruno Wolff III
On Tue, Jul 05, 2005 at 13:47:24 +0200, Zac <[EMAIL PROTECTED]> wrote: > I think you should use 'FOR UPDATE' clause in your first "select": > > select into vnrBon maxnrbon+1 from MagMaxNrBon where magazie = > dsgroup.magazie_implicita_lansare FOR UPDATE; > > In this way you lock the rows event

Re: [SQL] Help on Procedure running external function

2005-07-05 Thread Din Adrian
I am sorry but: the table is TEMPORARY ... I don't need to do any lock on it (eventualy I should do a lock on the table where I want to insert the documents - the MagMaxNrBon is only a temp table used for storing the max document nr for each user's setings in this transaction - I did that

Re: [SQL] Create connection with Oracle database from Postgres plpgsql

2005-07-05 Thread Bricklen Anderson
Dinesh Pandey wrote: > How can we create connection with Oracle database from Postgres plpgsql > function and execute some oracle stored procedure? > > Thanks > Dinesh You can use perl DBI to access Oracle, providing you have DBI and the plperlu language installed. Sample code that may help you g