Report to display a picture from a blob column
hi all
i have a problem :please help
environment: oracle AS 10.1.2.0.2 portal version 10.1.4
i have a slq report:
select field1,field2...,,
decode(cd.photo, empty_blob(),
'<img src="MYCS.show_img?p_field=IMG&p_rowid=NO_CHILD_PIC">',
decode(cd.SOURCE, 'MAIN',
'<img src="MYCS.show_img?p_field=CHILD&p_rowid='||mycs_lib.url_encode(cd.rid)||'" width=160 height=120>',
'<img src="MYCS.show_img?p_field=CHILDARCH&p_rowid='||mycs_lib.url_encode(cd.rid)||'" width=160 height=120>')
) "PHOTO"
from MYCS.mycs_child_details_v cd
where cd.id like :child_id
adn ...
The last field on the (select statement) is a photo(blob type)
NB:MYCS.mycs_child_details_v is a view
trying to create the report i get the following Error:
unable to describe SQL statement. Please correct it (WWV-13010)
Took exception (WWV-13005)
ORA-00942: inconsistent datatypes: expected - BLOB wwv-11230
This report runs without any errors on portal 3.0.9 9i AS
i dont understand what could be wrong here?
is BLOB datatype not supported by/on portal?
is the other way i can display this picture(s)?
Jean,
See this thread:
How can I upload/display image within a record ?
Sergio
Similar Messages
-
Display a PDF from a BLOB Column on a page.
Hi Folks.
I have PDFs stored in BLOB columns in the database.
Is there a way to display these to the APEX user on the page at runtime?
Any pointers appreciated.
Meantime I'm going to experiment.
Cheers
Dogfighter.I suppose this depends really on what you want.
You have at least two choices.
1) Allow the user to download the pdf and then they get the option to save it or open it in a new window
2) You can also get them to open it. You can open it in a new window by adding "_blank"
in the target.
The sample application has procedures download_my_file and custom_image_display which will show you how to achieve this.
The only other way you could possibly do it is open it as a plugin. Thats way beyond my knowledge, but I'm sure someone else will chip in. -
Report to display (actuals data from one cube and plan from another)
Hi Gurus,
I have a requirement in reporting to display actual data from one cube and plan data from a different one.
The example below might give a clear picture of the requirement.
rows has key figures and columns = months
Jan | Feb | Mar | Apr | May | Jun ... ....
GrossSales
Net Sales
Now if I run the report for Current month (Apr), then for the months of (Jan, Feb and Mar) i need to get the data from CUBE1 and for the remaining months (Apr thru Dec) from CUBE2.
Similarly when i run the report next month(may),
then (data for Jan, Feb, Mar, Apr from CUBE1)
and ( May thru Dec from CUBE2)
Any suggestions.
Thanks in Advance
KumarHi Henry,
We alreadey have a multi provider which includes
FinDat Cube(CUBE1) for actuals and Comm.Goals cube (CUBE2) for plan.
So you suggest that we have two versions of key figure for actual and plan.
ie. each KF will have two versions.
actuals = (version 10, FiscPer<curr.mnth, key figure, acutals cube)
Plan = (version 20, FiscPer>=curr.mnth, key figure, comm.goals cube)
eg:
Jan | Feb | Mar | Apr | May | Jun ...
GrossSales(Act)
GrossSlaes(Plan)
Net Sales(Acutal)
Net Sales(Plan)
Correct me if I am wrong.
the report has a lot of key figures, having two versions for each kf will be confusing.
the user would like to see
Jan.....| ...Feb |..Mar |..Apr.....| May |
GrossSales Act Value|Act.V |Act.V| PlanVal|PlanVal|
Net Sales
where Act.Value is from CUBE1
Plan Value is from CUBE2
Thanks
Kumar -
IPhoto 9.6 doesn´t display any pictures from library, upgraded
iPhoto 9.6 doesn´t display any pictures from library. I have upgraded from an old iPhoto. I upgraded the Library also.
Everything is inside the Library I can see but when I run iPhoto I get only a yellow note on the screen and no pictures?Everything is inside the Library I can see
Do you mean by looking into the library using the Finder?
but when I run iPhoto I get only a yellow note on the screen and no pictures?
Then iPhoto has probably opened a new, empty library, because it could not find or access your iPhoto library. What happens, whiny double-click the Library to open it directly?
Where is your iPhoto library stored? Is it in the Pictures folder or on an external drive? -
I cannot display image (read from oracle BLOB field) on browser?
I cannot display image (read from oracle BLOB field) on browser?
Following is my code, someone can give me an advise?
content.htm:
<html>
<h1>this is a test .</h1>
<hr>
<img src="showcontent.jsp">
</html>showcontent.jsp:
<%@ page import="com.stsc.util.*" %>
<%@ include file="/html/base.jsp" %>
<%
STDataSet data = new STDataSet();
//get blob field from database
String sql = "SELECT NR FROM ZWTAB WHERE BZH='liqf004' AND ZJH='001'";
//get the result from database
ResultSet rs = data.getResult(sql,dbBase);
if (rs!=null && rs.next()) {
Blob myBlob = rs.getBlob("NR");
response.setContentType("image/jpeg");//
byte[] ba = myBlob.getBytes(1, (int)myBlob.length());
response.getOutputStream().write(ba);
response.getOutputStream().flush();
// close your result set, statement
data.close();
%>Don't use jsp for that, use servlet. because the jsp engine will send a blank lines to outPutStream corresponding to <%@ ...> tags and other contents included in your /html/base.jsp file before sending the image. The result will not be treated as a valid image by the browser.
To test this, type directly showcontent.jsp on your browser, and view it source.
regards -
How to display the content of a BLOB column in a ADF/BC pages ?
How to display the content of a BLOB column in a ADF/BC pages ?
There is some image in database table blog column. And we want to display image on the screeen.
There is some example about upload and dowload blog columns.
(steve not yet document example page etc...)
But We want to display blog picture in a image component...
is there any basic way to do it ?
Thanks a lot...Ali,
You could just download the sample app... but... here is the servlet code from the demo (look at it just for technique - you'll obviously have to change it for your needs)...
John
package oracle.fodemo.storefront.servlet;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.*;
import javax.servlet.http.*;
import oracle.jbo.ApplicationModule;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.ViewObject;
import oracle.jbo.client.Configuration;
import oracle.jbo.domain.BlobDomain;
import oracle.jbo.domain.DBSequence;
import oracle.jbo.domain.Number;
import oracle.jbo.server.ViewObjectImpl;
public class ImageServlet
extends HttpServlet
private static final String CONTENT_TYPE =
"image/jpg; charset=windows-1252";
public void init(ServletConfig config)
throws ServletException
super.init(config);
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
response.setContentType(CONTENT_TYPE);
response.setContentType(CONTENT_TYPE);
String detailProductId = request.getParameter("detail");
String thumbnailProductId = request.getParameter("thumbnail");
boolean thumbnail = true;
String productId = null;
OutputStream os = response.getOutputStream();
String amDef = "oracle.fodemo.storefront.store.service.StoreServiceAM";
String config = "StoreServiceAMLocal";
ApplicationModule am =
Configuration.createRootApplicationModule(amDef, config);
ViewObjectImpl vo =
(ViewObjectImpl) am.findViewObject("ProductImages"); // get view object (the same as used in the table)
if (detailProductId != null)
productId = detailProductId;
thumbnail = false;
else
productId = thumbnailProductId;
vo.defineNamedWhereClauseParam("paramThumbnail", null, null);
vo.defineNamedWhereClauseParam("paramProductId", null, null);
vo.setWhereClause("DEFAULT_VIEW_FLAG = :paramThumbnail AND PRODUCT_ID = :paramProductId");
vo.setNamedWhereClauseParam("paramThumbnail", (thumbnail? "Y": "N"));
vo.setNamedWhereClauseParam("paramProductId", productId);
vo.executeQuery();
Row product = vo.first();
BlobDomain image = (BlobDomain) product.getAttribute("Image");
InputStream is = image.getInputStream();
// copy blob to output
byte[] buffer = new byte[10 * 1024];
int nread;
while ((nread = is.read(buffer)) != -1)
os.write(buffer, 0, nread);
os.close();
vo.setWhereClause(null);
vo.removeNamedWhereClauseParam("paramProductId");
vo.removeNamedWhereClauseParam("paramThumbnail");
Configuration.releaseRootApplicationModule(am, false);
} -
Error while opening PDF file downloaded from database Blob column
Hi All,
I am working on jdev 11.1.1.4.0.
In my use-case I am using filedownload Actionlistner on a link to get the PDF file stored in the database in blob field. These files are being uploaded from other use-case in adf only.
After getting the dialog box to open/save/cancel for the PDF file when i click on open then i am getting an error *'Adobe Reader could not open 'abc.pdf' because it is either not a supported file type*
or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly docoded)' for some files , and to my surprise I am able to open some files.
When I open these PDF files separately from desktop I am able to view the content of each and every file in adobe reader.
I dont know where the problem exactly lies , while uploading/downloading the file . Any ideas/thoughts to resolve this issue?
Thanks
KanikaThanks a lot Timo...!!!
I checked the PDF file downloaded directly from the blob column in DB, there only it is corrupted so must be the problem in uploading the file. I am checking the code line by line,, but no problem in setting the file content type,size etc.
Here is the code snippet ..
byte[] buff;
buff = new byte[(int)length]; -- Length is the file size
int bytesRead = is.read(buff);
for (int i = 0; bytesRead < buff.length; i++) {
// int b = is.read();
int b = is.read();
if (b == -1)
break;
buff[i] = (byte)b;
BlobDomain blobDomian = new BlobDomain((buff));
TestVORow = (TestVORow Impl)TestVO.createRow();
if(blobDomian != null) {
TestVORow.setAttachment(blobDomian);
am.getTransaction().commit();
This seems to be Ok to me..the same issue, file is still corrupting.
Any thoughts from your side ???
Thanks
Kanika
The problem is resolved.
Changes made are instead of
InputStream is;
used ... BufferedInputStream bis ;
and after
for (int i = 0; bytesRead < buff.length; i++) {
// int b = bis.read();
int b = bis.read();
if (b == -1)
break;
buff[i] = (byte)b;
bis.close(); // use this close bufferedInput Stream.
Able to open each and every file now..Thanks for your suggestions Timo and Frank.
Edited by: Kanika on Mar 6, 2012 3:15 AM -
Insert picture in a blob column and show in oracle forms
hi ,
please help me with this
I am trying to insert a picture into a blob column of a table and show that in oracle forms , but not able to do it .
I am using version 10g for both database and forms .
Please tell me how to insert a picture in a blob column that is stored in my 'c:\test' folder
and also how to show that in forms .To populate the Image Item you have to use the Webutil Client_Read_Image_File() built-in.
here
http://www.oracle.com/webapps/online-help/forms/10g/state?navSetId=_&navId=3&vtTopicFile=f1_help/builtn_r/readimag.html&vtTopicId=
To add an Image Item to your block based on the table that contains the BLOB column, then give this Image Item the BLOB column name.
So that, all you have to do is to execute query on that block. -
Displaying a picture from an array of pixel values
I have a picture I want to display in an AWT frame. The picture is stored as several arrays of pixel values which represent rectangles.
Each rectangle has a start co-ordinate and a height and width.
There is a ColorModel associated with the pixel values, so that's not a problem.
What's the best way to display these rectangles as pixels, and patch them all together to make the full picture? I'm currently trying to use a MemoryImageSource, but I'm having trouble displaying more than one rectangle at once, and the picture flickers like mad, suggesting MemoryImageSource intended for animation, whereas I just want to display the picture once.
Any suggestions?OK, that looks good. I'm investigating it.
However, It's not clear how to get the pixel values from an array into it. It requires a WriteableRaster of the pixel data, and to create a WriteableRaster, you need a DataBuffer... which is Abstract!
Do you know how to make a DataBuffer from an array? -
Opening Excel Files from DB (blob column)
My project has implemented a WEBUTIL solution to attach files into the database, view the files stored in the database (in a BLOB column), and remove the files stored in the database.
Everything has been running smoothly. We are in final testing and have found a couple of interesting scenarios ...
When a user tries to view an Microsoft Excel 2007 file from our application, the Excel file displays properly (as long as Microsoft Excel isn't already open - outside of our Oracle application). Once the Excel file is viewed, the system will not allow the user back to our application until after the Excel file is closed (we use the start /wait myExcelFile.xls ... command). This works perfectly for us.
The two scenarios we encounter occur when
1.) The user has Microsoft Excel open outside of our application and tries to open an Excel file from within our application, or
2.) The user has the file already open (either from within our application or outside of our application) and then tries to open the file from within our application.
Let me explain a little further because the above two scenarios are interrelated.
When a user has Microsoft Excel open (outside of our application), and then clicks the button to open the Excel file, the system will open the file as another window (within Excel). The system will allow the user to navigate back to our application (where as, if Excel is not open outside of our application, the system will not allow the user to navigate back to our application). Once the user navigates back to our application (while the file is still open), the user can click the button to view the file again. At this point, the user is displayed a WUT-105 error message (I assume b/c the system is trying to open a file that is already open).
I assume the two solutions are the following:
a.) Do not allow a user to open a file that is already open (not sure how to check this from within Forms ?)
b.) Do not allow a user to open an Excel file when another EXCEL process is already running (this will avoid allowing the user to naviagate back to our application)
I don't know if there is a better solution.
Do you experts have any recommendations?
We are using Oracle Application Server 10g R2 (10.1.2.0.2), Oracle Database 10g R2 (10.2), and Oracle Developer 10g (10.1.2.0.2)
I hope this all makes sense.
Thanks,
Mike
Edited by: user639843 on Oct 20, 2008 2:15 PM
Edited by: user639843 on Oct 20, 2008 2:20 PMThank you, Thank you, Thank you!!!!
I believe that will work (adding a sequence number to the end of the filename)!
We do not allow a user to update the file, only view. If a user wants to make a change, they need to remove the existing file (from the database), create a new file (outside of our application), and attach the file in our application (into the database). All updates occur outside of our application - we are not a document authoring system, just a document storage system.
Once again, many thanks on the solution!
Mike -
Displaying the image stored in Blob column
Hi all,
I'm trying to print the report with an image. I've stored the image in a Blob column and the format of the image is Jpg.
I'm using the Reports 10g(10.1.2.0.2). When I'm trying to print the report, I'm getting an error Rep-62203. I want to know whether there are any settings which i need to set to display the image item. I mean to say that are there any registry settings.
Regards,
Alok Dubey
Edited by: Alok Dubey on Dec 1, 2008 12:55 PMHi all,
I'm trying to print the report with an image. I've stored the image in a Blob column and the format of the image is Jpg.
I'm using the Reports 10g(10.1.2.0.2). When I'm trying to print the report, I'm getting an error Rep-62203. I want to know whether there are any settings which i need to set to display the image item. I mean to say that are there any registry settings.
Regards,
Alok Dubey
Edited by: Alok Dubey on Dec 1, 2008 12:55 PM -
How to display the content of a BLOB column in a JSP page?
Hi,
I've a db table with a Blob column which contains an image (".gif" file). I've created a UIX JSP page with the wizard, but I cannot display my image.
This is my code:
<%@ page errorPage="errorpage.jsp" contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
<%@ taglib uri="http://xmlns.oracle.com/uix/ui" prefix="uix" %>
<%@ taglib uri="http://xmlns.oracle.com/uix/ui/bc4j" prefix="bc4juix" %>
<%-- Define Application Module and DataSource--%>
<jbo:ApplicationModule configname="PackageTest.PackageTestModule.PackageTestModuleLocal" id="app1" />
<jbo:DataSource id="ds1" appid="app1" viewobject="ProvaMediaView" rangesize="1" />
<%-- Main page contents go here --%>
<uix:contents>
<uix:form name="form1" method="POST">
<uix:labeledFieldLayout >
<jbo:AttributeIterate id="dsAttributes" datasource="ds1" hideattributes="UixShowHide">
<%if(dsAttributes.getName().compareTo("Image")==0){
%>
<bc4juix:LabelStyledText datasource="ds1" dataitem="<%=dsAttributes.getName()%>" />
<jbo:EmbedImage datasource="ds1" mediaattr="Image" />
<%}else{%>
<bc4juix:LabelStyledText datasource="ds1" dataitem="<%=dsAttributes.getName()%>" />
<bc4juix:InputRender datasource="ds1" dataitem="<%=dsAttributes.getName()%>" />
<%}%>
</jbo:AttributeIterate>
</uix:labeledFieldLayout>
<uix:formValue name="RowKey" value="<%= sRowKey%>" />
</uix:form>
</uix:contents>
and this is the error on running the page:
oracle.jbo.domain.BlobDomain
Exception Details
javax.servlet.jsp.JspException: oracle.jbo.domain.BlobDomain
int oracle.ord.html.jsp.datatags.ShowEmbedImageTag.doStartTag()
void Media_Edit._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void oracle.jsp.runtimev2.JspPageTable.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)
void oracle.jsp.runtimev2.JspServlet.internalService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void oracle.jsp.runtimev2.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void com.evermind.server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void com.evermind.server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
boolean com.evermind.server.http.HttpRequestHandler.processRequest(com.evermind.server.ApplicationServerThread, com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
void com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread)
void com.evermind.util.ThreadPoolThread.run()
How can I do?
Thanks in advance.Hi,
I've a db table with a Blob column which contains an image (".gif" file). I've created a UIX JSP page with the wizard, but I cannot display my image.
This is my code:
<%@ page errorPage="errorpage.jsp" contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
<%@ taglib uri="http://xmlns.oracle.com/uix/ui" prefix="uix" %>
<%@ taglib uri="http://xmlns.oracle.com/uix/ui/bc4j" prefix="bc4juix" %>
<%-- Define Application Module and DataSource--%>
<jbo:ApplicationModule configname="PackageTest.PackageTestModule.PackageTestModuleLocal" id="app1" />
<jbo:DataSource id="ds1" appid="app1" viewobject="ProvaMediaView" rangesize="1" />
<%-- Main page contents go here --%>
<uix:contents>
<uix:form name="form1" method="POST">
<uix:labeledFieldLayout >
<jbo:AttributeIterate id="dsAttributes" datasource="ds1" hideattributes="UixShowHide">
<%if(dsAttributes.getName().compareTo("Image")==0){
%>
<bc4juix:LabelStyledText datasource="ds1" dataitem="<%=dsAttributes.getName()%>" />
<jbo:EmbedImage datasource="ds1" mediaattr="Image" />
<%}else{%>
<bc4juix:LabelStyledText datasource="ds1" dataitem="<%=dsAttributes.getName()%>" />
<bc4juix:InputRender datasource="ds1" dataitem="<%=dsAttributes.getName()%>" />
<%}%>
</jbo:AttributeIterate>
</uix:labeledFieldLayout>
<uix:formValue name="RowKey" value="<%= sRowKey%>" />
</uix:form>
</uix:contents>
and this is the error on running the page:
oracle.jbo.domain.BlobDomain
Exception Details
javax.servlet.jsp.JspException: oracle.jbo.domain.BlobDomain
int oracle.ord.html.jsp.datatags.ShowEmbedImageTag.doStartTag()
void Media_Edit._jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void oracle.jsp.runtime.HttpJsp.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void oracle.jsp.runtimev2.JspPageTable.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)
void oracle.jsp.runtimev2.JspServlet.internalService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void oracle.jsp.runtimev2.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void com.evermind.server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
void com.evermind.server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
boolean com.evermind.server.http.HttpRequestHandler.processRequest(com.evermind.server.ApplicationServerThread, com.evermind.server.http.EvermindHttpServletRequest, com.evermind.server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
void com.evermind.server.http.HttpRequestHandler.run(java.lang.Thread)
void com.evermind.util.ThreadPoolThread.run()
How can I do?
Thanks in advance. -
How to get the File-Type from a BLOB-Column
Hi all,
I have the database table with the BLOB-Column. In this column are Word/Pdf/Excel/... files can be stored.
Now I want to open these Files from Webforms.
I can download the file from database to the client and then open the file with client_ole2.CREATE_OBJ('Word.Application');
But I can not be sure that the file is a Word-Document.
How can I know which application is saved in the BLOB-column?
RegardsHi Francois,
thank you.
Unfortunatelly I do not know the interMedia functions. Can you send me an example with interMedia?
I am working with your solution with WEBUTIL_HOST.blocking.
But when I do not give the extension for the file, in that the BLOB will be temporary stored, I get to see the Windows "Select Program..." window. When I select Word or anything else then the file will be opened, but the locking does not working.
Any ideas?
Regards -
How to display binary file saved in BLOB column in Discoverer PLUS /VIEWER
HI, Friends,
I tried to display the binary file saved in the database in BLOB column with the *.doc or *.xls fomats, but it seemed not work at all. I can display them in discoverer DESKTOP, but not the web version PLUS or VIEWER. MY Discoverer PLUS/VIEWER version is 9.0.4.45.02 and the database is 9.2.0.4. Are there any special setting/configuration in somewhere (Discoverer administration/Applicaiton server/PLUS/VIEWER?)
Any help /information will be greatly appreciated.
Thanks a lot.Hi,
Sorry but this feature is not available in the web version of 9.0.4.45. You will have to write your own mod_plsql function to download the file.
Rod West -
Displaying PDF file from database BLOB
I have successfully added a PDF file to a table as a BLOB. Now, I need to display the BLOB. I have created the following package but it does not display anything. Can someone please help?
SQL> create or replace package image_get
2 as
3 procedure pdf( p_id in demo.id%type );
4 end;
5 /
Package created.
SQL> create or replace package body image_get
2 as
3
4 procedure pdf( p_id in demo.id%type )
5 is
6 l_lob blob;
7 l_amt number default 30;
8 l_off number default 1;
9 l_raw raw(4096);
10 begin
11 select theBlob into l_lob
12 from demo
13 where id = p_id;
14
15 owa_util.mime_header( 'image/pdf' );
16 begin
17 loop
18 dbms_lob.read(l_lob,l_amt,l_off,l_raw);
19 htp.prn(utl_raw.cast_to_varchar2(l_raw));
20 l_off := l_off+l_amt;
21 l_amt := 4096;
22 end loop;
23 exception
24 when no_data_found then
25 NULL;
26 end;
27 end;
28 end;
29 /
Package body created.
SQL> DECLARE
2 l_pdf int(1);
3 begin
4 l_pdf := 1;
5 image_get.PDF(l_pdf);
6 end;
7 /
PL/SQL procedure successfully completed.
SQL> DECLARE
2 Image1 BLOB;
3 ImageNum NUMBER := 1;
4 BEGIN
5 SELECT TheBLOB INTO Image1 FROM demo
6 WHERE id = ImageNum;
7 DBMS_OUTPUT.PUT_LINE('Size of the Image is: ' ||
8 DBMS_LOB.GETLENGTH(Image1));
9 /* more LOB routines */
10 END;
11 /
Size of the Image is: 14064
PL/SQL procedure successfully completed.
SQL> exit
Am I missing something? I recently discovered that I need to set SERVEROUTPUT on to display the DBMS_OUTPUT. Is their some other environment variable I need to set.
Thanks!*Always post code wrapped in <a href=http://wikis.sun.com/display/Forums/Forums+FAQ#ForumsFAQ-Arethereanyusefulformattingoptionsnotshownonthesidebar?"><tt>\...\</tt> tags</a>:*
PROCEDURE lf_html_pdf (pv_image IN VARCHAR2, pv_index IN NUMBER) is
l_mime VARCHAR2 (255);
l_length NUMBER;
l_file_name VARCHAR2 (2000);
lob_loc BLOB;
BEGIN
begin
selecT OI_BLOB,DBMS_LOB.getlength (OI_BLOB)
into lob_loc,l_length
from ord_img
where oi_tno= pv_image
and oi_ti='PDF'
and oi_idx=pv_index;
exception
when others then
null;
end;
OWA_UTIL.mime_header (NVL (l_mime, 'application/pdf'), FALSE);
HTP.p ('Content-length: ' || l_length);
OWA_UTIL.http_header_close;
WPG_DOCLOAD.download_file (lob_loc);
END lf_html_pdf; Start by getting rid of:
exception
when others then
null;and never using it anywhere ever again.
If you're not actually going to use the <tt>l_mime</tt> and <tt>l_file_name</tt> variables then remove these as well. (Although I really think you should set a filename.)
>
Error report:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SYS.OWA_UTIL", line 356
ORA-06512: at "SYS.OWA_UTIL", line 415
ORA-06512: at "HCLABPRO.PKG_PDF", line 220
ORA-06512: at line 2
06502. 00000 - "PL/SQL: numeric or value error%s"
>
The error stack indicates that the exception is being raised in <tt>HCLABPRO.PKG_PDF</tt>: what is <tt>HCLABPRO.PKG_PDF</tt>? Does this actually have anything to do with the procedure above?
I get the error message as below when i execute the procedure above;How do you execute it?
What happens when it's executed without the <tt>when others...</tt> built-in bug?
Maybe you are looking for
-
Hyperlink in PDF to relative file does not work
I am creating PDFs from Java and the PDF contains a link to a relative file which is distributed along with the PDF. When the link is clicked, the file is opened with the OS default program (written by us). At least that is how it is supposed to work
-
Deleted a user but did not save any space
I used migration assistant some time ago and accidentally created a second user in the process. It took me several months to transfer all my files from the secondary user to the admin user (approximately 175 gigs worth) and I finally finished today.
-
I have a problem where my cookie doesn't get set on IE6. It works fine on Firefox and IE5. It works sometimes on IE but not always. When it was not set, I noticed that "set-cookie" was not in the response header. Anyone knows how this could happen? H
-
Répétition d'une opération par le biais d'une boucle
Rebonjour, je post un nouveau message pour vous demander à nouveau votre aide. Il y a quelques temps, j'ai réalisé un programme permettant d'envoyer des informations à un capteur (simulation de l'appuie sur la touche a, puis p, puis échap. La réalisa
-
I have a macbook pro does anybody can tell me hoe to update safari browser