View file stored in Database in client machine
Hi,
I am using oralce forms Release 10.2.0.1.0 .
In my application , files (.xls,.pdf,doc,gif etc) will be stored in Database table as BLOB. I have to add the provison to view the file in client browser.
I tried using the webutil function to transfer file from DB to client and then from client to AS and showed the file using web.show_document. The issue with that solution is file keeps on created in AS server. is there a way i can programatically delete the file from AS, after showing using web.show-document.
Or can anyone suggest any other solution for the same.
Thanks in advance.
Hello,
There is no need to transfer the file on the AS if they are stored in the database.
<p>Read this article.</p>
Francois
Similar Messages
-
How to get file input stream from the client machine by JSF Fileupload API?
Dear Friends,
How to get the file input stream from the client machine by JSF HtmlFileupload or fileupload API. At present, if i execute the file upload code in the client machine, it is able to get the local path of the file and looking for the file in server machine. So i am getting FileNotFoundException.
E.g., If a file is located at client machine at following location means "C:\Test\Test.txt",
uploadClass.getFileuploadComponent().getFilename().toString() returns "C:\Test\Test.txt". But it is looking for that file in server and throwing FileNotFoundException.
Please post your replies soon.
Thanks,
JPDepends on which version of JSF you're using. If JSF 1.2, I wouldn't even bother trying to hack this into JSF itself unless you can use something like Seam 2 or richfaces.
http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_fileUpload.html
http://docs.jboss.org/seam/2.2.1.CR3/reference/en-US/html/controls.html#d0e29259 (look for s:fileUpload)
But if I were you, a simple non-jsf form with a servlet works best for taking file uploads.
As for JSF 2.0, there are other ways of getting it done.
http://balusc.blogspot.com/2009/12/uploading-files-with-jsf-20-and-servlet.html -
Access forms File stored in database
Can any body help in this
Call_Form('i:\test\fmb\entgrp');
here entgrp is the FMX file stored in Server which is mapped to i:
1 Now if i want to use this call_form
to call the file stored in database what is the syntax
2 and How to invoke this file from desktop using f45run
3 The File Stored in Databse like this is fmb or fmx
Thanks in AdvanceWhen you save a Form to the database it is the FMB that you save and not the FMX. So you'll need to have the FMX on a file system and call it from there.
f45run recieves parameters such as userid=scott/tiger module=a.fmx
Check out the help to see the full list.
(P.S. Isn't it time you upgraded to a newer version of Forms?) -
Unable to connect report to database on client machine
I am using C# and Visual Studio 2010 with several Crystal Reports embedded into my application as resources. This is a Windows application running on Vista. I am trying to connect to a SQL Server database. I created the reports using the design wizard in VS. I am allowing for the server and database name to be changed at runtime through values stored in the project manifest.
As experienced by hundreds of other frustrated developers, my reports run fine on my development machine but fail on my client machine. On the client machine I am prompted with a database login window. The server name is properly populated with the server name pulled from the ...exe.config file. The database name is blank and the field is disabled. The integrated security checkbox is not checked. I am programatically providing the server name, the database name and specifying integrated security to be true using sample code I found on this forum. See below.
I reviewed the Troubleshooting Guide to Database Connectivity Issue with Crystal Reports in Visual Studio .NET Applications. Accordingly, I am running the SP1 for Visual Studio 2010 on my development machine and the most recent runtime module on the client machine.
Here is my application code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine; //jp
using CrystalDecisions.Shared; //jp
namespace WindowsFormsApplication1
public partial class FormRptArtist : Form
private CrystalReport1 crReportDocument = new CrystalReport1();
public FormRptArtist()
InitializeComponent();
private void FormRptArtist_Load(object sender, EventArgs e)
try
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.IntegratedSecurity = true;
connectionInfo.ServerName = Properties.Settings.Default.CrystalServer; // SQLExpress
connectionInfo.DatabaseName = Properties.Settings.Default.CrystalDatabase; // TriviaProd
SetDBLogonForReport(connectionInfo, crReportDocument);
SetDBLogonForSubreports(connectionInfo, crReportDocument);
crystalReportViewer1.ReportSource = crReportDocument;
catch (Exception exp)
MessageBox.Show(exp.Message);
private void SetDBLogonForSubreports(ConnectionInfo connectionInfo, ReportDocument reportDocument)
Sections sections = reportDocument.ReportDefinition.Sections;
foreach (Section section in sections)
ReportObjects reportObjects = section.ReportObjects;
foreach (ReportObject reportObject in reportObjects)
if (reportObject.Kind == ReportObjectKind.SubreportObject)
SubreportObject subreportObject = (SubreportObject)reportObject;
ReportDocument subReportDocument =
subreportObject.OpenSubreport(subreportObject.SubreportName);
SetDBLogonForReport(connectionInfo, subReportDocument);
private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
Tables tables = reportDocument.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
TableLogOnInfo tableLogonInfo = table.LogOnInfo;
tableLogonInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogonInfo);Hello,
Install the MS SQL Server Client tools on your PC and when setting location use the MS SQL Native 10 client as your database driver.
Only one MS supports for Server 2008, there is a MS Kbase on this, you can't use MDAC version of the SQL Client engine.
Then update your app to use RAS and search in this forum on ReplaceConnection_click and you'll find my sample code on how to set location to use the new DB server and connection properties.
If that doesn't work then try hard coding the log on info rather than using variables. At the same time, unfortunately SQL Express doesn't have the Management Console, you want to watch the server using Profiler to see what your app is actually sending to the Server. If you have a full version of SQL 2008 then you can monitor what is going on. If not then you'll ahve to find some other tool you can use.
Try ODBC, you can enable ODBC Trace to see is all other options are not available.
If that doesn't work post to MS's forum and ask them why you connection info isn't working.
Thank you
Don -
Download file stored in Database?
We are implementing a mini DMS in our application and need to
write and read files to the database. We are trying to figure out
if we can convert the byte array we get from the DB into a file
that the end user can save on the client machine.
Is this possible with Flex? I have heard no, but that Apollo
might allow it. What is Apollo?
Any ideas on how we could accomplish this with Flex3?Apollo is what Adobe AIR was call in it's last version.
It's certainly possible to donwload this file from DB to
user's machine using Flex. And the bulk of the job would be done on
the server side, using Java/.NEt/PHP/whatever.
Flex would simply send a request using FileReference class to
a server side page and that page would read the file from DB as
byte array and write to the response. That would allow user to save
the file on his/her machine.
ATTA -
Manupulating Excel File Stored In Database
Is there any way I can manipulate the excel file that is stored in the database as LONG RAW ?
I need to allow user to manupulate the excel file that is stored in database and accordingly fetch the specific data from that manipulated Excel File of Database.Your best bet is to keep the data in tables and generate a new excel file each time. Search this forum on how to generate excel files.. Here are three techniques... I like the XML method..
1) OLE2
2) XML
3) CSV
I have also done this using webutil..
1) retrieve excel blob from db to client using webutil function db_to_client_with_progress()
2) manipulate excel file on client using CLIENT_OLE2
3) put excel file back in db using webutil function client_to_db_with_progress()
Sorry.. Just re-read your post and didnt notice the Long-raw part.. :)
Message was edited by:
Mark Reichman -
Access my flat file, which is located on client machine
Hi all,
I have configure Webutil on ApplicationServer to access flat file contents which is located on client machine also configure all of the required parameter.
file open Dialog box open successfuly but after selecting flat file from client machine ,content of text file is not read
but if flat file exists on application server it is working properly;
code is here
begin
:file_name:= CLIENT_GET_FILE_NAME('c:/', File_Filter=>'Text Files (*.txt)|*.txt|');
get_file_contents(:file_name);
exception when others then
message(sqlerrm);
end;
Edited by: user581546 on Apr 1, 2010 5:02 AMIn webutil.pll there is a function CLIENT_TEXT_IO. By using this function you can read the client text file.
Search on forum by CLIENT_TEXT_IO
-Ammad -
How to display the content from a file stored in database
when i am trying to display the content from a file which stored in database on oracle report 10g
data are displaying as following. please help me to display the data in readable format
<HTML LANG="en-US" DIR="LTR">
<!-- Generated: 1/11/2006, postxslt.pl [1012] v1
Source: amsug304286.xml
File: amsug304286.htm
Context: nil
Tiers: ALWAYS
Pretrans: YES
Label: Release 12 -->
<HEAD>
<!-- $Header: amsug304286.htm 120.4 2006/11/01 20:57:29 appldev noship $ -->
<!--BOLOC ug1_OMPO1010302_TTL--><TITLE>Product Overview (ORACLE MARKETING)</TITLE><!--EOLOC ug1_OMPO1010302_TTL-->
<LINK REL="stylesheet" HREF="../fnd/iHelp.css">
</HEAD>
<BODY BGCOLOR="#F8F8F8">
<A NAME="T304286"></A><A NAME="ProdOve"></A>
<CENTER><H2><!--BOLOC ug1_OMPO1010302--><B>Product Overview</B><!--EOLOC ug1_OMPO1010302--></H2></CENTER>
<p><!--BOLOC ug1_OMPO1010304-->Oracle Marketing drives profit, not just responses, by intelligently marketing to the total customer/prospect base. By leveraging a single repository of customer information, you can better target and personalize your campaigns, and refine them in real time with powerful analytical tools.<!--EOLOC ug1_OMPO1010304--></p>
<p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
<ul>
<li>
<p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
</li>
<li>
ls.<!--EOLOC ug1_OMPO1010304--></p>
<p><!--BOLOC ug1_OMPO1006611-->With tools necessary to automate the planning, budgeting, execution, and tracking of your marketing initiatives, Oracle Marketing provides you with:<!--EOLOC ug1_OMPO1006611--></p>
<ul>
<li>
<p><!--BOLOC ug1_OMPO1006612--><B>Customer Insight</B> - With sophisticated customer management and list generation, Oracle Marketing enables you to quickly generate target lists and segments using an intuitive user interface. The easy to use Natural Query Language Builder (NLQB) lets you query for customers or prospects using a natural language while hiding data complexity; fatigue management ensures that you do not over-contact the same customers with marketing messages; and predictive analytics helps you predict customer behavior that you can leverage to produce significant increases in marketing return on investments (ROI).<!--EOLOC ug1_OMPO1006612--></p>
</li>
<li>
<p><!--BOLOC ug1_OMPO1006613--><B>Sales Alignment</B> - Oracle Marketing's leads management helps you compile and distribute viable leads so that sales professionals can follow up valuable opportunities and not just contact interactions. Additionally, support for distributing proposals and marketing material drive speedy and consistent setups and collaboration of best practices.<!--EOLOC ug1_OMPO1006613--></p>
</li>
<li>
<p><!--BOLOC ug1_OMPO1006614--><B>Marketing Insight</B> - While Oracle Marketing Home page reports and Daily Business Intelligence (DBI) for Marketing and Sales provide aggregated management level information in almost real time, operational metrics help in tracking the effectiveness of individual marketing activities.<!--EOLOC ug1_OMPO1006614--></p>
</li></ul>
</BODY>
</HTML>
<!-- Q6z5Ntkiuhw&JhsLdhtX.cg&Zp4q0b3A9f.&RQwJ4twK3pA (signum appsdocopis 1162406236 2673 Wed Nov 1 10:37:16 2006) -->Hi,
you can try to use the:
<b>ConsumerTreeListPreview</b>
layout for KM navigation ivew (or customize to your own).
This layout shows a folder tree on the left, a document list on the right. When you click on a document from the list it shows the contents of the file on the bottom of the iview.
Hope this helps,
Romano -
Reg :File upload and download from client machine
hi..
anyone help me the way that how to upload and download word
document file from client machine.. i am using j2eeserver1.4 in linux..
i want upload file from client machine(windows) to server(linux.) please
help me . tell me idea regarding..
i have tried this coding.. but i can transfer txt file. only. when i upload mirosoft word file.. it will open with some ascii values with actual content.
<!-- upload.jsp -->
<%@ page import="java.io.*" %>
<%String contentType = request.getContentType();
String file = "";
String saveFile = "";
FileOutputStream fileOut = null;
if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0))
DataInputStream in = new DataInputStream(request.getInputStream());
int formDataLength = request.getContentLength();
byte dataBytes[] = new byte[formDataLength];
int byteRead = 0;
int totalBytesRead = 0;
while (totalBytesRead < formDataLength)
byteRead = in.read(dataBytes, totalBytesRead, formDataLength);
totalBytesRead += byteRead;
try {
file = new String(dataBytes);
saveFile = file.substring(file.indexOf("filename=\"") + 10);
saveFile = saveFile.substring(0, saveFile.indexOf("\n"));
saveFile = saveFile.substring(saveFile.lastIndexOf("/") + 1,saveFile.indexOf("\""));
int lastIndex = contentType.lastIndexOf("=");
String boundary = contentType.substring(lastIndex + 1,contentType.length());
int pos;
pos = file.indexOf("filename=/" + 1);
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
pos = file.indexOf("\n", pos) + 1;
int boundaryLocation = file.indexOf(boundary, pos) - 4;
int startPos = ((file.substring(0, pos)).getBytes()).length;
int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length;
String folder = "/tmp/uploads/";
fileOut = new FileOutputStream(folder + saveFile);
fileOut.write(dataBytes);
fileOut.write(dataBytes, startPos, (endPos - startPos));
fileOut.flush(); } catch(Exception e) { out.print(e);
} finally
{ try
{fileOut.close();
}catch(Exception err)
%>
please which package will help me to upload word document file with no errror. send me how can use in ftp.. send me some sample program..
Regards..
New User M.Senthil..Hi,
Well,i don't know whether if this helps people here are not.
It is always a good practise to do it via Servlet and then download content.
The adavantage of doing this is
1). You may not need to pack the downloadable with the .war which you ultimately genrate which ceratinly help us in terms of faster deployment.
3). You may update the new content just by moving a file to the backup folder.
2).One may definately download the content irrespective to the content/file.
Hope example below helps..
Configurations:
In the above example we are assuming that we placing all downlodable file in D:/webapp/downlodables/ and you have configured the same path as a init param with the name "filePath" in your web.xml.
something like the one below.
<servlet>
<servlet-name>DownloadServlet</servlet-name>
<servlet-class>com.DownloadServlet</servlet-class>
<init-param>
<param-name>filePath</param-name>
<param-value>D:/webapp/downlodables/</param-name>
<!--Could use any backup folder Available on your Server-->
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>DownloadServlet</servlet-name>
<url-pattern>/downloadFile</url-pattern>
</servlet-mapping>DownloadServlet.java:
==================
package com;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import javax.activation.MimetypesFileTypeMap;
*@Author RaHuL
/**Download Servlet
* which could be accessed downloadFile?fid=fileName
* or
* http://HOST_NAME:APPLN_PORT/ApplnContext/downloadFile?fid=fileName
public class DownloadServlet extends HttpServlet{
private static String filePath = new String();
private static boolean dirExists = false;
public void init(ServletConfig config){
// Acquiring Backup Folder Part
filePath = config.getInitParameter("filePath");
dirExists = new File(filePath).exists();
private void processAction(HttpServletRequest request,HttpServletResponse response) throws Exception{
// Some Authentication Checks depending upon requirements.
// getting fileName which user is requesting for
String fileName = request.getParameter("fid");
//Building the filePath
StringBuffer tFile = new StringBuffer();
tFile.append(filePath);
tFile.append("fileName");
boolean exists = new File(tFile.toString()).exists();
// Checking whether the file Exists or not
if(exists){
FileInputStream input = null;
BufferedOutputStream output = null;
int contentLength = 0;
try{
// Getting the Mime-Type
String contentType = new MimetypesFileTypeMap().getContentType(tFile.toString());
input = new FileInputStream(tFile.toString());
contentLength = input.available();
response.setContentType(contentType);
response.setContentLength(contentLength);
response.setHeader("Content-Disposition","attachment;filename="+fileName);
output = new BufferedOutputStream(response.getOutputStream());
while ( contentLength-- > 0 ) {
output.write(input.read());
output.flush();
}catch(IOException e) {
System.err.println("Exception Occured:"+e.getMessage());
System.err.println("Exception Localized Message:"+e.getLocalizedMessage());
} finally {
if (output != null) {
try {
output.close();
} catch (IOException ie) {
System.err.println("Exception Occured:"+e.getMessage());
System.err.println("Exception Localized Message:"+e.getLocalizedMessage());
}else{
response.sendRedirect("/errorPage.html");
public void doPost(HttpServletRequest request,HttpServletResponse response) throws Exception{
processAction(request,response);
public void doGet(HttpServletRequest request,HttpServletResponse response) throws Exception{
processAction(request,response);
NOTE: Make sure You include activations.jar in your CLASSPATH b4 trying the code.
therefore,if you have something like above set as your application enviroment in the above disccussed
can be done by just giving a simple hyper link like
<a href="downloadFile?fid=fileName.qxd" target="_blank">Download File</a>REGARDS,
RaHuL -
Sound file storing in Database & accessing these files
Hi Friends
i have working on the project of Sound Recognization system
the requirement is that sound should be passed through mike input device & that sound should be stored in to database along with the user & password
for recognization & identification of user
But problem in storing the sound files in the database so how can i store the files into the database so please guide me.brad103 wrote:
In my particular application, I process the byte array from the TargetDataLine. Then I save this to a db using new ByteArrayInputStream(soundData), soundData.length); where soundData is my byte[].
Am I correct that this will save the data in the relevant format (eg PCM_SIGNED, 8k, 16bit, etc), but the header information is not included? That's correct. Essentially, in JavaSound, that data has an associated "Format" object that was part of the line the data came from, would need to be given to any line the data was going to...and that format object is essentially a container for all of the header data...
And if so, then if I control the saving and retrieval then I can omit that step anyway as I know the format?You can omit the AudioSystem.write step and store the byte[] directly into the database...as long as you're capable of, as above, recreating the Format object that was originally associated with the data.
And my next question (digressing slightly, sorry umeshS), is that when using the tritonus gsm library and converting from above format to gsm, should I be using AudioSystem.write to write to an outputstream prior to calling AudioSystem.getAudioInputStream(targetEncoding, originalAIS) to convert encodings?AudioSystem.write adds the file header to the stream, and that's all. If you're using a "stream", you have to have the Format object in order to create an AudioInputStream, so there's no need to add the file header (and the file header will screw things up if you're not using the File or URL versions of getAudioInputStream)...
So, as a giant summary...
AudioSystem.write adds a file header, which will include format information. This should only be used if you're planning on using AudioSystem.getAudioInputStream(File f) to read the file the next time.
Otherwise, just save the data and the Format object associated with the data, so you can read it all back in later by building an AudioInputStream around your favorite IO stream.
And in retrospect, after explaining all of that...umeshS, the problem with the way you're doing it is that when you copy the file into the database, you're copying the file header. And then, because you're not using the "File" version of AudioSystem.getAudioInputStream, the system isn't handling the file header being there correctly.
You need to copy things into the database by creating an audioinputstream of your file, and then saving out the raw byte[] data. You can just call "read" on the ais a bunch of times and throw the results into your stream. Then, you can play it by pulling the data out of the database via a stream, and playing that stream by throwing it back into an AudioInputStream. -
Error while starting database from client machine.
Hi,
I connected to oracle server from a clinet PC on LAN. I connect as-
SQL> conn sys/pwd@orcl as sysdba
Now, I am able to shutdown the database, but when I try to open my database it gives following error.
SQL> STARTUP
ORACLE instance started.
ORA-12523: TNS:listener could not find instance appropriate for the client connection
SQL>
Thanks.Here is the contents of my listener.ora file-
# LISTENER.ORA Network Configuration File: E:\oracle\ora92\network\admin\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = Faisal)(PORT = 1521))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = E:\oracle\ora92)
(PROGRAM = extproc)
) -
Size limit of access database with image files stored outside database
I have read 2GB limit on size of Access database. We are using Access 2013 database with fields that are data type attachment and storing attached images outside the database. Does the size of the folder that is holding these images count
in any way toward 2GB size limit?Hi,
As far as I know, Access database limit size 2GB based on itself, not related to the folder size. Attachment data
type is similar to attaching files to e-mail messages. We need to control the Access database size is smaller then 2GB.
When a field is defined with the attachment data type, you can store one or more files for each record in it.
Attachments can dramatically increase the size of the database, but since the attached file is stored as a part of the dabatbase, you are not dependent on network drives being available as you would be if you inculded a hyperlink to the file. As a matter of
fact, feel free to backup the origainal file to other disk after you attach it to the database.
Regards,
George Zhao
TechNet Community Support -
Viewing HTML stored in database in Dreamweaver
For the longest time, I have tried to figure out how to
access, view and edit html/php code stored in a database. I build
most of my sites using the Joomla CMS so all of the content is
stored within its database. When I am working on a page, I need to
open the site, go into HTML view, copy the code, paste it into DW,
make my changes and then copy it back to the CMS.
What I want to do is create a direct DB connection so that I
can open, edit and save the changes all from within DW. Is there
any way to do this?The thing is I don't know if DW has the ability to extend in
that manner because it would affect the way in which DW connects to
the database which seems to me to be a bit above and beyond what
the extensions were designed to do. I personally have not designed
extensions, but maybe one of the PVII guys who hang around this
forum or even Murray might be able to shed some light on this
subject.
The reason I don't believe it can do this right now is
because it does not have the database editing technologies built
into it, although I do believe that might not be a bad feature to
recommend (
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
). I know it is too late for CS4 because that is already in the
beta stages and not too far from production from the looks of it
and what has been discussed on the CS4 forums. Probably a couple
small patches and it is ready to go. Although it is possible for
the CS5 release which should also see PHP4 support going
away. -
Open word file, stored in database through Forms.
Assalam-o-Alikum
to Genius of Oracle's
I have stored the Word file name "MY_FILE.DOC" in oracle database. Now i want to open the file through Forms, remember i am using forms 6i. is there any body who help me to open the file.
Best Regards
Farrukh ShaikhAssalam-o-Alikum
My in tension was not to hurt any body. if it did then sorry for that.
here is the code through which i stored the file in database
first create the DIRECTORY CREATE DIRECTORY generic AS 'C:\temp';---- --directory path where your files will be searched for storing.
THEN
create table my_blob_table
pk_name varchar2(20) primary key,
pk_value varchar2(20),
col_document blob
INSERT INTO MY_BLOB_TABLE
(PK_NAME,PK_VALUE)
('A','A');
COMMIT;
CREATE OR REPLACE PROCEDURE load_blob_from_file
( src_file_name IN VARCHAR2
, table_name IN VARCHAR2
, column_name IN VARCHAR2
, primary_key_name IN VARCHAR2
, primary_key_value IN VARCHAR2 ) IS
-- Define local variables for DBMS_LOB.LOADBLOBFROMFILE procedure.
des_blob BLOB;
src_blob BFILE := BFILENAME('GENERIC',src_file_name);
des_offset NUMBER := 1;
src_offset NUMBER := 1;
-- Define a pre-reading size.
src_blob_size NUMBER;
-- Define local variable for Native Dynamic SQL.
stmt VARCHAR2(2000);
BEGIN
-- Opening source file is a mandatory operation.
IF dbms_lob.fileexists(src_blob) = 1 AND NOT dbms_lob.isopen(src_blob) = 1 THEN
src_blob_size := dbms_lob.getlength(src_blob);
dbms_lob.open(src_blob,DBMS_LOB.LOB_READONLY);
278 Oracle Database 11g PL/SQL Programming
END IF;
-- Assign dynamic string to statement.
stmt := 'UPDATE '||table_name||' '
|| 'SET '||column_name||' = empty_blob() '
|| 'WHERE '||primary_key_name||' = '||''''||primary_key_value||''' '
|| 'RETURNING '||column_name||' INTO :locator';
-- Run dynamic statement.
EXECUTE IMMEDIATE stmt USING OUT des_blob;
-- Read and write file to BLOB.
dbms_lob.loadblobfromfile( dest_lob => des_blob
, src_bfile => src_blob
, amount => dbms_lob.getlength(src_blob)
, dest_offset => des_offset
, src_offset => src_offset );
-- Close open source file.
dbms_lob.close(src_blob);
-- Commit write.
IF src_blob_size = dbms_lob.getlength(des_blob) THEN
$IF $$DEBUG = 1 $THEN
dbms_output.put_line('Success!');
$END
COMMIT;
ELSE
$IF $$DEBUG = 1 $THEN
dbms_output.put_line('Failure.');
$END
RAISE dbms_lob.operation_failed;
END IF;
END load_blob_from_file;
after create the PROCEDURE run the procedure
begin
load_blob_from_file('FILE_NAME.DOC',' my_blob_table','col_document','PK_NAME','A');
end; -
How to play .swf files stored in database?
Ok, i am pretty stuck with this...
Here is the problem:
I have upload form which upload file to the server folder and in the database insert path. That works fine. What is my problem? When i go to dreamweaver and make insert SWF and i give the path to that file in database, on my web page always stays:
Content on this page requires a newer version of Adobe Flash Player.
But i have installed that flash player... And when i change the path to file that is actualy stored in folder on the server, all plays nicely?
Is this the way to solve this problem? I want to display dinamicaly .swf files into my web page. Please help. Thank you.Ok, i dont understand what you mean,
sorry for my bad english... This is the link to the web page : http://casmedia.blog-media.net/admin/111.php
And this is the structure of my site in dreamweaver, as you can c i have folder and file in it...
And this is the page:
Maybe you are looking for
-
Can't open MAIL, iCal or Preview
Please excuse me... I'm in a learning mode in using this Apple Support Communities medium. I clicked that my reply answered my problem as my issue suddenly resolved itself when in fact I still have the same problem and more. On 12-Jul-2012 10:09 AM I
-
i liked ios 5 better but still had problems but now since i updated to ios 6 on both my pc itunes and ipod touch 4 my music library glithches freezes skips crashes sticks repeats when i play my music and it's unbearable especially since i'm a huge ad
-
10.5.6 Update Breaks Time Machine backup of FileVault home folders?
Time machine used to backup FileVault home folders when I logged out. After 10.5.6, it just logs out and does not do the backup. Anyone else? s
-
Slow cd import with imac 24 vs dual G5
my new imac 24 is much slower at importing cd's (converting to mp3 at 192) than my G5... something like 7-8x with the imac vs 18-20x with the G5... ??? is this typical for your results or do I have a bum setting??? stephen
-
Is it possible to delete page(s) from a pdf document?
37 page pdf document; I would like to take out some of the pages. Using createpdf.