firebird

Combining 2 queries in 1 (select based on other select)

拈花ヽ惹草 提交于 2019-12-11 11:37:05
问题 I have 2 queries: SELECT EW_OBIEKTY.STATUS , EW_OB_ELEMENTY.IDE , EW_OB_ELEMENTY.TYP FROM EW_OBIEKTY INNER JOIN EW_OB_ELEMENTY ON EW_OBIEKTY.UID = EW_OB_ELEMENTY.UIDO WHERE (((EW_OBIEKTY.STATUS)=0) AND ((EW_OB_ELEMENTY.TYP)<>1)); and second one base on first one SELECT EW_POLYLINE.P0_X, EW_POLYLINE.P0_Y, EW_POLYLINE.ID, EW_POLYLINE.STAN_ZMIANY, [**result of 1st one**].IDE, EW_POLYLINE.ID_WARSTWY FROM EW_POLYLINE LEFT JOIN [**result of 1st one**] ON EW_POLYLINE.ID = [**result of 1st one**].IDE

Embedded firebird not accepting create table statement

两盒软妹~` 提交于 2019-12-11 10:55:29
问题 The following SQL code works very well on MYSQL, and it contains valid SQL query language. However this doesn't work on embedded Firebird server. The SQL code: CREATE TABLE publications ( id int(11) NOT NULL, filename varchar(500) NOT NULL, title varchar(500) DEFAULT NULL, authors varchar(1000) DEFAULT NULL, uploader int(7) DEFAULT NULL, keywords varchar(500) DEFAULT NULL, rawtext text, rawbinarydata blob NOT NULL, lastmodified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT

Return only most recent entry per id

亡梦爱人 提交于 2019-12-11 10:38:36
问题 I'm running this SQL script on my Firebird 2.5-DB: SELECT aktivitaet.creationdatetime, (select STRINGPROPVALUE from PROPERTY WHERE PROPERTYNAME LIKE 'GlobalDokPfad') as basispfad, aktivitaet.pfad, cast(rechnung.datum as date), rechnung.nummer, projekt.code, cast(rechnung.verrtotal as numeric(10,2)), projekt.betreffend FROM rechnung INNER JOIN aktivitaetenlink ON rechnung.bold_id=aktivitaetenlink.eintraege INNER JOIN aktivitaet ON aktivitaetenlink.aktivitaeten=aktivitaet.bold_id Left JOIN

Repetitions with regexes in Firebird

跟風遠走 提交于 2019-12-11 10:06:03
问题 Hello all :) I'm having trouble with Firebird's SIMILAR TO , which is supposed to provide regex-like behavior. 'aaaaa' SIMILAR TO 'a{2,}' -- true 'aaaaa' SIMILAR TO '(_)\1+' -- false The \1 does not seem to be interpreted by Firebird. \ is not even a special character. How can I match on character repetition? (or use a back-reference?) 来源: https://stackoverflow.com/questions/21432507/repetitions-with-regexes-in-firebird

with Zend\Db\Sql\Select can I manipulate the order that the SQL parts are put together?

一曲冷凌霜 提交于 2019-12-11 09:53:52
问题 I am using PDO Firebird with Zend\Db. This is fine until i want to limit the number of records returned. I am using this code; $select = $this->getSelect() ->limit($limit); Which produces this SQL; SELECT "MODELS".* FROM "MODELS" limit '10' However firebird needs SQL like this; SELECT first 10 "MODELS".* FROM "MODELS" I can change the word 'limit' to 'first' by using this statement; $select->setSpecification('limit', 'first %1$s'); But I can't figure out how i get it to put the limit (first)

Firebird database SYSDBA connection error

自闭症网瘾萝莉.ら 提交于 2019-12-11 09:07:04
问题 I just installed Firebird for Win64, and I was trying to connect to the employee database which comes pre-packaged with ISQL. Following the steps from the Firebird official QuickStart Documentation I opened the ISQL utility and entered: connect localhost:employee user sysdba password masterkey; As a result I got: Statement failed, SQLSTATE = 28000 Your user name and password are not defined. Ask your database administrator to set up a Firebird login. Strangest thing is that if I navigate to

Display all Dates in a given month and year in firebird select procedure

点点圈 提交于 2019-12-11 08:44:44
问题 I am making a program for Time and Attendance. I have a table with this fields ATTEND_PK INTEGER NOT NULL, EMP VARCHAR, ATTEND_DATETIME TIMESTAMP, USER_PK SMALLINT, ATTEND_UPDATETIME TIMESTAMP); here is the sample data | ATTEND_PK | EMP | ATTEND_DATETIME | | 1 | john | 1/23/2018 7:00:00 | | 2 | john | 1/23/2018 12:00:00 | | 3 | john | 1/23/2018 13:00:00 | | 4 | john | 1/23/2018 16:00:00 | | 5 | john | 1/24/2018 7:30:00 | | 6 | john | 1/24/2018 11:50:00 | | 7 | john | 1/24/2018 13:20:00 | | 8

In Firebird, how do I write multiple if statements in a procedure?

随声附和 提交于 2019-12-11 08:42:42
问题 I'm writing an sql script in Firebird for an assignment. First, I have to create a 2 column table and add some values (the values aren't supposed to do anything yet) --Create the table create table salary_class ( class varchar(5), occurrence int ) ; commit work; --Add Values to our table insert into salary_class (class, occurrence) values ('ELITE', 0); insert into salary_class (class, occurrence) values ('HIGH', 0); insert into salary_class (class, occurrence) values ('MID', 0); insert into

Building SQL with foreach

你说的曾经没有我的故事 提交于 2019-12-11 08:41:44
问题 I have this code: private void button1_Click(object sender, EventArgs e) { foreach(Int_String partner in partneri) { double danaBezProdaje = (DateTime.Today - Komercijalno.Partner.PoslednjaKupovina(partner._int)).TotalDays; if (danaBezProdaje > 31 && danaBezProdaje < 1100) { NeaktivniPartner np = new NeaktivniPartner(); np.ppid = partner._int; np.naziv = partner._string; np.danaBezKupovine = danaBezProdaje; neaktivniPartneri.Add(np); } } dataGridView1.DataSource = M.List.ConvertToDataTable

Access Denied error when trying to connect to Firebird in Visual Studio

旧城冷巷雨未停 提交于 2019-12-11 08:35:38
问题 I recently have it working that, within Visual Studio, I can see Firebird as a data provider. The project I am working on I am trying to get the embedded version of Firebird working to use in my c# program However, when I go to Tools/Connect to Database Choose firebird Data source I enter the following Data source: Firebird Data Source (.net framework data provider for firebird) Data Source: is blank Data Source Port: 3050 Dialect: 3 charSet: NONE Database: path to my fdb file Server Type: