firebird2.5

How to decide when use index on table column

佐手、 提交于 2019-12-03 06:59:27
问题 When should I use index on table? From how many rows index makes sense? If I have table with constant rows, just edited come columns (not in 'where' clause), makes index sense even if table has just about 15 rows? EDIT: Can be in such case non-index selecting/reading more effective than index read? EDIT: Now I am working with firebird 2.5, but most of the time I am using SQL Server 2005/2008. 回答1: In general, my indexing strategy would be something like this (I'm using SQL Server exclusively

firebird procedural query throwing “token unknown” error at “SET TERM #;”

风格不统一 提交于 2019-12-02 22:47:28
问题 I am quering a firebird 2.5 database using php (ibase). Simple queries are working fine, but when I try to use the following procedural query I get a "token unknown" error at line 1, column 5 - ie when "TERM" is encountered. I feel I am missing something very basic here! $query = <<<X SET TERM #; EXECUTE BLOCK RETURNS (product INT, minPrice FLOAT, maxPrice FLOAT) AS DECLARE transID INT = 8733; BEGIN FOR SELECT "Product", MIN("CurrencyRate" * "UnitPrice"), MAX("CurrencyRate" * "UnitPrice")

How to decide when use index on table column

岁酱吖の 提交于 2019-12-02 20:39:56
When should I use index on table? From how many rows index makes sense? If I have table with constant rows, just edited come columns (not in 'where' clause), makes index sense even if table has just about 15 rows? EDIT: Can be in such case non-index selecting/reading more effective than index read? EDIT: Now I am working with firebird 2.5, but most of the time I am using SQL Server 2005/2008. In general, my indexing strategy would be something like this (I'm using SQL Server exclusively for now - adapt to your own database system as needed): pick a good clustering key - not a GUID, not a

Could not find driver ( PHP and Firebird )

早过忘川 提交于 2019-12-02 12:29:42
问题 I have a web-based PHP script named portail , so I want to make it functional on Ubuntu . I installed Xampp 5.6 , Firebird 2.5 under Ubuntu , then I uncommented the library: "extension=php_pdo_firebird.dll" and I made the specific configuration for php5 and firebird (https://mapopa.blogspot.com/2009/04/php5-and-firebird-pdo-on-ubuntu-hardy.html), but he always shows me the following message could not find driver localhost/portail Screenshot: 回答1: You should install the required php extension

is there any way to pivot rows to columns dynamically without a specific no of columns in firebird

微笑、不失礼 提交于 2019-12-02 10:56:08
I need a way to display my data from rows to columns dynamically using sql. My row no. starts from 0 to N and I want to convert it to columns. I cannot use static column to match my requirement because the maximum no of rows changes every time depending on the policy required by the company. I have done researching but firebird has no pivot/transpose/cross-tab implementation (i might be wrong). Here are my tables here is my client tables here is my payable table i need to display like this since there are many clients involve as you can notice my client can have 0 to N payable. Is there a way

firebird procedural query throwing “token unknown” error at “SET TERM #;”

久未见 提交于 2019-12-02 10:27:42
I am quering a firebird 2.5 database using php (ibase). Simple queries are working fine, but when I try to use the following procedural query I get a "token unknown" error at line 1, column 5 - ie when "TERM" is encountered. I feel I am missing something very basic here! $query = <<<X SET TERM #; EXECUTE BLOCK RETURNS (product INT, minPrice FLOAT, maxPrice FLOAT) AS DECLARE transID INT = 8733; BEGIN FOR SELECT "Product", MIN("CurrencyRate" * "UnitPrice"), MAX("CurrencyRate" * "UnitPrice") FROM "CustomerStockInDetail" HAVING "Product" = :transID INTO :product, :minPrice, :maxPrice DO SUSPEND;

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

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

How to REVOKE ROLE GRANTED BY another user on Firebird 2.5.8?

随声附和 提交于 2019-12-02 03:59:35
I am working with Firebird 2.5.8, ODS Version 11.2, connecting via Firebird ADO.NET v6.6 (in C# using Visual Studio). I have built a database management tool for configuring our tables, as well as performing some basic Firebird user management operations. The database has different roles (MyRoleX and MyRoleY) defined to give/restrict access. User management operations include granting/revoking these roles to different users. When logged into the tool, the connection uses the RDB$ADMIN ROLE and the connected user has been created with the ADMIN ROLE. Lastly, there may be more than one Firebird

Firebird Query- Return first row each group

旧巷老猫 提交于 2019-12-01 23:13:19
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:22 4 31 07/03/16 10:22 6 22 10/01/16 08:45 I've already tested following code " Select first row in