SQL & PL/SQL :: Converting XLS With Korean Data To CSV And Reading It

Mar 3, 2011

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 have a .xls file, which has few columns with Korean data. I have problem converting it into .csv. I converted it to UNICODE TEXT, which was TAB separated. I replaced tabs with commas. but still saved it as .txt file. Now I am using utl_file package to open and read.

utl_file.fopen_nchar(l_dir, l_filename , 'R',8000);

I outputted the first header line, and instead of Korean fieldnames, it displayed some different characters.. cannot even copy-paste..

I am uploading the converted .txt as I cannot upload original .xls file here...

View 18 Replies


ADVERTISEMENT

SQL & PL/SQL :: Reading Data From Clob Field

Apr 15, 2010

I have one table with clob field. The data in this field will contain string having transaction record data. Now I want to read data from this clob filed and insert different record in other oracle table.

example ->
Data in clob field will be->
H|12|1233|fff|sss
L|1234|gggg|tttt|yyyyyy|rrrrr
L|1094|gggg|tttt|yyyyyy|rrrrr
L|1344|gggg|tttt|yyyyyy|rrrrr
L|1666|gggg|tttt|yyyyyy|rrrrr
L|188|gggg|tttt|yyyyyy|rrrrr

I have one master table and one detail table. I want to insert record -> H|12|1233|fff|sss in master table
and records->
L|1234|gggg|tttt|yyyyyy|rrrrr
L|1094|gggg|tttt|yyyyyy|rrrrr
L|1344|gggg|tttt|yyyyyy|rrrrr
L|1666|gggg|tttt|yyyyyy|rrrrr
L|188|gggg|tttt|yyyyyy|rrrrr
in detail table.

End of excercise will redult-> 1 record in header and 5 records in detail table.

I need to implement it in my project.

View 7 Replies View Related

SQL & PL/SQL :: Storing And Reading Xml Data From XMLType Table

Aug 21, 2010

Since I need to do something along the lines of inserting an xml document into the database for later to use.

Anyway, the problem I get with the below is

Quote:
Error at line 95
ORA-00984: column not allowed here

Script Terminated on line 95.

It's on the INSERT line

declare

