Re: [firebird-support] How to rename the database after backup/restore?

2012-02-03 Thread Chuck Belanger
This is how I ended up doing it: Initially I have been using IBOServices to do my local hard drive FDB backups. My routine that seems to work now: 1. Check for connected users using a query of MON$Attachments, other than connection used in the utility app. 2. Disconnect the app I'm using. 3. GF

[firebird-support] How to rename the database after backup/restore?

2012-02-03 Thread Chuck Belanger
Hello: After using Firebird (2.5 SS) exclusively in a desktop application environment, I've created an associated app that stores data at an internet address. I just finished the code to allow me via a remote site to backup and immediately restore as a maintenance operation the database. My p

RE: [firebird-support] join to select top 1 of another table

2012-02-03 Thread Leyne, Sean
> what is the best way to do a join to a "top 1 row" select of second table? For > example CAR and CAR_IMAGES to display just one image. > I wrote following select, this works. However I think there must be a clever > way to use "ROWS 1" instead of "min() and group by". > > SELECT > CMRK.CAR_MAR

[firebird-support] join to select top 1 of another table

2012-02-03 Thread Net Newbie
what is the best way to do a join to a "top 1 row" select of second table? For example CAR and CAR_IMAGES to display just one image. I wrote following select, this works. However I think there must be a clever way to use "ROWS 1" instead of "min() and group by". SELECT CMRK.CAR_MARK_NAME, CMDL.C

Re: [firebird-support] max() on primary key very slow

2012-02-03 Thread Ann Harrison
On Fri, Feb 3, 2012 at 10:25 AM, wrote: > > SQL databases are always in for a surprise about performance of simple > statements. Particularly true when you switch between record locking and MVCC. > > I have a table with the column 'ID' as BIGINT unique primary key. > > The table has about 4

[firebird-support] Re: best type for storing 0.686956521739130434782?

2012-02-03 Thread angel_ignacio_colmenares
thanks Ann, You're right, the best option seems to be decimal (18,18). (19,19) doesn't work : SQL error code = -842. Precision must be from 1 to 18 --- In firebird-support@yahoogroups.com, Ann Harrison wrote: > > On Thu, Feb 2, 2012 at 6:50 AM, angel_ignacio_colmenares > wrote: > > I'm writing

Re: [firebird-support] corrupted table or record?

2012-02-03 Thread Bart Smissaert
Thanks for the suggestions. For some strange reason all seems to be fine now. DB Workbench finds the record (and looks normal data) and works fine via ODBC as well. No idea what went on there. RBS On Fri, Feb 3, 2012 at 6:43 PM, Thomas Steinmaurer wrote: > ** > > > > Firebird 1.5 on Windows, acc

Re: [firebird-support] max() on primary key very slow

2012-02-03 Thread Thomas Steinmaurer
> SQL databases are always in for a surprise about performance of simple > statements. > > I have a table with the column 'ID' as BIGINT unique primary key. > > The table has about 400 entries, the ID counts up without gaps. > > A simple > > select max(ID) from T > > takes about 14 second

Re: [firebird-support] corrupted table or record?

2012-02-03 Thread Thomas Steinmaurer
> Firebird 1.5 on Windows, accessed via ODBC. > Have a large table (some 50 million records) with the following structure: > > CREATE TABLE AUDIT_TRAIL > ( >AUDIT_ID INTEGER NOT NULL, >AUDIT_TIME DATE, >USER_ID VARCHAR(12) C

Re: [firebird-support] Using fbtracemgr

2012-02-03 Thread Thomas Steinmaurer
> Hi, I'm trying to use fbtracemgr, but I get nothing coming out after I've run > a query. Here is my config file: > >enabled true > log_transactions true > log_trigger_start true > log_trigger_end true > print_perf true > prin_plan true > log_procedure_start true > log_procedure_finish

Re: [firebird-support] max() on primary key very slow

2012-02-03 Thread Matthias Hanft
ruch...@gmx.de wrote: > > I have a table with the column 'ID' as BIGINT unique primary key. > select max(ID) from T > So Firebird seems to do plan a full table scan. (Hallo, anyone at home? > I have an unique index on that column ;-) ) As far as I know, you need a DESC index for MAX queries.

