Re: execute block like Firebird does

2018-05-30 Thread Peter J. Holzer
On 2018-05-30 15:16:56 +0200, Félix GERZAGUET wrote: > On Wed, May 30, 2018 at 2:50 PM, PegoraroF10 wrote: > So, is that possible to change a DO structure is ran, to be possible to > return one or more values ? > It would be like ... > DO returns(ID Integer, Description Text) as >

Re: execute block like Firebird does

2018-02-14 Thread Edson Carlos Ericksson Richter
Em 11/02/2018 03:57, PegoraroF10 escreveu: We are migrating our databases from Firebird to PostGres. A useful feature Firebird has is Execute Block. What it does is just return a record set from that dynamic SQL, just like a PostGres function, but without creating it. It sound like ... execute

Re: execute block like Firebird does

2018-02-12 Thread PegoraroF10
I loved Firebird but now we have to have some cool things that Postgres has and Firebird doesn´t. Fiirebird has just 3 cool features that Postgres doesn´t: Computed by columns, Position for fields and triggers and execute blocks, just that. Replication, PITR, JSON and JSONB, XML, inherited

Re: execute block like Firebird does

2018-02-12 Thread Adrian Klaver
On 02/12/2018 10:02 AM, PegoraroF10 wrote: Explaining better my problem. All reports our customer use are customizable. So, when a customer runs a report it just runs all SQLs that are inside that report, being SQL or Execute Blocks. But because they are completelly customizable, one customer

Re: execute block like Firebird does

2018-02-12 Thread David G. Johnston
On Monday, February 12, 2018, PegoraroF10 wrote: > Explaining better my problem. All reports our customer use are > customizable. > So, when a customer runs a report it just runs all SQLs that are inside > that > report, being SQL or Execute Blocks. But because they are

Re: execute block like Firebird does

2018-02-12 Thread PegoraroF10
Explaining better my problem. All reports our customer use are customizable. So, when a customer runs a report it just runs all SQLs that are inside that report, being SQL or Execute Blocks. But because they are completelly customizable, one customer has 80 reports with 300 Execute Blocks on them

Re: execute block like Firebird does

2018-02-12 Thread Adrian Klaver
On 02/12/2018 08:57 AM, PegoraroF10 wrote: I know I need to think a different approach of what execute blocks does on Firebird. What I was trying to was just let them the way they were wrote, because their results are correct and with more time replace them to a new way. That may not be

Re: execute block like Firebird does

2018-02-12 Thread PegoraroF10
I know I need to think a different approach of what execute blocks does on Firebird. What I was trying to was just let them the way they were wrote, because their results are correct and with more time replace them to a new way. But, if that way cannot be used, I´ll probably write some hundred

Re: execute block like Firebird does

2018-02-12 Thread David G. Johnston
On Mon, Feb 12, 2018 at 6:48 AM, PegoraroF10 wrote: > Another approach to solve my problem would be a function that receives a > dynamic SQL, runs it and returns a XML or JSON and on client side I convert > that XML back to a recordset. Is that possible ? Yes, you can pass

Re: execute block like Firebird does

2018-02-12 Thread Adrian Klaver
On 02/12/2018 05:48 AM, PegoraroF10 wrote: We can change all those execute blocks, but it would be a huge work if we need to rewrite them all. Today, just for a test, I replaced a Firebird execute block to a Postgres CTE. OK, worked but I spend 40 minutes and the problem is that we have hundreds

Re: execute block like Firebird does

2018-02-12 Thread PegoraroF10
We can change all those execute blocks, but it would be a huge work if we need to rewrite them all. Today, just for a test, I replaced a Firebird execute block to a Postgres CTE. OK, worked but I spend 40 minutes and the problem is that we have hundreds of these execute blocks and on each one we

Re: execute block like Firebird does

2018-02-11 Thread Thiemo Kellner
On 02/11/18 06:57, PegoraroF10 wrote: I know we could create a function but we have several hundred of these blocks running, so ... it would be a huge work to do. So, there is a way to run a dynamic sql which returns a set of records ? But don't you need to touch the code of those blocks

Re: execute block like Firebird does

2018-02-11 Thread PegoraroF10
but DO doesn´t return values, or it does ? execute block returns(ID Integer, Name varchar(50), LastInvoice Date, ...) as begin for select ID, Name from Customers where ... into ID, Name do begin select bla, bla, bla from functionX(ID) into ...; if ... then bla = X else

Re: execute block like Firebird does

2018-02-11 Thread Fabrízio de Royes Mello
Em dom, 11 de fev de 2018 às 06:47, Andreas Kretschmer < andr...@a-kretschmer.de> escreveu: > > > Am 11.02.2018 um 06:57 schrieb PegoraroF10: > > We are migrating our databases from Firebird to PostGres. A useful > feature > > Firebird has is Execute Block. > > What it does is just return a

Re: execute block like Firebird does

2018-02-11 Thread Andreas Kretschmer
Am 11.02.2018 um 06:57 schrieb PegoraroF10: We are migrating our databases from Firebird to PostGres. A useful feature Firebird has is Execute Block. What it does is just return a record set from that dynamic SQL, just like a PostGres function, but without creating it. It sound like ...