SQL & PL/SQL :: Utl_file Error In Oracle 9i?

Oct 5, 2010

I have make utl_file. Its run in oracle 10 g. But when i run oracle 9i it give some error.

ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_FILE", line 120
ORA-06512: at "SYS.UTL_FILE", line 204
ORA-06512: at "HR.EXP_DATA", line 9
ORA-06512: at line 1.

[code]......

View 3 Replies


ADVERTISEMENT

SQL & PL/SQL :: Oracle 9i - UTL_FILE Package?

Oct 4, 2010

oracle 9i, I am reading about UTL_FILE package.make this in Hr Schema.Where hire date between date 1 and date 2.

View 8 Replies View Related

Forms :: Use Features Of Utl_file In Oracle Forms

Apr 3, 2011

can we use features of utl_file in oracle forms.

View 2 Replies View Related

SQL & PL/SQL :: How To Handle A File With UTL_FILE

Mar 11, 2013

I Got a scnario like a upload file contains

1.Header(Contains the File Name,Branch Name,MIS date)
2.Body(Customer Details)
3.Footer (File Name,Contians Total Number of Records and Number of Customers)

Like

CustomerDet_11-12-2013.csv,Chennai,11-12-2013
101,AAA,Savings,'M',10000
102,BBB,Current,'O',2000
103,CCC,Deposit Acct,'F',3000
CustomerDet_11-12-2013.csv,3,15000

How to handle this scnario through UTL_File

View 31 Replies View Related

SQL & PL/SQL :: Updating A File With UTL_FILE

May 3, 2010

I have an application that creates files using the utl_file package. It works fine but one of the lines in the file should hold the number of bytes in the file (on a line formatted like 'FileSize: 2104'). Unfortunately this line is not the last line of the file and the lines that follow it are variable in length.

My approach therefore is as follows:
1. Write the 'FileSize: ' line during file creation.
2. Write the remaining lines of data to the file (but don't close it).
3. Use utl_fgetattr to find the file size.
4. Go back and find the 'FileSize' line I need to update, using get_line to read it into the buffer.
5. Append the filesize (plus the number of characters that the variable I use to store the filesize value) to the buffer string.
6. Write the line back to the file using put_line.

However I keep getting invalid file operation errors however I try to re-access the file...

PROCEDURE setUtlFileSize (pFileName IN VARCHAR2,
pFileHandle IN utl_file.file_type) IS
vbFileExists BOOLEAN;
viFileLen NUMBER;
viFileBlockSize NUMBER;
vsFileRecord VARCHAR2(2000);
[code].......

This gives me the following output.... (for two files)... currently I am using some generic exception handling just to show me the error.

File Length: 2106
File Position: 0
-29283,ORA-29283: invalid file operation
File Length: 497
File Position: 0
-29283,ORA-29283: invalid file operation
Process exited.

Two things here concern me: The File Position suggests that the current offset position is set to the start of the file... but since I had not closed or performed any other operation since the last put_line and fflush (which are used to add lines to the file) I had expected that the offset position would be the same as the file length?

Secondly: Even if the position had been reset to the start of the file I don't understand why the get_line gives me the oracle error.

View 1 Replies View Related

SQL & PL/SQL :: Loop In UTL_FILE Is Not Getting Closed

Nov 1, 2013

I am trying read a File to find out the error message through UTL_FILE.m. But the loop used inside is not getting closed.

CREATE OR REPLACE procedure alert_mail_A
as
v_flag varchar2(10);
mesg varchar2(100);
c1 utl_smtp.connection; -- passing the datatype to a variable.
c varchar2 (1000);
B utl_file.file_type;
[code]........

View 1 Replies View Related

SQL & PL/SQL :: File Encoding UTL_FILE

Apr 21, 2011

I'm using

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options

I'm creating a file using UTL_FILE.FOPEN and UTL_FILE.PUTF

But I don't know the file I created is in which encoding ASCII, UTF-8, EBCDIC etc.

1.) How can I create files in my desired encoding using UTL_FILE?
2.) Does UTL_FILE use database encoding? If yes then how to find out database encoding?
3.) Which encoding is used by UTL_FILE by default?

View 4 Replies View Related

SQL & PL/SQL :: File Spool Using UTL_FILE

Apr 27, 2012

How to spool the Japanese characters in table using UTL_FILE. I tried with utl_file.fopen it's general,it's spooling. but i am not sure it this right way or not. in this case we need to change any character.

We can't see this characters in TOAD. Only possible in PLSQL developer

