

Henry Olive
Members-
Content Count
325 -
Joined
-
Last visited
Everything posted by Henry Olive
-
Thank you so much RVK I tested your code in FlameRobin it works w/o any problem But when i try the same code in Delphi i get "Token Unknown Line1 Column 5 TERM." err.msg. What am i doing wrong ? Here below my codes SQLText := 'SET TERM ^ ; '+ 'EXECUTE BLOCK AS '+ 'DECLARE VARIABLE NOMTABLE varchar(100); '+ 'DECLARE VARIABLE REQ1 Varchar(100); '+ 'BEGIN '+ 'for select '+ 'x.RDB$TRIGGER_NAME from rdb$triggers x where '+ 'rdb$trigger_source is not null and (coalesce(rdb$system_flag,0) = 0) '+ 'and rdb$trigger_source not starting with ''CHECK'' into :NOMTABLE '+ 'do begin '+ 'NOMTABLE=trim(NOMTABLE); '+ 'req1= ''ALTER TRIGGER '' || :NOMTABLE || '' ACTIVE;''; '+ 'execute statement req1; '+ 'end '+ 'END^ '+ 'SET TERM ; ^' ; SQLDataset1.Close; SQLDataset1.CommandText :=SQLText; SQLDataset1.ExecSql;
-
I wish everyone a healthy day. Uses System.StrUtils; var S, FirstStr, SecStr : String, begin S := SqlQuery1.FieldByName ('RANGE').asString; // it is '5/10' FirstStr := SplitString(S, '/')[0]; SecStr := SplitString(S, '/')[1]; end; Above code works in Delphi-XE w/o any problem but i get Not enough actual parameters err.msg in Delphi 10.3 What is wrong ? Thank You
-
Thank you so much Alexander, Peter, Achim, Dany I tested my code in 10.3 in a *new project* and noticed my code works, then I copied the new project's Uses ( Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Controls, Forms, Vcl.Dialogs, Vcl.StdCtrls, System.StrUtils; ) I returned to my main project and paste the uses here and delete old uses and my problem solved. Regarding the variable semicolon, in my original codes it is semicolon, comma is my wrong typo I'm very very sorry for misleading you.
-
I wish everyone a healthy day Edit1.Text := 'AA BB' MyVar := Trim(Edit1.Text); // MyVar is still AA BB, i was expecting to get AABB Thank You
-
Thank you Gunther, Peter
-
I wish everyone a healthy day I have a S.Proc and it's WHERE part like below ..... WHERE MY FIELD IN : MYVALUE I'm getting Token Unknown err. msg Line 12 Char 20 which is : ( myvalue='AA', 'BB' ) what am i doing wrong ? Thank You
-
Thank you SO MUCH Dany, Serge, Irawan
-
I wish everyone a healthy day. S:= Edit1.Text; // which is A1 A2 A3 A4 with below code i get only A1 but i need to get A1 A2 (First 2 words ) X:=Pos(' ',S); Left2Words:= Copy(S,1,X-1); Edit2.Text := Left2Words; Thank You
-
Thank you so much Peter, Sviridenkov, Elagin
-
I wish everyone a healthy day. I want to Filter a Dataset When user click the DBGrid's *desired title (Column)* i want to show a PopUpMenu according to its place in the dbgrid's column I write below code procedure TForm1.DBGrid1TitleClick(Column: TColumn); var p:TPoint; begin if Column.FieldName ='TNAME' then p:=DBGrid1.ClientToScreen(Point(0,DBGrid1.Height)); Pop1.Popup(p.x, p.y) end; With above code PopUpMenu PopUp sometimes Above, sometimes below of the dbgrid I need the PopUpMenu PopUp according to its place in the dbgrid's column Something like below p:=DBGrid1.Columns[1].ClientToScreen(Point(0,DBGrid1.Columns[1].Height)); Thank You
-
Thank you so much Peter
-
I wish everyone a healthy day. ITEMS Table ITEMNO AAA ITEMMOVEMENTS View ( WHNO = Ware House No, and i dont know how many ) ITEMNO...WHNO...INCOME...OUTGO AAA.............1................10.................0 AAA.............2................20.................0 AAA.............3................30.................0 AAA.............3..................0...............10 How can get below result ? ITEMNO...TOTAL_STOCK.....1.......2.......3 AAA...............50......................10.....20.....20 Thank You
-
Thank you so much Attila, Serge, Vandrovnik, Stano Serge, your solution is very interesting, not exactly like Pivot but it is very very simple and fast, i'll keep your codes for future Stano, Your five methods... is also very very useful Thank you so so much
-
Your method
-
I wish everyone a healthy day. In my data path there are udf.sql, udflib.c, udflib.def files I copied below code from Firebird's udf.sql when i try to execute below code in Flame Robin I'm getting CREATE FUNCTION SUBSTR failed unknown ISC error 336068876 DECLARE EXTERNAL FUNCTION substr CSTRING(256), SMALLINT, SMALLINT RETURNS CSTRING(80) FREE_IT ENTRY_POINT 'fn_substr' MODULE_NAME 'udflib' What is wrong ? Thank You
-
I wish everyone a healthy day Regarding below SQL I'm getting Unknown sql type err.msg. What is wrong ? SELECT ID, (UPRICE * QTY) AS PRICE /* Cause of the problem is multiplication */ FROM TABLE1 Thank You
-
Thank you so much Virgo
-
Thank you so much Haentschman, Dany Serge, thank you so much for the time you spent for me.
-
I wish everyone a healthy day. Is there a way get sum of total fields from different tables ? Something like below (SELECT SUM(TOTAL) FROM TABLE1) + (SELECT SUM(TOTAL) FROM TABLE2) + (SELECT SUM(TOTAL) FROM TABLE3) For Example 3 Field's Total Sum RESULT = 12,000.- Thank You
-
Firebird - Sum of total fields from different tables ?
Henry Olive replied to Henry Olive's topic in Databases
Perfect, Thank You SO MUCH Vandrovnik -
I just learnt that ( In this forum ) there is no support FB 4.0 in Delphi so i'm thinking to move to FB 3.0
-
Thank you so much Serge, Vandrovnick Serge, i'm so sorry, you are right, i should have written more info UPRICE = NUMERIC(18,5) QTY =NUMERIC(18,2) I'm trying to execute the sql in FlameRobin ( not yet in Delphi ) with ROUND i get same err.msg. w/o Parenthesis i get same err.msg. I'll try to change DataTypeCompatibility = 3.0 in Firebrid.Conf tonight Again Thank you so much for the time you spent for me.
-
Thank you SO MUCH Serge, Vandrovnik SUBSTRING solves my problem
-
Thank you so much Serge firebird.conf file says below message NOTE: THE EXTERNAL FUNCTION ENGINE FEATURE COULD BE USED TO COMPROMISE # THE SERVER/HOST AS WELL AS DATABASE SECURITY!! # IT IS STRONGLY RECOMMENDED THAT THIS SETTING REMAINS NONE! Any advice to use SUBSTR function ? Thank You