ParamByName('...').asOraClob or asOraBlob

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Walter Weiss
Posts: 7
Joined: Tue 18 Dec 2007 13:39

ParamByName('...').asOraClob or asOraBlob

Post by Walter Weiss » Fri 22 Feb 2008 15:13

What is wrong?

The text is not in the Database, only the other Parameters.

text := TMemoryStream.create;

text is passed as parameter and is filled!

PKG_KOMMENTAR_P_ADD_COMMENT.Active := false;
PKG_KOMMENTAR_P_ADD_COMMENT.ParamByName('p_type').AsString := p_type;
PKG_KOMMENTAR_P_ADD_COMMENT.ParamByName('p_private_id').AsString := p_private_id;
PKG_KOMMENTAR_P_ADD_COMMENT.ParamByName('p_user_id').AsString := p_user_id;
PKG_KOMMENTAR_P_ADD_COMMENT.ParamByName('p_sessionid').AsString := p_sessionid;

text.Position := 0;
PKG_KOMMENTAR_P_EDIT_COMMENT.ParamByName('p_text').AsOraBlob.LoadFromStream(text);

showmessage(inttostr(PKG_KOMMENTAR_P_EDIT_COMMENT.ParamByName('p_text').AsOraBlob.size));

//Size equals text.size!!

PKG_KOMMENTAR_P_ADD_COMMENT.Execute;

After execute no text! :?

Is it not possible to store Blobs in one step,
do i have to select it and to store it with createBlobStream(..,bmWrite)?

greetings!

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 25 Feb 2008 09:22

Temporary blob must be used to pass a blob value to the stored procedure.
If you are using ODAC 6, you should set TemporaryLobUpdate option of TOraStoredProc component to True.

Walter Weiss
Posts: 7
Joined: Tue 18 Dec 2007 13:39

Thank's a lot

Post by Walter Weiss » Mon 25 Feb 2008 12:07

Thank you it works fine now.

Post Reply