Questions tagged [firebird]

Firebird is a free and open-source, cross-platform, client-server SQL relational database management system, running on Linux, Unix, and Windows. Please mention your exact Firebird version when asking questions.

Firebird (Wikipedia) is an open-source SQL relational database management system (RDBMS) using the client-server model. It is cross-platform, running on Linux, Unix, and Windows.

It is written in C++, and is ultimately derived from the Borland InterBase 6.0 source code. Firebird is open-source, released under a non-copyleft MPL-like license. It is totally libre and free, for both open-source and commercial applications, but of course you can contribute back with code and donations to the Firebird Foundation.

Firebird and its predecessors have been in use for more than 30 years, which makes it a very mature and stable product.

Resources

Useful links

3750 questions
1
vote
2 answers

Can't connect to firebird database using Django

First time using Django, so I looked up a tutorial - I followed this link and everything went fine, until I had to adjust the settings.py file, where I followed this other link and got this error: django.core.exceptions.ImproperlyConfigured:…
user12725052
1
vote
1 answer

Firebird 2.5 commit/rollback (using autonomous transaction) in loop

I have to process records in a stored procedure's loop, for example: create or alter procedure process_waiting_records as declare v_id type of column my_table.id; begin for select t.id from my_table t …
tcxbalage
  • 696
  • 1
  • 10
  • 30
1
vote
2 answers

Select closest maximal numeric value in Firebird

Imagine there're 2 tables, let's call them "Master" and "Detail": Master -------------------------------- | ID | field_1 | ... | field_n | -------------------------------- Detail -------------------------------------------- | ID | master_id |…
Old Skull
  • 165
  • 7
1
vote
1 answer

How to drop an existing index in Firebird?

What a script should I create to check is this index exist? Because I want this index will be dropped if it has been created yet and then create the index again CREATE INDEX IF NOT EXISTS IDX_TABLE ON TABLE (ID, DATE) I need only one script to…
DisplayName
  • 219
  • 4
  • 23
1
vote
0 answers

How to get correct year, month and day in firebird function datediff including leap years

I need a solution extension that I received and it is visible at the link How to get correct year, month and day in firebird function datediff. I thought I had the right solution, but it turned out that the results I get differ from those counted by…
jeffers
  • 145
  • 3
  • 13
1
vote
3 answers

count the number of days of current month from day 1 until yesterday

I am trying to calculate the number of days of the current of month from day 1 until yesterday without the need of changing the count manually. The original SQL as below: select order_id from orders where date > dateadd(-23 to current_date) and…
1
vote
1 answer

java.sql.SQLException: The result set is closed on Firebird when executing two statements

I try to make 2 queries from a Firebird 2.5 DB. I use two separate Statement objects, but when in second query program try to use data from first query, it gets an error: java.sql.SQLException: The result set is closed. conn =…
Алекс
  • 13
  • 3
1
vote
1 answer

Accessing firebird from Python, can't send new commands after commit

I'm trying to work with a Firebird's SQL with Python, but once I make the first "COMMIT" line, everything else requires a new transaction, but I can't seem to find how do I start one. fbsql.ShowEverythingInTable("Cakes", con)…
user12725052
1
vote
1 answer

select the max value of 2 variables

I have the situation where I need to get the record of the latest date and then the max SEQ number. Example: CLIENT_ID STATUS DATE SEQ 10 1 2019-01-03 1 10 2 2019-01-03 2 10 4 2019-01-02 3 10…
1
vote
1 answer

"Column does not belong to referenced table" Why?

This code should delete an album but I don't know why it still doesn't work declare variable al_eliminare integer; begin select count(album.id) from album where id = :id_album into :al_eliminare; if(al_eliminare = 0) then delete…
1
vote
1 answer

How to send a subquery like parameter into a SQL procedure?

I have a firebird database where I call a procedure to get some data. This procedure needs an ID so I have two php queries, one of them gives me all the ID's and the another one calls the procedure. $queryP ="SELECT PROVEEDOR_ID FROM…
1
vote
1 answer

Date of last day of week in Firebird 3

This is a date of first day of week (monday) in Firebird 3: DATEADD(DAY, (EXTRACT(WEEKDAY FROM D - 1) * -1), D) And how to get the date of the last day of the week (Sunday)? In Firebird: Mon = 1, Tues = 2, ... Sun = 0.
Akella225
  • 61
  • 2
  • 8
1
vote
2 answers

How can I get the next generator value if my table has no records?

I'm using Firebird as my database and I wish to know how can I select the next generator value of my table when there's no data? Currently I'm using this script: SELECT GEN_ID(" + sGEN_NAME + ", 1) FROM sGEN_TABLE This works fine if there's…
Diego Bittencourt
  • 595
  • 10
  • 28
1
vote
1 answer

Firebird C Api Executing Unicode Sql Statements

When I try to execute sql statement in Firebird C Api, I can only use char* sql statements and I can not execute wide characters. How can I use execute() or prepare() with wide characters? const char* updstr = "UPDATE Tablo SET TABLOADI='Türkçe…
1
vote
0 answers

Firebird 3 not using index in plan

I am trying understand why Firebird 3 does not use an index in my simplified query below. If I run it without the plan clause it uses PLAN JOIN (L NATURAL, T INDEX (FK_TRANS_LEDGER), P INDEX (IDX_PRODUCTIONS1)) If I explicitly add the plan with the…
Tony
  • 48
  • 1
  • 9
1 2 3
99
100