[11g] ORA-31061/ORA-19202 - how to insert data xmltype table/validation of the schema (just well formed)
Hello
Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE Production 11.2.0.3.0
AMT for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Here's the demo program:
==============================
create a global temporary table GTT_Test(data xmltype) validation delete rows;
- and run this
declare
v_data xmltype.
Start
-It does not work
/*
v_data: = xmltype ("< itf:meta > < node / > < / itf:meta > '");
*/
- but it works
v_data: = xmltype)
XMLDATA = > ' < my: meta > < node / > < / my: meta > ',
schema = > null,
validated = > 0,
correct = > 1);
- but try to insert into the table in the same way fails again:
insert into GTT_Test (data)
values (xmltype)
XMLDATA = > ' < my: meta > < node / > < / my: meta > ',
schema = > null,
validated = > 0,
correct = > 1));
end;
==============================
It translates errors ORA above and suspicion: "prefix 'my' is not declared".
I need to create the TWG somehow different to accept without diagram validation?
-Thanks!
Kind regards
Frank
Hello.
Try to declare to your XML namespace.
for example
"If you don't have a schema, try xmlns: my =" "(espace en blanc)."
Tags: Database
Similar Questions
-
How to insert data into tables using sql loops
Oracle 10.2 g
using Oracle sql * more
Table amounts is
nowcreate table student(id) as select distinct student_id from students_table;
Now create a sequencedesc student; will retrieve student ====== Name Null? Type =========================== ID VARCHAR2(10)
create sequence st_seq;
alter table student add column no;
This is the main partselect * from student no id ========= 234 298 ..........
There are 100 student in the table
now, I want to fill the table with sequences using seq.next_val
How to use a loop to insert 100 auto generated numbers in the table.
Thank you.
Expected result
Why I'm doing this instead ofSelect * from student no id ========= 1 234 2 298 .........
This will cause the duplication of the upncreate table student(no,id) as select st_se.nextval,student_id from students;
using separate throws an error.
Thank you.create table student(st_id,id) as select distinct st_seq.nextval,academicyear from student as select distinct st_seq.nextval,academicyear * ERROR at line 2: ORA-02287: sequence number not allowed here
Hello
As you discovered, you cannot use SELECT DISTINCT and sequence. NEXTVAL in the same query.
You can SELECT DISTINCT in a subquery, like this:
CREATE TABLE student AS WITH distinct_ids AS ( SELECT DISTINCT student_id AS id FROM students_table ) SELECT st_seq.NEXTVAL AS st_id , id FROM distinct_ids;
-
How to insert data in table form fields
Hai
My problem is
Consider this as an example
This is a table contains fields of teas
empcode empname, barcode, timein, timeout...
and I created a form and retrieve data from text file, that the fields are
barcode, bardate, bartime
so now, I need to write code to move my data in the table. Is that my form should be moved to this table if the table is empty, then we need to insert and if it is not null then update
I tried a logic and give me some solutions and measures to solve
declare
pin_no varchar2 (25);
pin_date varchar2 (25);
date of pin_time;
Start
Select * from dailyattend1 where emplcode =: bar code;
loop
If timein not null then
"Update dailyattend1 set = timein: bartime where emplcode = ': bar code."
else timein is null then
insert into dailyattend1 (timein) values(:bartime);
end if;
end loop;
commit_form();
What are the corrections to do tell me Pls...
Concerning
srikkanth. Msrikkanth,
Check your post previous order by clause
Kind regards
Manu.
-
How to insert data with &; table...
Hello
I want to insert following data to the table
SQL > insert into emp values ("company & co");
Enter the value for co:
How to avoid this?set define off sql>insert into emp values('company & co');
It will work
-
How to insert data into a BLOB column using sql
Hi all
How to insert data into the BLOB column directly using sql.
Thank youcreate table temp ( a blob, b clob); SQL> / Insert into temp values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ; * ERROR at line 1: ORA-01465: invalid hex number Please help in this.
Prakash PInsert into temporary values (UTL_RAW. CAST_TO_RAW ('32aasdasdsdasdasd4e32'), 'adsfbsdkjf');
-
How to insert data into the table by using the expression builder in the assign activity
How to insert data into the table by using the expression builder in affect business in BPEl, I use SOA Suite 11.1.1.5
Can someone help me pleaseHello
I don't think that oraext:query-database() can insert data into the table.
What are your needs?
Can not you plan to use the DB adapter with the insert operation?Kind regards
Neeraj Sehgal -
How can insert quary in database by using the collection.
Hi friends,
My friend advice me to insert several point with collection for the use of multiple lines. But I don't know how to use the collection. How do I create the form to insert data using the collection.
Please send me any link or example .au insert data into database by using the collection.
My problem is:-
I have a bill with several point for example. Grapes (25) with amount here and now I want to add these question with quantity in my database, Badam (145), banana (49), Apple (12)
When I finally click on submit button.
Actully I was used as a table but I am facing a problem when using tabular, tabular, I enter first item for example. Apple and there quantity for example. 12 in the textfield and after clicking on Add line enter Buttom went to the database. but I want that entry should not go the database. But only the new line should add when I click on the button Add a line.
I want all these point 4 should enter into the database when I click on Submit Final.
Maury
Published by: Ed on September 6, 2009 02:22Hello
I would do something like the code:
BEGIN DECLARE vDATE DATE; BEGIN vDATE := TO_DATE(:P1_DATE1,'DD.MM.YYYY'); WHILE vDATE <= TO_DATE(:P1_DATE2,'DD.MM.YYYY') LOOP INSERT INTO ABC (DTE, LEAVE) VALUES (vDATE, :P1_C); vDATE := vDATE + 1; END LOOP; END; END;
You must ensure that the datepicker points both use the ' JJ. MM YYYY ' date format.
Andy
-
How to recover data from table
I'm new to APEX 4.0, how to recover data from table
My table is CR_USERPROFILE... and I want to recover data to the following recommendations:
Select the title, user name, address, email, mobile, cr_userprofile where e-mail is APEX_CUSTOM_AUTH. GET_USERNAME
Text P110_EMAIL 10 field
20 P110_TITLE selection list
P110_USERNAME 30 text field
Text field P110_ADDRESS 40
P110_PHONE 50 text field
Text P110_MOBILE 60 field
could any body if you please help...
Thanks and greetings
LukeHello
1. create the process Page.
2. Select the Data Manipulation
3. in the category select "Automated line Fetch".
4 enter the process name, sequence, select "on the load - before the headers" to the point.
5. specify the owner, table, primary key and the key column primary (Item name contains the primary key).
6. create a process.
7. in each element, select "Column of the database" in "the Source Type.Kind regards
Patel Kartik
------------------------------------------------------------------------
http://patelkartik.blogspot.com/
http://Apex.Oracle.com/pls/Apex/f?p=9904351712:1 -
How to insert data with ' ' in the table
I have the following requirement
I gave you some example of table to understand the requirement
Although insert the foregoing statement looking for somewhat different, but according to my requirement, I need to do...SQL> create table ttt(a varchar2(55)); Table created. SQL> insert into ttt values('insert into aa values('abc')') insert into ttt values('insert into aa values('abc')') * ERROR at line 1: ORA-00917: missing comma
Please help me in this...
Thank you
Salihauhhhh.... cant you just substitute your name instead of | one and the same thing, SQL> insert into ttt values('hai ''jyothsna'' how are you'); 1 row inserted SQL> commit; Commit complete A ------------------------------------------------------- hai '|' jyothsna how are you hai 'jyothsna' how are you
-
How to insert Date and time in video
Hello
I wonder how to insert the Date and time in video files during their transfer to PC with my Handycam(DCR-SR82).
Thank you
Frank
The date and time does not appear during recording, however they are saved automatically by the display system during playback. The camcorder can not burn in the video, but once you have on your computer, third-party software can do for you.
-
How to insert a value of triggers in the table?
Mr President.
I have the following trigger
CREATE OR REPLACE TRIGGER lineitem_trg BEFORE UPDATE OF lineitem ON voucherdet FOR EACH ROW BEGIN :NEW.LINEITEM := TO_CHAR ( TO_NUMBER (:OLD.LINEITEM) + 1 , 'FM00' ); END lineitem_trg; /
Now to how to add this triggers a value in the table
The value of this trigger is part of the primary key with voucher_id which is obtained by the voucher_id_seq
This is my database as below
CREATE TABLE "NOM" ( "ACCT_ID" VARCHAR2(7) NOT NULL ENABLE, "ACCT_NAME" VARCHAR2(50) NOT NULL ENABLE, "O_BAL" NUMBER(13,2), "ITAX_ID" VARCHAR2(7), "SALES_TAX_NO" VARCHAR2(20), "PL_SUPPLIER" VARCHAR2(1) DEFAULT 'N', "STOCK_REPORT" VARCHAR2(1) DEFAULT 'N', "ACCT_TYPE" VARCHAR2(4), CONSTRAINT NOM_PK PRIMARY KEY ("ACCT_ID")ENABLE, CONSTRAINT NOM_ACCT_TYPE_FK FOREIGN KEY ("ACCT_TYPE") REFERENCES "ACCT_TYPE" ("ACCT_TYPE") ENABLE ); CREATE TABLE "VOUCHER" ( "VOUCHER_ID" VARCHAR2(8) NOT NULL ENABLE, "VOUCHER_DATE" DATE DEFAULT sysdate, "POST_DATE" DATE DEFAULT sysdate, "DEBIT" VARCHAR2(7), "CREDIT" VARCHAR2(7), "VOUCHER_SOURCE" VARCHAR2(2), CONSTRAINT VOUCHER_PK PRIMARY KEY ("VOUCHER_ID")ENABLE, CONSTRAINT VOUCHER_NOM_DEBIT_FK FOREIGN KEY ("DEBIT") REFERENCES "NOM" ("ACCT_ID") ENABLE, CONSTRAINT VOUCHER_NOM_CREDIT_FK FOREIGN KEY ("CREDIT") REFERENCES "NOM" ("ACCT_ID") ENABLE ); CREATE TABLE "VOUCHERDET" ( "VOUCHER_ID" VARCHAR2(8) NOT NULL ENABLE, "DEBIT" VARCHAR2(7) NOT NULL ENABLE, "CREDIT" VARCHAR2(7) NOT NULL ENABLE, "PARTICULARS" VARCHAR2(100), "AMOUNT" NUMBER(21,2), "LINEITEM" VARCHAR2(4) DEFAULT '01', "V_ID_ITAX" VARCHAR2(11), "V_ID_PAY" VARCHAR2(11), "CHALLAN_NO" VARCHAR2(10), CONSTRAINT VOUCHERDET_PK PRIMARY KEY ("VOUCHER_ID", "LINEITEM")ENABLE, CONSTRAINT VOUCHERDET_DEBIT_FK FOREIGN KEY ("DEBIT") REFERENCES "NOM" ("ACCT_ID") ENABLE, CONSTRAINT VOUCHERDET_CREDIT_FK FOREIGN KEY ("CREDIT") REFERENCES "NOM" ("ACCT_ID") ENABLE, CONSTRAINT VOUCHERDET_VOUCHER_FK FOREIGN KEY ("VOUCHER_ID") REFERENCES "VOUCHER" ("VOUCHER_ID") ON DELETE CASCADE ENABLE );
CREATE SEQUENCE VOUCHER_ID_SEQ INCREMENT BY 1 START WITH 1; begin execute immediate 'create or replace trigger VOUCHER_ID_TRG '||chr(10)|| ' before insert on "ALIZA"."VOUCHER" '||chr(10)|| ' for each row '||chr(10)|| 'begin '||chr(10)|| ' if inserting then '||chr(10)|| ' if :NEW."VOUCHER_ID" is null then '||chr(10)|| ' select VOUCHER_ID_SEQ.nextval into :NEW."VOUCHER_ID" from dual; '||chr(10)|| ' end if; '||chr(10)|| ' end if; '||chr(10)|| 'end;'||chr(10); end; /
Concerning
And I explained to you why it is false.
Go one read what I put above, and I gave an example of (with command and control elements) in the other thread.
If you want the user a composite key as the primary key by using the primary key of the voucher and something else, do this thing, just a sequence that is obtained from a sequence value (not gapless, but always unique). And then you always build your LINEITEM values for display based on this sequence for example
LPAD (to_char (ROW_NUMBER () over (partition by order VOUCHER_ID by LINEITEM)), 2, '0') as a CONTROL element
It's when you query the data to display it, is not to store it in the database. In the database, you simply store an internal sequence number in LINEITEM.
Do not try and store a sequence for your lineitem gapless. It is false.
-
I have two tables (2) RESULT TAB (1)
CREATE TABLE TAB
(
NUMBER OF SNO
A NUMBER,
B THE NUMBER.
NUMBER OF THE SUM
);
CREATE AN ARRAY OF RESULT
(
NUMBER OF SNO
NUMBER OF THE SUM
)
my doubt is:
(1) I want to insert a table TAB, my question is how to insert a column to the SUM using the column A AND B... Here im adding two values of the column and store result in the AMOUNT column.
SNO A B SUM
1 100 150 250
2 300 100 400
I want to like this, it is possible with single insert query?
(2) at the time of the insertion TAB of values that SNO, and the values of table TAB $ insert in the table of RESULTS... is it possible these two inserts at the same time?
in fact, im using another this table.fro TAB and easy to understand I write like that, please solve this problem
First, you post in the wrong forum as this one is only for Oracle's SQL developer tool. So you might ask your question in the general forum of SQL.
Second, you might solve your problems with bind variable:
Insert tab
(sno, a, b, sum)
values
(: SNO,: A: B: A + B :))
You should not use sum as column name because it is a reserved word.
More you cannot insert into two different tables with a single SQL, but you can use PL/SQL to do this:
Start
insert into tab values (: SNO,: A: B: A + B :);)
insert into result values (: SNO,: A + B :);)
end;
If you meet sno from a sequence, you could do something like this:
Start
insert into values tab (seq_sno.nextval,:,: B,: A +: B) return sno in: SNO.
insert into result values (: SNO,: A + B :);)
end;
Hope that helps,
dhalek
-
How to insert data in the XML file?
Hi guys,.
How to insert information into an XML file. I tell you, I have a CFM file with some questions to the user
When users submit this form within the form information is send in an XML file.
How can insert this information in the XML file?
When I don't have a DB?
Thank you
Kind regards
Fabiano Magno Pechibella
You must
- Read in the XML file
- Analyze the document in an XML (just one big struct) object
- Insert your XML code of the object where you need
- rewrite the XML file with your data now included
You can Google 'ColdFusion working with XML' and find hundreds of items to help you. Here's a beginning tutorial to help you get started:
-
How to insert data into the table of plain text stored as a CLOB in another table
Hi people,
Maybe it's an easy question for someone who is more frequently used files and CLOB.
I have a table that stores text files in the CLOB column. Files text includes some basic data that I want to load in the other - a text line = a new insert for me. Is there a "trick" how to do it effectively?
Here is my model:
Table OS_IMPORT_DOCS, stores the complete files as CLOB
Sample data from OS_IMPORT_DOCSSQL> desc OS_IMPORT_DOCS Name Type Nullable Default Comments ------------- -------------- -------- ------- -------- OBJECT_ID NUMBER DATUM_ZMENY DATE sysdate FILE_PATH VARCHAR2(4000) Y FILE_NAME VARCHAR2(4000) Y FILE_SIZE NUMBER Y LAST_MODIFIED DATE Y DOCUMENT CLOB Y STATUS VARCHAR2(15) Y 'NEW'
Example of file CLOB - stored text data (select d.document from os_import_docs d where d.object_id = 1815042 ;)SQL> select * 2 from os_import_docs d 3 order by d.last_modified desc 4 ; OBJECT_ID DATUM_ZMENY FILE_PATH FILE_NAME FILE_SIZE LAST_MODIFIED DOCUMENT STATUS ---------- ----------- ------------------------------ --------------- ---------- ------------- ----------- --------------- 1815043 13.8.2012 1 d:\data\C120813.DAT C120813.DAT 16800 13.8.2012 16: <<CLOB>> NEW 1815042 13.8.2012 1 d:\data\C120812.DAT C120812.DAT 3600 12.8.2012 22: <<CLOB>> NEW 1815041 13.8.2012 1 d:\data\C120811.DAT C120811.DAT 1800 11.8.2012 13: <<CLOB>> NEW
Above the example text includes "columns" in plain text:061053120820120000AGT000002Osoby 0000000042301000000017210632 062322120820120000AGT000002Osoby 0000000012301000000017197566 063526120820120001AGT000002Osoby 0000000012301000000017197566 064234120820120001AGT000002Osoby 0000000103301000000162218777
timestamp - 1-14, SSMIHH24DDMMYYYY position format
flag - post 15-18
company code - position 19-27
etc...
How can I query data stored within the OS_IMPORT_DOCS. The DOCUMENT column, divide it into columns and insert into another table?
I have to read this method of 'online' file?
Thank you very much
TomasFor the first three columns:
SQL> create type TRecord is object ( 2 ts timestamp 3 , flag varchar2(4) 4 , company_code varchar2(9) 5 ); 6 / Type created SQL> SQL> create type TRecordTable is table of TRecord; 2 / Type created SQL> SQL> create or replace function parse_clob (p_doc in clob) 2 return TRecordTable pipelined 3 is 4 lf number; 5 eol varchar2(2) := chr(10); 6 eollen number := length(eol); 7 line varchar2(32767); 8 offs number := 1; 9 begin 10 loop 11 lf := dbms_lob.instr(p_doc, eol, offs); 12 if lf != 0 then 13 line := dbms_lob.substr(p_doc, lf - offs + 1 - eollen, offs); 14 offs := lf + eollen; 15 else 16 line := dbms_lob.substr(p_doc, dbms_lob.getlength(p_doc) - offs + 1, offs); 17 end if; 18 pipe row ( 19 TRecord( 20 to_timestamp(substr(line, 1, 14), 'HH24MISSDDMMYYYY') 21 , substr(line, 15, 4) 22 , substr(line, 19, 9) 23 ) 24 ); 25 exit when lf = 0; 26 end loop; 27 end; 28 / Function created SQL> SQL> select t.* 2 from os_import_docs d 3 , table(parse_clob(d.document)) t 4 where d.object_id = 1815042; TS FLAG COMPANY_CODE -------------------------------------- ---- ------------ 12/08/12 06:10:53,000000 0000 AGT000002 12/08/12 06:23:22,000000 0000 AGT000002 12/08/12 06:35:26,000000 0001 AGT000002 12/08/12 06:42:34,000000 0001 AGT000002
-
How to insert data into the initialization blocks
I want to connect the user which connect to the obiee system. in the initialization, user blocks, we can get, but how to insert the date and user in the database is it in any way. Thanks in advance.The connection id is stored in the system USER session variable. You can use it to insert into the database in the initialization block.
INSERT INTO tablename (username, date) values (': USER ', sysdate);
Maybe you are looking for
-
Why the total time required for the test sequence is different during the test runs
Hello -J' have different test resources to test our product which includes engines and the NOR-Box (6351). -Number of test files in sequence that are called during the test (ca. 20) -The problem is that when I run these test sequence files separate (
-
How to get the file ConnAPI.DLL?
How can I get the exe to ConnAPI.DLL?
-
My computer says it has 4 GB of system memory. When I go to check the amount of memory I have left, I see availabel 331GB GB 452. I'm looking at the right thing? If I'm supposed to have 4 GB why he said 452 GBs? Or am I looking at the statistics
-
vista operating system lost on laptop
my laptop was working fine one day, then when I turned it on I got the message that there is no operating system?so I tried to install winxp home on it and I didn't get the message had no installed hardware. I ran publishing family vista and my hard
-
Prevent the installation of programs
We have 1 PC with Windows 7 Ultimate and we use 1 account. I would like to know if I can able to prevent from installing programs with the exception of updates?