RE: [firebird-support] How to change Primary Key on a table by adding a new field

2015-01-26 Thread 'Bogdan Mihalache' bogdan.mihala...@soter.ro [firebird-support]
Select trim(RC.RDB$INDEX_NAME) from RDB$RELATION_CONSTRAINTS RC where (RC.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY') and (RC.RDB$RELATION_NAME = :TABELA) into :PKTEMP Using that select you can fiind the name of the column who has the primary key. Inspired from Carlos Cantu external log proced

RE: [firebird-support] How to change Primary Key on a table by adding a new field

2015-01-26 Thread 'Bogdan Mihalache' bogdan.mihala...@soter.ro [firebird-support]
Select trim(I.RDB$FIELD_NAME) from RDB$RELATION_CONSTRAINTS RC join RDB$INDEX_SEGMENTS I on (I.RDB$INDEX_NAME = RC.RDB$INDEX_NAME) join RDB$INDICES IDX on (IDX.RDB$INDEX_NAME = RC.RDB$INDEX_NAME) where (RC.RDB$CONSTRAINT_TYPE = 'PRIMARY KEY') and (RC.RDB$RELATION

RE: [firebird-support] Advice with the following sql command

2014-09-25 Thread 'Bogdan Mihalache' bogdan.mihala...@soter.ro [firebird-support]
Manyou shlould read a bit more before going on this road. It a simple example of select with group option. Select TRANS_DATE,TRANSTIME, POSNUMBER, TRANSNUMBER, Count(ITEM_QTY) as ItemsSold, SUM(LINE_TOTAL) as LineTotal from accounthistory " WHERE TRANS_DATE BETWEEN '" & StartDate & "' AND

RE: [firebird-support] Round - quarter hour

2014-04-07 Thread Bogdan Mihalache
Round(100/15.00) * 15 Or (div(100,15)*15) + (cast((mod(100,15)/15.00) as Integer)*15) From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of checkmail Sent: Tuesday, April 8, 2014 8:55 AM To: firebird-support@yahoogroups.com Subject: AW:

RE: [firebird-support] toggle betweenn 0 and 1

2014-04-02 Thread Bogdan Mihalache
Update table set column = Mod(column+1,2) where id = :id From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of Mark Rotteveel Sent: Wednesday, April 2, 2014 10:16 AM To: firebird-support@yahoogroups.com Subject: Re: [firebird-support] toggle betweenn 0

RE: [firebird-support] Select stored in a table

2014-03-04 Thread Bogdan Mihalache
in a table :sql=replace(:sql,':lcIdContract',:lcIdContract); :sql=replace(:sql,':lcIdRamura',:lcIdRamura); ... On Tuesday, March 4, 2014 12:24 PM, Bogdan Mihalache wrote: I have this Sql statement strored in a table : Select sum(secunde_fact) as cantitat

RE: [firebird-support] Select stored in a table

2014-03-04 Thread Bogdan Mihalache
Meanwhile i have found that link, but i was wondering if there is a way to pass the parameters in a variable or something like that. I have made a new fiels in the table that stores the sql statement, and put in there the variables like this : - lcIdContract := :lcIdContract, lcIdRamura

[firebird-support] Select stored in a table

2014-03-04 Thread Bogdan Mihalache
Execute Statement Sql Into :lnCantitate ; If i remove the variables(:lcIdContract, :lcIdRamura, etc.) from the sql statement, that is stored in the table, it`s working, but I really need to keep them, and keep the sql in the table. Does anyone has a solution to my problem? Bogdan MIHALACHE

RE: [firebird-support] Udf returning VARCHAR

2014-01-31 Thread Bogdan Mihalache
Why don`t you use CAST ( var as VARCHAR(NN)) ? Bogdan MIHALACHE From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of liviuslivius Sent: Friday, January 31, 2014 10:22 AM To: firebird-support@yahoogroups.com Subject: [firebird-support] Udf

RE: [firebird-support] get data from table based on criteria from another table

2013-12-16 Thread Bogdan Mihalache
Select * from TABLE_A aa where Exists (Select ab.id From table_b ab And ab.data_b = 100 And aa.id = ab.id) From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of peter_...@yahoo.com Sent: Monday, December 16, 2013 12:41 PM To: firebird-support@yahoogroup

[firebird-support] mon$sql_text

2013-11-06 Thread Bogdan Mihalache
<> ? That question mark represents an variable. My question is from witch table I can extract the value and the name of that variable? It is possible? Thank you for your kind help! Bogdan MIHALACHE

RE: [firebird-support] Firebird seminar in Prague, November 25, 2013

2013-10-10 Thread Bogdan Mihalache
...@poczta.onet.pl Sent: Thursday, October 10, 2013 5:22 PM To: firebird-support@yahoogroups.com Subject: Odp: [firebird-support] Firebird seminar in Prague, November 25, 2013 Hi, Read once again ;) Firebird semi in PRAGUE Regards, Karol Bieniaszewski - Reply message - Od: "Bogdan Miha

RE: [firebird-support] Firebird seminar in Prague, November 25, 2013

2013-10-10 Thread Bogdan Mihalache
And where exactly can we found a list of all countries of the tour? So i can find a close to mine and maybe join the seminary? I`ve searched the websites bellow and could not find anything like. Thank you! From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.co

Re: [firebird-support] Update query and trigger

2013-10-09 Thread Bogdan Mihalache
if(new.field_b>0) and new.field_a = old.field_a then      dosomething; else      dosomethingelse; Original message From: "Dr. Fabrizio Villanova" Date: To: firebird-support@yahoogroups.com Subject: [firebird-support] Update query and trigger hi all,   for example: mytabl