firebird2.5

Using Reserved Word TimeStamp as a field name (Firebird 2.5)

假装没事ソ 提交于 2019-12-01 06:28:57
I am extending the data layer of an existing application to work with Firebird 2.5, in addition to MSSQL and SQLite, but I have hit a stumbling block. I have a field called TimeStamp which stores the data/time as type TimeStamp. This works fine under MSSQL and SQLite where the type is datetime, but falls over under Firebird. The following SQL: SELECT SysTrnId,'TimeStamp' from "TRANSACTIONS" seemingly works, but the TimeStamp field is return as fieldname "CONSTANT" and the contents are the text "timestamp" Is it possible to do this under Firebird, or am I going to have to rename the field and

How to SELECT a PROCEDURE in Firebird 2.5

大兔子大兔子 提交于 2019-12-01 03:51:05
I'm using Firebird Embedded v2.5. How to use procedures in query (SELECT) ? My procedure: SET TERM ^ ; CREATE PROCEDURE FN_TEST( Y INTEGER ) RETURNS( X INTEGER) AS BEGIN X = Y + 1; END^ SET TERM ; ^ I want to list some field of table modified by some procedure, like this: SELECT some_table_field_1, fn_test( 4 ) AS zzz, some_table_field_2, fn_test( some_table_field_2 ) AS field_2_modified FROM tb_test Need results (table): some_table_field_1 zzz some_table_field_2 field_2_modified --------------------------------------------------------------------------- aaa 5 14 15 bbb 5 23 24 www 5 75 76

Firebird 2.5 CHARACTER SET WIN1252 is not installed

梦想与她 提交于 2019-11-29 07:51:12
I've installed Firebird-Server 2.5 on FreeBsd 9.1 using: pkg install firebird-server-2.5.2_1 It's working ok, since I can connect using FlameRobin from an external PC. Now, when I try to restore a database using gbak, I got this: ... gbak: ERROR: CHARACTER SET WIN1252 is not installed gbak:Exiting before completion due to errors Should I install something more server side?. The database was created on a Windows machine, that's why its character set is WIN1252. EDIT: after some trouble I deinstalled firebird and reinstalled WITHOUT USING SUDO. Now I can connect using isql-fb and do "show system

Invalid request BLR at offset 258 , function HASHMD5 is not defined?

五迷三道 提交于 2019-11-28 10:14:29
问题 I am using Firebird 2_5 database with c#, at inserting data into Firebird databse i have this error please how to solve this r? "FirebirdSql.Data.FirebirdCliente.FbException (0x80004005):invalid request BLR at offset 258 function HASHMD5 is not defined No message for error code 335544932 found" ' 回答1: Firebird itself does not have a function called HASHMD5 . Firebird also has UDFs (user defined functions) which allow you to add functions (with a library on the search path of the Firebird

How to redirect binary gbak output to a Delphi stream?

给你一囗甜甜゛ 提交于 2019-11-28 07:52:25
I want the Firebird backup tool gbak to write its output to a Delphi stream (with no intermediate file). There is a command line parameter to write to stdout rather than a file. I then use the Execute method in JEDI's JclSysUtils to launch gbak and process that output. It looks like this: procedure DoBackup; var LBackupAbortFlag: Boolean; LBackupStream: TStringStream; begin LBackupAbortFlag := False; LBackupStream := TStringStream.Create; try Execute('"C:\path to\gbak.exe" -b -t -v -user SYSDBA -pas "pw" <db> stdout', LBackupStream.WriteString, // Should process stdout (backup) SomeMemo.Lines

How to split comma separated string inside stored procedure?

跟風遠走 提交于 2019-11-27 18:13:30
问题 How to split comma separated string into strings inside store procedure and insert them into a table field? Using Firebird 2.5 回答1: Here a sample how to split the string and write the sub-strings into a table: create procedure SPLIT_STRING ( AINPUT varchar(8192)) as declare variable LASTPOS integer; declare variable NEXTPOS integer; declare variable TEMPSTR varchar(8192); begin AINPUT = :AINPUT || ','; LASTPOS = 1; NEXTPOS = position(',', :AINPUT, LASTPOS); while (:NEXTPOS > 1) do begin

In FirebirdSql, how to return exception message from procedure

丶灬走出姿态 提交于 2019-11-27 15:39:44
I want to return the error message from a procedure when an exception happens. In SQL Server you would select the Error_Number() and Error_Message(). How would I do it in FirebirdSql SET TERM ^ ; CREATE PROCEDURE sprocname ( id int ) RETURNS ( gcode int, errmsg varchar(250) ) AS BEGIN gcode = 0; errmsg = ''; -- do procedure code here WHEN ANY DO BEGIN gcode = gdscode; -- ?? errmsg = ??; END SUSPEND; END^ SET TERM ; ^ Unfortunately you will need to do that at the client side, as it is currently not possible to obtain this in PSQL. There is a feature request in the Firebird tracker, which has