firebird

how to get today date in YYYYMMDD in firebird

社会主义新天地 提交于 2019-12-02 07:55:34
问题 how to get today date in YYYYMMDD in firebird, I had a look on following but could not figured how to write this. 回答1: I think you can do: select replace(cast(cast('Now' as date) as varchar(10)), '-', '') from rdb$database 回答2: This is a fully version (in Integer) select Extract(year FROM cast('NOW' as date))*10000 + Extract(month FROM cast('NOW' as date))*100 + Extract(day FROM cast('NOW' as date)) from rdb$database This is a fully version (in VARCHAR) select CAST(Extract(year FROM cast('NOW

PHP firebird insert blob file into the database apache suddenly stop working

喜你入骨 提交于 2019-12-02 07:29:05
问题 I'm currently working on inserting image on the firebird database and it's working fine alone, see the code below. $dbh = ibase_connect($host, $user, $pass); $blh = ibase_blob_create($dbh); ibase_blob_add($blh, $data); $blobid = ibase_blob_close($blh); $sql = "INSERT INTO blobtable(blobfield) VALUES (?)"; $sth = ibase_query($dbh, $sql, $blobid); but when I add some data on the insert statement suddenly the apache crash and stops working. See below code when I add new data. $dbh = ibase

Best SQL statement for this table?

旧时模样 提交于 2019-12-02 07:15:36
I have table with 9 fields ID, F1..F8. An example of some data: id f1 f2 f3 f4 f5 f6 f7 f8 1 1 2 3 0 0 0 0 0 2 0 1 0 3 2 0 0 0 3 4 0 5 2 1 0 0 0 4 0 0 0 0 0 0 1 4 5 2 0 0 0 0 1 3 0 6 2 0 0 0 0 1 0 8 7 2 0 0 0 0 1 0 3 . . . How can I select * from table where F1...F8 in value (1,2,3) ? The result of this query must have records with id 1,2,5,7. Use query with common table expression: WITH t AS ( SELECT id, f1 AS f from tbl UNION ALL SELECT id, f2 AS f from tbl UNION ALL SELECT id, f3 AS f from tbl UNION ALL SELECT id, f4 AS f from tbl UNION ALL SELECT id, f5 AS f from tbl UNION ALL SELECT id,

Firebird BLR 623 invalid request - LRTRIM is not defined - module name or entrypoint could not be found

可紊 提交于 2019-12-02 07:12:57
I work in Firebird 2.5 database: Occasionally (not always) I get the following error when I run some stored procedures or views (database objects) that use the LRTRIM function: Invalid token. invalid request BLR at offset 623 function LRTRIM is not defined module name or entrypoint could not be found Error while parsing procedure XXXXXXX (stored_procedure name) ; (I get this both in IB Expert and SSRS) This said I am able to access other database objects that do not use LRTRIM function! I had a similar issue with LTRIM, now I am getting LRTRIM. I had copied firebird.msg from Firebird folder to

Entity Framework Code First and Firebird - Foreign Key name issue

蓝咒 提交于 2019-12-02 07:05:06
I'm trying to create new database with 2 tables ( Districts and Databases ) using EF code-first and this simple code: using (var db = new FirebirdDBContext(_connectionString)) { db.Database.CreateIfNotExists(); } My classes: public class District { [Key] public int District_id { get; set; } [Column(TypeName = "VARCHAR")] [StringLength(50)] public string District_name { get; set; } [ForeignKey("DataBase")] public int DataBase_id { get; set; } public DataBase DataBase { get; set; } } public class DataBase { [Key] public int DataBase_id { get; set; } [Column(TypeName = "VARCHAR")] [StringLength

How, and where to install a database driver into an IDE? Part II

旧时模样 提交于 2019-12-02 07:02:30
The background to this query was this question . I have installed this driver for Firebird and placed it within the path (system32) used by the IDE. The XE Data Explorer recognises the driver, and it is possible to create a connection using the Data Explorer. Trying to view tables or any other database element through this connection results in the error described in this question . As far as I can see @ Alejandro Jourdan has not obtained a solution to this problem, and I can find no solution on any of the support sites for Firebird or for Delphi XE. The second problem comes when I create a

Entity Framework Code First and Firebird - Foreign Key name issue

无人久伴 提交于 2019-12-02 05:59:42
问题 I'm trying to create new database with 2 tables ( Districts and Databases ) using EF code-first and this simple code: using (var db = new FirebirdDBContext(_connectionString)) { db.Database.CreateIfNotExists(); } My classes: public class District { [Key] public int District_id { get; set; } [Column(TypeName = "VARCHAR")] [StringLength(50)] public string District_name { get; set; } [ForeignKey("DataBase")] public int DataBase_id { get; set; } public DataBase DataBase { get; set; } } public

Problem connecting to Firebird 3 embedded with C# in .NET

徘徊边缘 提交于 2019-12-02 05:42:51
I am trying to connect to Firebird 3 embedded database from a .NET project. I have copied all the files of Firebird to the executing directory of the application. I have used the following connection string builder: var builder = new FbConnectionStringBuilder() { UserID = v1, Password = v2, Database = v3, ServerType = FbServerType.Embedded, Charset = "UTF8", ClientLibrary = "fbclient.dll" }; However I get the following connection error FirebirdSql.Data.FirebirdClient.FbException (0x80004005): Unable to complete network request to host "xnet://Global\FIREBIRD". Unable to complete network

Firebird Query- Return first row each group

血红的双手。 提交于 2019-12-02 04:27:33
问题 In a firebird database with a table "Sales", I need to select the first sale of all customers. See below a sample that show the table and desired result of query. --------------------------------------- SALES --------------------------------------- ID CUSTOMERID DTHRSALE 1 25 01/04/16 09:32 2 30 02/04/16 11:22 3 25 05/04/16 08:10 4 31 07/03/16 10:22 5 22 01/02/16 12:30 6 22 10/01/16 08:45 Result: only first sale, based on sale date. ID CUSTOMERID DTHRSALE 1 25 01/04/16 09:32 2 30 02/04/16 11

Opening a Firebird database file on a network share

丶灬走出姿态 提交于 2019-12-02 04:02:24
I thought converting a mapped drive letter to a UNC path would be enough to be able to open a .GDB file, but alas: function ConvertToUNCPath(AMappedDrive: string) : string; var lRemoteString : array[0..255] of char; lpRemote : PChar; lStringLen : Cardinal; begin lpRemote := @lRemoteString; lStringLen := 255; If WNetGetConnection(Pchar(ExtractFileDrive(AMappedDrive)) , lpRemote, lStringLen) = NO_ERROR Then Result := lRemoteString else Result := ''; // No mapping found end; function TDataModuleData.OpenGDBDatabase(AGDBName: string) : Boolean; var lDlgLogin: TFrmLogin; p : Integer; lUNC, lErrMsg