File content retrive/view problem using DBMS_LOB...?
Below this procedure working fine but getting buffer length/file content display problem...
CREATE OR REPLACE Procedure READ_FILE_LOB_tmp IS
l_dir CONSTANT VARCHAR2(30) := 'READ_LOB_DIR';
l_fil CONSTANT VARCHAR2(30) := 'testfile.txt';
l_sen CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(10));
l_loc BFILE;
l_pos NUMBER := 1;
l_sum BINARY_INTEGER := 0;
l_buf VARCHAR2(400);
l_end NUMBER;
l_getlength NUMBER;
l_ret BOOLEAN := FALSE;
BEGIN
l_loc := BFILENAME(l_dir, l_fil);
l_getlength := DBMS_LOB.getlength(l_loc);
l_ret := DBMS_LOB.FILEEXISTS(l_loc) = 1;
IF (l_ret) THEN
DBMS_LOB.OPEN(l_loc, DBMS_LOB.LOB_READONLY);
LOOP
l_end := DBMS_LOB.INSTR(l_loc, l_sen, l_pos, 1);
IF l_end >= l_getlength THEN
EXIT;
END IF;
l_sum := l_end - l_pos;
DBMS_LOB.READ(l_loc, l_sum, l_pos, l_buf);
dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(l_buf));
l_pos := l_pos + l_sum + 1;
END LOOP;
DBMS_LOB.CLOSE(l_loc);
END IF;
END;
My file content:
Test Content1
Test Content2
Test Content3
Test Content4
Test Content5
When i run this procedure, get the output like below format:
Test Content1
Test Content2
Test Content3
Test Content4
Test Content5
But I want to display as per file content format...
I changed the code like...
CREATE OR REPLACE Procedure READ_FILE_LOB IS
l_dir CONSTANT VARCHAR2(30) := 'READ_LOB_DIR';
l_fil CONSTANT VARCHAR2(30) := 'testfile.txt';
l_seb CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(32));
l_sen CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(10));
l_loc BFILE;
l_pos NUMBER := 1;
l_sum BINARY_INTEGER := 0;
l_buf VARCHAR2(4000);
l_end NUMBER;
l_ret BOOLEAN := FALSE;
l_getlength NUMBER;
BEGIN
l_loc := BFILENAME(l_dir, l_fil);
l_getlength := DBMS_LOB.getlength(l_loc);
--dbms_output.put_line(l_getlength);
If l_getlength > 0 then
l_ret := DBMS_LOB.FILEEXISTS(l_loc) = 1;
IF (l_ret) THEN
DBMS_LOB.OPEN(l_loc, DBMS_LOB.LOB_READONLY);
LOOP
l_end := DBMS_LOB.INSTR(l_loc, l_sen, l_pos, 1);
IF l_end = 0 THEN
l_sum := l_getlength - l_pos + 1;
DBMS_LOB.READ(l_loc, l_sum, l_pos, l_buf);
dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(l_buf));
EXIT;
END IF;
l_sum := l_end - l_pos;
DBMS_LOB.READ(l_loc, l_sum, l_pos, l_buf);
DBMS_LOB.TRIM(l_buf, (l_sum * 2) - 2);
dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(l_buf));
l_pos := l_pos + l_sum + 1;
END LOOP;
DBMS_LOB.CLOSE(l_loc);
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error:' || SQLERRM);
DBMS_LOB.CLOSE(l_loc);
END;
Now its working fine with my format
Similar Messages
-
The PDF file and slideshow view corrupted using iPhoto. Macbook air only get corrupted slideshow and Mac Mini both slideshow and PDF file is corrupted.
Saving as a PDF file for some users have been a problem. If you boot into Safe Mode and run iPhoto you can create undamaged PDF files. We don't know why the problem but this is a workaround.
This problem prevents many from ordering books, calendars and cards since iPhoto creates PDF file of them for uploading and printing. Booting into Safe Mode lets them successfully order those items. -
PDF file contents of word document using XSLT.
Hi Public,
I am creating pdf file through the XML, XSL and FOP. I want PDF file contents to display external file contents such as word document.
I know for displaying image in PDF we use <fo:external-graphic> but what tag we should to display file contents other than pdf file type.
Thanks in advance.
RahulYour instructions for doing this are very clear.
-
File Content Conversion: Sender Problem
Hi,
I'm getting a very typical error in my Sender Communciation channel.
Channel CC_FILE_SENDER_2: Empty document found. Proceed without sending message
I've gone through a few threads and I know that the problem is with the Key Field and using * in the Recordset Structure but I cannot solve it. If I use * in the Recordset structure it fails,when I use a specific number it works. Any ideas
Here is my Communication Channel details
Document Name: MT_SENDER
Document namespace: http:\\sender
Recordset Structure: FileHeaderRecord1,1,FileHeaderRecord2,1,FileHeaderRecord3,1,FileDetailRecord,*,FileTrailerRecord1,1
Recordset Sequence: Ascending
Key Field Name: RType
And the configuration:
FileHeaderRecord1.fieldNames: RType,Filler,Code,Filler2
FileHeaderRecord1.fieldFixedLengths: 10,31,6,69
FileHeaderRecord1.keyFieldValue: V
FileHeaderRecord2.fieldNames: RType,Filler
FileHeaderRecord2.fieldFixedLengths: 3,113
FileHeaderRecord2.keyFieldValue: HDR1
FileHeaderRecord2.fieldNames: RType,Filler,Date,File,Filler2,Num,Filler3
FileHeaderRecord3.fieldFixedLengths: 3,2,5,6,21,3,76
FileHeaderRecord3.keyFieldValue: UH1
FileDetailRecord.fieldNames: RType,Filler,TCode,Filler1,Amount,Filler2,ZGC,Filler3,Date,Filler4
FileDetailRecord.fieldFixedLengths: 14,1,2,18,11,18,9,28,5,10
FileDetailRecord.keyFieldValue: 9
FileTrailerRecord1.fieldNames: RType,Filler,TCode,Filler1,Date
FileTrailerRecord1.fieldFixedLengths: 14,1,2,12,5
FileTrailerRecord1.keyFieldValue: UT1
ignoreRecordsetName: true
This is a copy of my file....
VPR456SCL1 852086
HDR1 SED456RD 345344500428 F 04 094520428 BS 09452
UHL1 09452ESBCL1 00000000 004
85208681123787085 000000000000500FREW RTYU POSWS123704375 09452
85208681123787085 000000000000600FREW RTYU POSWS123705307 09452
85208681123787085 000000000000600FREW RTYU POSWS123705671 09452Hi,
problem is in your keyfield value,
FileHeaderRecord1.fieldNames: RType,Filler,Code,Filler2
FileHeaderRecord1.fieldFixedLengths: 10,31,6,69
FileHeaderRecord1.keyFieldValue: V
keyfield name is RType and it is given a fixedlength of 10 characters, but your keyfieldvalue is "V
" which is not 10 char long that is the reason your adapter is failing to pick it.
same for all the other recordsets, the fieldvalue shd match the fixed length given.
Eg:- give keyfieldvalue like this "V ". it will work. -
How to display a file content in view
hi team,
I have files which are already uploaded in SAP. I can read the contents of the file but
I can't find the UI element where I can display the content of the file.
I have heard that IFrame can be used to solve the purpose. But using IFrame I am only
capable to show files which are in MIME objects.
Can anybody give suggestions how to achieve it?Hi,
have you tried
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/9d/a6884121a41c09e10000000a155106/frameset.htm">TextView</a> or <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/3b/219141c1d0ae5fe10000000a1550b0/frameset.htm">FormattedTextView</a> ?
You could also make a development request.
Regards, Heidi -
Pdf report viewing problem using Sun appserver9
i want to generate a report from my web application.if i use appserver8.2 it can view report in pdf ,html and csv format.but when use appserver 9 it cant show the report in pdf format.message is shown as File is not a valid postscript document.i am using fedora core 4 and mozilla firefox.pls help someone
Hi user;
Please check below thread and related docs,suggestion
Re: Print pdf direct from concurrent manager
Re: How to print PDF file with hp-ux 11.31 on itanium
Hope it helps
Regard
Helios -
File Content Conversion Mapping problem
Hi,
I tried a file to file simple scenario using FCC on the Sender Side,but I repeatedly get a message mapping error.
I tried changing the different parameters in filesender file adapter, checked message mapping for errors .
1.My Mapping is Correct.
2.The parameters in the FCC are correct.
Is there any way where we can debug the the Message Error.
Regards,HI,
but I repeatedly get a message mapping error.
what error message ur getting.
what is ur file strucutre
what FCC u r using.
give me the details
chirag
Hi,
These are the following details:
1.error message: There is an exception in mapping
2. File structure: A comma separated text file
e.g : Somya, 24.
3. I am using sender file FCC.
My data type is as follows:
FileInput
Recordset
Row
Name
Age
The Sender FCC used is:
Document Name: FileInput
Recordset Name: Recordset
Recordset Sturcute: Row,*
Row.fieldNames: Name,Age
Row.fieldSeparator: ,
Row.endSeparator: 'nl'.
Do Help.
Regards, -
Cannot search PDF file contents - Windows 7 32 bit - Adobe Acrobat X
Hello,
If this is in the wrong forum please move it.
I work in an enterprise environment and our systems are having trouble searching file contents in Windows Explorer using Acrobat X and Windows 7 32 bit. The files are on a mapped network location.
After removing all adobe products from a test machine and reinstalling the Acrobat 10.0.0 software the windows explorer search function seems to work locally but once I install Acrobat 10.1.anything update, it will fail. It never worked on a networked location.
I have also tried installing Adobe Acrobat 11.0.00 after removing 10.0. Then I made sure my indexing settings were setup to index files and contents and made sure the .pdf extension was selected under file types.
I then created a mapped drive to the network location, and setup my indexing to the folder on that network drive. I was able to do this by installing this Microsoft Add-in that allows use of UNC paths in the indexing.
http://www.microsoft.com/en-us/download/confirmation.aspx?id=3383
Once I set this up, I rebuilt my index and restarted the computer. This is where it gets weird. I can now search the contents of PDF files in this indexed network location, but only by one letter. Searching "c type:pdf" will produce results, but "co type:pdf" will not. I know for sure some of the documents have the work Comment in there so this should should up.
Does anyone have experience getting this to work correctly with the latest versions of Adobe Acrobat X or XI and Windows 7 32 bit? It would be greatly appreciated.
Thank you.I will never understand why but in the end I rebuilt my 32 bit dell laptop from scratch and the pdf files can now be searched.
I cannot search them on a mapped drive as I was able to with Windows XP because now they must be indexed and windows 7 will seems not to allow a mapped location to be indexed which must be done to make the pdf files searchable so I have had to move the files to the local drive.
My Windows 7 64 bit systems can search the mapped drives just fine without needing to be indexed. Again I will never understand why this works and the 32 bit machine does not. -
Inconsistency File Content Conversion
Hi,
My scenario is file to r/3 wherein the source file is a fixed length file. So I am using file content conversion in my sender adapter.
My source structure looks like:-
DT_TRAN
|__RECORD 1..unbounded
|_____HEADER 1
|_____QUOTE 0...unbounded
|_____ORDER 0...unbounded
|_____INVOICE 0...unbounded
|_____BILLING 0...unbounded
|_____CONTACT 0...unbounded
|_____FOOTER 1
I am getting this error while executing the scenario.
Conversion of file content to XML failed at position 0: java.lang.Exception: ERROR consistency check in recordset structure validation (line no. 5: missing structure(s) before type 'Header'.
However, I checked the record in line no.5 and it's clean and perfect. But still getting the error. If I remove this record and execute, the file is picked and data is processed.
In File Content Conversion, I have used the following parameters:-
Recordset Name = Record
Recordset Structure = HEADER,1,QUOTE,,ORDER,,INVOICE,,BILLING,,CONTACT,*,FOOTER,1
I am using Key Fields to separately identify the details records. I used ignoreRecordsetName = true. In this case, in XML message payload does not contain <Record> node and so there is an error.
Can anyone suggest, how to overcome the issue such that all the records in the file are processed.
Thanks.
BalakrishnanThe content conversion parameters are:-
Record.endSeparator = 'nl'
Record.fieldNames = HEADER,QUOTE,ORDER,INVOICE,BILLING,CONTACT,FOOTER
Record.fieldSeparator = 'nl'
like the above, i have done for all the nodes. However, if i remove the record from line 5 and process the file, the file is picked up and processed succesfully. i have checked many times. the line no.5 record is not having any issues with structure or fixed length calculation. for some reaosn, it gives the error. -
I installed iCloud drive in my mac and saved a .xls file to be viewed and used with my iPad and iPhone. Though these devices are upgraded to IOs8 and Icloud drive is 'on' in these devices, I am unable to access this particular file in iPad or iPhone. Request help on how to open, view and amend files thru iPhone or Ipad.
Do you have Excel installed on your iPad and iPhone? https://itunes.apple.com/us/app/microsoft-excel/id586683407?mt=8
-
Hi ,
can we change the input file content before processing in XI? if yes how?Hi Ranj,
You can convert the file content in a XML using file content conversion (https://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm or Basic File Adapter Content Conversion - Process Integration - SCN Wiki) if your file is structured.
In other case you would need a java mapping in order to modify the file in the operation mapping (interface mapping in XI).
If you want to do a File to File scenario without ESR(IR) objects you can't modify the files if you dont develop a new adapter module to add to file adapter. (Custom Adapter Module Development - SAP PI 7.1 - Netweaver Technology - SCN Wiki)
Regards. -
Hi I am using Iframe with src="abc.mht" file. i want to view the mht file content in same window.please help..
Thanks in AdvanceThis is not a Java problem, this is a WEBBOT problem.
I suggest that you research the topic in your FrontPage help files.
Yes, we do know how to solve this problem using ordinary HTML and JSP. The sample code that you've posted implies that you are looking for an extremely different solution. To put it another way, it looks like you're logging onto the Federal Aviation Administration's forums and asking them how to go from Chicago to New York by train.
But in any case, if you can't find the information in FrontPage, I'm 100% certain that if you went to www.microsoft.com and searched for FrontPage and downloads, and skipped the results that actually want you to download FrontPage, you'll get some sample code. -
Problem when using keyfield in sender file content conversion
Hi all,
I am using FCC at sender side.
My recordset structure is as follow::
<MT_TW_TLOG>
<Transaction>
---<SalesItem> 1...unbounded
<XF_SOURCESYS>
<XF_STORECODE>
<XF_TYPE>
<XF_VOIDFLAG>
---</saleItem>
---<SalesReturn> 1...unbounded
<XF_SOURCESYS>
<XF_STORECODE>
<XF_TYPE>
<XF_VOIDFLAG>
---</saleReturn>
---<SalesTotal>
<XF_SOURCESYS>
<XF_STORECODE>
<XF_TYPE>
<XF_VOIDFLAG>
---</saleTotal>
---<SalesTender> 1...unbounded
<XF_SOURCESYS>
<XF_STORECODE>
<XF_TYPE>
<XF_VOIDFLAG>
---</saleTender>
</Transaction>
FCC specification that i have used is::
Recordset name:: Transaction
Recordset Structure:: salesItem,,salesReturn,,salesTotal,1,SalesTender,*
Recordset Sequencee::
Variable
Key field name::XF_TYPE
key fiel type::String(Case-sensitive)
then i have given following information::
salesItem.fieldnames ::all field names
salesItem.fieldSeparator::,
salesItem.keyFieldvalue::2
salesItem.processFiledNames::fromConfiguration
salesReturn.fieldnames ::all field names
salesReturn.fieldSeparator::,
salesReturn.keyFieldvalue::2
salesReturn.processFiledNames::fromConfiguration
salesTotal.fieldnames ::all field names
salesTotal.fieldSeparator::,
salesTotal.keyFieldvalue::2
salesTotal.processFiledNames::fromConfiguration
salesTender.fieldnames ::all field names
salesTender.fieldSeparator::,
salesTender.keyFieldvalue::2
salesTender.processFiledNames::fromConfiguration
My source file is a text file.
So when i am transfering following data,
scenario works fine.
PCTW,TWS001,2,1
PCTW,TWS001,2,10
PCTW,TWS001,3,2
PCTW,TWS001,1,3
PCTW,TWS001,4,4
Third field is my XF_TYPE.
But if i change the order of records as follows::
PCTW,TWS001,3,1
PCTW,TWS001,3,10
PCTW,TWS001,2,2
PCTW,TWS001,1,3
PCTW,TWS001,4,4
It fails at adaper monitor and throws following error::
2006-11-01 10:42:00 UTC: Error: Conversion of complete file content of 'try.txt' to XML format failed around position 0: Exception: ERROR consistency check in recordset structure validation (line no. 3: missing structure(s) before type 'SalesItem'
Please provide some help on it.
Thanks & Regards,
NilimaHi Nilima,
Just go through this Weblog.
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
and specially the hilighted ( circled text ) in this and its description below.
Hope this will be helpful
Reward if helpful.
Regards
Sachin -
Problem using file content conversion
I want to generate a input message with no recordset and root element
It just contains one element like below:
<line>AI0 AXXX-001 20089830 120</line>
<line>AI0 AXXX-002 20089830 120</line>
What properties I need to setup in file content conversion to get this format message?
The data inside <line> comes from a txt flat file.
Please help
Thanks
GopalHi,
Root element can be ignore by using FCC property Recordset Name i.e ignoreRecordsetName: true
If you set the parameter to true, the <Recordset> element is not inserted.
Recordset Name defines the root node under which rest of the XML will be created. If not required ignore.
As Recordset Structure is a mandatory parameters, So I'm not sure how you ignore it.
Abid! -
How to view the file content from the directory? getting Error:ORA-21560
SQL> create directory READ_LOB_DIR as 'D:\Prj\Comm\Data';
CREATE OR REPLACE Procedure READ_FILE_LOB IS
-- Input Directory as specified in create directory
l_dir CONSTANT VARCHAR2(30) := 'READ_LOB_DIR';
-- Input File which is read word by word
l_fil CONSTANT VARCHAR2(30) := 'testfile.txt';
-- Separator Character between words is a BLANK (ascii = 32)
l_seb CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(32));
-- Character at the end of the file is NEWLINE (ascii = 10)
l_sen CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(10));
-- Pointer to the BFILE
l_loc BFILE;
-- Current position in the file (file begins at position 1)
l_pos NUMBER := 1;
-- Amount of characters have been read
l_sum BINARY_INTEGER := 0;
-- Read Buffer
l_buf VARCHAR2(500);
-- End of the current word which will be read
l_end NUMBER;
-- Return value
l_ret BOOLEAN := FALSE;
BEGIN
-- Mapping the physical file with the pointer to the BFILE
l_loc := BFILENAME(l_dir, l_fil);
-- Check if the file exists
l_ret := DBMS_LOB.FILEEXISTS(l_loc) = 1;
IF (l_ret) THEN
dbms_output.put_line('File ' || l_fil || ' in Directory ' || l_dir ||
' exists');
-- Open the file in READ_ONLY mode
DBMS_LOB.OPEN(l_loc, DBMS_LOB.LOB_READONLY);
LOOP
-- Calculate the end of the current word
l_end := DBMS_LOB.INSTR(l_loc, l_seb, l_pos, 1);
-- Process end-of-file
IF (l_end = 0) THEN
l_end := DBMS_LOB.INSTR(l_loc, l_sen, l_pos, 1);
l_sum := l_end - l_pos - 1;
DBMS_LOB.READ(l_loc, l_sum, l_pos, l_buf);
dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(l_buf));
EXIT;
END IF;
-- Read until end-of-file
l_sum := l_end - l_pos;
DBMS_LOB.READ(l_loc, l_sum, l_pos, l_buf);
dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(l_buf));
l_pos := l_pos + l_sum + 1;
END LOOP;
DBMS_LOB.CLOSE(l_loc);
ELSE
dbms_output.put_line('File ' || l_fil || ' in Directory ' || l_dir ||
' does not exist');
END IF;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error:' || SQLERRM);
DBMS_LOB.CLOSE(l_loc);
END;
The Text file content is...
Copyright 1996,2001 Oracle Corporation. All Rights Reserved
This file contains installation instructions for installing the
Oracle8 ODBC Driver software.
It is divided into four parts:
o Part I: Summary of systems supported by Oracle8 ODBC client
software
Lists the platforms on which the Oracle8 ODBC Client software can
be installed.
o Part II: Oracle8 ODBC Driver software.
Describes the files, and installation prerequisites for the Oracle8
ODBC driver software.
o Part III: Exploding the kit onto your system
Describes how to explode the kit onto your system hard drive.
o Part IV: Installation Instructions
Describes how to install the Oracle8 ODBC driver.
Part I: Systems supported by the Oracle8 client software
You can install the ODBC client software on any of the following systems:
o Windows 2000
o Windows NT X86
o Windows 95
o Windows 98
The Oracle8 ODBC Driver provides support for ODBC connections
from Windows 2000, Windows NT, Windows 95, and Windows 98 systems
to Oracle databases.
o Part II: Oracle8 ODBC Driver software.
Refer to the following files for information about the Oracle8 ODBC Driver:
LICENSE.TXT - Oracle8 ODBC Driver License Agreement. Read carefully
before installing and/or using this product. Enclosed in
your software distribution kit.
SQORA.HLP - A Window's Help file which is the primary reference
manual for the Oracle8 ODBC Driver.
ODBCRelnotes.WRI - The release notes for the Oracle8 ODBC Driver
which contains information which may have not been
included in the Help file.
Installation Prerequisites
See the Oracle8 ODBC Driver release notes (ODBCRelnotes.WRI),
for a complete list of software products required and their versions.
Time Required
The installation of the Oracle8 ODBC Driver takes approximately 5
minutes. The actual time may be shorter or longer, depending upon
your hardware configuration.
Disk Space Required
The Oracle8 ODBC driver installation requires approximately 2
megabytes of available storage space. The space required depends upon
what files you already have installed. The installation procedure
checks to see if you have enough available disk space. If you do not,
the installation fails.
Part III: Exploding the Kit onto your system
Expand the self-extracting archive file onto your hard drive.
C:\> ORA8174.EXE
Part IV: Installation Instructions
Oracle8 ODBC Driver 8.1.7.4.0
This section assumes the following:
1. MS Windows 2000, Windows NT, Windows 95 or Windows 98 is running.
2. Oracle Universal Installer shipping with 8.1.7 has already been
installed on your system.
3. Part III has been completed.
Software fixes:
Refer to release notes (ODBCRelnotes.wri) for a complete list of
Software fixes.
Installation Instructions
Once the self-extracting archive file ORA8174.EXE has been
exploded it will create an installable directory structure
onto your hard drive. Run the Oracle Universal Installer from
your local drive.
1. On the screen "File Locations" use the "Browse" button of
the source path to choose the file 'products.jar' from the
folder that ORA8174.EXE was extracted to. Choose 'Next'.
2. You will receive a warning that some of the dependencies of
this product are not found in the staging area. This warning
is OK. The ODBC driver depends on the Net8 Client being already
installed on the system. Answer 'Yes' to continue.
Oracle is a registered trademark of Oracle Corporation.
Microsoft, MS are registered trademarks of Microsoft Corporation.
Microsoft Windows, Windows NT, Windows 95, Windows 98 and Open Database
Connectivity are trademarks of Microsoft Corporation.
All other trademarks and registered trademarks are the property
of their respective owners.
The output was...
File testfile.txt in Directory READ_LOB_DIR exists
Copyright
1996,2001
Oracle
Corporation.
All
Rights
Reserved
This
file
contains
installation
instructions
for
installing
the
Oracle8
ODBC
Driver
software.
It
is
divided
into
four
parts:
o
Part
I:
Summary
of
systems
supported
by
Oracle8
ODBC
client
Error:ORA-21560: argument 2 is null, invalid, or out of range
I want to diplay/view as per file content format from the file under that specified directory.
Have any other method / any help or suggestions would be really appreciated.I changed the code like...
CREATE OR REPLACE Procedure READ_FILE_LOB_tmp IS
-- Input Directory as specified in create directory
l_dir CONSTANT VARCHAR2(30) := 'READ_LOB_DIR';
-- Input File which is read word by word
l_fil CONSTANT VARCHAR2(30) := 'testfile.txt';
-- Separator Character between words is a BLANK (ascii = 32)
l_seb CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(32));
-- Character at the end of the file is NEWLINE (ascii = 10)
l_sen CONSTANT RAW(100) := UTL_RAW.CAST_TO_RAW(CHR(10));
-- Pointer to the BFILE
l_loc BFILE;
-- Current position in the file (file begins at position 1)
l_pos NUMBER := 1;
-- Amount of characters have been read
l_sum BINARY_INTEGER := 0;
-- Read Buffer
l_buf VARCHAR2(4000);
-- End of the current word which will be read
l_end NUMBER;
-- Return value
l_ret BOOLEAN := FALSE;
BEGIN
-- Mapping the physical file with the pointer to the BFILE
l_loc := BFILENAME(l_dir, l_fil);
-- Check if the file exists
l_ret := DBMS_LOB.FILEEXISTS(l_loc) = 1;
IF (l_ret) THEN
dbms_output.put_line('File ' || l_fil || ' in Directory ' || l_dir ||
' exists');
-- Open the file in READ_ONLY mode
DBMS_LOB.OPEN(l_loc, DBMS_LOB.LOB_READONLY);
LOOP
-- Calculate the end of the current word
l_end := DBMS_LOB.INSTR(l_loc, l_sen, l_pos, 1);
-- Process end-of-file
IF (l_end = 0) THEN
EXIT;
END IF;
-- Read until end-of-file
l_sum := l_end - l_pos;
DBMS_LOB.READ(l_loc, l_sum, l_pos, l_buf);
dbms_output.put_line(UTL_RAW.CAST_TO_VARCHAR2(l_buf));
l_pos := l_pos + l_sum + 1;
END LOOP;
DBMS_LOB.CLOSE(l_loc);
ELSE
dbms_output.put_line('File ' || l_fil || ' in Directory ' || l_dir ||
' does not exist');
END IF;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error:' || SQLERRM);
DBMS_LOB.CLOSE(l_loc);
END;
Now its working fine with one addtional line...
The file content is...
This is My Content
This is My Content
This is My Content
This is My Content
This is My Content
But The output was...
File testfile.txt in Directory READ_LOB_DIR exists
This is My Content
This is My Content
This is My Content
This is My Content
This is My Content
here, i want to delete that additonal line...?
Maybe you are looking for
-
MacBook and Wireless Epson Printer won't connect anymore?
I have a MacBook Pro running Lion OSX. I also have an Epson Stylus NX430. I had it connected to my laptop wirelessly and it worked fine. I went home for spring break and when I came back, I tried printing something, and my computer said that my print
-
Problems after wrt45g v5.1 hard reset
Hello, I need to recover my password, and in short - get to factory defaults. So I followed the manual - hold down the reset button for 30 seconds. Then I plug in my eth cable and connect to 192.168.1.1 via browser but it doesn't work. The power led
-
I am wondering if there is a way to write a small java program that will check the time of day and set your volume control depending upon time of day. I am a student and would love to be able to have my volume turned off all the way while at school a
-
Help - how to Eject DVD/CD in mini?
Hi all I got my new mini last week I use it as HTPC only with the apple remote (no keyboard or mouse). I need help with - how to eject DVD/CD in mini? Thx for the help Benzi
-
Even after the update 10.5.1 some mail messages send by a PC user are completely empty, I thought. But when I look at the version there is a message. When I dig into the /library/mail/mailboxxes and then look for the messages folder and do a quickloo