Jump to content

Serge_G

Members
  • Content Count

    122
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Serge_G

  1. Serge_G

    Third party FireDAC drivers

    I use some of these CData Drivers. No, these are derivation of FireDAC.Phys.ODBCBase.pas and FireDAC.Phys.ODBC.pas and some registering classes FDPhysManager().RegisterRDBMSKind FDPhysManager().RegisterDriverClass
  2. Serge_G

    Custom ListBox Layout in fmx

    listboxitem.stylesdata['Btn.text']:='btn Hello'; I think there is also a way to fit image in the circle (fill.bitmap) but I still investigate
  3. Serge_G

    FB3.0 SQL

    Well there is LIST but, I am not sure you agree the result (even if you can work with via a TStringList) PIVOT, I don't think it's supported even in FB4. I see that it is a view, don't you think that using the original table should be better? NOTE : Please for SQL questions, furnish a script for creating table, and filling it. Something like CREATE TABLE TESTHO( ITEMNO VARCHAR(10), WHNO INTEGER, INCOME INTEGER, OUTGO INTEGER); COMMIT; INSERT INTO TESTHO VALUES('AAA',1,10,0); INSERT INTO TESTHO VALUES('AAA',2,20,0); INSERT INTO TESTHO VALUES('AAA',3,30,0); INSERT INTO TESTHO VALUES('AAA',3,0,10); this to avoid us the "coding" for the test. With LIST you can do something like SET TERM !! ; EXECUTE BLOCK RETURNS ( ITEMNO VARCHAR(10), TOTAL INTEGER, WHNOS VARCHAR(250), QTYS VARCHAR(250) ) AS BEGIN SELECT ITEMNO,SUM(INCOME-OUTGO) FROM TESTHO GROUP BY ITEMNO INTO ITEMNO,TOTAL; WITH C AS (SELECT ITEMNO,WHNO, SUM(a.INCOME-a.OUTGO) Q FROM TESTHO a GROUP BY ITEMNO,WHNO) SELECT LIST(WHNO,';'),LIST(Q,';') FROM C a GROUP BY ITEMNO INTO WHNOS,QTYS; SUSPEND; END!! SET TERM ; !! And obtain ITEMNO TOTAL WHNOS QTYS AAA 50 1;2;3 10;20;20 but your test data is too small and don't expect order in both lists always correct
  4. Serge_G

    Custom ListBox Layout in fmx

    I had this problem long time ago but don't remember how I manage it! Indeed, a test with D10 reproduces this behavior (I only had to change a few lines of your program, and use default style removing default, renaming windows 7 to blank -> default). If you read French (google trad can be a friend), I wrote a tutorial long time ago (https://delphi.developpez.com/tutoriels/firemonkey/intro-styles-firemonkey-xe4/). Ideas : Try yo use standard stylenames i.e. txt,icon (especially this one) mystyle : here icon and text can be accessed via ListboxItem.StylesData['txt']:='Data hello'; ListBoxItem.ItemData.Bitmap.LoadFromFile('D:\XE8\icons8-planète-terre-48.png'); As you can see, stile using findstyleresource coding it works better (only speedbutton hidden) but if you code (here, I test my new style) ListboxItem.StylesData['button.text']:='Data btn'; ListboxItem.StylesData['speedbtn.text']:='speed btn'; instead of sequence // Itembtn := ListBoxItem.FindStyleResource('button') as TSpeedButton; // if Assigned(Itembtn) then // Itembtn.Text := 'Btn Hello!'; the whole stuff works as expected. Nowadays, I use more often Listview (dynamic appearance) than ListBox, Writing this other tutorial, I bang another time in this "empty object problem" I override also playing with link (disabling/enabling) and not only with the BeginUpdate/EndUpdate. However I never tested with the new versions to find out if this potential bug had been fixed.
  5. Serge_G

    IB -> FB Data Transfer

    And what method did you use finally ?
  6. Serge_G

    IB -> FB Data Transfer

    As other alternatives Step by Step - using fdbatchmove (during design time that's work, using fdbatchmove context menu) - extracting data in SQL insert statements
  7. Serge_G

    Delphi/FireDAC and Firebird 4

    I will, but not for now, my applications involving REST (linking Prestashop to my home-maid ERP shoes factory business) are functional without this suffix thing But thanks for the offer. Returning to Firebird 4 things. I installed it (dual install on another port than 3050) but only test with Flamerobin. I'll take some time to connect a database with Firedac, but I am not certain if the good fbclient.dll should be used except in an embedded way
  8. Serge_G

    Delphi/FireDAC and Firebird 4

    As I (but the replay). I use Rest for quite a while, but I was not aware of that suffix property 😮. I still have some difficulty with the usage of this thing (better that parameters I think ?) I am not so far in your book (the priority chapters for me were Livebindings and FMX Styles)
  9. Serge_G

    Delphi/FireDAC and Firebird 4

    And when did Firedac will support Firebird for Android? Actually, Unidac can (it's just a little hard to deploy Firebird correctly)! I am not an Interbase fan, especially when I found that Interbase don't have windowing functions Oh, I also asked a question about Firebird with same behaviour : ignored. Don't know if I made a mistake with webinar or there was an Embarcadero filter
  10. Serge_G

    Firebird 4.0 Unknown sql type err.

    Please, when you post a question like this, don't forget to give us table description and in which context (Delphi+Component, GUI etc.! An advice : Get the Firebird 4.0 migration guide https://www.firebirdnews.org/migration-guide-to-firebird-4/ or read short version here I think that one problem is how you have migrated your Interbase BDD to Firebird and I persist, in my mind, version 3 would have been a better target As Vandrovnick said typecasting should a solution but try also a ROUND function (especially if QTY is not an integer) SELECT ID, ROUND(UPRICE * QTY,2) PRICE -- To test FROM TABLE1 Note : did you test without parenthesis? SELECT ID,UPRICE*QTY PRICE FROM TABLE1
  11. Serge_G

    Firebird 4.0 UDF

    firebird .conf says # ---------------------------- # External Function (UDF) Paths/Directories # # UdfAccess may be None, Full or Restrict. If you choose # Restrict, provide ';'-separated trees list, where UDF libraries # are stored. Relative paths are treated relative to the root directory # of firebird. # # Since FB4.0 default value is None. Set it to 'Restrict UDF' to have # the same restrictions as in previous FB versions. To specify access # to specific trees, enum all required paths (for Windows this may be # something like 'C:\ExternalFunctions', for unix - '/db/udf;/mnt/udf'). # # 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! # # Type: string (special format) # #UdfAccess = None First change is to uncomment (removing #) last line and say UdfAccess = Restrict UDF as wrote line 10 (pointing the dir_udf directory C:\Program Files\Firebird\Firebird_4 _0\UDF) or indicate directories like indicated below line 10 UdfAcess=C:\interbase\UDF;C:\MyUDF .... If you make a non customed install of Firebird 4.0 you should see the UDF directory don't exist, and no udflib dll copied AS I said if you want a near Interbase Firebird use version 3
  12. Serge_G

    Firebird-Create Procedure

    By the way, don't forget to indicate the GUI (or other) you use for the SQL. With FlameRobin (I guessed) you need these SET TERM, but with IBExpert it wouldn't have been necessary.
  13. Serge_G

    Firebird 4.0 UDF

    Hi, First, know that : there are many internal functions in Firebird SUBSTR should be replaced advantageously by SUBSTRING (even if a little more "verbose" syntax) Udf are deprecated in Firebird 4.0 (P.S. don't ask me about UDR, I am still with 2.5 in production, 3 running only for test, 4 only installed) read 5.10 chapter of Firebird 4.0 Language reference In my mind, Firebird 3 is closer Interbase For the declaration of the UDF, I think you have to first check firebird .conf file (default parameter “UdfAccess” set to “None” ) , UDFs directories and bitness of the library also involved
  14. Serge_G

    Firebird-Create Procedure

    Use SET TERM SET TERM $ ; CREATE PROCEDURE CUSTITEMMOVEMENT ( CUSTNO INTEGER ) RETURNS ( RNO INTEGER, TNAME VARCHAR(5), TDATE DATE, DOCNO VARCHAR(12), QTY NUMERIC(18, 2), NETPRICE NUMERIC(18, 4), ITEMNO VARCHAR(20), ITEMNAME VARCHAR(40) ) AS BEGIN FOR SELECT IM.RNO,IM.TNAME,IM.TDATE,IM.DOCNO,IM.QTY, IM.NETPRICE,IM.ITEMNO, IT.ITEMNAME FROM ITEMMOVEMENTS IM JOIN ITEMS IT ON IT.ITEMNO=IM.ITEMNO WHERE (IM.CUSTNO= :CUSTNO) ORDER BY IM.TDATE, IM.DOCNO INTO :RNO,:TNAME,:TDATE,:DOCNO,:QTY,:NETPRICE,:ITEMNO,:ITEMNAME DO SUSPEND; END $ SET TERM ; $ By the way, don't use quotation marks except if you want columns names to be case-sensitive and, for purpose of maintenance I suggest you not to name your columns xxxNO if type is not a number
  15. Yes, but if I do so, it's because the AIndex argument of OnDelete event is always 0 ! (what a strange thing no ?)
  16. Hi, No, the image I post was a "classic" ImageListItemRightButton Item appearance (with TextButton visible) , and ImageListItemRightButtonDelete for the ItemEdit appearance. The "access error", I got it when I try to use a ListView1.DeleteItem(AItem.Index); beforehand declared as an helper (only way I found to raise OnDelete/Ondeleting event with touch input unavailable. TListViewHelper = class helper for TListView public function DeleteItem(const ItemIndex: Integer): Boolean; end; { TListViewHelper } function TListViewHelper.DeleteItem(const ItemIndex: Integer): Boolean; begin inherited; end; And using the OnButtonClick event of TListView (guilt, the TListItem.MouseUp event) Using the OnItemClick to use DeleteItem procedure TForm1.ListView1ItemClick(const Sender: TObject; const AItem: TListViewItem); begin ListView1.DeleteItem(AItem.Index); end; I have no "access error" Sorry, it was an "argument out of range" not an "access violation" (guilty TListItemView.GetObject). My test (on Android), shows me that if there is only one item (the one to delete) this exception does not raise. Yes, perhaps a bypass but in wich event ?
  17. So, I test this on Android. @Tang I can submit you this solution Add a private variable (in my code key : integer;) procedure TForm1.ListView1DeleteItem(Sender: TObject; AIndex: Integer); begin if FDMemtable1.Locate('id',key) then fdmemtable1.Delete; // delete the record end; procedure TForm1.ListView1DeletingItem(Sender: TObject; AIndex: Integer; var ACanDelete: Boolean); begin key:=listView1.Items[aIndex].Tag; // get the key to delete ACandelete:=true; end; But, yes, there is one, I think there is a bug I wrote in the prior post :
  18. Ok, but I try this on a windows pc how can I "simulate" this wipeleft ? On another hand, with a "classic" windows app (D11 Alexandria). I found that Deleting last item of the list raise an 'access violation' ! procedure TForm1.LinkListControlToField1FilledListItem(Sender: TObject; const AEditor: IBindListEditorItem); begin (AEditor.CurrentObject as TListItem).Tag := FDTable1.FieldByName('ID').AsInteger; end; procedure TForm1.ListView1ButtonClick(const Sender: TObject; const AItem: TListItem; const AObject: TListItemSimpleControl); begin if FDtable1.Locate('Id',AItem.Tag) then FDtable1.Delete; end;
  19. Hi, Well, I don't understand the goal, I never use this DeletingItem method, but I will investigate. So to be clear : You have a TListView filled with livebindings, how do you : A gesture, I think, but the code? (I am not a gesture expert) Sorry to disappoint, but I'm not that far (I have not encountered this need in my professional life)
  20. Serge_G

    Date Time with filter in FDTable

    Please read all my post before posting this! I forgot nothing, you don't follow my steps. You miss the : It was an example, not involving date format. And this is SGBD dependent. So, it's not your field MyDateTime which is involved in the filter I wrote, but a computed column I named c_date, computed column you have to add to your table. You jump to a bad conclusion. Filter expression is not preprocessed I think, so you can't use {fn CONVERT(mydate,DATE)}
  21. Serge_G

    Date Time with filter in FDTable

    I think the problem is deeper. Using a FDquery (with parameter) instead of FDTable is for me the best solution, assuming your SGBD is MySQL SELECT * FROM mytable where DATE(MyDateTime)=:paramdate by then instead of a filter building and activating you only have to write something like FdQuery.Open('',[AdvDateTimePicker2.Date]); Contraction of fdquery.Close; fdquery.prambyname('paramdate').asDateTime:= AdvDateTimePicker2.Date ; fdquery.Open; Note to avoid flickering, surround the code with a fdQuery.DisableControls / Fdquery.EnableControls Another way if you want to use FDtable and Filter is to add to your DBtable (MySQL I assume) a generated column for example ALTER TABLE mytable ADD c_date integer AS (YEAR(mydate)*10000+MONTH(mydate)*100+DAY(mydate)) now you can use this computed column for your filter var dd,mm,yy : word; begin decodedate(advdatetimePicker2.date,yy,mm,dd); fdtable.filtered:=false; fdtable.filter:=Format('c_date=%d',[yy*10000+mm*100+dd]); fdtable.filtered:=true;
  22. Serge_G

    Firebird Admin Tool

    If it's a vote I use Flamerobin (light and open source) for all quick jobs including backup/restore, extracting data and more For design purpose (very rare) I used others *DBeaver (not so fine for firebird) but I appreciate ER Diagrams You can have a list of third party firebird tools here Do my Interbase reviews have anything to do with your choice? Keep in mind that some functionality of Interbase don't exist in Firebird (thinking about column crypto for example)
  23. Serge_G

    cannot load client library ibtogo.dll

    Yes, this is fine, I am a Firebird addict, but what if you want to migrate you Firebird App to mobiles (Androïd or IOS ?) Firedac can't do this ! Ok, there are others third-party components (ANyDac, ZEOSDBO) but keep this fact in mind. By the way, deploying Firebird on Androïd is a little messy
  24. Serge_G

    "filtering" FDBatchmove

    Hi, The goal, I have a text file with words and I want to export in a FDMemTable words with length between 4 and 12 ? I don't know how to get the value in onWriteRecord event, is there a way to ? I can get the value in the OnWriteValue one but fired after onWriteRecord it's unusefull. Any hints (not involving a localsql DELETE)
  25. Serge_G

    "filtering" FDBatchmove

    OK, found it! I need mappings and then my "filter" works procedure TDataModule2.FDBatchMove1WriteRecord(ASender: TObject; var AAction: TFDBatchMoveAction); var m : String; begin AAction:=TFDBatchMoveAction.paInsert; m:=FDBatchmove1.Mappings[0].ItemValue; accept:=(Length(m)>=4) AND (Length(m)<=12); if not Accept then AAction:=TFDBatchMoveAction.paSkip; end; My file text need a first line =column definition. I just have an encoding problem to solve (attached my file) and as you can see on image I have some problems like these zygopétale, zygopétales liste_de_mots.francais.frgut.txt
×