PL/SQL :: ORA-03113 When Inserting CLOB Value Casted As XML From SELECT Query Into Table?

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


ADVERTISEMENT

SQL & PL/SQL :: Inserting Multiple Records With CLOB Using Select

Oct 11, 2013

I'm updating a large piece of legacy code that does the following type of insert:

INSERT INTO foo_temp
(id, varchar2_column)
SELECT id, varchar2_column
FROM foo;

We're changing varchar2_column to clob_column to accommodate text entries > 4000 characters. So I want to change the insert statement to something like:

INSERT INTO foo_temp
(id, clob_column)
SELECT id, clob_column
FROM foo;

This doesn't work, since clob_column stores the location of each text entry, rather than the actual content. But is there some way that I can achieve the insert with one call to a select statement, or do I need to select each individual record in foo, open the clob_column value, read it into a local variable and then write the content to the matching record in foo_temp?

View 2 Replies View Related

SELECT With JOIN In Oracle Error ORA-03113?

Aug 23, 2011

When executing a SELECT with JOIN in oracle error as I am having the title. If I change the JOIN to where the procedure works normally. When installing my application, it works normally for a day or two, then it only shows the end of communication error. What I do is select the following:

SELECT /*+ FIRST_ROWS(10) */ TM1.EsqCodigo, TM1.EsqDescricao, TM1.EsqTipo, TM1.EsqConector, T2.ACnDes, TM1.EsqStatus, TM1.EsqVersaoNfeRecepcao, TM1.EsqVersaoArqNfeRecepcao, TM1.EsqVersaoArqNfe, TM1.EsqVersaoProcNfe, TM1.EsqVersaoNfeRetRecepcao, TM1.EsqVersaoArqNfeRetRecepcao, TM1.EsqVersaoNfeCancelamento, TM1.EsqVersaoArqNfeCancelamento, TM1.EsqVersaoNfeInutilizacao,

[code]...

View 2 Replies View Related

SQL & PL/SQL :: Inserting Result Set Of Query Into Another Table

Jul 24, 2012