create table test1(name varchar2(1000),fname varchar2(1000))

insert into test1 values ('名を入力してください。','姓を入力してください。')

commit;

View 6 Replies View Related

SQL & PL/SQL :: Excel Created Using Utl_file Is Larger

Jul 1, 2010

when I am running a cursor and printing its data into an excel file using utl_file, the file size is nearly 50mb. But if I run the cursor and copy its data manually into an excel sheet the file size is only 22mb. I am unable to undersatnd why there is difference in file size.

View 6 Replies View Related

SQL & PL/SQL :: Moving Files After Using UTL_FILE Package?

Feb 21, 2013

We have a p/slq procedure that reads a *.txt file using the UTL_FILE package. The contents of the file are then inserted into a database table.

At the end of the procedure we close the open file using UTL_FILE.FCLOSE.

There is a program (non-oracle)that attempts to move the file to a new location after being read into Oracle. The problem is that the application cannot move the file as the file is locked. ie message displays that the file is open and cannot be moved to a new location.

Is there anything else that we are missing besides the UTL_FILE.FCLOSE.

View 5 Replies View Related

SQL & PL/SQL :: Writing Multiple Files Using UTL_FILE

Aug 16, 2012

I'm trying to read the data from flat file and write data into multiple files based on the condition. The value of each line is checked with the Flag Table (Id NUMBER, FlagType VARCHAR(25), Flag CHAR(1)), If the Flag is True then new file has to be created and corresponding line has to be moved into new file otherwise it has to continue with the same file.

CREATE OR REPLACE PROCEDURE rw_demo (File_In VARCHAR2, File_out VARCHAR2) IS
InFile utl_file.file_type;
OutFile utl_file.file_type;
vNewLine VARCHAR2(4000);
i PLS_INTEGER;
j PLS_INTEGER := 0;
SeekFlag BOOLEAN := TRUE;
[code].........

View 24 Replies View Related

To Use UTL_FILE Package To Create OS File

Apr 26, 2013

I want to use UTL_FILE package to create OS file. How to resolve this error. Oracle11g under XP.

SQL> create directory my_dir as 'c: emp';

Directory created.

1 create or replace procedure test_1(md in varchar2)
2 is
3 file utl_file.file_type;
4 begin
5 file := utl_file.fopen(md,'abc.log','w');
6 utl_file.put_line(file,'EMPLOYE REPORT');
7 utl_file.fclose(file);
8* end;
SQL> /

Procedure created.

SQL> execute test_1('MY_DIR');
BEGIN test_1('MY_DIR'); END;

RROR at line 1:
RA-06510: PL/SQL: unhandled user-defined exception
RA-06512: at "SYS.UTL_FILE", line 98
RA-06512: at "SYS.UTL_FILE", line 157
RA-06512: at "SCOTT.TEST_1", line 5
RA-06512: at line 1

View 2 Replies View Related

SQL & PL/SQL :: Extra Characters While Utl_file.get_line()

Jul 21, 2010

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
"CORE 11.1.0.6.0 Production"

i am trying to read the file, for which i m using the following:

l_utlfile_hdr := utl_file.fopen(p_dir,'header_evnt.txt', 'R');

utl_file.get_line(l_utlfile_hdr, l_hdr_evnt);

it gets these three characters at the start of the line
l_hdr_evnt = 

So i saved header_evnt.txt as UTF-8, and used utl_file.fopen_nchar, utl_file.get_line_nchar, which got rid of first two characters, but still has ¿. How to get rid of that?

View 18 Replies View Related

SQL & PL/SQL :: Read International Characters Through Utl_file Function

Jul 19, 2010

i am using oracle 10g enterprise edition.whether its possible to read international characters from the text file using the utl_file function..?

View 1 Replies View Related

SQL & PL/SQL :: Read Excel File Using UTL_FILE Package

Jul 23, 2010

Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
"CORE 11.1.0.6.0 Production"

Is there a way to read Excel file using UTL_FILE package ?

Like our usual method:
l_utlfile := utl_file.fopen(p_dir, p_filename, 'R',2000);
p_filename is event.xls

Or do we need to convert that file to .csv or .txt ?

View 5 Replies View Related

SQL & PL/SQL :: UTL_FILE.PUT_LINE Is Not Writing Data To A File?

Jan 18, 2011

I want to extract data from a table and write into a txt file using UTL_FILE utility.I have written the below query. I am able to see query is returning data.But it is not creating file and writing data into it.

