firebird

How to SELECT a PROCEDURE in Firebird 2.5

六眼飞鱼酱① 提交于 2019-12-19 06:02:04
问题 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 ------------

Which version of Interbase or Firebird was a database created under?

人走茶凉 提交于 2019-12-19 03:11:30
问题 I have a file with an extension .ib . I am guessing it is either an Interbase or a Firebird file, but I am having trouble working out exactly which. Furthermore, it isn't clear exactly which version of Interbase (or Firebird) was used to create the file. What I have found so far: I have tried various different software to read this file (FlameRobin, Firebird's isql.exe and also the latest version of Interbase) and the error messages I get tell me the ODS ("On Disk Structure") is version 9.

Which version of Interbase or Firebird was a database created under?

笑着哭i 提交于 2019-12-19 03:10:42
问题 I have a file with an extension .ib . I am guessing it is either an Interbase or a Firebird file, but I am having trouble working out exactly which. Furthermore, it isn't clear exactly which version of Interbase (or Firebird) was used to create the file. What I have found so far: I have tried various different software to read this file (FlameRobin, Firebird's isql.exe and also the latest version of Interbase) and the error messages I get tell me the ODS ("On Disk Structure") is version 9.

Firebird 2.5 - Equivalent function to STUFF in SQL (GROUP_CONCAT in MySql / LISTAGG In Oracle)

五迷三道 提交于 2019-12-18 15:54:23
问题 Does anyone know if Firebird 2.5 has a function similar to the "STUFF" function in SQL? I have a table which contains parent user records, and another table which contains child user records related to the parent. I'd like to be able to pull a comma delimited string of the "ROLES" the user has without having to use a second query, loop over the values returned for the given ID and create the string myself. I've searched for any other related questions, but have not found any. The question in

Postgres vs Firebird [closed]

这一生的挚爱 提交于 2019-12-18 12:53:03
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm looking to use either Firebird or Postgres in my next development project ... largely because both are available under a BSD-like license. I found a great comparison of the two database at http://web.archive.org/web/20100305134128/http://www.amsoftwaredesign.com/pg_vs_fb But this comparison is a good 4+

How to reference field names with variable in Firebird stored procedure or execution block

牧云@^-^@ 提交于 2019-12-18 09:31:05
问题 Please give me an example how to reference field names with variable in a Firebird stored procedure or execute block Something like this pseudo SQL: Insert into tab1 (1, f1, f2, f3) select 1, tab2.f+var_loop, tab2.f+var_loop, tab2.f+var_loop from tab2 where ..... where "f" is the first initial of the field name and "var_loop" is a loop variable 回答1: It's still not quite clear to me what you want to achieve, but in the PSQL there is also EXECUTE STATEMENT feature available which might suit

How to backup/restore a Firebird database?

浪尽此生 提交于 2019-12-17 21:25:23
问题 I am really confused here about Firebird v2.5 backup/restore process. What should I use to backup/restore a local Firebird database: fbsvcmgr.exe , gbak.exe , isql.exe or nbackup.exe Are these all options or I am wrong about something! What is the practical way to do it for a C++ application? How should I know if a database already exists the first time, so I can decide whether to restore it or not. 回答1: There are two primary ways to create backups in firebird: gbak, which creates a logical

how to connect to firebird DB on android

时间秒杀一切 提交于 2019-12-17 16:48:20
问题 I need to connect my android application to my firebird DB do someone knows how to do this? please write the code! 回答1: I'm not particularly familiar with Firebird, but my guess is the best approach would be to use a web service of some sort (RESTful?) which allows your Android client to communicate with the database. This is the solution that is typically used for most apps since you can't connect directly to the database from Android. It's also good from a design standpoint because your

In FirebirdSql, how to return exception message from procedure

♀尐吖头ヾ 提交于 2019-12-17 14:01:28
问题 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 ; ^ 回答1: Unfortunately you will need to do that at the client side, as it is

Update a table with join?

独自空忆成欢 提交于 2019-12-17 13:25:30
问题 I am trying to update table A with data from table B. I thought I can do something like this update A set A.DISCOUNT = 3 from INVOICE_ITEMS A join ITEM_PRICE_QUNTITY B on A.ITEM_PRICE_NO = B.ID where A.INVOICE_ID = 33 but getting error SQL Message : -104 Invalid token can anyone help me? 回答1: It is not possible to do this with a JOIN . The Firebird UPDATE statement has no FROM clause. The syntax is: UPDATE {tablename | viewname} [[AS] alias] SET col = newval [, col = newval ...] [WHERE