Jump to content

Henry Olive

Members
  • Content Count

    325
  • Joined

  • Last visited

Everything posted by Henry Olive

  1. Henry Olive

    Firebird3- Active and InActive ALL Triggers

    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;
  2. Henry Olive

    SplitString

    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
  3. Henry Olive

    SplitString

    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.
  4. Henry Olive

    Trim

    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
  5. Henry Olive

    Trim

    Thank you Gunther, Peter
  6. Henry Olive

    Firebird3 - WHERE MYFIELD IN : MYVALUE

    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
  7. Henry Olive

    Firebird3 - WHERE MYFIELD IN : MYVALUE

    Thank you SO MUCH Dany, Serge, Irawan
  8. Henry Olive

    Pos

    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
  9. Henry Olive

    Pos

    Thank you so much Peter, Sviridenkov, Elagin
  10. Henry Olive

    PopUpMenu TPoint

    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
  11. Henry Olive

    PopUpMenu TPoint

    Thank you so much Peter
  12. Henry Olive

    FB3.0 SQL

    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
  13. Henry Olive

    FB3.0 SQL

    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
  14. Henry Olive

    IB -> FB Data Transfer

    Your method
  15. Henry Olive

    Firebird 4.0 UDF

    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
  16. Henry Olive

    Firebird 4.0 Unknown sql type err.

    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
  17. Henry Olive

    Firebird 4.0 Unknown sql type err.

    Thank you so much Virgo
  18. Henry Olive

    IB -> FB Data Transfer

    Thank you so much Haentschman, Dany Serge, thank you so much for the time you spent for me.
  19. 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
  20. Henry Olive

    Firebird - Sum of total fields from different tables ?

    Perfect, Thank You SO MUCH Vandrovnik
  21. Henry Olive

    Firebird 4.0 Unknown sql type err.

    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
  22. Henry Olive

    Firebird 4.0 Unknown sql type err.

    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.
  23. Henry Olive

    Firebird 4.0 UDF

    Thank you Stano
  24. Henry Olive

    Firebird 4.0 UDF

    Thank you SO MUCH Serge, Vandrovnik SUBSTRING solves my problem
  25. Henry Olive

    Firebird 4.0 UDF

    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
×