472,374 Members | 1,256 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

updating table with two images

I have table with columns id(number), photo(blob) and thumbnail(blob). I
would like to insert image (using stored procedure) from file to column
photo and in same time copy reduced image to column thumbnail. My code is:
CREATE OR REPLACE PROCEDURE "MDEMO"."PUT_PHOTO_THUMB"
(

image_file_directory in varchar2,
image_file_name in varchar2,
image_file_mime_type in varchar2,
image_http_path in varchar2,
image_http_name in varchar2,
ord_procedure_path in varchar2,
ord_content_type in varchar2,
ord_content_blob out blob
)
as
localImage ordsys.ordimage;
localThumb ordsys.ordimage;
begin
/*
* Create an empty object.
*/
localImage := ordsys.ordimage( ordsys.ordsource( empty_blob(),
null,
null,
null,
null,
null ),
null,
null,
null,
null,
null,
null,
null );
localThumb := ordsys.ordimage( ordsys.ordsource( empty_blob(),
null,
null,
null,
null,
null ),
null,
null,
null,
null,
null,
null,
null );

/*
* Process the request based on the location of the new image.
*/
if length( image_file_directory ) > 0 then
/*
* Image is stored as a FILE in a database server directory.
* Set the local image object to reference the specified file.
*/
localImage.clearLocal();
localImage.setSource( 'FILE',
image_file_directory,
image_file_name );
localImage.setMimeType( image_file_mime_type );
elsif length ( image_http_path ) > 0 then
/*
* Image is stored on a web server somewhere.
* Set the local image object to reference the URL.
*/
localImage.clearLocal();
localImage.setSource( 'HTTP',
image_http_path,
image_http_name );

else
/*
* Image is being uploaded from the client to be stored in the
database.
* Set the flag to indicate the image is to be stored in the object's
* local-data BLOB.
*/
localImage.setLocal();
localImage.setMimeType( ord_content_type );
localThumb.setMimeType( ord_content_type );
/* copy reduced image from localImage to localThumb*/
localImage.processCopy('maxScale=50,50',localThumb );
end if;

/*
* Update the image object in the table. If the image is to be stored in
* the object's local-data BLOB, then return the LOB handle so the web
* agent can store the image in the database.
*/

if localImage.isLocal() then
update MPHOTOS i set i.IMAGE = localImage where ID =
ord_procedure_path
return i.IMAGE.source.localdata into ord_content_blob;

update MPHOTOS i set i.THUMB = localThumb where ID =
ord_procedure_path
return i.THUMB.source.localdata into ord_content_blob;
else
update MPHOTOS i set i.IMAGE = localImage where ID =
ord_procedure_path;
update MPHOTOS i set i.THUMB = localThumb where ID =
ord_procedure_path;
end if;

end;

/
SHOW ERRORS;

When I want to execute (using intermedia clipboard) I receive a message
"invalid LOB locator specified". What is wrong?

Thanx in advance
--
--
,-._|\ Vladimir Kanovnik Melbourne PC UsersGroup
/ Oz \ Email: vl**@melbpc.org.au
\_,--.x/ Phone: +61 3 9791 1409
v Fax: +61 3 9791 1946
Mobile: +61 412 134012
~~ Australia ~~
Jul 19 '05 #1
0 2522

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David P. Donahue | last post by:
I'm using the following code to add a row to a table (for holding images) in my database (obtained from http://www.codeproject.com/aspnet/image_asp.asp?df=100&forumid=38225&select=1038401): ...
3
by: Jim Cobban | last post by:
I have a set of web pages that are organized in pairs. One of each pair contains a graphic and the other is an extended description of the graphic. I am trying to set it up that selecting a single...
3
by: Katy | last post by:
In my project I have two tables with the same structure and second table's data is a part of the first one. (one is the main and the second is used to keep the results of filters performed on the...
0
by: Mike P | last post by:
I have a formview which has exactly the same parameters as a detailsview, but I get an error when I try to update when editing the formview. Here are my update parameters : <UpdateParameters>...
2
by: nino9stars | last post by:
Hello, I have just started messing with absolute positioning on webpages, and it definitely let's you do some creative things. Well, after much searching and help, I got the images I was using...
3
by: Trez | last post by:
Hey guys, Am new at using ASP.Net. am having some problems updating my SQL DB. whenever i try i get this Error. Can someone help me? Incorrect syntax near 'nvarchar'. Description: An unhandled...
0
by: Jankie | last post by:
Hey you all ! Happy holidays ! I have 2 tables: Ads ad_id primary ... ..
5
by: rosaryshop | last post by:
I'm working a jewelry/rosary design web site at http://www.rosaryshop.com/rosariesAndKits2.php. As the user makes selections, it updates images of various parts, giving them a preview of the...
0
by: John Mason | last post by:
Hi, I've been trying for most of the day to get a FormView control to work. I would like to display a single record, based on a unique user id (loginid), which I am retreiving from a cookie. No...
10
by: Humakt | last post by:
Hey all. It's been a while since I last visited. Short description of program: Board game which's html elements are fully constructed using DHTML/Javascript. Board is constructed of html table,...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.