xmlInput clob;
begin
xmlInput :=('<?xml version="1.0" encoding="windows-1256"?>
<XLAAPRPT>

[Code].....

View 2 Replies View Related

Forms :: Reading And Writing Data In A Text File

Mar 8, 2011

I need to read data from text file(located on application or db server or on some other server, however path is known to me.) and then append some data in it.

Data will be read and written on daily basis so i want to clear all data on date change.

View 3 Replies View Related

Forms :: Reading Excel Data And Inserting Into Table Using 6i?

Feb 16, 2004

how to read the excel data and insert into tables without using SQL loader. i tried using OLE2 package,but i am getting an non-oracle exception. even i tried using CSV format. but i couldn't make it.

View 3 Replies View Related

SQL & PL/SQL :: Reading Streaming Continuous Binary Data From A Website?

Jan 26, 2011

Is it possible to read streaming continuous binary data from a web site using PL/SQL?

View 8 Replies View Related

SQL & PL/SQL :: Error In Reading Data From Collection Variable For Ref Cursor

Jun 19, 2013

While reading data from collection variable using ref cursor . I am getting the below two errors.

PLS-00382:Expression is of wrong type
ORA-22905 Cannot access rows from a non-nested table item.

CREATE OR REPLACE PACKAGE APPS_GLOBAL.GIIOMEGAORDERLIST
AS
TYPE BU_LIST_TYPE IS TABLE OF VARCHAR(50);
TYPE OFFER_DETAIL IS RECORD
(
GII_BU VARCHAR(50),
GII_OFFER NUMBER,
[code]........

View 4 Replies View Related

SQL & PL/SQL :: Ftp File To Remote Server By Reading Data From Table?

May 1, 2012

I need a way to ftp file to remote server by reading data from table. I searched a couple of sites which asked me to use Chris xutl_ftp package..but unfortunately the site is no accessible..

Here is the code

CREATE OR REPLACE PACKAGE UTL_FTP
AUTHID CURRENT_USER
AS
/**
* LICENSE: GNU Lesser General Public License (LGPL)
* Copyright (C) 2003-2006 Russ Johnson (john_2885@yahoo.com)

[code].....

View 3 Replies View Related

SQL & PL/SQL :: Partial Data Inserted When Reading From Global Temporary Table?

Jun 25, 2012

I have a complex sql query that fetches 88k records. This query uses a global temporary table which is the replica of one of our permanent tables. When I do Create table..select... using this query it inserts only fewer records. But when I make the query point to the permanent table it inserts all 88k records.

1. I tried running the select query separately using temp and perm table. Both retrieves 88k records.

2. From debugging I found that this problem occurred when we were trying to perform a left outer join on an inline view.

However this problem got resolved when I used the /*+ FIRST_ROWS */ hint.

From my limited oracle knowledge I assume that it is the problem with the query and how it is processed in the memory.

View 1 Replies View Related

Forms :: Reading Data From Excel File And Load Into Form

Oct 25, 2013

I have a Excel File which contains some columns and rows, i need to load that excel into a form and import that form data to Database Table, using DDE Method.

In simple i say; Just to read the excel and load into a form, which can be imported into a table later.

How to achieve this? only dde method.

View 10 Replies View Related

SQL & PL/SQL :: Reading Data From XML Message And Send Result To Net Using Bulk Collect

Aug 15, 2013

We want to send the following XML message as IN parameter to the procedure

<?xml version="1.0" encoding="UTF-8" ?>
- <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
- <s:Body>
- <CalculateWEDBCached xmlns="http://wedb.GGG.Services/Contracts/">
- <skuItems xmlns:a="http://schemas.datacontract.org/2004/07/wedb.GGG.Services.Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
- <a:SkuItem>
[code].......

I need a procedure to get the records from the table for every SKU of XML message from the table and take one record for each SKU based on order precedence.And send the set of output records to the .net code. The order precedence is

If MODEL is not null that record should be high precedence and consider max lead_time
If MODEL and VK_UNIT is NULL then the precedence goes to STATE_ID.

The parameters in the procedure are

CREATE OR REPLACE PROCEDURE sku_proc
(
p_bu_id IN number,
p_model IN varchar2,
p_vk_unit IN XMLTYPE,
p_country_id IN varchar2,
[code].......

Query to get the data from the table based on the parameters.

SELECT bu_id,
model,
vk_unit,
country_id,
state_id,
Lead_Time,
[code].......

Here every SKU from XML message should be passed as p_vk_unit to VK_UNIT column in the query

210-39348
210-39348
210-39348
405-12132
340-30904
340-30904
340-30904
403-10890
403-10890
709-10007

Based on the above query assume we got the following records.

BU_ID MODEL VK_UNIT COUNTRY_ID STATE_ID LEAD_TIME FC
0 M123 210-39348 AB 0 20 A
0 M123 210-39348 AB 0 30 B
0 NULL 210-39348 AB 0 10 C
0 M123 405-12132 AB 0 10 A
0 NULL 340-30904 AB 0 30 C
0 M123 340-30904 AB 0 20 B
0 M123 340-30904 AB 0 10 A
0 NULL 403-10890 AB 0 10 B
0 M123 403-10890 AB 0 20 A
0 M123 709-10007 AB 0 10 B
0 NULL NULL AB 0 20 B
0 NULL NULL AB 1 30 A

Th final query has to return the following result to the OUT parameters p_Lead_Time p_FC of the procedure.

LEAD_TIME FC
30 B
10 A
20 B
20 A
10 B
30 A

How to implement my above requirement using BULK COLLECT.

View 11 Replies View Related

SQL & PL/SQL :: Converting Data From English To Arabic?

Feb 1, 2012

I need to prepare a bilingual system (English and Arabic).

So i need to store data in English as well as in Arabic

Is there any possibility to convert the data from English to Arabic and Arabic to English through oracle forms

basically what i am thinking is let us suppose user selected the English version of the application and he entered all the data in English during saving the records i need to convert all the English data into Arabic and store it in another table for Arabic data reference.

View 3 Replies View Related

JDeveloper, Java & XML :: Reading Data From Database Table That Contains Control Characters

May 1, 2011

I have the following bit of code that reads data from the an Oracle table (Note: This is running on Jdk 1.4.2)

ResultSet message = messageStatement.executeQuery(getMsgSql);
String messageData = message.getString("MESSAGE_DATA");

The data in the MESSAGE_DATA column contains text but also control characters that separate data elements in the message (i.e (char)31, (char)29) and (char)28) . What i am finding is that for some reason message.getString() is sometimes truncating the message. I can read the majority of messages but some of them are truncated. Am i supposed to be reading the data using a different method? If so how?

I have tried to use sqlplus to look at the data in the database and it is all there it is just truncated by the message.getString() method. I saw this when i tried to output the result i.e. System.out.println(message.getString()).

I ran an sql query using the length() function in Oracle and length("MESSAGE_DATA") returns 2032 whereas in java message.getString(1).length() returns 2000.

View 5 Replies View Related

SQL & PL/SQL :: Converting BLOB Data To Long Or Varchar

Feb 6, 2013

converting BLOB data into varchar2 or long .

we have function which convert long data and return it has varchar . But has part of Apps upgrade the Column has been converted into blob column.

How we need the same function to read the data from BLOB and return its as long or varchar2.

Somewhere i am making mistake..

CREATE OR REPLACE function GDS.test_alert_msg(v_rowid rowid) return varchar2 is

vblob blob;
i2 number;
amt number :=32767;
len number;
pos raw(32767);
position INTEGER := 10000;
my_vr raw(32767);

[Code]....

View 2 Replies View Related

SQL & PL/SQL :: Converting Dates - How To Compare Data With Sysdate And Display

Jan 5, 2011

CREATE TABLE SCHEDULE_DETAILS
(
SCHEDULE_ID NUMBER NOT NULL,
SCHEDULE_TYPE VARCHAR2(10 BYTE),
SCHEDULE_START_DATE DATE,
SCHEDULE_END_DATE DATE,
RUNTIME CHAR(8 BYTE),
TIMEZONE VARCHAR2(40 BYTE));

SET DEFINE OFF;
Insert into SCHEDULE_DETAILS
(SCHEDULE_ID, SCHEDULE_TYPE, SCHEDULE_START_DATE, SCHEDULE_END_DATE, RUNTIME, TIMEZONE)
Values
(1970, 'Daily', TO_DATE('07/26/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
TO_DATE('01/26/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), '13:58 ', 'America/New_York');
[code]........

Taking Today date and timezone as EST, I need to run a select that shows all the rows , where sysdate falls in between

Start_date and End_date and RunTime, ( run time is basically the Local time of the TimeZone Column)

Basically we should Display rows by checking/Converting, Start_date||End_date||Runtime||timezone with Sysdate(est) then display.

From the Above Data these rows should be Displayed by that select, how to compare this data with sysdate and display.

SCHEDULE_IDSCHEDULE_TYPESCHEDULE_START_DATESCHEDULE_END_DATERUNTIMETIMEZONE
1970Daily7/26/20101/26/201113:58 America/New_York
2588Daily10/18/20104/18/201115:50 America/New_York
3567Daily12/8/20106/8/20118:40 America/New_York
3386Daily12/27/20106/27/20111:0 America/New_York
1973Daily8/3/20102/3/201111:25 America/New_York
2565Daily9/7/20103/7/20117:0 America/New_York
3580Daily12/20/20106/20/201117:0 America/Chicago
3167Daily11/30/20105/30/20111:0 US/Alaska
3390Daily12/30/20101/15/20117:00 Asia/Calcutta

For Example, Below rows shouldn't come, Since it's end date is less than Sysdate.

SCHEDULE_IDSCHEDULE_TYPESCHEDULE_START_DATESCHEDULE_END_DATERUNTIMETIMEZONE
2579Daily9/17/20109/18/201011:32 America/New_York

View 2 Replies View Related

Reading AWR Reports

Jul 22, 2012

We are facing the problem of slow performance in the production system and lots of complaints from the clients for resource busy or system hang related issue. We are finding the locked object in the system which are mostly inactive in nature so we kill them manually and the problem gets resolve.

We have some observation in AWR reports which are as below :

1)
Instance Efficiency Percentages (Target 100%)
Execute to Parse %: -26.96
Parse CPU to Parse Elapsd %: 4.83
===============================================================
2) Total time in database user-calls (DB Time): 55700.6s
=================================================================
3)
TCP_RECEIVE_SIZE_DEFAULT 16,384
TCP_RECEIVE_SIZE_MAX 9,223,372,036,854,775,807
TCP_RECEIVE_SIZE_MIN 4,096
TCP_SEND_SIZE_DEFAULT 16,384
TCP_SEND_SIZE_MAX 9,223,372,036,854,775,807
TCP_SEND_SIZE_MIN 4,096
=================================================================
4)
Wait Class Waits %Time -outs Total Wait Time (s) Avg wait (ms) %DB time
Network 45,423,119 0 2,122 0 3.81
=================================================================
5)
Event Waits %Time -outs Total Wait Time (s) Avg wait (ms) Waits /txn % DB time
SQL*Net message to client 45,030,511 0 55 0 127.77 0.10
=====================================================================

