Jump to content
Al T

Delphi sqlite datatype IMAGE ??? does this really exists?

Recommended Posts

Here is a link from official SQLite website https://www.sqlite.org/datatype3.html it says there is BLOB support.

Here is another link from official SQLite website https://www.sqlite.org/changes.html you can find BLOB support is introduced with 2004-06-18 (3.0.0 alpha).

 

Delphi already has TBlobField support https://docwiki.embarcadero.com/Libraries/Sydney/en/Data.DB.TBlobField

Edited by ertank

Share this post


Link to post

The code below is from another Delphi programmer whom owns Delphi Berlin:

 

procedure TDM.FDConnectionAfterConnect(Sender: TObject);

begin

  FDConnection.ExecSQL(

  'CREATE TABLE IF NOT EXISTS ENTRY( '+

    'Title VARCHAR2(60) NOT NULL, '+

    'UserN VARCHAR2(40), '+

    'Passw CHAR(64) NOT NULL, '+

    'URLpa VARCHAR2(100), '+

    'NickN VARCHAR2(20), '+

    'CustN VARCHAR2(20), '+

    'Notes VARCHAR2(400), '+

    'DateC DATE, '+

    'Icon IMAGE)');

end;

 

What I'm trying to figure out is if IMAGE is in Delphi or not.

 

Also, there's a DATE datatype?  Is that also from Delphi?

 

I just wonder if Delphi has a Datatype that I can't seem to find on the Internet.   SQLite 3 Delphi datatype IMAGE and DATE?

 

 

 

Share this post


Link to post

What you might be wondering is how FireDAC interprets a column that is defined to have the data type IMAGE when that data is read from the database. IMAGE is not a SQLite data type.

 

Quote

SQLite provides developers with the freedom to store content in any desired format, regardless of the declared datatype of the column. Some people find this feature troublesome. Some developers are shocked to discover that it is possible to insert text into a column marked INTEGER.

 

Have a look at this page:

 

https://www.sqlite.org/flextypegood.html

 

7 hours ago, Al T said:

The code below is from another Delphi programmer whom owns Delphi Berlin:

 

procedure TDM.FDConnectionAfterConnect(Sender: TObject);

begin

  FDConnection.ExecSQL(

  'CREATE TABLE IF NOT EXISTS ENTRY( '+

    'Title VARCHAR2(60) NOT NULL, '+

    'UserN VARCHAR2(40), '+

    'Passw CHAR(64) NOT NULL, '+

    'URLpa VARCHAR2(100), '+

    'NickN VARCHAR2(20), '+

    'CustN VARCHAR2(20), '+

    'Notes VARCHAR2(400), '+

    'DateC DATE, '+

    'Icon IMAGE)');

end;

 

What I'm trying to figure out is if IMAGE is in Delphi or not.

 

Also, there's a DATE datatype?  Is that also from Delphi?

 

I just wonder if Delphi has a Datatype that I can't seem to find on the Internet.   SQLite 3 Delphi datatype IMAGE and DATE?

 

 

 

 

Edited by weirdo12

Share this post


Link to post
CREATE DOMAIN IMAGE AS BLOB SUB_TYPE 0 SEGMENT SIZE 2048;

After that, you can call your domain. You don't need to definite everything when creating your database table. I really like to use domains.

 

 'CREATE TABLE IF NOT EXISTS ENTRY( '+
    'Title VARCHAR2(60) NOT NULL, '+
    'UserN VARCHAR2(40), '+
    'Passw CHAR(64) NOT NULL, '+
    'URLpa VARCHAR2(100), '+
    'NickN VARCHAR2(20), '+
    'CustN VARCHAR2(20), '+
    'Notes VARCHAR2(400), '+
    'DateC DATE, '+
    'Icon IMAGE)'); 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×