[firebird-support] Creating UDF - stdcall vs cdecl

2014-10-07 Thread hamacker sirhamac...@gmail.com [firebird-support]
Hi everyone, I am studying how to create UDFs on Firebird, but there is a thing that I can not understand. Samples that I found over internet, like this: http://www.firebirdsql.org/en/writing-udfs-in-delphi-for-interbase-firebird/ All functions are exported as stdcall: function

[firebird-support] It´s a bug or whatever?

2015-10-29 Thread hamacker sirhamac...@gmail.com [firebird-support]
Hi everybody. When I try: select (2183.48/(1-(37.25/100))) as valor from rdb$database As result Firebird: 3465,8412 But other databases(MSSQL) and spreadshets(Excel and Calc) the correct result is 3479,6494023904 If I change (37.25/100) to 0.3725 as follow: select (2183.48/(1-0.3725)) as

Re: [firebird-support] It´s a bug or whatever?

2015-10-29 Thread hamacker sirhamac...@gmail.com [firebird-support]
15 19:22, skrev hamacker sirhamac...@gmail.com > [firebird-support]: > > Hi everybody. > > When I try: > select (2183.48/(1-(37.25/100))) as valor from rdb$database > > As result Firebird: 3465,8412 > But other databases(MSSQL) and spreadshets(Excel and Calc) the correct &

Re: [firebird-support] What is more effective execute block or select?

2016-01-29 Thread hamacker sirhamac...@gmail.com [firebird-support]
Thanks, it´s clear now. 2016-01-27 14:27 GMT-02:00 Ann Harrison aharri...@ibphoenix.com [firebird-support] : > >

[firebird-support] What is more effective execute block or select?

2016-01-27 Thread hamacker sirhamac...@gmail.com [firebird-support]
I would know whats methods is more effective, per exemple: To know if itens exists or not, select: select case when exists(select 1 from cv_itens where id_cv=51716) then 'Y' else 'N' end as existe_itens from rdb$database OR using block execute: execute block returns(exist

Re: [firebird-support] There is a verb to supply identity columns?

2017-02-06 Thread hamacker sirhamac...@gmail.com [firebird-support]
:35 GMT-02:00 Mark Rotteveel m...@lawinegevaar.nl > [firebird-support] <firebird-support@yahoogroups.com>: > >> >> >> On 11-1-2017 12:00, hamacker sirhamac...@gmail.com [firebird-support] >> wrote: >> > Colums identity in FB3, I love it! >> > &

[firebird-support] detect duplicate blobs, how to?

2017-02-09 Thread hamacker sirhamac...@gmail.com [firebird-support]
Hi All, I am using FB3 and I have a table where each record has a picture and some picture are duplicated. I think to separate pictures into a new table. But I need a method (server side is better) to not duplicate pictures again. First, I need to know if exists function as CHECKSUM (magical

Re: [firebird-support] Is this a bug of Firebird?

2017-02-09 Thread hamacker sirhamac...@gmail.com [firebird-support]
Some times, I need to create a query where there is a 'where (0=0)' . it´s not logic for anyone. But to me, it´s significant because I need to certify that WHERE clausule always exists when populate my query with dinamic filters controlled by my application. In your example, I can espaculate that

Re: [firebird-support] Re: detect duplicate blobs, how to?

2017-02-09 Thread hamacker sirhamac...@gmail.com [firebird-support]
Well, the man page says fully supports text BLOBs, I assume that binary not. If HASH() behavior will operate ^Z and others control chars in Blob Image, then now I need to think how to use this function to kill duplications. Any function like CHECKSUM, CRC32,...? 2017-02-09 10:36 GMT-02:00 Dmitry

Re: [firebird-support] FB3 No permission for usage access to exception

2017-02-17 Thread hamacker sirhamac...@gmail.com [firebird-support]
grant to public and it will be resolved. 2017-02-16 10:59 GMT-02:00 r...@seedsbydesign.com [firebird-support] < firebird-support@yahoogroups.com>: > > > I'm confused about an error when accessing an FB3 database - "No > permission for USAGE access to Exception E_Exception". > > > When I run a

[firebird-support] How to identify if field of table is identity or not?

2017-01-12 Thread hamacker sirhamac...@gmail.com [firebird-support]
hi All, I did a procedure that recompute all identity fields of a list with items separate by comma, but I need a method to check if table.field is identity or not. It´s a procedure of mainnitence. My code: EXECUTE BLOCK returns ( result_table varchar(255), result_idkey varchar(255),

Re: [firebird-support] There is a verb to supply identity columns?

2017-01-11 Thread hamacker sirhamac...@gmail.com [firebird-support]
I knew it! Never alone :) I´m following your ticket, Mark. Thanks. 2017-01-11 10:35 GMT-02:00 Mark Rotteveel m...@lawinegevaar.nl [firebird-support] <firebird-support@yahoogroups.com>: > > > On 11-1-2017 12:00, hamacker sirhamac...@gmail.com [firebird-support] > wrote: &

[firebird-support] There is a verb to supply identity columns?

2017-01-11 Thread hamacker sirhamac...@gmail.com [firebird-support]
Hi, All. Colums identity in FB3, I love it! But there is one thing missing. I would like to know, if exists a verb to supply identity value to not assume a literal value. Ex: create table test ( id integer generated by default as identity primary key, name varchar(15) ); insert into

Re: [firebird-support] How to identify if field of table is identity or not?

2017-01-12 Thread hamacker sirhamac...@gmail.com [firebird-support]
just be careful, shits happens ;) Now, its done: EXECUTE BLOCK returns ( result_table varchar(255), result_idkey varchar(255), result_done varchar(1)) as declare variable source_list varchar(8192); declare variable l_item varchar(255); declare variable l_lastpos integer; declare

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] Any 'run as' in SQL/PSQL in FB3 ?

