Page 1 of 1

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

Posted: Fri 22 Feb 2008 15:13
by Walter Weiss
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!

Posted: Mon 25 Feb 2008 09:22
by Plash
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.

Thank's a lot

Posted: Mon 25 Feb 2008 12:07
by Walter Weiss
Thank you it works fine now.