Hi Tom -
Just following up on the questions above, because it is related to something I'm not quite understanding yet. I've been looking at the "Populating an Image Table from an HTTP Data Source" documentation from </code>
http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10840/mm_uses.htm <code>
but getting stuck on the insert portion of the example :
TABLE:
create table imgtable (id number,Image ordsys.ordImage);
1) if I run the insert from the example given in the documentation:
insert into imgtable (id, Image) values (7, ORDSYS.ORDImage.init('http','your.web.site.com/intermedia','image1.gif'));
it's no problem because I have manually assigned the value of "7" to the "id" column. But, I'm confused about how I can find out what the "id" value is/will be if it is getting generated by a sequence or a sys_guid()? If I were to run the following example to import the image file from the HTTP source (as in the example, using "7" for "id" column):
DECLARE
obj ORDSYS.ORDIMAGE;
ctx RAW(64) := NULL;
BEGIN
-- This imports the image file image1.gif from the HTTP source URL
-- (srcType=HTTP), and automatically sets the properties.
select Image into obj from imgtable where id = 7 for update;
obj.import(ctx);
update imgtable set image = obj where id = 7;
commit;
it's again no problem because I know the value is "7", and also using "where id= 7" in the update statement works easily because I know it's "7"; but I'm seriously not getting how I can automate this when using a sequence, like:
insert into imgtable (id, Image) values (sequence.next_val, ORDSYS.ORDImage.init('http','your.web.site.com/intermedia','image1.gif'));
-- say for the example the next_val = 4321
DECLARE
obj ORDSYS.ORDIMAGE;
ctx RAW(64) := NULL;
BEGIN
select Image into obj from imgtable where id = (<how do I get_"4321"_to_be_put_here_?>) for update;
obj.import(ctx);
update imgtable set image = obj where id = (<how do I get_"4321"_to_be_put_here_?>);
commit;
I just can't figure out how to automate the act of telling the update statement to use the value "4321" because the value was assigned by the sequence (instead of me manually).
Probably one of those things that I've been racking my brain over so much I can't think straight about it anymore. More than likely it's my lack of expereince in development.
Thanks in advance for any help or follow up on this.