2017-08-30 Thread hamacker sirhamac...@gmail.com [firebird-support]
:15 GMT-03:00 Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] <firebird-support@yahoogroups.com>: > > > 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

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

2017-08-30 Thread hamacker sirhamac...@gmail.com [firebird-support]
end end end suspend; end 2017-08-30 16:33 GMT-03:00 Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] <firebird-support@yahoogroups.com>: > 30.08.2017 21:15, hamacker sirhamac...@gmail.com [firebird-support] wrote: > > Here in fb3, to put role name in execute, It

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] <firebird-support@yahoogroups.com>: > 30.08.2017 14:16, hamacker sirhamac...@gmail.com [firebird-support] wrote: > > I am looking for an instruc

[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

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

2017-08-31 Thread hamacker sirhamac...@gmail.com [firebird-support]
sql_update_cv_itens_sub1) > (:lvl_base, :lid_cv_itens_sub1) > role 'perfil_vendas'; > > HTH, > Set > > > 2017-08-30 23:08 GMT+02:00 hamacker sirhamac...@gmail.com > [firebird-support] <firebird-support@yahoogroups.com>: > >> >> >> Something wr

Re: [firebird-support] Bulk upload options

2018-05-16 Thread hamacker sirhamac...@gmail.com [firebird-support]
I dont know bulk method in firebird. You can write scripts, scripts is more fastest than transfer from machine to another. You can run isql.exe < script.sql If is not possible to create scripts then use (hard) commit each 1000 (or more) transfers, if you not to do, transaction will be slowing at

Re: [firebird-support] Bulk upload options

2018-05-18 Thread hamacker sirhamac...@gmail.com [firebird-support]
Well, I wrote that scripts by isql.exe < script.sql is more fast than transfer from machine to another because... I did and compare. Is more fast because dont depends of any kind of application that use data layers(ado, odbc,...) and network protocols, it´s more similar that 'bulk insert' in

Re: [firebird-support] Bulk upload options

2018-05-16 Thread hamacker sirhamac...@gmail.com [firebird-support]
months ago, I test method load data from script (sorry I dont test load from csv) and transfer source/to. Well, script is fast, but when error occour you need to correct file and try again and it´s not easy edit from huge file (only gvim app I can manipulate fast) Easy method that I choose

[firebird-support] lock_timeout or isc_tpb_lock_timeout?

2019-04-15 Thread hamacker sirhamac...@gmail.com [firebird-support]
Hi All, Simple question, I use Delphi Firedac and only now I need to put a time out in wait transactions, but I my test not run I expected, so I think that I did something wrong. First question: fdconn1.Params.Values['lock_timeout']:='180'; or fdconn1.Params.Values['isc_tpb_lock_timeout']:='180';

