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
1 answer

Select first 5 but only if their next ID are +1 to previous one

So I have to: select first 5(or any other number, it will be input) filed2 from table1 where field1=YES AND last ID = first ID+5 or something So normally making: select first 5 field2 from table1 where field1=YES…
1
vote
1 answer

How to transpose line up using SQL

I'm looking for a way to transpose line up using SQL so that first table would looks like the second one. I'm using Firebird 2.5 Edit: Uploaded DDL and…
kelsen
  • 29
  • 7
1
vote
3 answers

Can Firebird SQL procedure know the parent procedure/trigger from which it is called from?

I have SQL procedure which should return a bit different result if it is called from one specific procedure. Is it possible for the SQL procedure to detect that it is called from one particular other SQL procedure? Maybe monitoring mon$... table…
TomR
  • 2,696
  • 6
  • 34
  • 87
1
vote
1 answer

How to get sum of table a and sum of table b with multiple rows

I have two tables: table1 as a id date customer amount 1 2021-04-08 a 2 2 2021-04-08 a 3 table2 as b id orderid money 1 1 50 2 1 60 3 2 10 4 2 20 Now I want to have the date, customer and the sum of amount from table1…
1
vote
1 answer

Skip None values in entry widgets Tkinter Python

Let's say we have a Tkinter app with many entry widgets like this: root = Tk() entry1 = Entry(root, width=40) entry1.grid(row=0, column=0) entry2 = Entry(root, width=40) enrtry2.grid(row=1,column=0) entry3 = Entry(root,…
Tony
  • 618
  • 12
  • 27
1
vote
2 answers

Null terminator + String matching using Firebird C API and parameterized inserts

I have several VARCHAR columns. After performing inserts using a parameterized statement, I would like to query one of them, e.g., select * from my_table where name = 'my_varchar'. This works properly if I insert my char arrays with…
mlawsonca
  • 103
  • 1
  • 6
1
vote
1 answer

Swift package wrap a C library for macOS and Linux

I create a Firebird Swift client library for macOS and Linux, but I need to link the Firebird C library, depending of the system target. Currently, my library bundle the Firebird Framework for macOS using a xcframework, but I'm unable to do it for…
ugocottin
  • 64
  • 8
1
vote
1 answer

How to detect if a trigger is fired for an insert or update?

I need to make a table in my database that has all of the history of all DML statements that occur in a given table. The LOG table is like this: id event ts record 1 update 2020-01-01 record1 2 delete 2020-01-02 record2 LOG table has a…
Tony
  • 618
  • 12
  • 27
1
vote
1 answer

Check for is numeric in Firebird database

How can I check if the value of a field is numeric or not in a Firebird database? This seems like an easy problem but I can't find anything in the FreeUDFLib or standard Firebird library. Here's how I would do it in SQL Server. Select field from…
Joan Wojcicki
  • 75
  • 1
  • 7
1
vote
1 answer

Insert values into tables with a foreign key

I want to insert some values in two tables in a loop, but it seems like I can't do it because of the foreign key. However, the same code does work in SQL Server. This works perfectly in SQL Server: declare @i int = 1 while @i<1200 BEGIN INSERT…
1
vote
1 answer

ADO.NET FirebirdSql.Data.FirebirdClient.FbException: "Unable to complete network request to host "

I have a pretty strange problem when trying to connect my C# program to an existing Firebird server. First of all, this is reproducable with the default connection example from the Firebird documentation at…
1
vote
1 answer

Firebird how to use IIF in ORDER BY with a subquery's column

The following query doesn't work, because Firebird (2.1) won't recognize the subquery's column. How can I rewrite it to work? SELECT I.InvoiceID, I.PayByDate, (SELECT FIRST 1 I2.PayByDate FROM Invoices I2 WHERE I2.OriginalInvoiceID =…
Steve
  • 2,510
  • 4
  • 34
  • 53
1
vote
1 answer

Exception when trying to execute a query from pascal

The following function takes the cuits (the cuit is like social security number) from a grid and inserts them into a temporary table. I'm using Delphi XE7 and Firebird 2.5. function TfImportFileARBARetenPercep.fxListClientFromGrid( pboClient:…
Franco Torres
  • 253
  • 1
  • 6
1
vote
1 answer

Computed table column with MAX value between rows containing a shared value

I have the following table CREATE TABLE T2 ( ID_T2 integer NOT NULL PRIMARY KEY, FK_T1 integer, <--- foreign key to T1(Table1) FK_DATE date, <--- foreign key to T1(Table1) T2_DATE date, …
1
vote
0 answers

Converting SQL Server code to Firebird produces "Token unknown" error

I have my SQL Server code available, but I couldn't convert it to Firebird no matter how hard I tried. I would like your help in this matter. SQL Server and Firebird all tables are the same and the data types are the same. SQL Server Database SQL…