Re: [firebird-support] COALESCE() + CAST() converts timestamp format

2014-05-12 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Bhavbhuti, I do not know the exact solution, but I'd say: COALESCE(CAST(tPB.dBillDt AS TIMESTAMP), '') AS tDocDt converts timestamp inside servers environment to a string - the returning client receives a string and does not know about it's datatype - yet does not a apply specific

Re: [firebird-support] Query optimization mystery

2014-05-13 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Kevin, let me first answer one of your particular questions: I don't really understand statistics but USV_SUPPROG_ADVOCATE_CODE has 0.029412 and USV_SCHLHIST_ADVOCATE_CODE has 0.000422. with the first index, you've about 3% of records with the same value in index (these are going to be

Re: [firebird-support] Query optimization mystery

2014-05-13 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Oops: If you know, that the stored procedure returns view records, connect ... I meant: few records -- Mit freundlichen Grüßen, Thomas Beckmann Diplom-Informatiker Wielandstraße 14c • 23558 Lübeck Tel +49 (22 25) 91 34 - 545 • Fax +49 (22 25) 91 34 - 604 Mail thomas.beckm...@assfinet.de

Re: [firebird-support] database became broken for any reasons

2014-05-15 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi! 1. Sometimes without any reasons if I send database to shutdown mode, it's not happened without killing all pro cesses of fb_inet_server.exe(I hope it's ok, because no one use database in this moment) If the server can't set database in shutdown mode, it's still active in working on the

Re: [firebird-support] Re: database became broken for any reasons

2014-05-15 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Well, Dimitri, I don't know whether it's ok for the people at the other end of the killed connection, because their operation is cancled and rolled back, but at least, you don't get database corruptions, if you close all connections and shut down database regularly... Best regards, Thomas Am

Re: [firebird-support] Re: Performance of Stored Procedures versus execute blocks

2014-05-19 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Lafras, I'm sorry to not dig in that deep again, but your assumptions are starting to get a bit complex. Few thoughts: - Not only sorting, but narrowing procedure result sets (where, join, on) is not performed by indexed search. - The main software architectural argument to write a stored

Re: Odp: [firebird-support] Re: database became broken for any reasons

2014-05-20 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
You might create an on connect trigger that trows an exception on certain condition, for example the value of a generator (bcause this gets visible to every transaction immediately) and for other users than yourself. That will prevent applcication from reconnecting successfully. Am 20.05.2014

Re: Odp: [firebird-support] Re: database became broken for any reasons

2014-05-20 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
You might create an on connect trigger that trows an exception on certain condition, for example the value of a generator (bcause this gets visible to every transaction immediately) and for other users than yourself. That will prevent applcication from reconnecting successfully. Am 20.05.2014

Re: [firebird-support] loading data from a .csv file?

