AW: [firebird-support] exponential, string to double precision
Hello András, so simple, thank you very much -Ursprüngliche Nachricht- Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Gesendet: Mittwoch, 28. Februar 2018 07:50 An: firebird-support@yahoogroups.com Betreff: RE: [firebird-support] exponential, string to double precision Hi Olaf! Try this: select cast('+0.200E+01' as double precision) from rdb$database András From: firebird-support@yahoogroups.com [mailto:firebird-supp...@yahoogroups...com] Sent: Wednesday, February 28, 2018 7:44 AM To: firebird-support@yahoogroups.com Subject: [firebird-support] exponential, string to double precision Hello, is there a simple function to convert a string "+0.200E+01" to a number, double precision, in this case to 2.0? Thank you Best regards Olaf __ Information from ESET Mail Security, version of virus signature database 16977 (20180228) __ The message was checked by ESET Mail Security. http://www.eset.com __ Information from ESET Mail Security, version of virus signature database 16977 (20180228) __ The message was checked by ESET Mail Security. http://www.eset.com [Non-text portions of this message have been removed] ++ Visit http://www.firebirdsql.org and click the Documentation item on the main (top) menu. Try FAQ and other links from the left-side menu there. Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ ++ Yahoo Groups Links
RE: [firebird-support] exponential, string to double precision
Hi Olaf! Try this: select cast('+0.200E+01' as double precision) from rdb$database András From: firebird-support@yahoogroups.com [mailto:firebird-supp...@yahoogroups..com] Sent: Wednesday, February 28, 2018 7:44 AM To: firebird-support@yahoogroups.com Subject: [firebird-support] exponential, string to double precision Hello, is there a simple function to convert a string "+0.200E+01" to a number, double precision, in this case to 2.0? Thank you Best regards Olaf __ Information from ESET Mail Security, version of virus signature database 16977 (20180228) __ The message was checked by ESET Mail Security. http://www.eset.com __ Information from ESET Mail Security, version of virus signature database 16977 (20180228) __ The message was checked by ESET Mail Security. http://www.eset.com [Non-text portions of this message have been removed] ++ Visit http://www.firebirdsql.org and click the Documentation item on the main (top) menu. Try FAQ and other links from the left-side menu there. Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ ++ Yahoo Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/firebird-support/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/firebird-support/join (Yahoo! ID required) <*> To change settings via email: firebird-support-dig...@yahoogroups.com firebird-support-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: firebird-support-unsubscr...@yahoogroups.com <*> Your use of Yahoo Groups is subject to: https://info.yahoo.com/legal/us/yahoo/utos/terms/
[firebird-support] exponential, string to double precision
Hello, is there a simple function to convert a string "+0.200E+01" to a number, double precision, in this case to 2.0? Thank you Best regards Olaf
Re: [firebird-support] Re: Execute Block: Need Insert Into to trigger Primary Key generator.
Hi. Your trigger set FK_ID not PK_ID Regards,Karol Bieniaszewski null
[firebird-support] Re: Execute Block: Need Insert Into to trigger Primary Key generator.
Sorry for the first example. I knew it didn't work. I accidentally copied it from an attempt that didn't work. I really meant to copy the second example but didn't catch my error until after I posted. When using the second example, the Primary Key is not updated which produces an error message indicating that a primary key cannot be null (as you so kindly pointed out). I do not know why the trigger/generator do not work. Perhaps I am missing something in the SQL. Here are copies of the generator and trigger as you requested: Generator (copied from FlameRobin): CREATE GENERATOR GEN_ACORD_DATA_ID; Trigger (Copied from FlameRobin) SET TERM ^ ; CREATE TRIGGER TRG_ACORD_DATA_ID_BI FOR ACORD_DATA ACTIVE BEFORE INSERT POSITION 0 AS BEGIN /* Auto Increment trigger */ IF (NEW.FK_ID IS NULL) THEN NEW.FK_ID = GEN_ID(GEN_ACORD_DATA_ID,1); END^ SET TERM ; ^
AW: [firebird-support] Re: 335544382. Can't allocate difference page
Hi again, I had the error now again: 335544382. Can't allocate difference page I think that happened when I tried to execute ALTER DATABASE END BACKUP I also found the following in syslog: Feb 19 04:24:13 kernel:traps: firebird[16552] trap invalid opcode ip:7fabfa1bec19 sp:7fabd19c6950 error:0 in libpthread-2.23.so[7fabfa1b2000+17000] Feb 19 04:24:13 systemd-coredump[16555]: Cannot store coredump of 5837 (firebird): No space left on device Feb 19 04:24:13 systemd-coredump[16555]: Process 5837 (firebird) of user 450 dumped core. Feb 27 09:03:34 kernel:traps: firebird[5995] trap invalid opcode ip:7f94c16c8c19 sp:7f94af7fb4a0 error:0 in libpthread-2.23.so[7f94c16bc000+17000] Feb 27 09:03:35 systemd-coredump[7883]: Cannot store coredump of 5846 (firebird): No space left on device Feb 27 09:03:35 systemd-coredump[7883]: Process 5846 (firebird) of user 450 dumped core. Sadly I do not have a coredump (as that part of the harddrive is not mounted writeable). But also notice, that the firebird database partition still has >400GB free space. Also I found a "335544363. no transaction for request" error, but I have no timestamp and cannot correlate it with the crash. However I got the impression that this happened really short after the crash (and we are using a connection pool). This is currently firebird 3.0.2. Does the information above help in any way? We are preparing an update to the system that will make the coredump position writeable. But then we do not want to wait for the next problem at the customers site. Regards, Steffen
Re: [firebird-support] Space used null values
On 27-2-2018 04:42, hugo.lar...@yahoo.com [firebird-support] wrote: > Does null values take up disk space? > > If I have a table with 4 VARCHAR columns and I add 4 more does the table > need double space even if the new columns are null? I recently answered this question on dba.stackexchange.com: https://dba.stackexchange.com/questions/198260/firebird-table-and-null-data In short, adding a new column will not affect existing records (until you update them). A new column will affect storage, but this will be just a few bytes per column if the value is null due to the applied RLE compression. As far as I know, for most datatypes 2 bytes, and for char/varchar possibly multiples of two bytes depending on the column (byte) length. Mark -- Mark Rotteveel
[firebird-support] Re: Space used null values
27.02.2018 06:42, hugo.lar...@yahoo.com [firebird-support] wrote: > > Does null values take up disk space? Yes, but much less than the declared column size. > If I have a table with 4 VARCHAR columns and I add 4 more does the table > need double space even if the new columns are null? Already existing records will not be extended at all, the occupied space will remain the same. New record versions may slightly increase in size, but not double. Dmitry
Re: [firebird-support] Execute Block: Need Insert Into to trigger Primary Key generator.
On 27-2-2018 03:17, ho...@agencybusys.com [firebird-support] wrote: > Firebird 2.14, Delphi 2007, Multi-User App, IBDac components. Why are you using 2.1.4? Version 2.1.4 has known security vulnerabilities (some of which are fixed in newer 2.1.x versions, some of which require you to upgrade to 2.5 or newer). The latest 2.1.x is 2.1.7. Given 2.1.x was discontinued in 2014, you really should be looking at upgrading to a newer version > I need to insert many multiple rows ( 200 to 600) in a single event. To > avoid network slowing the process, I'm trying Execute Block for the > first time (just learned about it). The code below doesn't work because > the Primary Key is null. There is a generator but this doesn't seem to > trigger it. Any help will be greatly appreciated. > > > SQL snippet: > set term ^ ; > > EXECUTE BLOCK AS BEGIN > > INSERT INTO ACORD_DATA (PK_ID, FK_ID, D_ACORD_FORM_FIELD_NAME, > D_ACORD_FORM_FIELD_TYPE, STR_VALUE) VALUES (Default ,972, 'FrmCmplDtA', > 'CHAR', '02/26/2018'); > > INSERT INTO ACORD_DATA (PK_ID, FK_ID, D_ACORD_FORM_FIELD_NAME, > D_ACORD_FORM_FIELD_TYPE, STR_VALUE) VALUES (Default ,972, 'ProFullNmA', > 'CHAR', 'Waterman Insurance Agency Inc.'); > > INSERT INTO ACORD_DATA (PK_ID, FK_ID, D_ACORD_FORM_FIELD_NAME, > D_ACORD_FORM_FIELD_TYPE, STR_VALUE) VALUES (Default ,972, > 'ProAuthReprSigA', 'CHAR', ''); > > INSERT INTO ACORD_DATA (PK_ID, FK_ID, D_ACORD_FORM_FIELD_NAME, > D_ACORD_FORM_FIELD_TYPE, STR_VALUE) VALUES (Default ,972, 'FrmEdIdA', > 'CHAR', ''); > > END^ > > set term ; ^ This wouldn't work and should lead to a token unknown error, not in rows inserted with a null primary key (which isn't even possible). You should not specify the PK_ID column, Firebird currently has no `DEFAULT` clause for inserts (and if it existed, it would only work like you want with an identity column) INSERT INTO ACORD_DATA (FK_ID, D_ACORD_FORM_FIELD_NAME, D_ACORD_FORM_FIELD_TYPE, STR_VALUE) VALUES (972, 'FrmCmplDtA', 'CHAR', '02/26/2018') The insert shown in your second message should work, if it doesn't, you need to show us your trigger code, and be more precise in your problem description: neither statements can lead to null primary keys, as primary keys cannot be null. Mark -- Mark Rotteveel