[firebird-support] Re: How to total such values

2011-12-01 Thread ibmcom2011
m 01.12.2011 10:23, schrieb ibmcom2011: > > Suppose a table like below: > > > > CREATE TABLE T1( > > F1 varchar(20), > > V1 integer > > ); > > > > Now, it has some values in like these: > > > > insert into t1(f1, v1) values(a1,

[firebird-support] How to total such values

2011-12-01 Thread ibmcom2011
Suppose a table like below: CREATE TABLE T1( F1 varchar(20), V1 integer ); Now, it has some values in like these: insert into t1(f1, v1) values(a1, 20); insert into t1(f1, v1) values(a2, 5); insert into t1(f1, v1) values(a3, 3); insert into t1(f1, v1) values(a12, 12); insert into t1(f1,

[firebird-support] Re: A error of too many concurrent execution of the same request on a trigger

2011-11-29 Thread ibmcom2011
Helen, I created a view as you said. CREATE OR ALTER VIEW V_T_BALANCE( F_ACD_ID, NUM1, NUM2, BALANCE) AS select F_ACD_ID, NUM1, NUM2, BALANCE from FIN_ACC_CASH_DIARY where 1 = 1 with check option ; Then create a trigger for the view: CREATE OR ALTER TRIGGER V_T_BALANCE_AUD0

[firebird-support] Re: A error of too many concurrent execution of the same request on a trigger

2011-11-28 Thread ibmcom2011
heLen, Thanks. I found I should add a "with check option" to the end of a updatable view in the introduction of FB2.0. Now my FB version is 2.5. But the option requires a where sub-clause, and I don't know how to do. And Now, I have a suppose on my trigger. For the Column YE is not be updated

[firebird-support] Re: A error of too many concurrent execution of the same request on a trigger - Email found in subject

2011-11-28 Thread ibmcom2011
Sorry. The description is a part of my trigger, some infomation was omitted. Originally, I want to explain it simply, but difficult to see. The trigger is a After Update & Delete trigger. TABLE1 structure (show simply) ID -- Num1 -- Num2 - BALANCE 1 --- 15 -

[firebird-support] a error of too many concurrent execution of the same request

2011-11-28 Thread ibmcom2011
Hi, I try to update a column value in a trigger after updating a row, but it raises a error of too many concurrent execution of the same request. I know this is caused by recursion, but I can't avoid it. I want update a column value of all the rows which is after the updating rows. ID --

[firebird-support] A error of too many concurrent execution of the same request on a trigger

2011-11-28 Thread ibmcom2011
Hi, I try to update a column value in a trigger after updating a row, but it raises a error of too many concurrent execution of the same request. I know this is caused by recursion, but I can't avoid it. I want update a column value of all the rows which is after the updating rows. ID -

[firebird-support] How to Transpose Rows and Columns in store-procedure for uncertain distinct-rows

2011-11-27 Thread ibmcom2011
I want to transpose rows and columns for some dubious row-value in a store-procedure: for example, the table seems like this below: Products_NameNumber A 12 B 24 C 35 A 5 -- to A B C 17 24 35 Now, the products_name is dubious, but the

[firebird-support] Re: why failed to insert into a table from a storeprocedure?

2011-11-22 Thread ibmcom2011
te-compiled, every time X is altered). > If that doesn't help, send more details. > > regards > Tomasz > > On 2011-11-22 09:15, ibmcom2011 wrote: > > hi, all, > > > > in a store procedure, i try to insert into a table some records from an > > other store

[firebird-support] Re: why failed to insert into a table from a storeprocedure?

2011-11-22 Thread ibmcom2011
f (all procedures depending on X should > be altered, that is, byte-compiled, every time X is altered). > If that doesn't help, send more details. > > regards > Tomasz > > On 2011-11-22 09:15, ibmcom2011 wrote: > > hi, all, > > > > in a store procedure,

[firebird-support] why failed to insert into a table from a storeprocedure?

2011-11-22 Thread ibmcom2011
hi, all, in a store procedure, i try to insert into a table some records from an other store procedure, it seems like this: create procedure test1 as begin insert into table1(f1, f2, f3) select fa, fb, fc from test2(param1, param2); end test2 is a store procedure defined in the same dat

[firebird-support] Re: how to union a dubious query to another query

2011-10-28 Thread ibmcom2011
--- In firebird-support@yahoogroups.com, Svein Erling Tysvær wrote: > > >> select f1, f2, f3 from t1 > >>where f1 = 'xxx' > >> union > >> select 0, 0, 0 from rdb$database > >> where not exists( > >> select f1, f2, f3 from t1 > >>where f1 = 'xxx') > >> union > >> select f3, f4, f5 fr

[firebird-support] Re: how to union a dubious query to another query

2011-10-27 Thread ibmcom2011
--- In firebird-support@yahoogroups.com, Svein Erling Tysvær wrote: > > >i want to union a query A to an other query B, if no any record in a, > >then automatically switch the 3rd query C to union the B. otherwise, > >the A can union to B. > > > >now i try to do it such as: > > > >select 0, 0

[firebird-support] how to union a dubious query to another query

2011-10-27 Thread ibmcom2011
i want to union a query A to an other query B, if no any record in a, then automatically switch the 3rd query C to union the B. otherwise, the A can union to B. now i try to do it such as: select 0, 0, 0 from t1 /* C */ where not exists( select f1, f2, f3 from t1 where f1 = 'x

[firebird-support] how to union a dubious query to another query

2011-10-27 Thread ibmcom2011
i want to union a query A to an other query B, if no any record in a, then automatically switch the 3rd query C to union the B. otherwise, the A can union to B. now i try to do it such as: select 0, 0, 0 from t1 /* C */ where not exists( select f1, f2, f3 from t1 where f1 = 'x

[firebird-support] Re: how to combine a field value while their id is same?

2011-10-24 Thread ibmcom2011
--- In firebird-support@yahoogroups.com, Mark Rotteveel wrote: > > On Sun, 23 Oct 2011 21:23:20 -0500, Gordon Niessen > wrote: > >> The following query should work: > >> SELECT f1, LIST(f2) FROM table GROUP BY f1 > >> > >> Be aware that there is no defined order for the result of LIST. > >> > >

[firebird-support] how to combine a field value while their id is same?

2011-10-23 Thread ibmcom2011
now i have a table such as: f1 f2 1aa 2tf 1bb 3cc 2ht i want the result seems as: f1 f2 1aa, bb 2tf, ht 3cc any help is appreciated, thanks.