CREATE OR REPLACE DIRECTORY DOC_PATH AS '/apps/orarpt/SJDEV/utl'
CREATE OR REPLACE PROCEDURE xxcfi_outbound_test (errbuf OUT VARCHAR2,
retcode OUT VARCHAR2)
AS
CURSOR emp_cur

[code].....

View 1 Replies View Related

Create File With (other) User Having Read Permission When Using Utl_file?

Dec 23, 2012

We have a requirement to create a file using UTL_FILE package. so we tried to generate the file in directory at UNIX level,for example "/tmp" which means when we executing the stored procedure which in turn calls UTL_FILE package and create a file say "a.txt". On checking the permission for "a.txt", it shows as follows

-rw-r----- oracle dba a.txt

this means read and write for oracle user, read for dba group and no permission for other user.

our requirement is to have the following privileges at UNIX level.

-rw-r--r-- oracle dba a.txt

Is it possible to do at oracle level since the file is owned by oracle user or at UNIX level (with out logging to oracle user)?

Environment: UNIX AIX 6.1 and Oracle 11.2.0.3

View 3 Replies View Related

SQL & PL/SQL :: Loading Unique Text File Names With Utl_file

Oct 9, 2012

I am using an Oracle 8i database.We intend creating a dbms_job that would run every 5 minutes. The job executes a script that would use utl_file to read two text files (a header file and detail file) from a particular directory and load the data into temporary tables. The naming convention of the files are Parts_Master_DD/MM/YY HH:MI:SS and Parts_Stats_DD/MM/YY HH:MI:SS. Both files to be stored in the same directory.

If the file name was constant ie. Parts_Master, Parts_Stats I would not have a problem. However with each file name now going to be unique, how do I handle this using utl_file. To add to my dilemma, within an hour more than one set of files could be piped to the directory to be read into the database.

View 3 Replies View Related

SQL & PL/SQL :: UTL_FILE.FGETATTR Can't Access Files On Network Disk After Database Server Was Restarted

Jun 20, 2012

I managed to upload images to a database server, resize them, copy to the application server and everything worked just fine - the Apex page successfully displayed images. Since last week, things have broken. This is how: there's a directory object which points to application server's directory:

SQL> select * from all_directories;

OWNER DIRECTORY_NAME DIRECTORY_PATH
------- ------------------------------ -----------------------------------
SYS SLIKE_4005_UPLOAD d:gisslike_4005_upload --> on a database server
SYS SLIKE_4005 \my-iasd$homegisslike_4005 --> on an application server

SQL>

I can use a directory located on a database server:

D:GISSlike_4005_upload>dir photo_resize.*
Volume in drive D is RAID
Volume Serial Number is 88F2-69D2
Directory of D:GISSlike_4005_upload
[code]....

How come it doesn't work? I was absent last week, database server was restarted for some reason (there were Windows' updates which required restarting). After that, all applications (lucky us, just two of them, but in multiple procedures/functions) return FALSE for UTL_FILE.FGETATTR.

We recreated directory objects, but that didn't work (UNC or not, no difference). I Googled quite a lot, read Metalink notes - nothing I did solved the problem.

what these OS updates were about; maybe they are not to be blamed at all. Both servers (database & application) run MS Windows Server 2003 Standard Edition Service Pack 2. In the meantime, a colleague developed a workaround (it uses UTL_HTTP) which works, but it is MUCH slower than the previous UTL_FILE.FGETATTR option.

Why don't we keep these images on the database server (instead of the application server)?I was told that Apache is incapable of accessing mapped network directories so we used what we could.

View 13 Replies View Related

Error When Installing Oracle 10G

Jul 21, 2010

I have tried to install oracle 10g on my Windows XP. But during the installation I have got these errors:

"Enterprise manager configuration failed due to the following error. Error instanting EM configuration files. Refer to the log file U:\...\orcl6\emConfig.log for more details"

"VTA-1000 : The browser could not be launched with the file or

URL :%EM_UPLOAD_PORT%/em"

View 5 Replies View Related

Error On Oracle - ORA-03134?

Dec 14, 2010

i try to connect to Oracle DataBase Through my C# program

and i get this error: `ORA-03134`

View 4 Replies View Related

Error When Using INSERT INTO In Oracle

Jan 22, 2012

I have declared my table and it was created with no issue. This is the code I used to declare my table...