Re: [firebird-support] lock_timeout or isc_tpb_lock_timeout?

2019-04-16 Thread hamacker sirhamac...@gmail.com [firebird-support]
If I do: SET TRANSACTION TO 300 In ExecSQL, my currenty transaction will be waitting 30 sec? Em ter, 16 de abr de 2019 às 08:03, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] escreveu: > 15.04.2019 19:59, hamacker sirhamac...@gmail.com [firebird-support] wrote: > > First

[firebird-support] Number of transactions by selected user

2019-12-12 Thread hamacker sirhamac...@gmail.com [firebird-support]
To get number of connections by selected user: SELECT count(*) FROM MON$ATTACHMENTS a WHERE a.MON$USER='sysdba' But If I need number of transactions pending, is it possible?

Re: [firebird-support] double precision remove last 2 numbers

2020-02-26 Thread hamacker sirhamac...@gmail.com [firebird-support]
Maybe between 8 and 15 decimals, not more. Em qua., 26 de fev. de 2020 às 16:10, Dimitry Sibiryakov s...@ibphoenix.com [firebird-support] escreveu: > 26.02.2020 19:41, hamacker sirhamac...@gmail.com [firebird-support] wrote: > > I need to store long decimals numbers maybe mor

[firebird-support] double precision remove last 2 numbers

2020-02-26 Thread hamacker sirhamac...@gmail.com [firebird-support]
Hi All, I do this update: UPDATE CV SET perc_lucro=42.503064336972848 WHERE (id_cv=57528) Then I do a select and 'perc_lucro' was change to 42,5030643369728 after updated, two last numbers disappear. Why? perc_lucro is double precision type. FB 3.0.5 32bits, Windows 64.

Re: [firebird-support] double precision remove last 2 numbers

2020-02-26 Thread hamacker sirhamac...@gmail.com [firebird-support]
numbers maybe more than 15 decimals, is it possible without store as string? Em qua., 26 de fev. de 2020 às 15:21, Mark Rotteveel m...@lawinegevaar..nl [firebird-support] escreveu: > > > On 2020-02-26 19:07, hamacker sirhamac...@gmail.com [firebird-support] > wrote: > > Hi

Re: [firebird-support] SEC$DESCRIPTION, how to change it?

2020-01-08 Thread hamacker sirhamac...@gmail.com [firebird-support]
Thanks. I suspect that, but I trust in user docs. Em ter., 7 de jan. de 2020 às 16:05, Mark Rotteveel m...@lawinegevaar.nl [firebird-support] escreveu: > > > On 2020-01-07 19:49, hamacker sirhamac...@gmail.com [firebird-support] > wrote: > > There is a SEC$DESCRIPTION field

[firebird-support] SEC$DESCRIPTION, how to change it?

2020-01-07 Thread hamacker sirhamac...@gmail.com [firebird-support]
There is a SEC$DESCRIPTION field on security users table, but CREATE/ALTER USER command does not any parameter to change it, is it correct?

[firebird-support] is it possible to drop all indexes, except those related to PK and FK?

2020-03-12 Thread hamacker sirhamac...@gmail.com [firebird-support]
Is it possible to drop all indexes, except those related to PK and FK? I would like to do a test and recreate them by script.

[firebird-support] Re: is it possible to drop all indexes, except those related to PK and FK?

2020-03-13 Thread hamacker sirhamac...@gmail.com [firebird-support]
response to my self, is it correct? execute block returns (drop_index_name varchar(31), dropped boolean) as declare variable doit boolean; declare variable stmt varchar(2048); begin dropped=false; -- test before for select i.rdb$index_name from rdb$indices i where

[firebird-support] is it a bug?

2020-07-28 Thread hamacker sirhamac...@gmail.com [firebird-support]
If I try in FB3 (latest version): CREATE USER 'ROBOT.CUSTOS' -- wont run PASSWORD 'password' FIRSTNAME 'ROBOT' MIDDLENAME 'DE' LASTNAME 'CUSTOS' ; Not run! but If I try: CREATE USER "ROBOT.CUSTOS" -- it´s run PASSWORD 'password' FIRSTNAME 'ROBOT' MIDDLENAME 'DE' LASTNAME