SQL & PL/SQL :: Read CLOB And Use In SQL Query?
Jun 11, 2013
I have a small doubt on CLOB reading and not able to do it in the query because it has very large strings in it.
create table TEST
(
col1 VARCHAR2(100),
col2 VARCHAR2(100),
col3 VARCHAR2(100),
col4 DATE,
col5 CLOB,
col6 BLOB,
[code]....
This data I am inserting from front end into test table via XML but here i just giving insert statement.Now , I have below query to insert the data into different table:
This query is working for col3 ='2' as its small string but for col3 ='1' its not working and giving character string buffer too small.
with indata as
(select 1 sn, (select dbms_lob.substr(col5) from test where col3 = '1') x
from dual
union all
select 2, null x from dual),
t1 as
[code]....
View 19 Replies
ADVERTISEMENT
Dec 19, 2012
I have two tables File_Master and File_Detail
File_Master Primary key FILE_ID
File_Detail Primary key FILE_ID,LINE_ID
I have a CLOB column FILE_CONTENT in table File_Master. For every FILE_ID record in File_Master, several hundreds of lines are stored in the CLOB column.
I want to read this CLOB column 'File_Content' and and break every line (1000 Characters)
piecewise to populate columns of File_Detail.
Since there will be thousands of lines to process, what would be the best approach in writing PL/SQL code for better performance?
View 1 Replies
View Related
Sep 19, 2010
I am having a Select query(below Query1) and I want to use one column(sum(col4)) from this Select query to be displayed in another Select query(Query 2). how to display this.
Query 1 :-
select a.col1,a.col2,b.col3,sum(b.col4)
from tab a, tab b
where a.key1=b.key1 and a.key2=b.key2
group by a.col1,a.col2,b.col3
Query 2 :-
select a.col1,a.col2,b.col3,sum(b.col6)
from tab a, tab b
where a.key1=b.key1 and a.key2=b.key2
group by a.col1,a.col2,b.col3,b.col5
View 4 Replies
View Related
Jun 13, 2010
I need to display the parameter and status of DB for listener and Read Only.
I know those value could be get from command line , but could we get the values of Listener and Read only by SQL/PlSQL? So I can get it through the query of DB.
View 8 Replies
View Related
Aug 15, 2013
I have a table that contains a CLOB column with pseudo-XML in it. I want to keep this data in an XMLType column so that I can leverage some of Oracle's built-in XML features to parse it more easily.
The source table is defined as: CREATE TABLE "TSS_SRM_CBEBRE_LOGS_V" ( "INCIDENT_ID" NUMBER, "EVENT_TYPE" VARCHAR2(100 BYTE) NOT NULL ENABLE, "EVENT_KEY" VARCHAR2(100 BYTE), "CREATION_DATE" TIMESTAMP (6) NOT NULL ENABLE, "CREATED_BY" VARCHAR2(100 BYTE) NOT NULL ENABLE, "LOG_MSG" CLOB);
The target (for testing this problem) table is defined as: CREATE TABLE "TESTME" ( "LOG_MSG" "XMLTYPE") My query is: insert /*+ APPEND */ into testme ("LOG_MSG")select XMLTYPE.createXML("LOG_MSG") as LOG_MSG from "TSS_SRM_CBEBRE_LOGS_V" b; In SQL*Developer, my error is: Error report:SQL Error: No more data to read from socket In SQL*PLUS and Toad, my error is: ORA-03113: end-of-file on communication channelProcess ID: 13903Session ID: 414 Serial number: 32739
View 6 Replies
View Related
Apr 7, 2011
Following query is hanging either with 'Sequential access read' or 'Latch Free' wait event Important thing is the table which is self joined in subquery here does not have any index at all While it was hanged I tried to get trace of it and terminated twice. As such haven't got 'row source generataion' The table has only 120000 records and it shall update 34000 records
UPDATE invoice_header inv
SET inv.modified_due_date =
(SELECT inv1.btn_due_date
FROM invoice_header inv1
WHERE inv.dct_code = inv1.dct_code AND inv1.release = 'A5')
[code]...
During 'sequential read' using p1,p2 values tried to get what the session is reading and found that it is using the table itself.
During lath free I found following
SELECT name, 'Child '||child#, gets, misses, sleeps
FROM v$latch_children
WHERE addr= (select p1raw from v$session_wait where sid=18)
UNION
[code]...
However instead of self join when I creaed global temporary table as
create global temporary table t as select * from invoice_header where release='A5'
And used it in the update as
UPDATE invoice_header inv
SET inv.modified_due_date =
(SELECT t.btn_due_date
FROM t
WHERE inv.dct_code = t.dct_code AND t.release = 'A5')
WHERE inv.release = 'A5' AND inv.btn_due_date >= TRUNC (SYSDATE)
It updated the records in a second!!
Questions are
1) why it is producing 'sequential read' wait event when there is no index access or else why it is doing single block access when FTS is required?
2) Why is the 'latch free' wait event here and what it indicates here with 'cache buffer handles'?
Is it because we are reading and updating the same segment?
know in case DDL of table is required. It has all nullable columns and no index at all. Since it is 9i I am unable to use MERGE effectively in this case
View 14 Replies
View Related
Dec 27, 2010
my question is how to read ocr in oracle rac?
View 2 Replies
View Related
Jun 2, 2011
how to create script/steps that makes database read only to a particular user
View 2 Replies
View Related
Feb 12, 2012
i, I've Two database one for primary(GISC) and one for standby (GISCST) when i start open standby database i appeare erro :
ORA-16004: backup database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\ORCLSB\SYSTEM01.DBF'
I take the copy the datafiles from primary database and Pase them to the Standby database and the Enviroment of two database is :
SPfile for primary(GISC) IS:
*.compatible='10.2.0.3'
*.control_files='C:\oracle\product\10.2.0\oradata\gisc\CONTROL01.CTL','C:\oracle\product\10.2.0\oradata\gisc\CONTROL02.CTL','C:\oracle\product\10.2.0\oradata\gisc\CONTROL03.CTL'
*.db_block_size=8192
[code]....
View 1 Replies
View Related
Jun 3, 2013
What privilege needs to give the user for ready only access for OEM for limited instances not all instances.
Purpose: our application dba team just want monitor the specific databases that why they asked to create read only access account for OEM for limited databases.
View 2 Replies
View Related
Mar 5, 2011
I am often supplied with a list of numbers to query against & normally take the easy option of editing the file & placing the select on each line. Like so. what to do to loop this. The input file would just be the numbers in a flat file.
Select status from thetable where MPN=�01234567890�;
Select status from thetable where MPN=�12345678901�;
Select status from thetable where MPN=�23456789012�;
Select status from thetable where MPN=�34567890123�;
View 4 Replies
View Related
Jan 30, 2013
I know how to use cursors to read all the records in a table.
But how can records that should be processed together be read in a loop, using cursors?
If there were, for instance persons from different nationalities, French, German, English, ..., I woluld like to read the first unknown number of persons from France and process that data, and then continue with the unknown number of germans and process that, and so on.
View 34 Replies
View Related
Dec 16, 2011
I Want Read Image Through URL..Image Is Placed In Another Server Which Is Not in Local Network.
View 1 Replies
View Related
Apr 25, 2012
row can be marked as read only in Oracle database
View 7 Replies
View Related
Oct 4, 2011
I need to select all records from table tmp_mape where value <loyaltyDebit id="5554431"> from xml_params is for example 5554431.
create table tmp_mape
(xml_params clob)
Example of xml
insert into tmp_mape values (
'<prolongationData mode="normal" exceptionCaseID="" xmlns="URL....
<customer status="active" xmlns:ns2="URL.....mobile.sk/client/twizard/communication/orderentry" xmlns:tns="URL....
<customerReferences>
<reference name="customerID" platform="bscs">2319375</reference>
<reference name="externID" platform="other">BSCS-PRD-CUSTOMER-2319375</reference>
<reference name="siteID" platform="clarify">S-061009-1893787</reference>
[code].....
View 1 Replies
View Related
Dec 9, 2010
I am writing a PL/SQL code where in I would like to store the result set into a variable and then loop through it.I am using the following code and when I execute this peace of code it is giving me an error saying cannot able to read from the socket.
set serveroutput on
Declare
Type Start_End_Dates is Object(Start_Date Date,End_Date Date);
Type Start_End_Dates_Array is Table Of Start_End_Dates;
Dates Start_End_Dates_Array;
Begin
[code]....
View 4 Replies
View Related
May 1, 2013
I select the data from sql server column type nvarchar2 and load into varchar2 but data once loaded looks very different and can't be read.
let say name column in sqlser values is 'Rajesh' then in oracle it looks like series of square shape.
View 1 Replies
View Related
Sep 17, 2013
I have a requirement to load the csv into DB using oracle forms or pl/sql code, but the problem is they are asking to load the csv file which will not come in sequence every time.For Example: File1:col1 col2 col3 col4 file 2col3 col2 col4 col1 file 3col4 col2 col1 col3 Depending on the header we need to load the file,Can we load like this or not?
View 12 Replies
View Related
Mar 18, 2010
How can i read an HTML file from PLSQL.
View 12 Replies
View Related
Dec 9, 2012
When I am executing a query in Oracle Database version 11.2.0.1,I get an error as No more data to read from socket.In my sql query I had given all the joins as left outer join ,but when I comment two outer joins the result will be showing.
My SQL is :
select o.GENERAL_LEDGER as GROUP_NAME,
o.ACCNT_TYPE_CD AS GROUP_TYPE,
o.CUST_STAT_CD AS GROUP_STATUS,
pr1.START_DT AS EFFECTIVE_DATE,
[Code]...
when I comment last 2 outer join lines then the result will shows.
how can we resolve this error?
View 1 Replies
View Related
Jan 8, 2013
Oracle Version 11.2.0.1
Windows
There are some tables in a schema. How can I make some rows as a read only i.e. no user can make either any update nor delete them. After searching in google, I found that trigger is one way, but since this way can be manipulated by dropping or renaming the trigger, so I am looking non-trigger way to achieve this problem. Making tablespace read only affects other users. I am not looking whole table as a read only, just couple of rows should be locked (no DML allowed) for specific time period and I after specific time/date this restriction should auto disable or on user call i.e. something like row's block level locking..
View 17 Replies
View Related
Oct 12, 2012
Below is the request i have received from a user -
" Can you setup user <usernmae> in <database>S to have read only access to <applicationname> (CHADBA, CHAS, EMI and SVCM schemas)"
Steps I have followed -
create user <usernmae> identified by password default tablespace USERS temporary tablespace TEMPL;
Grant PRODUCEBILL to <username>;
Grant REPORTING to <username>;
Grant PAYMENT to <username>;
Grant CONNECT to <username>;
My question is as user has request for read only access to specific schemas, so how do I validate them?
View 11 Replies
View Related
Sep 28, 2011
I'm writing a PHP page to display some data from an Oracle database. Unfortunately, I can't copy the code because it's proprietary. One of the columns in the db is of type CLOB. I'm having trouble getting the data from the CLOB column.
The way the code is now, is there is a query string read into a variable, and the query string variable is read into a function that then retrieves the data from the db. Once the result set is returned, it is parsed to get data from all of the columns. The issue is that I've never worked with CLOB data before, so I'm having some difficulty extracting the data for that column. I know I can use the DBMS_LOB.READ function, but I'm not sure how to apply it in this case. The following is a generic form of the query string I'm using with b.clob_col being the column I'm having issues with.
$queryString = <<<EOD
SELECT a.col1,
a.col2,
a.col3,
b.col4,
b.col5,
b.clob_col,
from table1 b
inner join b.col4
on blah1
inner join a.col2
on blah2
where blah
and blah
EOD;
View 1 Replies
View Related
Nov 9, 2011
create table top_uid(oldUID number,newUID number);
select * from top_uid;
OLDUID NEWUID
---------------------- ----------------------
1 1001
2 1002
3 1003
4 1004
create table topdUIDXML (uidinfo clob);
insert into topdUIDXML select '<filter name="test" topologyUID="1">' from dual;
insert into topdUIDXML select '<filter name="test2" topologyUID="2">' from dual;
insert into topdUIDXML select '<filter name="ftest" topologyUID="3">' from dual;
insert into topdUIDXML select '<filter name="qtest" topologyUID="4">' from dual;
select * from topdUIDXML
UIDINFO
---------------------------------------
<filter name="test" topologyUID="1">
<filter name="test" topologyUID="2">
<filter name="test" topologyUID="3">
<filter name="test" topologyUID="4">
the topdUIDXML table will contain the oldUID's in the clob XML. need to update the topologyUID in that topdUIDXML with the newUID from the top_uid.
View 5 Replies
View Related
Nov 13, 2012
I the table VOYAGERS with the following data.
ID is of type number and DETAILS is of type CLOB.
ID DETAILS
--- --------
100 The ship has left san diego http:/localhost/icons/sandiego.png to okinawa on nov 10, 2011.
I need to update the record(id = 100) by replacing the url "http:/localhost/icons/sandiego.png" with "http:/localhost/icons/okinawa.png".
I need a procedure where I will pass the ID value, replace string(i.e http:/localhost/icons/sandiego.png) and replace with string (ie. http:/localhost/icons/okinawa.png).
View 2 Replies
View Related
Nov 30, 2011
How can I insert xml to clob ? I'm taking from database clob making it in xml type and when I want to insert xml type into clob field it calls and error:
Error(316,43): PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got -
View 9 Replies
View Related
Mar 23, 2010
in our application we are using clob column instead of varchar2 because varchar2 does not allow more that 4000 chars, so Using clob allows to put data of any length, will it cause performance issues ? we have this column in almost in all tables .
View 2 Replies
View Related
Oct 18, 2011
I have to generate a big xml. Each part of the xml needs data from different tables. So I have created two clob to hold the portion of the big xml. How can i have the concatenated clob values as an argument for xml element.
View 1 Replies
View Related
Apr 21, 2011
Ok, CLOB columns are such a hassle.
I have a variable in my script: v_field1 VARCHAR2(32000);
This is part of a cursor record:
v_mf_table IS TABLE OF mf_detail%ROWTYPE INDEX BY BINARY_INTEGER;
v_mf_record v_mf_table;
I use a FORALL to insert the data into a table:
FORALL x IN v_mf_record.FIRST .. v_mf_record.COUNT
INSERT INTO monthly_mf_snapshot VALUES v_mf_record(x);
BUT! v_field1 is > 4000 characters. Does this trash my changes of using FORALL? Do I need to deal with 4k chunks in an UPDATE instead?
View 30 Replies
View Related
Apr 26, 2013
I have table like-
CREATE TABLE C2X_TEST(NAME VARCHAR2(100),XML_CLOB CLOB,XML_XML XMLType);
here in XML_CLOB column xml files are stored.
Now i want to update XML_XML column with corresponding XML_CLOB value .
View 8 Replies
View Related