Re: [firebird-support] Any 'run as' in SQL/PSQL in FB3 ?

2017-08-30 Thread hamacker sirhamac...@gmail.com [firebird-support]
Something wrong in my test because 'sintax error' when I try role name without username/password. Can you help me? EXECUTE BLOCK returns (result_value Integer) AS declare variable lid_cv bigint=3; declare variable lcoditem varchar(30)='(C120P2AC)'; declare variable lvl_base NUMERIC(18,2)=

[firebird-support] FB connection over a VPN

2017-08-30 Thread dres...@tbinc.com [firebird-support]
By default, my app (Delphi with IBObjects) use FB 1.56 embedded with an option to run as client server (C/S). One of my customers wants to set it up to run C/S over a VPN. They tried using 1.56 but it timed out. They then tried switching to 2.5 (including changing out the DLL) but it still

Re: [firebird-support] Is it possible IF then statement in where clause?

2017-08-30 Thread hamacker sirhamac...@gmail.com [firebird-support]
For any kind of logic threatment in query I think that you can use CASE/WHEN/END method (include WHERE clausule). To make more simple your SQL, deal with null values using coalesce function, like: where (coalesce(myvalue,-1)>0). 2017-08-30 15:19 GMT-03:00 Luigi Siciliano luigi...@tiscalinet.it

Re: [firebird-support] Is it possible IF then statement in where clause?

2017-08-30 Thread setysvar setys...@gmail.com [firebird-support]
> < snip> > from > > PN_TESTA PNT > JOIN PN_CORPO PNC on PNT.ID = PNC.PN_TESTA_ID > WHERE > PNC.CONTO_ID = :CONTO > > if :CLIENTE is not null then <-- *IS NOT ACCEPTED* > > AND IIF (PNC.CLIENTE_ID IS NOT NULL, PNC.CLIENTE_ID, > PNC.FORNITORE_ID) = :CLIENTE) >

Re: [firebird-support] Any 'run as' in SQL/PSQL in FB3 ?

2017-08-30 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
30.08.2017 21:15, hamacker sirhamac...@gmail.com [firebird-support] wrote: > Here in fb3, to put role name in execute, Its mandatory put username and > password too. I was wrong a little, but still you should read the documentation: > - if ON EXTERNAL DATA SOURCE clause is omitted then >

Re: [firebird-support] Any 'run as' in SQL/PSQL in FB3 ?

2017-08-30 Thread hamacker sirhamac...@gmail.com [firebird-support]
Here in fb3, to put role name in execute, Its mandatory put username and password too. For username I can use current_user to workaround, but password ... there is not current_password to go on...(ha haha ) Well, I will wait for this feature in fb3+. The intention is do sometihing that

[firebird-support] Is it possible IF then statement in where clause?

2017-08-30 Thread Luigi Siciliano luigi...@tiscalinet.it [firebird-support]
Hallo,   I have a stored procedure that have two parameters: CONTO and CLIENTE because there is two values for CONTO that needs CLIENTE parameters, all other values of CONTO not needs CLIENTE. I need to have a if statement in WHERE clause to add "AND IIF (PNC.CLIENTE_ID IS NOT NULL,

Re: [firebird-support] Any 'run as' in SQL/PSQL in FB3 ?

2017-08-30 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
30.08.2017 17:58, hamacker sirhamac...@gmail.com [firebird-support] wrote: > To run, I need to know user and password and I don´t. No, you don't. If you provide role name only, current user will be used. -- WBR, SD.

Re: [firebird-support] Any 'run as' in SQL/PSQL in FB3 ?

2017-08-30 Thread hamacker sirhamac...@gmail.com [firebird-support]
To run, I need to know user and password and I don´t. 2017-08-30 9:50 GMT-03:00 Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] : > 30.08.2017 14:16, hamacker sirhamac...@gmail.com [firebird-support] wrote: > > I am looking for an instruction to execute

[firebird-support] FB and VPN

2017-08-30 Thread dres...@tbinc.com [firebird-support]
My (Delphi) application uses FB embedded (1.56 by default right now; connection via IBObjects) and works great. I have a user who wants to run it over a VPN and it times out on him. He replaced the 1.56 library with 2.5 and installed 2.5 on the server, but this did not fix the problem. Any

Re: [firebird-support] Any 'run as' in SQL/PSQL in FB3 ?

2017-08-30 Thread Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
30.08.2017 14:16, hamacker sirhamac...@gmail.com [firebird-support] wrote: > I am looking for an instruction to execute SQL block with elevate permitions. > I would like to know if exists how to execute pSQL as another role (or user) > or SQL > update/insert/delete. RTFM Execute Statement on

[firebird-support] Any 'run as' in SQL/PSQL in FB3 ?

2017-08-30 Thread hamacker sirhamac...@gmail.com [firebird-support]
Hello ALL, I am looking for an instruction to execute SQL block with elevate permitions. I would like to know if exists how to execute pSQL as another role (or user) or SQL update/insert/delete. I found 'set role' in docs, but in my test case does not run in PSQL (execute block). I can change