firebird2.5

Firebird 2.5.2 change blob subtype

筅森魡賤 提交于 2019-12-10 13:58:59
问题 Is there a posibility to change the SUBTYPE of a BLOB field ? I have a BLOB with SUBTYPE BINARY an need to change it to SUBTYPE TEXT, because i get some strange Characters into the BLOB and in a BLOB with SUBTYPE TEXT i don't have this Problem 回答1: Directly altering the subtype of a blob column is not possible (attempts to do this will give the error "Cannot change datatype for column BLOBCOLUMN. Changing datatype is not supported for BLOB or ARRAY columns." ) You will need to Add a new

Update records in one table using another table's records as WHERE parameters

两盒软妹~` 提交于 2019-12-10 11:22:23
问题 I have 2 tables: Table1 and Table2. Both tables have a column named Column2. I want to set all values of Table1.Column1 as NULL for all records that do not exist in Table2. I.e. all records where Table1.Column2 <> Table2.Column2. This is the query I am trying to execute: UPDATE a SET a.Column1 = null FROM Table1 a INNER JOIN Table2 b ON a.Column2 <> b.Column2 I get a "Token Unknown" Dynamic SQL error on "FROM" when I try to execute this query. Any idea what I am doing wrong? I am fairly new

Get list of column names from a Firebird database table

爱⌒轻易说出口 提交于 2019-12-09 04:44:54
问题 How do you get a list of the column names in an specific table? ie. Firebird table: | name | id | phone_number | get list like this: columnList = ['name', 'id', 'phone_number'] 回答1: if you want to get a list of column names in an specific table, this is the sql query you need: select rdb$field_name from rdb$relation_fields where rdb$relation_name='YOUR-TABLE_NAME'; I tried this in firebird 2.5 and it works. the single quotes around YOUR-TABLE-NAME are necessary btw 回答2: Get list of columns

Firebird UTF-8 German phonebook sorting

北城余情 提交于 2019-12-08 02:29:09
问题 Server: Windows 2008 R2 x64 with Firebird 2.5 x64 I need a sorting methode like the German phonebook at a Query e.g. SELECT Name, Forename FROM Address ORDER BY Name, Forename; I want as result: Name, Forename Assemann, Simon Aßmann, Erika Assmann, Frank Astmann, Manfred Hacker, Simon Hackmann, Gustav Häcker, Emil Haecker, Manfred Häcker, Xaver Hafermann, Ulrich In the German phonebook sorting, the German special characters are handled at following way: Ä/ä = Ae/ae Ö/ö = Oe/oe Ü/ü = Ue/ue ß =

How to pass a parameter to a query using dbExpress in Delphi

南笙酒味 提交于 2019-12-07 07:21:01
问题 I want to use a dbExpress TSQLQuery component. But i do not know how to write the SQL to add a parameter. I will give an example maybe it will be more clear what my problem is. In a TADOQuery the following works: SELECT* FROM sometable WHERE sometable.id = :value; Now in the above example you pass the parameter to the query using the colon (:) before the parameter name. But when I try and do that with the TSQLQuery, I get the following error: dbExpress driver does not support the TDBXTypes

Firebird - get all modified fields inside a trigger

ε祈祈猫儿з 提交于 2019-12-06 19:22:44
问题 I need to get all the values which changed in a row and post modifications on other 'audit' table. Can I accomplish this, without writing the conditions for each element from the row? I know the SQL from http://www.firebirdfaq.org/faq133/ which gives you all the conditions for verifications: select 'if (new.' || rdb$field_name || ' is null and old.' || rdb$field_name || ' is not null or new.' || rdb$field_name || 'is not null and old.' || rdb$field_name || ' is null or new.' || rdb$field_name

Firebird UTF-8 German phonebook sorting

喜你入骨 提交于 2019-12-06 12:29:23
Server: Windows 2008 R2 x64 with Firebird 2.5 x64 I need a sorting methode like the German phonebook at a Query e.g. SELECT Name, Forename FROM Address ORDER BY Name, Forename; I want as result: Name, Forename Assemann, Simon Aßmann, Erika Assmann, Frank Astmann, Manfred Hacker, Simon Hackmann, Gustav Häcker, Emil Haecker, Manfred Häcker, Xaver Hafermann, Ulrich In the German phonebook sorting, the German special characters are handled at following way: Ä/ä = Ae/ae Ö/ö = Oe/oe Ü/ü = Ue/ue ß = ss Other special characters like the French ones (á, à…) is handled like the normal characters (a,a…).

Firebird - get all modified fields inside a trigger

烈酒焚心 提交于 2019-12-05 01:10:21
I need to get all the values which changed in a row and post modifications on other 'audit' table. Can I accomplish this, without writing the conditions for each element from the row? I know the SQL from http://www.firebirdfaq.org/faq133/ which gives you all the conditions for verifications: select 'if (new.' || rdb$field_name || ' is null and old.' || rdb$field_name || ' is not null or new.' || rdb$field_name || 'is not null and old.' || rdb$field_name || ' is null or new.' || rdb$field_name || ' <> old.' || rdb$field_name || ') then' from rdb$relation_fields where rdb$relation_name =

Pivot rows into columns Firebird 2.5

若如初见. 提交于 2019-12-04 07:36:37
The sequence: table1 ===== id - Description ---------------- |1 |Proj-x |2 |Settlers |3 |Bank |4 |Newiest table2 ===== id table1Id value alternate-value --------------------------------- |1| 1 |12 |null |1| 4 |6 | null |1| null |22 |Desktop |2| 2 |7 |null |2| 3 |11 |null |2| null |2 |Camby Jere |3| 1 |8 |null |3| 4 |6 |null |3| null |7 |Camby Jere The select instruction must return |table1.id|Proj-x|Settlers|Bank |Newiest|Desktop|Camby Jere ---------------------------------------------------------- |1 |12 |null |null |null |null |null |1 |null |null |6 |null |null |null |1 |null |null |null

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

青春壹個敷衍的年華 提交于 2019-12-04 07:08:19
问题 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