The Top Five events are :

db file sequenctial Read
enq TX -row lock contention
DB CPU
Virtual circuit wait
Read by other session

Is there a any oracle doc id or any other document ,which can be referred to get better understanding of AWR Reports and gives the steps of resolution to be taken for various top timed events

View 3 Replies View Related

SQL & PL/SQL :: Reading From A Excel File

Dec 1, 2011

I am looking for a code/script to read values from excel file and perform PLSQL script.

Now i have the PLSQL script to generate report which takes two value which i have to change all the time to generate new report .All i wanna do create a script to read from a excel file and perform the other script.

I have been searching from a long time and only found UTL_file Package which use CREATE OR REPLACE FUNCTION and create some virtual table.

The problem is i don't have create authorization in database so i m not able to use UTL_File command . Is there any simple way to read value from excel file?

View 16 Replies View Related

SQL & PL/SQL :: Error In Reading XML Massage

Aug 16, 2013

I am not able to parse this XML message.

with t as (select xmltype('sku_list xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<sku vk_unit="213-13085" model="M14573" />
<sku vk_unit="227-10036" model="M14573" />
<sku vk_unit="227-10037" model="M14573" />
<sku vk_unit="213-13086" model="M14573" />
[code].....

View 1 Replies View Related

SQL & PL/SQL :: Reading File With UL_FILE?

Jul 8, 2013

I'm trying to utilize the utl file to read a txt file and import the data into a table in Oracle. I've read in various forums and have researched a lot on oracle documentation site and on the internet but can not find the answer to the problem.

The source follows:

Set serveroutput on
DECLARE
arquivo_ler UTL_File.File_Type;
Linha Varchar2 (1000);
BEGIN
arquivo_ler: UTL_FILE.FOPEN = ('INTRANET_LOAD', 'carga_intranet.txt', 'R', 32767);
Loop
UTL_File.Get_Line (arquivo_ler, Linha);
dbms_output.put_line (Linha);
End Loop;
UTL_File.Fclose (arquivo_ler);
DBMS_OUTPUT.PUT_LINE ('File processed with sucesso.');
END;
/

The errors:

ORA-29283: invalid file operation

ORA-06512: at "SYS.UTL_FILE", line 633

ORA-29283: invalid file operation

ORA-06512: at line 5

What has been done:

Created DIRECTORY (INTRANET_LOAD) and given the GRANT read, write to the user

On Linux where Oracle is installed, was given full access to the Oracle user folder: / u01/app/oracle/product/11.2.0/db_1/adp

When writing the query;

SELECT *

FROM ALL_TAB_PRIVS

WHERE table_name = 'INTRANET_LOAD';

The data are returned.

1 FOLLOW INTRANET INTRANET_LOAD SYS READ NO NO

2 FOLLOW INTRANET IN NO WRITE SYS INTRANET_LOAD

View 10 Replies View Related

PL/SQL :: Reading 2 HTTP Headers?

Jul 15, 2013

I'm planning to do a single-sing-on in one of my applications. To get to my application, the user has to log in to a portal-application befor. From this application i receive 2 headers, to verify this person has authenticated successfully. But how can I read these 2 headers? It doesn't work with the UTL_HTTP package, because i don't do an active request on an url.

View 8 Replies View Related

SQL & PL/SQL :: Reading Doc File Stored In Database

Jun 8, 2011

A doc file stored in a database having data type blob. To read this file I have written Following procedure

create or replace procedure XX_read_blobfile1 as
b blob;
c clob;
n number;
begin
SELECT file_data INTO b FROM fnd_lobs WHERE file_id = 322420;
if (b is null) then
[code]......

With the data displaying some boxes before and after data

View 11 Replies View Related

SQL & PL/SQL :: Reading BLOB Field To REF Cursor

May 27, 2011

I have a procedure which will be called my front end team get the reports stored in the database as BLOB. These reports are mostly PDF files.

I need to read this BLOB field as a part of OUT PARAMETER REF CURSOR which also contains other two columns.

View 13 Replies View Related

SQL & PL/SQL :: Reading Flat File With Header?

Jul 3, 2012

working on loading the data from flat file into table and below given is the validation condition given.I checked the UTL_FILE build in package but not able to figure out, how to identify the column header in flat file.

1. Skip the header, if any. The header is the first record, and starts with '000'
2. Skip the trailer, if any. The Trailer is the last record, and starts with '999'
3. Log an error, but continue if a line exceeds 512 characters
4. Log an error, but continue if a line is blank

View 5 Replies View Related

LPAD - Reading Values From One Table And Inserting Into Another

Apr 20, 2012

LPAD not behaving as expected. the main thing I'm trying to accomplish here is reading values from one table, and inserting them into another... but in the "other" table, they need to be inserted as 11 characters long, with leading zeros. in it's most basic form, this is the cursor I'm using:

CODEDECLARE
CURSOR update_mpi_cur IS
    select distinct A.epn_nbr, A.mrn_nbr, B.mpi_nbr
      from table1 A, table2 B
     where B.external_id = A.epn_nbr and B.identifier_type = 'EPN';
[code]....

should have mentioned that this is Oracle 10.2.0.3, on HPUX. not sure if that matters for this issue or not, but wanted to throw that out there.

View 2 Replies View Related

Reading Specific Line In Util File

Jul 1, 2013

I would like to read specific line in the file in the util file.

View 1 Replies View Related

Server Utilities :: Reading From Oracle Dump

Jun 14, 2006

Is there is any way of reading from oracle dump file?

View 16 Replies View Related

Performance Tuning :: Loading And Reading At Same Time

Feb 13, 2013

For example, we have a table ACCOUNT (snowflake dimension containing other dimension keys) and I have many fact tables based on this dimension. Normally data warehouse load happens like first dimensions needs to be loaded and then facts. Our frequency of loads is 30 mins.

To increase the rate in which the data will be available in the facts (as its a financial application), am considering to have two batches one with dimension and another one with fact (came to this conclusion as there is no dependency like first dimensions to be loaded then only fact) just the update might get missed sometimes. But if I do that, when dimension gets loaded, it will be read in the facts in another session. Will this affect the performance ?

LOADING (insert/update) and selecting data from table at the same time. Will it affect the performance in any way.

View 1 Replies View Related

SQL & PL/SQL :: Mail Reading / Saving Through Package Or Procedure

Nov 14, 2011

sample code to read attachments in inbox(from POP3 mail server) using plsql package or procedure.

View 6 Replies View Related

SQL & PL/SQL :: Reading Oracle Statements From A Procedure / Function?

Sep 15, 2010

I want to read the oracle procedure/function and find out the no of valid sql statment lines in a procedure:--

Consider the procedure is like :--

PROCEDURE TESTVAR IS
l_local number;
i integer;
j integer;
BEGIN
SELECT real_id_number

[code]....

Now i want to read this procedure in such a way that it should return me below output :-

Seq_No Sql_Statements

1 SELECT real_id_number
2 into l_local
3 FROM master_var v
4 where v.variable_type = i
5 AND V.ID_NUMBER = j ;

how to achieve this output.

View 5 Replies View Related

JDeveloper, Java & XML :: Procedure For Reading Xml Element Value

May 25, 2011

In my pl/sql procedure I'm calling a webservice and it is returning me a varchar2 which contains xml tags.I want to pull values for each element. any one can provide me procedure/function to pull data from it.Below is the output from webservice.

<ResponseEnvelope xmlns:xsd="URL....xmlns="URL....> <ResponseHeader xmlns="URL......
[code]....

ResponseId, MessageVersion etc are element name. the value between element names are to be retrived.

View 13 Replies View Related







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