Forum > Databases
How to use memory stream with asbcd.
(1/1)
loaded:
Hi All,
There is a database that I created using Postgresql, in this database;
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---'DOC BYTEA,'I have a blob column that I have defined, in this column I intend to store binary data to files.
Using opendialog, I transfer the file I selected to MemoryStream, then the SQL query is set to the parameter value.
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- varfc,fof:TMemoryStream;....DataModule1.ZQuery_CRecord.SQL.Clear;DataModule1.ZQuery_CRecord.SQL.Add( ' UPDATE '+ table_name+ ' SET '+ ' DOC '+ '=:DOC WHERE ID=:ID;' ); DataModule1.ZQuery_CRecord.Params.ParamByName('ID').AsString:=DataModule1.ZQuery_VZ.FieldByName('id').AsString; DataModule1.ZQuery_CRecord.Params.ParamByName('DOC').LoadFromStream(fc,ftBlob); DataModule1.ZQuery_CRecord.ExecSQL;
I transfer it in the form and save it in the relevant database. No problem, I'm coming here.
But by making a change; This process is not with the sql query, but directly in the field of the sql query;
I want to transfer the memory stream to the
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---ZQuery.FieldByName('DOC').AsBCD:=how to use fc; feature, is it possible?
I would be very grateful if you could help. Regards.
Navigation
[0] Message Index