firebird

Filter sql based on C# List instead of a filter table

空扰寡人 提交于 2019-11-27 09:39:04
Say I have a table with the following data: Now I want to filter by the primary keys department and number. I have a list of department and number combinations that have to be filtered in code. In my mind, I would create a join that results in the following: select * from employee e inner join dynamicTable dyn on e.Department = dyn.Department and e.Number = dyn.Number; dynamicTable is my List in C# code that has the primary keys to filter, but I don't know how to pass this list to the database level. I dont't want to load everything from my employees table and that filter in code by linq or

How can I get only one row per record in master table?

别说谁变了你拦得住时间么 提交于 2019-11-27 08:26:01
问题 it is possible to get only one row per record in a multitable query? I have this three tables: APPLES ID | APPLE ---------- 1 | RED 2 | YELLOW 3 | GREEN FARMS ID | FARM -------------------- B1 | GEORGE'S FARM B2 | JOHN'S FARM FARM_APPLES FARM | APPLE --------------- B1 | 1 B1 | 2 B1 | 3 B2 | 1 B3 | 3 With this tables I need this result: FARM_NAME | APPLE_1 | APPLE_2 | APPLE_3 ---------------------------------------- B1 | 1 | 2 | 3 B2 |1 | | 3 Any help is much appreciated, thanks in advance.

Easiest way to create an auto increment field in Firebird database

给你一囗甜甜゛ 提交于 2019-11-27 05:50:14
问题 Is there an easy way to create auto increment field using Firebird? I have installed the FlameRobin admin tool, but the process of creating an auto increment field through the tool is complex. Can I not create such an identity field just by clicking a checkbox or using some other tool other than Flamerobin? 回答1: Firebird 2.5 and earlier do not have auto-increment fields. You need to create them yourself with a sequence (aka generator) and a trigger. Sequence is the SQL standard term and

Generate insert SQL statements from a CSV file

空扰寡人 提交于 2019-11-27 04:17:00
问题 I need to import a csv file into Firebird and I've spent a couple of hours trying out some tools and none fit my needs. The main problem is that all the tools I've been trying like EMS Data Import and Firebird Data Wizard expect that my CSV file contains all the information needed by my Table. I need to write some custom SQL in the insert statement, for example, I have a CSV file with the city name, but as my database already has all the cities in another table (normalized), I need to write a

Combining UNION ALL and ORDER BY in Firebird

…衆ロ難τιáo~ 提交于 2019-11-26 23:20:12
问题 This is my first attempt at answering my own question, since someone may well run into this and so it might be of help. Using Firebird, I want to combine the results of two queries using UNION ALL, then sort the resulting output on a given column. Something like: (select C1, C2, C3 from T1) union all (select C1, C2, C3 from T2) order by C3 The parentheses came from valid syntax for other databases, and are needed to make sure the arguments to UNION ALL (an operation that's defined to work on

How to connect and use Firebird db embedded server with Visual C# 2010

為{幸葍}努か 提交于 2019-11-26 22:46:35
问题 I was trying to use Firebird embedded server with Microsoft Visual C# 2010. so here is what I done till now: Downloaded Firebird .Net Data Provider (Firebird Client v2.5.2). Downloaded Firebird Embedded server (Firebird Embedded Server v2.5.0). Added a reference to FirebirdSql.Data.FirebirdClient.dll to my project. Extracted and Copied fbembed.dll file to my application's directory. Added my FDB file "TEST.FDB" to my application's directory. Added " using FirebirdSql.Data.FirebirdClient; "

Firebird: Unable to complete network request to host

别说谁变了你拦得住时间么 提交于 2019-11-26 22:03:25
问题 I'm trying to connect to a remote Firebird database "test" (alias already added). It is not an embedded server, and is installed on VM with IP 192.168.1.147. Here is my connection string: User=sysdba;Password=masterkey;Database=test;DataSource=192.168.1.147 However I got an error: FirebirdSql.Data.FirebirdClient.FbException (0x80004005): Unable to complete network request to host "192.168.1.147". ---> Unable to complete network request to host "192.168.1.147". I've done some research on that

C# constructing parameter query SQL - LIKE %

随声附和 提交于 2019-11-26 09:58:31
问题 I am trying to build SQL for a parameter query in C# for a query which will contain the LIKE %% command. Here is what I am trying to acheive (please note that the database is Firebird) var SQL = string.format(\"SELECT * FROM {0} WHERE {1} LIKE \'%?%\'\", TABLE, NAME); cmd.Parameters.AddWithValue(NAME, \"JOHN\"); Now I have tried every single permutation to get the parameter to work, I have tried; Adding the % character to the parameter, cmd.Parameters.AddWithValue(NAME, \"%\" + \"JOHN\" + \"%

Incompatible wire encryption levels requested on client and server with Firebird ado.net provider

别来无恙 提交于 2019-11-26 09:56:10
问题 I am testing the connection firebird 3 using C #. The version of what I\'m used is the latest : Firebird ADO.NET Provider 5.0. But when you make the connection , the error occurs \"Incompatible wire encryption levels requested on client and server\".\" At \"Does Firebird ADO.NET 4.10.0.0 Data provider work with Firebird 3.0?\", there are some suggestions for enabling authentication in legacy model or create legacy user. But my question is if really does not support to new SRP authentication