2014-05-22 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
To import csv, I usually use B_LOADFROMFILE from rfunc UDF library (http://rfunc.sourceforge.net/) with some recursive query to split lines and fields. If you need hints on this, I'll provide an example. If you can modify the format of the data to import, you might consider external tables.

Re: [firebird-support] Firebird export/import tool

2014-06-03 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hard to say, 'cause you're not pointing out what kind of problem you encounter... Cheers, Thomas Am 03.06.2014 13:30, schrieb milossi...@yahoo.com [firebird-support]: Hello, We are using a firebird database for our application programmed in .NET. We are using this tool for

Re: [firebird-support] Materialized views

2014-06-07 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi, if you can commit yourself in maintaining one or the other rule in writing the body of the viesws, it should not bee too complicate to find out what tables and fields you are refering and to query system tables for data types of you materialized views... Thomas Am 07.06.2014 14:36, schrieb

Re: [firebird-support] Conversion error from string #Timestamp#

2014-06-11 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Augusto, if the insert-string contains timestamp information in the form you specified, no error should occur. Are you sure, that the data does not contain the string 'Timestamp' (as the error message indicates)? Are you able to log your datastream during pump to the cloud? Are you able to

Re: [firebird-support] How to retrieve list of users granted with the admin role

2014-06-18 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Robert, roles are database specific. Check RDB$ROLES and RDB$USER_PRIVILEGES, you'll probably find out what you need - if not, come back and ask, I'll dig in more details. Thomas Am 18.06.2014 15:23, schrieb r...@xs4all.nl [firebird-support]: As SYSDBA I like to know which users are

Re: [firebird-support] Re: Execute SQL scrip (few sql statements) in one step in SP

2014-06-21 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
The query I've been sending you could be inside a stored procedure: create porcedure P_EXEC_SCRPT(CMDS varchar(16)) as declare variable CMD varchar(16)) begin for with recursive... select CMD from ... into :CMD do execute statement :CMD; end If you are not executing the execute

Re: [firebird-support] Invalid argument in EXECUTE STATEMENT - cannot convert to string

2014-06-26 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
userClause is probably null. Then the entire string will be null. Am 25.06.2014 16:08, schrieb Tim Ward t...@telensa.com [firebird-support]: Anyone know what this error message actually means? Yes I am trying to run an EXECUTE STATEMENT, but it's not clear to me what an argument means

Re: [firebird-support] remove constraint

2014-07-07 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Wolfgang, I think, you should alter table and alter the field definition to not required the check any more. Regards, Thomas Am 07.07.2014 08:22, schrieb Wolfgang Kluge wkl...@kb-labuan.com [firebird-support]: Good afternoon. Can anypme give me a hint how I can by code remove a

Re: [firebird-support] no-wait vs wait transactions?

2014-07-08 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Not to make you jealous or anything, but we just came back into cell phone range o n our leisurely cruise down the Maine coast. I'd send a picture, but the list won't let me. Now it's 6:30. The drinks flag is out; the dog has had her run through the woods and a bit of swimming. Life is

Re: [firebird-support] gds32.dll failed to load ODBC32+FB64+App32

2014-07-21 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Bhavbhuti, ASAIK, 32bit ODBC-driver can connect to 32bit Firebird only. Regards, Thomas Am 21.07.2014 08:21, schrieb venussof...@gmail.com [firebird-support]: Hi all I found that on my 64 bit i5, 64 bit Win7 that there were both 32 and 64 bit installations of FireBird. So I

Re: [firebird-support] Re: CrossTab Select

2014-07-23 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
What do you need help for? Am 22.07.2014 15:14, schrieb sremula...@bol.com.br [firebird-support]: help -- Mit freundlichen Grüßen, Thomas Beckmann Diplom-Informatiker Wielandstraße 14c • 23558 Lübeck Tel +49 (22 25) 91 34 - 545 • Fax +49 (22 25) 91 34 - 604 Mail

Re: [firebird-support] Skip records

2014-07-29 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
thomas.beckm...@assfinet.de [firebird-support]: Hi Svein, hi Sean, my solution would look similar to what you pointed out, Sean, and I agree, execute block usually provides better readability and recursion depth is a problem: with recursive CTE_NR as (select 1 as NR, t.ID, (select first 1

Re: [firebird-support] Triggers

2014-08-13 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Hugo, in use means, the database is attached? You can change triggers at any time, but as far as I konw, the change gets visible only after transaction is committed. Thomas Am 13.08.2014 19:53, schrieb Hugo Eyng hugoe...@msn.com [firebird-support]: Hello. Is it possible to

Re: [firebird-support] where condition

2014-08-14 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
and coalesce(d.bsnr, -1) = coalesce((select ag from p_getmaxag(a.teilenr,:typ,1)),d.bsnr,-1) seem to be a possible, but probably not very performant approach. Doing a left join with the procedure in case the stuff before your leading and holds true could be a solution... Thomas Am 14.08.2014

Re: [firebird-support] Insert existing record into same table several times

2014-08-16 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Alan! The reason is very simple: The first select in your procedure is a singleton select, it can deal with one record only, because it's no for select Thus you get an error, if there are more than one record that match the condition (quantity1). Do for select Id, description, quantity

Re: [firebird-support] Re: CrossTab Select

2014-08-19 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hard to help, when there's no question... Looking back the thread, you got some answers but did not relate on them in your following questions. Does select sum(iif(extract(weekday from t.DATAB) = 0, PRODUTO, 0)) as W0, sum(iif(extract(weekday from t.DATAB) = 1, PRODUTO, 0)) as W1,

Re: [firebird-support] Export data to CSV file from stored procedure?

2014-08-21 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
There are UDFs around to write files (example rfunc: http://rfunc.sourceforge.net/) and you can use freeadhocudf (http://freeadhocudf.org/dokumentation_deutsch/dok_deu_blob.html) to transform your data. Cheers, Thomas Am 20.08.2014 18:26, schrieb Tim Ward t...@telensa.com [firebird-support]:

[firebird-support] Execute statement on external does not enter default values in target table

2014-10-30 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi, it seems to me, that execute statement on external enters NULL in the target table in columns that are not mentioned in an insert statement - at least, the default values from domain definition are not used. Example: in test.fdb create domain D_TID as integer default current_transaction;

[firebird-support] Is there still a difference between sweep and gabage collection?

2015-02-20 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi everybody, in her book in chapter 39 (Housekeeping tool), Helen explains the difference between garbage collection and sweep: However, gbak doesn't perform a full sweep. Like the regular garbage collection, it leaves deleted and rolled-back versions alone. Sweeping is the only way to get rid

Re: [firebird-support] Re: Is there still a difference between sweep and gabage collection?

2015-02-23 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Many thanks for your comments! Thomas -- Diplom-Informatiker Wielandstraße 14c • 23558 Lübeck Tel +49 (22 25) 91 34 - 545 • Fax +49 (22 25) 91 34 - 604 Mail thomas.beckm...@assfinet.de mailto:thomas.beckm...@assfinet.de ASSFINET-Logo *ASSFINET Dienstleistungs-GmbH* Max-Planck-Straße 14 •