[firebird-support] max() on primary key very slow

2012-02-03 Thread ruchbah
Hallo, SQL databases are always in for a surprise about performance of simple statements. I have a table with the column 'ID' as BIGINT unique primary key. The table has about 400 entries, the ID counts up without gaps. A simple select max(ID) from T takes about 14 seconds comple

[firebird-support] Using fbtracemgr

2012-02-03 Thread Russell Rose
Hi, I'm trying to use fbtracemgr, but I get nothing coming out after I've run a query. Here is my config file: enabled true log_transactions true log_trigger_start true log_trigger_end true print_perf true prin_plan true log_procedure_start true log_procedure_finish true and here is my c

Re: [firebird-support] best type for storing 0.686956521739130434782?

2012-02-03 Thread Ann Harrison
On Thu, Feb 2, 2012 at 6:50 AM, angel_ignacio_colmenares wrote: > I'm writing a firebird provider for ServiceStack.OrmLite and unit tests > ask for store  the value : 0.686956521739130434782 in a table. > the datatable is simple: > > CREATE TABLE TEST > ( >    v1 float, >    v2 float > ); Float

[firebird-support] Re: selecting between dates with timestamps fields

2012-02-03 Thread Sergio
> I'm trying with (to get all records from Feb 2nd) > > where > (MyTimeStamp between '02-01-2012 00:00:00' and '02-01-2012 23:59:59') > > it uses the index, but I don't get all the records My mistake!... that seems to work OK... Now I just wonder if that is the *best* way to do that... So

[firebird-support] Centos 6.2 64 bit and ibase.h missing

2012-02-03 Thread wang960
hi, using this to install firebird: yum install firebird-classic.x86_64 it works in centos 6.2. now where is the ibase.h? i need that to compile some other modules. Thanks, Wang

[firebird-support] selecting between dates with timestamps fields

2012-02-03 Thread Sergio H. Gonzalez
Hello! I have a timestamp field with an index how can I select the fields from a given date, but using the index? If I do: where ((cast (MyTimeStamp as date)) between :from_date and :to_date) I guess that is better not to do the cast and pass the params with date + time. I use Delphi and

[firebird-support] Re: best type for storing 0.686956521739130434782?

2012-02-03 Thread angel_ignacio_colmenares
thanks Karol, I fixed it using 21 digits as you say. now FirebirdDialect for Servicestack.OrmLite pass all unit tests. btw, if someone is interested in using an ORM for Firebird can go to my respository (fork): https://github.com/aicl/ServiceStack.OrmLite/ or to the official one: https://githu

[firebird-support] corrupted table or record?

2012-02-03 Thread Bart Smissaert
Firebird 1.5 on Windows, accessed via ODBC. Have a large table (some 50 million records) with the following structure: CREATE TABLE AUDIT_TRAIL ( AUDIT_ID INTEGER NOT NULL, AUDIT_TIME DATE, USER_ID VARCHAR(12) COLLATE NONE, TAB

[firebird-support] Re: OS X related questions

2012-02-03 Thread philippe makowski
wang960 [2012-02-03 12:09] : > Thanks for the reply, that answers most of the questions I asked. now, for > the firebird client for OS X, doing it "by hand", any tips for me to explore > this direction? I think that you you need fbintl, Firebird, libib_util.dylib, libicudata.dylib, libicui18n.dy

[firebird-support] Re: OS X related questions

2012-02-03 Thread wang960
Thanks for the reply, that answers most of the questions I asked. now, for the firebird client for OS X, doing it "by hand", any tips for me to explore this direction? --- In firebird-support@yahoogroups.com, philippe makowski wrote: > > wang960 [2012-02-03 02:53] : > > Hi, > > > > Got three