You can do it via parameters under Oracel and Interbase 4.1 and higher (not sure about 
other DBs).

INSERT INTO CTabHed (Name. Landscape) VALUES (:Name, :Landscape, :Layout)

This then requires that you have your Blob field in memory so that you can load 
ParamByName('Layout').AsBlob.

Cheers.
                        BJ...

----------
From:   Mark Derricutt[SMTP:[EMAIL PROTECTED]]
Reply To:       [EMAIL PROTECTED]
Sent:   Thursday, 11 February 1999 11:09
To:     Multiple recipients of list delphi
Subject:        [DUG]:  Inserting Blobs Via SQL

I'm wanting to insert a record into a table via SQL that has a blob field,
at the moment I'm using this code:

    Query.Close;
    Query.SQL.Text := Format('INSERT INTO CTabHed ( Name, Landscape ) VALUES
( "Copy of ''%s''", False )',[
      dmSTEAMMAN.qCTabHed.FieldByName('Name').AsString]);
    Query.ExecSQL;

What I'm doing is duplicating a record, the table CTabHed has a binary blob
field called Layout which I also wish to duplicate, whats the easiest way of
doing this?

Mark


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to