Subject | [IBO] Re: Storing PDF into Firebird Blobs |
---|---|
Author | Terry Black |
Post date | 2012-05-20T07:01:44Z |
If I look at the Help file it gives some code for using CreateBlobStream but I am unable to get it to work.
Has anyone another example I could use.
Terry
Has anyone another example I could use.
Terry
--- In IBObjects@yahoogroups.com, "Terry Black" <tblac@...> wrote:
>
> Thanks heaps
>
> Terry
>
> IT Manager | Public Health Unit Hornsby | Health Reform Transitional Organisation Northern
> Hornsby Hospital, Main Building 1, 36-76 Palmerston Road, Hornsby NSW 2077
> Tel. 02 9477 9400 | Fax. 02 9482 1650 | tblac@...
> www.health.nsw.gov.au
>
>
> >>> Aage Johansen <aagjohan@...> 15/05/2012 4:02 am >>>
> Terry wrote:
> >>
> ...
> Could you please give me an idea of how to use it. You mentioned
> using a prepared DSQL component?
> >>
>
> It is very close to using the query components.
> Here, MYDSQL is a TIB_DSQL component, with connection and transaction
> properties set.
>
> MYDSQL.SQL.Text:='insert into MYTABLE '+
> '( ID, PICT, ...) '+
> 'values '+
> '(:ID,:PICT, ...)';
> MYDSQL.Prepare; // No longer really necessary
> MYDSQL.ParamByName('ID' ).AsInteger:= ... ;
> MYDSQL.ParamByName('PICT').LoadFromFile('C:\XYZ.pdf');
> ...
> MYDSQL.ExecSQL;
>
> If the picture arrives via a memorystream you can use
> MYDSQL.ParamByName('PICT').Assign(PICT_STREAM);
>
>
> Totally untested, of course.
> TIB_DSQL is not used if you want to return rows from the
> operation. In a pinch you can get a single value, as with "select
> count(*) from MYTABLE".
>
> Jason wrote:
> <<
> CreateBlobStream( ) is what you use.
> >>
> I haven't actually use this myself.
>
>
> --
> Aage J.
>
>
>
> Disclaimer: This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender.
>
> Views expressed in this message are those of the individual sender, and are not necessarily the views of the Local Health District or associated entities.
>