CODECREATE TABLE STUDENT
(
Sid NUMBER(5) CONSTRAINTS STUDENT_Sid_pk PRIMARY Key,

[Code]...

Now I am trying to INSERT INTO that table, but ORACLE doesn't like ANY data that I input..

CODEINSERT INTO STUDENT VALUES
2  (100, �McClure�, �Sarah�, �M�, '144 Windridge Blvd', 'Eau Claire', 'WI', 54703, 7155559876, 'SR', 14-JUL-1979, 8891, 10);

View 2 Replies View Related

ERROR While Installation Of Oracle

Dec 24, 2011

I m getting error while installing ORACLE 10.2.0.1 client on windows error is as follows :"The path is more than 1023 character....."

------------------------------------------------------------------------------
my PATH variable contains following value

D:\oracle\product\10.2.0\client_1\bin;C:\Program Files\CA\SC\CAWIN\;E:\oracle\product\10.2.0\db_1\bin;C:\Program Files\Common Files\NetSarang;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\CA\SC\CAM\bin;C:\Program Files\CA\DSM\bin

View 1 Replies View Related

Oracle Error ORA-04052?

Mar 12, 2008

Ok i have stored proc that is accessing another DB thru a DB link. Now i can run select statements on the remote DB without issue, but i recieve the ora-04052 error when i try to do it thru my stored proc.

here is the format of my query that it doesn't like

SELECT STATUS INTO V_STATUS
FROM myschema.ticket@remote.db.com
WHERE ID = V_ID;

View 1 Replies View Related

SQL & PL/SQL :: Error In Oracle Collection

Aug 8, 2011

I got error in oracle collection

CREATE OR REPLACE PACKAGE BODY pkg_das_stag_to_master
AS
PROCEDURE sp_load_dasstage_security
AS
cursor cur_stag is
select Asset_id,
ID_ISIN,
ID_SEDOL1,
ID_CUSIP,
[code].........

error:

66/35 PLS-00302: component 'ASSET_ID' must be declared
66/35 PLS-00302: component 'ASSET_ID' must be declared
66/18 PL/SQL: ORA-00904: "TYP_SECURITY_VAR"."ASSET_ID": invalid identifier
63/1 PL/SQL: SQL Statement ignored

View 2 Replies View Related

Oracle 11g Login Error

Mar 17, 2013

I am new to Oracle and I have just installed 11g on my 64-bit laptop and after downloading and installing SQL Developer I can nolonger log in using DBSNMP and my specified password both from SQL PLUS or Developer retaining this error message : ERROR: ORA-01033: ORACLE initialization or shutdown in progress.

View 1 Replies View Related

SQL & PL/SQL :: Oracle 11g Function Error

Apr 16, 2013

I'm using the following code for a function which is working fine in Oracle 9i, but throwing error like ORA-06512 (Numeric value error) in Oracle 11g.

CREATE OR REPLACE FUNCTION Decrypt(toconvert VARCHAR2) RETURN VARCHAR2 IS
str_original VARCHAR2(30);
str_new VARCHAR2(30);
sub_str VARCHAR2(1);
j NUMBER;
[code]......

View 17 Replies View Related

Oracle Streams 11g (11.1.0.7) - Getting Error?

Oct 4, 2010

Platform: Windows 2003
Streams Set up: One way Streaming at table level

The error: ORA-26786: A row with key ("REPT_NUM", "STATE_CODE", "SURVEY_ID") = (067305669, 49, J) exists but has conflicting column(s) "DATE_TIME", "PREV_PARENT_ID" in table TOPCATI_JOLTS.UNIT ORA-01403: no data found

We are consistently getting this error every other day and some weeks more often, different records of course. On the capture site the application does a process called split cases. In this process the application will take an old PK case num insert a new PK case number with all of the data of the old case (Parent level). At the unit (Child level) the application will change all of the units to this new FK case number. This means the old case (parent) is left with no child units. This is all one transaction.

Is it possible that streams may be applying the LCR's out of order? especially since that whole process is one transaction.

View 2 Replies View Related

PL/SQL :: Error While Using Oracle Client

Nov 19, 2012

I have installed an oracle client in my machine and at the same time the machine is having an express edition database installed .

My question is how can i make both the clients working ? The one which is installed later sets the path variable. Despite changing the value of path variable , i am unable to connect through the client .

View 3 Replies View Related

RAC/ASM Clusterware Installation :: ORA-03114 / Not Connected To ORACLE Error With Oracle DB Installation

Dec 3, 2012

I am getting "ORA-03114: not connected to ORACLE" while installing "Oracle Database 11GR2" on "Oracle RAC 11R2" cluster setup. I am getting this error at the time of "Oracle Database Configuration Assistant" configuration reaches till 39% on HP-UX 11.31 IA64 platform.

View 25 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved