All Questions
Tagged with firebird firebird-3.0
202 questions
1
vote
1
answer
31
views
Set generator to value of another generator
I want to set the value of the generator Dest to the actual value of generator Src:
ALTER SEQUENCE Dest RESTART WITH GEN_ID(Src, 0);
This doesn't work:
Invalid token. Dynamic SQL Error. SQL error ...
0
votes
0
answers
64
views
Firebird Server Installed but no Firebird Service
I downloaded Firebird 2.1.7 tar file. Installed with install.sh. I can connect to the db at /opt/firebird/bin/isql, but how do I set it up as a service? There is no Firebird service and no instruction ...
0
votes
1
answer
49
views
Why can't Firebird 3 perform where in?
When the code below is executed, it keeps thinking forever and ends up crashing fastreport, why?
SELECT TREQDEVMAT.COD_PRODUTO,
TPRODUTO.DES_PRODUTO,
TPRODUTO.COD_SUBFAMILIA,
...
0
votes
0
answers
64
views
How to move numbers on a number line?
I have a Firebird 3 table like this:
MyTable
-------
ID: Integer (auto inc), primary key
Pos: Integer, Unique
Flavor: varchar
Data looks like:
Pos Flavor
-------------
1 Chocolate
2 Vanilla
3 ...
2
votes
1
answer
115
views
Firebird ODBC Driver not load UDF dll
My DB have a lot of procedures that uses functions from rfunc.dll, but when I try to uses ODBC Driver connection on C# the UDF functions doesn't load
Here how I'm doing the connection
public ...
2
votes
1
answer
92
views
Which constraint is checked first - primary key or unique key (on different columns)?
I have a program that synchronizes records in two databases. It relies on primary key violation on insert to know that record already exists, and then it makes applies an update to that record. That ...
0
votes
0
answers
117
views
Firebird Database: SELECT on OCTET versus CHAR
My platform:
Server Name: localhost/3050
Server Version: WI-V3.0.7.33374 Firebird 3.0
Server Implementation: Firebird/Windows/AMD/Intel/x64
Service Version: 2
I have been told that record ...
1
vote
1
answer
499
views
Cannot open gbk file - is it Firebird or Interbase?
We have a .gbk file that we are trying to restore to a database, in order to convert it to Postgres, but we can’t figure out the ODS or even if it is actually an Interbase file, and not a Firebird ...
1
vote
1
answer
80
views
Count distinct records in Firebird 3.0
I have data as follows:
nota | produto | descricao | vendida | total | ...
1 A AAA 100 1000
1 B BBB 20 200
1 A AAA ...
0
votes
1
answer
173
views
Python Firebird driver raise "Not a Directory" exception by connecting to or creation a database
I'm writing a Python3 script under Ubuntu 22.04.3 LTS to work with Firebird database under the Firebird3.0 server. I use the firebird.driver library. But I'm constantly getting an error "Not a ...
1
vote
1
answer
573
views
How to restore a Firebird 4 backup to Firebird 3 [closed]
I'm looking to migrate from Firebird 3 to 4, but in case it is needed I want to know if and how I can downgrade a database back to Firebird 3. For testing purposes I have a database running under the ...
0
votes
1
answer
69
views
Yii2 returns Firebird 3.0 dialect 1 numeric(15,2) field as string with constant junk value (24833794986.24 or 4039119896.80)
I am using Yii2 PHP framework to access Firebird 3.0 database which, unfortunately, is still in dialect 1. I have lot of numeric(15,2) fields in it. That is quite natural approach to store monetary ...
0
votes
1
answer
84
views
Update multiple rows in single select
I'm getting multiple rows in single select error with this SQL:
UPDATE ITEMS IT
SET IT.BCOST = (SELECT V.PRICE + (V.PRICE * 0.1)
FROM VENDOR V
WHERE V.ITEMNO = IT....
0
votes
0
answers
39
views
Update all records of a table according to a view result
I have a view like below
ITEMNO INCOME OUTGO
AA 10 2
BB 15 0
...
so on
I'd like to update every record of the ITEMS table (item cards) according to above view's results.
I ...
0
votes
1
answer
63
views
How many days from first day of the current year till today
I'm trying to get day count of from the first day of the current year till today
For example:
Today = 24/07/2023
FirstDate = 01/01/2023
LastDate = 24/07/2023
The result is 204 days
Is it possible to ...
1
vote
1
answer
47
views
Why does my query return null when subquery condition is false
I have these three tables in my Firebird database:
CREATE TABLE CLIENT_CODE_MASTER
(
ID INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL PRIMARY KEY,
CLIENT_CODE VARCHAR(100) UNIQUE NOT NULL,
...
0
votes
1
answer
1k
views
Connection timeout in Firebird Server 3
I'm connecting to a Firebird SQL Server version 3 with a C# application using Firebird .NET Client 9.1.1. Once the application is started 3 connections to the server are established using a connection ...
-1
votes
1
answer
68
views
How to return the first row after group by?
My table looks like the following:
ID
ITEMNO
LOCATIONNO
LOTNO
INCOME
OUTGO
1
AAA
A-01
001
1
0
2
AAA
A-02
002
1
0
3
AAA
A-01
001
0
1
When a user sells an item, I want to show the oldest income ...
-1
votes
1
answer
63
views
Case when doesn't accept BEGIN
Case doesn't accept Begin
I need to update 2 separate fields in one case, something like below
UPDATE PYR SET
MSR =
Case
When MSR = :WRKH then
Begin
MSR = NULL
...
2
votes
1
answer
85
views
What is the purpose of the '.' operator in a firebird database query?
When I am executing the SQL query below against A Firebird database (version 3.0.9) running on a Windows 10 64 bit PC.
SELECT * FROM AliasName WHERE AliasId=3. or 1=1--
I expected the query to fail ...
-4
votes
1
answer
76
views
Creating a quarterly report in SQL
I'm creating a quarterly report of item usage in Firebird, and got stuck at this point:
The select below is working, but it brings me the monthly usage of last 3 months like the image below:
Script:
...
0
votes
1
answer
831
views
Power BI Dataset can not find Firebird database
After a Firebird 3.0 update, our PowerBI Dataset can't find the Firebird database, although the ODBC Setup works just fine.
But the most bizarre part, I can create a new Dataflow-set with the exact ...
1
vote
2
answers
72
views
Count days since 3rd event from today
I have a table Events in LibreOffice Base with a Firebird database (version 3.0.8) that records how many times an event occurs. Example below:
Date
EventCount
22-04-01
15
22-09-30
10
22-10-01
1
...
1
vote
2
answers
208
views
Differences in "procedure locking" based on the way the client is connecting to the database
I have created a test procedure like that:
CREATE OR ALTER PROCEDURE tmp_fab
RETURNS (dummy INTEGER) AS
BEGIN
dummy = 1;
suspend;
END
Then a first client ("client A") uses the ...
1
vote
1
answer
1k
views
How to get the max value of 3 fields
I have a table with integer fields like this:
Field1
Field2
Field3
6
1
2
3
6
2
7
4
2
5
6
1
1
6
2
5
7
1
First, I want to look for the max value in field3. It's 2.
Now, I want to look for the ...
1
vote
1
answer
244
views
How to check if running in autonomous transaction?
In a trigger, I need to do some stuffs only when the code is not running from autonomous transaction.
Is there a way to detect if the code is running in the context of an autonomous transaction?
2
votes
1
answer
711
views
Can't connect to Firebird 3.0 with user with small letters in login with Java
I connect with names in capital letters, but it does not want to connect with small letters in the login.
Here is a small test
String ENCODING = "WIN1251";
String CONNECTION_URL = "jdbc:...
0
votes
1
answer
1k
views
Firebird Server 3.0 not run automatically after installation
I have used Firebird setup 3.0 (Firebird-3.0.10.33601_0_Win32.exe) witch the parameters:
Firebird-3.0.10.33601_0_Win32.exe /SILENT /NORESTART /COMPONENTS="ServerComponent,ServerComponent\...
0
votes
0
answers
465
views
Firebird dump tables
I have a database.gdb running with Firebird 3.0.
This database has two tables:
Table1 and
Table2.
Every day I add records to these tables and when I have finished my work I need to export the two ...
0
votes
1
answer
546
views
Commit/Rollback transaction not listed in MON$TRANSACTIONS
We have a strange issue in a customer's Firebird database. We noticed an active transaction not listed in the mon$transactions table.
According to the gstat utility, transaction 231.768.260 is active:
...
0
votes
1
answer
207
views
Get value from Firebird cursor by field name
I need get data from cursor by field name, stored in var. For example, I have statement:
for select CUBE1, CUBE2, CUBE3, ....., CUBE31
from GET_DATA(......) B
where ..... as cursor cvol do
...
0
votes
0
answers
397
views
Firebird 3 connection string not working in C#
I have a problem after migrating a database from Firebird 2.5 to Firebird 3. The C# application stopped displaying data. I have a 'REPORTER' user assigned to ROLE_SELECT, but not authorized to all ...
0
votes
3
answers
364
views
Distinct max values or only one maximum value from the serial number
I have a database (with two columns "id" and "serial") with serial numbers. For example:
id |Serial
10 | A18D003.000106
12 | A13D002.000100
122| A19D004.000107
There are many more ...
0
votes
2
answers
569
views
gbak gives system directive access failed on Ubuntu when running from net core application
Basically, I want to run a gbak restore (Firebird 3) from my ASP.NET Core application on Ubuntu.
Here is my code:
string output = "";
using (Process pProcess = new System.Diagnostics....
0
votes
1
answer
1k
views
How to print message in ISQL / IBExpert Sql tool?
I know that in SQL Server we can print message via operator PRINT, but PRINT doesn't work in IBExpert, and command OUTPUT too. Can someone help me?
I have this error when I run previous code:
1
vote
1
answer
391
views
Firebird SQL join recommendation
I am using Firebird 3.0. I have 2 tables and I want to get the following result with one query, but I couldn't do this.
USERS Table
ID
USER_NAME
10
User1
20
User2
30
User3
40
User4
50
User5
...
0
votes
2
answers
89
views
'Custom' group by in select
(edited to minimal reproducible example)
I needed some help with the following select:
Select
Id_Product, -- product identifier
Sum(Qt_Sold) Sold_Amount, -- total sum of quantity sold
Sum(...
2
votes
1
answer
193
views
Round to the next tenth, subtract 0.02
I have an ITEMS table with a PRICE column. I added 4% to the price using the built-in functions in the application, but that leaves the result not in a friendly formats for retail. I want all the ...
1
vote
1
answer
143
views
TIB_Script run large script
I encountered a problem that IB_Script returned an error while running a longer script:
SQL Error Code = -104
Unexpected end of command - line 18, column 52
As long as the number of characters in ...
-1
votes
1
answer
103
views
Query and total for each week
user, timeon, timeoff, hours
Monday -
1510, 2021-10-25 05:00:00, 2021-10-25 09:00:00 -
1510, 2021-10-25 14:00:00, 2021-10-25 17:00:00 -
The total should be 4 + 3 = 7
Tuesday -
1510, 2021-10-25 ...
2
votes
0
answers
104
views
How can I post updates for deleted records using TEMSDataSetResource in RAD Server 11
I have created a simple new Rad Server Package with resource with a data module to access a Firebird 3.05 database running on Ubuntu 18.0.4. I included sample endpoints and a database endpoint with ...
2
votes
2
answers
2k
views
How to configure firebird 3.0 or set rights so any user can create a DB
I followed this guide for firebird3.0 on ubuntu. It is outdated, since there is no more employe.fdb in the examples and you have to create it itself through the included sql script. My problem is, ...
2
votes
1
answer
608
views
Delete empty lines in a text blob
I have a list of email addresses in a table called cc_list (blob(text)). To remove an email address from the list, I have used the replace function
update actions
set cc_list=replace(cc_list,'email@...
0
votes
1
answer
307
views
Firebird 3.0 embedded DB after new install of Windows 10 with new Username not accessible anymore
I coded a CRM application in Delphi some years ago and worked with it. Now I reinstalled my computer and the only thing that changed was the Username of Windows 10 itself. Result is, that I cannot ...
2
votes
1
answer
7k
views
FirebirdSql Data Client I/O error during "CreateFile (open)" operation for file
One of our clients is getting this error very randomly. Once or twice a week. It has only been happening for the last month or so.
Error message:
I/O error during "CreateFile (open)" ...
0
votes
2
answers
770
views
How to get value from table using Firebird trigger
I want to get a value from the table and compare it with inserted value in the Firebird trigger.
Here is my code.
SET TERM ^;
CREATE TRIGGER after_in_systab FOR SYSTEMTAB
ACTIVE AFTER INSERT POSITION ...
0
votes
1
answer
332
views
Updating NULL fields with values
I have a simple table that was populated without complete data and an integer field was not used immediately, so it has over 20,000 null values. I simply want to change every record with a NULL value ...
2
votes
1
answer
4k
views
Firebird Unable to complete network request to host
Getting this error message randomly from our .Net Core Web Application. There's no problem with connecting. But in the middle of performing a job to grab some report data which can take anywhere from ...
0
votes
1
answer
78
views
How to make ledger using Firebird database
I want to design Crystal Report from mentioned query, but I'm unable to fetch data from a Firebird database.
SELECT TRANSACTION_DATE=null, PARTICULAR='Opening Balance', DEBIT=null, CREDIT=null, sum(...
0
votes
0
answers
28
views
How to remove Firebird's triggers created automatically [duplicate]
How to remove Firebird's triggers created automatically? I've got an error:
SQL> drop trigger CHECK_4;
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-DROP TRIGGER CHECK_4 failed
-...