Sqlite (12) memo under Delphi FIREDAC

Source: Internet
Author: User
Tags integer join reference sqlite

The continuation of the topic is mainly the syntax of SQL, the reason for the hasty ending is that the brain has entered the intraweb world.

The related memo will be added at any time below:

Reference code to connect multiple databases: Fdconnection1.execsql (' ATTACH ' c:hr.sdb ' as HR ');
Fdconnection1.execsql (' ATTACH ' c:cust.sdb ' as Cust '); Fdquery1.open (' select * from ' Orders ' o ' + ' left join HR. ') Employees "E on o.employeeid = E.employeeid ' + ' left join Cust."


Customers "C on o.customerid = C.customerid"); Sqlite_onauthorize Reference Code:procedureTform1.formcreate (Sender:tobject);beginfdconnection1.connected: = True; Tsqlitedatabase (FDCONNECTION1.CONNECTIONINTF.CLIOBJ).
  Onautorize: = doauthorize; Fdquery1.open; End;procedureTform1.doauthorize (adb:tsqlitedatabase; Acode:integer;ConstAArg1, AArg2, AArg3, aarg4:string;varAresult:integer);beginMEMO1.LINES.ADD (Format ('%d-%s-%s-%s-%s ', [Acode, AArg1, AArg2, AArg3, AArg4]);ifAcode = Sqlite_deletethenAresult: = Sqlite_denyElseAresult: = SQLITE_OK; End; Sqlite_onupdate Reference Code:procedureTform1.formcreate (Sender:tobject);beginfdconnection1.connected: = True; Tsqlitedatabase (FDCONNECTION1.CONNECTIONINTF.CLIOBJ).
  OnUpdate: = DoUpdate; Fdquery1.open; End;procedureTform1.doupdate (adb:tsqlitedatabase; Aoper:integer;ConstAdatabase, atable:string; Arowid:sqlite3_int64);beginMEMO1.LINES.ADD (Format ('%d-%s-%s-%u ', [Aoper, Adatabase, ATable, Arowid]); End; Quick Select to row: SELECT * from Orders WHERE ROWID =: RID//tfdmemtable replaces TClientDataSet
 class= "Delphi" " Procedure  tform1.formcreate (sender:tobject);
   Begin   with 
    FDMemTable1.FieldDefs.AddFieldDef  do   begin  Name: = ' word ';
    DataType: = ftstring;
  Size: = 50;

   End ;  with 
    FDMemTable1.FieldDefs.AddFieldDef  do   begin  Name: = ' ph ';
    DataType: = ftstring;
  Size: = 50;

   End ;  with 
    FDMemTable1.FieldDefs.AddFieldDef  do   begin  Name: = ' note ';
    DataType: = ftstring;
  Size: = 255;

   End ;  with 
    FDMemTable1.FieldDefs.AddFieldDef  do   begin  Name: = ' num ';
  DataType: = Ftinteger;

   End ;
  FDMEMTABLE1.INDEXDEFS.ADD (' index_1 ', ' word ', [ixprimary]);
Fdmemtable1.createdataset;
 End ; 
Concurrency Related: http://docwiki.embarcadero.com/RADStudio/XE6/en/Using_SQLite_with_FireDAC#Locking_and_Concurrent_Updates

Author:cnblogs in case

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/Delphi/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.