CREATE TABLE tbl_emp
(
name VARCHAR2(20),
price NUMBER,

[Code]...

NAME PRICE DATAENTRD ROWRANK

aaa 9999 24.07.2012 05:56:00 1

aaa 10000 24.07.2012 05:55:58 2

I want to insert this result into another table, how can I do it??

Quote:TABLE

CREATE TABLE tbl_emp_result_set
(
name VARCHAR2(20),
price NUMBER,
dataEntrd date,
rowrank number
)

View 8 Replies View Related

PL/SQL :: Inserting PDF File Into Clob?

Oct 11, 2012

I tried inserting PDF file into a CLOB column , in the below example l_bfile is a bfile datatype. and I'm inserting l_bfile to CLOB column.

l_bfile := bfilename('C: est', 'test.pdf');

But It is throwing below error:

ORA-06550: line 9, column 42:
PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got FILE
ORA-06550: line 9, column 1:
PL/SQL: SQL Statement ignored

View 2 Replies View Related

SQL & PL/SQL :: Inserting Data From Clob To Varchar2?

Aug 21, 2006

I have to Insert data from one table to another table. First table contains some clob datatype columns and second table have carchar2 datatype.

Below are the structures of both tables;

SQL> DESC TBL_MAINSQL> DESC TBL_MAIN2
Name Type Name Type
----------------------------- ----------------------------------------- --------------
TXT_FEIN_NUMBER VARCHAR2(9) TXT_FEIN_NUMBER VARCHAR2(9)
TXT_QUOTE_NUMBER VARCHAR2(12)TXT_QUOTE_NUMBER VARCHAR2(12)
TXT_POLICY_NUMBER VARCHAR2(12)TXT_POLICY_NUMBER VARCHAR2(12)
TXT_AGENT_CODE VARCHAR2(10)TXT_AGENT_CODE VARCHAR2(10)

[code]....

The Table contains 5000 records. how to convert CLOB to VARCHAR2.

I used DBMS_LOB.SUBSTR but I received BUFFER TO SMALL ERROR.

View 10 Replies View Related

SQL & PL/SQL :: Inserting Result Set Of Query Into Corresponding SQL Table Type Variable?

Aug 28, 2012

I am unable to insert the result set of query into corresponding SQL Table type variable where as same functionality can be accomplished by PL/SQL table type variable. Can't we access the same by using SQL type variable?

Ex:

Step 1:

SQL Object type , Table type Objects creation :
drop type sql_emp_tab_type ;
drop type sql_emp_type ;
create or replace type sql_emp_type as object
(
empno number,
ename varchar2(20),

[code]...

Step 2: Accessing the table type object from PL/SQL block

SQL>
SQL> declare
2
3 tab_type_var sql_emp_tab_type := sql_emp_tab_type();
4
5 begin
6
7 tab_type_var.extend(10);

[code]...

Step 3: Instead of SQL Table type , if we define the corresponding PL/SQL table type variable

SQL> declare
2
3 --tab_type_var sql_emp_tab_type := sql_emp_tab_type();
4
5 type pl_sql_emp_type is record
6 (
7 empno number,

[code]...

View 3 Replies View Related

SQL & PL/SQL :: Stop Inserting Data Into A Table Before It Inserting Using Trigger?

Jul 26, 2011

shall we stop inserting data into a table before it inserting using Trigger?

View 3 Replies View Related

PL/SQL :: Select Query On Emp Table

Jun 7, 2012

How to find display the o/p like manager name under dependent employess same like parent child relation ship on noraml emp table:

sample o/p:

name job
xx manger
yy sales
yy1 sales
aa manager
rr marketing
rr1 marketing

View 6 Replies View Related

Create Table From Select Query?

Sep 13, 2004

Can we create a table from a Select query ?

View 5 Replies View Related

SQL & PL/SQL :: Insert Into Table A With Select Query On B And C?

Mar 22, 2013

I have a table A on dev with definition as TAble A(address,name) and the same table on Prod is defined as Table A(name,address).

my question is Ihave one package in that am trying to insert into this table as follows:

INSERT INTO A
SELECT b.name name,
a.address address,

[Code]....

so the query works on Prod but fails on Dev because column order is different.

I have 2 solutions:

1. I can mention column names in insert line and modify the query but tomorro some body changes again the definition of table A I need to change the query, so do I have solution in oracle sql that can handle the column order without specifying the column names in insert line.

so tomorrow On prod column order and on Dev column order is different though my sql should successfully execute.

View 5 Replies View Related

SQL & PL/SQL :: Select * From One Table But Not All Tables In A Query

Oct 30, 2013

How does one select * from one table without selecting * from other tables that are included in a query? For example, if in the query below I want to view all fields in some_table, but not the fields from other_table, how do it?

select *
from some_table st,
other_table ot
where st.id = ot.id

View 15 Replies View Related

How To Give Table Name Dynamically In A Select Query

Aug 23, 2012

I have 12 different tables

Record_jan
Record_feb
.
.
.
Record_nov
Record_dec

Based on the month i need to do some i/o operations from these table.

For eg: If it is january then Record_jan table should be accesed or for nov Record_nov table should be accesed.

If I try to store the table name in some variable and then give the variable name in place of table name then it gives error.

var:=Record_month;
Select * from var;

this gives error.

View 3 Replies View Related

Select Query With Four Table Its Generating Around 650 Rows?

Feb 20, 2013

i have a select query with four table its generating around 650 rows. and i need to update these 650 rows only.

for example

update ps_po_lining b
set y.recv_req = 'N'
where recv_req in

[Code]....

this query runs but its updating 6000 rows. which is not right. we need to update what ever the select query is retrieving.

View 5 Replies View Related

PL/SQL :: Hierarchical Query To Select Data From One Table?

Sep 7, 2012

Here is my case,

create table t (id number,row_id number primary key ,value number);ID   row_id value
1     1     10
1     2     11
1     3     1
2     4     11
3     5     11
3     6     12
4     7     12
4     8     12
4     9     13
4     10     11
4     11     10Requirement is

1) To get all the ID that have the value 10

2) The row_ids for the ID I got in I

Can I do this with Hierarchical query. If not which one of below will be fast?

select * from t where id  in (select id from t where value=10);

or

select T2.* from t T1, t T2 where T1.ID=t2.id and T1.VALUE=10;

I have billion of rows so I am looking for either Hierarchical query to solve it or some other way . All the three column the index.

View 5 Replies View Related

SQL & PL/SQL :: How To View Rows In Table Format Using Select Query

May 28, 2012

I need to view the rows of the result of a select query in table format in GUI application.I have used XMLELEMENT to somewhat match the scenario to display as ','(comma) separate values as b belwo

SELECT RTRIM (XMLAGG (XMLELEMENT (e, EMPNO || ',')).EXTRACT ('//text()'),
',')
AS empid,
RTRIM (XMLAGG (XMLELEMENT (e, ENAME || ',')).EXTRACT ('//text()'),

[code]...

But the case is I need to display the value in table format Horizontally as below

EMPIDemployee nameDEPID
778
278CLARK10
397MILLER
934KING

[code]...

View 14 Replies View Related

SQL & PL/SQL :: Insert Records From A Select Query Into Temporary Table?

Mar 21, 2013

We are trying insert records from a select query into temporary table, some of the records is missing in the temporary table. The select statement is having multiple joins and union all which it little complex query. In simple terms the script contains 2 part 1st Part Insert in to temporary table 2nd part Select query with multiple joins, inline sub queries, unions and group by classes and conditions Eg. If we execute select statement alone it returns some count for example => 60000 After inserting into the temp table, in temp table the count is around 42000 why is the difference?

It is simple bulk inserts... insert in to temp table select * from xxx. also, there is no commit in between. The problem is all the records populated by the select statement are not inserted in to temp table. some records are not inserted.

Also, we had some other observation. It only happens in its 2nd execution and not its first run. Hope there might be some cache problem Even, we also did not believe that. We are wondering. In TOAD, we tested however at times it happens. In application jar file, after "insert in to temp select * from xxx" we take the i. record count of temp table and ii. record count of "select * from xxx" separately but both doesn't match. Match only at 1st time.

View 16 Replies View Related

SQL & PL/SQL :: Insert As Select With Clob Field

Oct 15, 2013

Oracle 11.2.0.3 on Linux.

I need to execute this insert as select:
INSERT INTO TAB1 (SQL_ID,SQL_FULLTEXT)
SELECT DISTINCT t.sql_id, t.sql_text FROM DBA_HIST_SQLTEXT;

But I get this error:
ORA-00932: inconsistent datatypes: expected - got clob

This is TAB1:

SQL_ID VARCHAR2(13)
SQL_FULLTEXT CLOB Y
SQL_CUSTOM_HASH VARCHAR2(60) Y

Should I user dbms_lob package? Is so, I do not understand how.

View 2 Replies View Related

SQL & PL/SQL :: How To Extract Full Text From Clob Where Having Distinct Select

May 23, 2013

I am only able to extract only 4000 characters from the clob column "DESCRIPTION".how to get more characters or max for that column with the same query concept?

select distinct
o.id "Organization ID",
en.entity_id "Contact ID",
en.entity_cd "Note Entity Code",
ed.entity_name "Note Entity",
en.entity_id "Note Entity_id",

[code]....

View 28 Replies View Related

JDeveloper, Java & XML :: Select Entire Message From CLOB - ORA-22806

Jun 20, 2013

I have a "simple" query that needs to extract all of the XML messages stored in a CLOB column in a table for a data deidentification project. This query

select c.cc_data_area.getClobVal() as cc_xml
from ci_cc c;

This query returns an ORA-22806: not an object or REF

cc_data_area is the clob column, and contains messages longer than 4000 characters.

View 1 Replies View Related

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 View Related

SQL & PL/SQL :: Inserting Data In Target Table From Source Table

Nov 22, 2012

I need to insert data in Table A from Table B where most of the fields are identical and might some of the fields will be more in Table A.

ex: Table A: a,b,c,d,e,f
Table B: a.b,c,g,h

How to insert this using user_tab_columns in cursor and if I am giving the i/P as my table names . This needs to be configurable and reusable rather i mention all the fields in my logic.

View 4 Replies View Related

SQL & PL/SQL :: How To Select All Columns From Table Except Those Columns Which Type In Query

Jan 21, 2011

I have a two question.

Question 1:How to select all columns from table except those columns which i type in query

Question 2:How to select all columns from table where all columns are not null without type each column name which is in empty data

View 5 Replies View Related

Storing Select Query Result Into Array And Using It In Another Query?

Aug 7, 2009

I am looking to simplify the below query,

DELETE FROM A WHERE A1 IN (SELECT ID FROM B WHERE BID=0) OR A2 IN (SELECT ID FROM B WHERE BID=0)

Since both the inner queries are same,I want to extract out to a local variable and then use it.

Say,

Array var = SELECT ID FROM B WHERE BID=0;

And then ,

DELETE FROM A WHERE A1 IN (var) OR A2 IN (var)

How to do this using SQLPLUS?

View 8 Replies View Related

Inserting Dates Into Table

Mar 10, 2012

My homework requires me to create a booking table for a hotel and I have created the table but I'm having trouble inserting the dates.

This is my table:

DROP TABLE BookingDM CASCADE CONSTRAINTS PURGE;
CREATE TABLE BookingDM (
hNo NUMBER(3),
gNo NUMBER(5),
dFrom DATE NOT NULL,
[code]......

This is the first set I'm attempting to insert
hNo = 148
gNo = 11169
dFrom = 09/03/2009
dTo = 09/10/2009
rNo = 202

This is my attempt to insert the set:

SQL> INSERT INTO BookingDM VALUES('148', '11169', '09/03/2009', '09/10/2009', '202');
INSERT INTO BookingDM VALUES('148', '11169', '09/03/2009', '09/10/2009', '202')
*
ERROR at line 1:
ORA-01843: not a valid month

I need my dates to be in the format "MM/DD/YYYY".

View 4 Replies View Related

Inserting Cursor Into A Table

Aug 27, 2010

i am trying to fetch the cursor returned from a stored procedure and insert into a physical table. but i am unable to populate the table. below is how my code looks.

declare
p_out sysadm.CGF_PKG_REFCUR.rcDataCursor;
a table1.node%TYPE;
b table1.acct%TYPE;
c table1.descr%TYPE;
[code]......

In the above, stored_proc is the stored procedure from OLAP database. Above code i am executing is from EPM database.

p_out returns a result set of (select a,b,c from table2).

I am trying to get the result set from OLAP database and populate a table in the EPM database.

View 3 Replies View Related

SQL & PL/SQL :: Inserting Data From One Table To Another?

Oct 23, 2010

I have two tables with two columns of each table in my Oracle Version :Oracle 9.2.0.1.0

TEST22:
-----------
|sno |sname |
-----------
| | |
-----------

TEST22P:
---------------
| col1 | col2 |
|---------------|
| sno | 1 |
| sname | arun|
---------------

Required outcome is

TEST22:
----------
|no | name |
|----------|
|1 |arun |
----------

Also this should be applicable for more than one value in the column col2 of table TEST22P.

ex:-
TEST22P:
--------------------
|col1 | col2 |
|--------------------|
|sno | 1,2..n |
|sname | arun,ajay..n|
--------------------

I used decode & pivot insert for this,but the result is a failure.

SQL>INSERT INTO test22 (no,name) SELECT DECODE(col1,'n',col2),DECODE(col1,'name',col2) FROM test22p;

SQL>
sno sname
--------
1 null
null arun

AND

SQL> INSERT ALL
2 INTO test22 VALUES(no)
3 INTO test22 VALUES(name)
4 SELECT DECODE(col1,'n',col2),DECODE(col1,'name',col2) FROM test22p;
INTO test22 VALUES(name)
*
ERROR at line 3:
ORA-00904: "NAME": invalid identifier

View 4 Replies View Related

Inserting Into Table Values

Oct 6, 2012

I need to insert rows in a table all the columns are have same value except one column i.e.

insert into table values( 'a','b','b','b');
insert into table values( 'b','b','b','b');
insert into table values( 'c','b','b','b');

is there any short cut to insert because there are thousands of records to be inserted.

View 3 Replies View Related

Inserting Table Data Into A Variable

Sep 3, 2012

I am trying to insert a column into a variable from a trigger.

Here is the code that i have:

CREATE OR REPLACE TRIGGER BUYER_after_update AFTER UPDATE ON buyer
FOR EACH ROW
DECLARE
v_key varchar2(10);
BEGIN
select ID into v_key from buyer;
insert into message_log_table (table_name, message_comments)
values
('Buyer', 'Buyer '||v_key||' has been updated');
end;
/

When I run the above I get the following compiler error:

[Error] ORA-00904 (6: 12): PL/SQL: ORA-00904: "ID": invalid identifier

Since ID is defined in my BUYER table I do not understand what the error means.

Here is my create table statement:

CREATE TABLE BUYER
(
ID VARCHAR(50) NOT NULL PRIMARY KEY,
FNAME VARCHAR(50) NOT NULL,
LNAME VARCHAR(50) NOT NULL,
ADDRESS VARCHAR(50) NOT NULL,
CITY VARCHAR(50) NOT NULL,
STATE VARCHAR(2) NOT NULL,
ZIP_CODE NUMBER(5) NOT NULL
);

View 1 Replies View Related

SQL & PL/SQL :: Inserting Bulk Records To The Table?

Jun 14, 2013

I want to insert bulk records to the table. I want to insert date rows for next 50 years in table ( from year 2001 to year 2050). I have following columns in my table :

YYYYMMDD MM/DD/YYYY Day of the week ( Monday, Tuesday etc) JulianDate

View 5 Replies View Related







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