How to insert xml into a table in different format
HelloMy version of db: database Oracle 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
I have a xml as below:
<?xml version="1.0"?>
<ROWSET>
<ROW>
<a>CNET</a>
<b>21416911</b>
<c>12345678</c>
<d>878787</d>
</ROW>
</ROWSET>
creating a test table:
CREATE TABLE test (
friendlyname VARCHAR2(150),
value varchar2(200));
I want to insert the XML in the test of the table as belowSELECT * FROM test;
friendlyname value
a CNET
b 21416911
c 12345678
d 878787
Please advice.
Here's the idea:
SQL> DECLARE
2
3 xmldoc xmltype := xmltype(
4 '
5
6
7 CNET
8 21416911
9 12345678
10 878787
11
12 ') ;
13
14 BEGIN
15
16 INSERT INTO test (friendlyname, value)
17 SELECT x.fname, x.value
18 FROM XMLTable(
19 '/ROWSET/ROW/*'
20 passing xmldoc
21 columns fname varchar2(150) path 'local-name(.)'
22 , value varchar2(200) path 'text()'
23 ) x ;
24
25 END;
26 /
PL/SQL procedure successfully completed
SQL> select * from test;
FRIENDLYNAME VALUE
---------------- ------------
a CNET
b 21416911
c 12345678
d 878787
Can be optimized according to the size of input XML code and its location.
Tags: Oracle Development
Similar Questions
-
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 to insert records into a table from a button?
Hey,.
I use Oracle form and I have a trigger button when button pressed.
I have a project being given for one of my classes. Basically, I have a Customers table and they hit the news. When they press submit, it must insert it into the table.
And here is the code I wrote to be inserted inside the button
declare
v_cust_id customer_detail.customer_id%type;
v_f_name customer_detail.fname%type;
v_l_name customer_detail.lname%type;
v_destination customer_detail.destination%type;
v_travel_date customer_detail.travel_date%type;
v_address customer_detail.address%type;
v_telephone customer_detail.telephone%type;
Start
insert into customer_detail
values (v_customer_id, v_fname, v_l_name, v_destination, v_travel_date, v_address, v_telephone);
end;
/
But its gives me an error. Is a PLsql Oracle form different syntax?
Why do you need to insert in the command, when applications oracle has this native features?
Make a form based on the table and just use
COMMIT_FORM; on your BUTTON.
Hope this helps
Hamid
-
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 values into a table
Hello Experts,
I would like to know if its possible to fill data in one table by performing a loop.
I have the following table:
Draw)
NUMBER OF NUM,
START_DATE DATE NOT NULL,
END_DATE DATE NOT NULL,
CHAR DEFAULT ACTIVE (1 BYTE) 'Y')
Now my table must contain the foll:
NUM start_date end_date active
1 2010-01-23 21:00 30/01/2010 19:00 Y
2 2010-01-30 21:00 02/06/2010 19:00 Y
I have an initial date and the end_date is always (start_date + 7) and the beginning of the next by the previous end_date but time varies from 19:00 to 21:00.
This is what I have at the moment, but I'm stuck out of
but I'm kind of stuck a bit for the dateCREATE SEQUENCE num_seq MINVALUE 1 START WITH 1 INCREMENT BY 1 CACHE 10 CREATE OR REPLACE procedure draw_date IS begin INSERT INTO draws (num, start_date , end_date, active ) VALUES (num_seq.nextval, ?, ?+7 days, Y); COMMIT; end;
Thank youHello
You can try something like:
INSERT INTO draws (num, start_date, end_date, active) with last_date as (select trunc(max(end_date)) dt from draws) select num_seq.nextval, last_date.dt + 21/24, last_date.dt +7 +19/24, 'Y' from last_date; COMMIT;
Untested code because I don't have the create table and insert orders... and I'm feeling lazy today.
;) -
Stuck with ORA-30937 when inserting XML in the table...
Hello
We are in 10 gr 2 (10.2.0.3.0)
I've never been so far with XMLs...
and I followed as well as Marc can messages and XML and relational views:
DB XML FAQ
I have saved the schema, renamed tables XMLTYPE that I needed...
but when I try to insert my XML data in the XMLTYPE, I get this error:
ORA-30937: no schema definition for 'WORKBENCH_PROJECT' (namespace ") in parent ' / '.
I think I need to display the xml, xsd, and code as well:
XML is:
<? XML version = "1.0"? >
< WORKBENCH_PROJECT >
< BaseCalendars >
< calendar
name = "Standard" lastUpdatedDate = "2001-07 - 10 T 09: 04:08" >
< / calendar >
< calendar
name = "Tunbase" lastUpdatedDate = "" 2008-02 - 21 T 12: 01:30 ' lastUpdatedBy = "sacchaud" > "
< days >
< day departure = '2008-01-01' isWorkDay = "false" / >
< day departure = finishing '2008-03-20' = '2008-03-21' isWorkDay = "false" / >
< day departure = "2008-04-09" isWorkDay = "false" / >
< day departure = '2008-05-01' isWorkDay = "false" / >
< day departure = '2008-07-25' isWorkDay = "false" / >
< day departure = '2008-08-13' isWorkDay = "false" / >
< day departure = "2008-11-07" isWorkDay = "false" / >
< / days >
< / calendar >
< calendar
name = 'SPAIN-BASE' lastUpdatedDate = "" 2008-11 - 28 T 10: 11:53 ' lastUpdatedBy = "ashwkulk" > "
< days >
< day departure = '2008-01-01' isWorkDay = "false" / >
< day departure = "2008-01-07" isWorkDay = "true" >
< go >
< Shift start = "08:00:00" complete ="12:00:00" / > "
< Shift start = "13:00:00" complete ="17:00:00" / > "
< / travel >
< / day >
< day departure = '2008-03-20' isWorkDay = "true" >
< go >
< Shift start = "08:00:00" complete ="12:00:00" / > "
< Shift start = "13:00:00" complete ="17:00:00" / > "
< / travel >
< / day >
< day departure = '2008-03-21' isWorkDay = "false" / >
< day departure = '2008-05-01' isWorkDay = "false" / >
< day departure = '2008-08-15' isWorkDay = "false" / >
< day departure = '2008-10-13' isWorkDay = "true" >
< go >
< Shift start = "08:00:00" complete ="12:00:00" / > "
< Shift start = "13:00:00" complete ="17:00:00" / > "
< / travel >
< / day >
< day departure = "2008-12-08" isWorkDay = "false" / >
< day departure = '2008-12-25' isWorkDay = "false" / >
< day departure = '2009-01-01' isWorkDay = "false" / >
< day departure = "2009-01-06" isWorkDay = "false" / >
< day departure = '2009-04-10' isWorkDay = "false" / >
< day departure = '2009-05-01' isWorkDay = "false" / >
< day departure = '2009-10-12' isWorkDay = "false" / >
< day departure = "2009-12-08" isWorkDay = "false" / >
< day departure = '2009-12-25' isWorkDay = "false" / >
< / days >
< / calendar >
< / BaseCalendars >
< PoolResources >
< PoolResource
resourceType = '0' inputTypeCode = '0' ADO = "FGASNIER" userFlag2 = "false" userFlag1 = "false".
fullName = "Gasnier Florian" firstName = "Florian" isExternal = "false" isActive = 'true '.
ResourceID = "FGASNIER" managerUserName = "PIDUPUIS" employmentType = "3" userNumber2 = "0.0".
userNumber1 = '0,0' userText2 = 'POWEO' userText1 = "' UDDI EUC + ' openForTimeEntry = 'true'"
emailAddress = '[email protected]' LastName As String = "Gasnier" isRole = "false" trackMode = "2" >
< Calendar CalendrierBase = 'FRANCE' >
< days >
< day departure = '2008-12-26' isWorkDay = "false" / >
< day departure = "2009-03-23" Finish = "2009-03-25" isWorkDay = "false" / >
< / days >
< / calendar >
< curve name = 'availability' type = '1' default = "1.0" / >
< / PoolResource >
< PoolResource
resourceType = '0' inputTypeCode = '0' ADO = "mmazelei" userFlag2 = "false" userFlag1 = "false".
fullName = "Kounde, Guillaume" firstName = "Guillaume" isExternal = "false" isActive = 'true '.
ID = "GKOUNDE" managerUserName = "PIDUPUIS" employmentType = "3" userNumber2 = "0.0".
userText3 = "RE7' userNumber1 = '0,0' userText2 = 'Poweo' userText1 =" ' UDDI EUC + ' openForTimeEntry = 'true' "
emailAddress = '[email protected]' LastName As String = "Kounde" isRole = "false" trackMode = "2" >
< Calendar CalendrierBase = 'FRANCE' >
< days >
< / days >
< / calendar >
< curve name = 'availability' type = '1' default = "1.0" / >
< / PoolResource >
< / PoolResources >
<>projects
< project
UID = "AJWF [& quot;" / A_ "'? & quot; GW:R'! '''? "P" ' 0 "baseTime =" "2008-10 - 02T 17: 33:10" closed = 'false' "
Active = 'true' approved = 'false' userText2 = 'Poweo' userText1 = '& amp; "D EUC +" start = "" 2008-10 - 02T 08: 00:00 ""
openForTimeEntry = 'true' format = '0' trackMode = '2' lastUpdatedDate = "" 2009-03 - 09 T 17: 25:03 ""
"baseFinish =" "2008-10 - 02T 17: 00:00" end = "2012-12 - 31 T 17: 00:00 ' baseStart =" "2008-10 - 02 T 08: 00:00" "
priority = "10" finishImposed = "true" cpmType = "0" name = 'ID-ID-Poweo recipe' startImposed = 'false '.
program = 'false' lastUpdatedBy = "lletaill" >
baseline <>
< baseline
Description = "P.Dupuis pilgrims © ation" code = 'Main' name = "ReferencePrincipale20081002" "
current = "true" / >
< / basic lines >
< resources >
< resource
requestStatus = '1' lastUpdatedBy = "JRATAJAK" resourceID = "lletaill" openForTimeEntry = "true".
lastUpdatedDate = "" 2009-01 - 06 T 16: 10:59 "bookingStatus ="15">"
< curve name = "allowance" type = "1" default = "1.0" / >
< curve name = 'rate' type = '1' default = "1.0" >
<>segments
"< start of the segment =" ' 1900-01 - 01 T 00: 00:00 "Finish =" 2008-10 - 02 T 00: 00:00 ' rate '0.0' = >
< / segment >
"< start of the segment =" "2008-10 - 02T 00: 00:00" end = "2010-01 - 01 T 00: 00:00" rate = "0.008880555555555555" >
< / segment >
"< start of the segment =" "2010-01 - 01 T 00: 00:00" Finish = "2013-01 - 01 T 00: 00:00 ' rate '0.0' = >
< / segment >
"< start of the segment =" "2013-01 - 01 T 00: 00:00" Finish = "2079-06 - 03 T 00: 00:00 ' rate '0.0' = >
< / segment >
< / segments >
< / curve >
< / resource >
< resource
requestStatus = '1' lastUpdatedBy = "EDAUDIFF" resourceID = "EDAUDIFF" availTo = "" 2009-02 - 14 T 00: 00:00 ""
openForTimeEntry = "false" lastUpdatedDate = "" 2009-02 - 16 T 15: 09:50 "bookingStatus ="15">"
< curve name = "allowance" type = "1" default = "1.0" / >
< curve name = 'rate' type = '1' default = "1.0" >
<>segments
"< start of the segment =" ' 1900-01 - 01 T 00: 00:00 "Finish =" 2008-10 - 02 T 00: 00:00 ' rate '0.0' = >
< / segment >
"< start of the segment =" "2008-10 - 02T 00: 00:00" end = "2010-01 - 01 T 00: 00:00" rate = "0.008880555555555555" >
< / segment >
"< start of the segment =" "2010-01 - 01 T 00: 00:00" Finish = "2013-01 - 01 T 00: 00:00 ' rate '0.0' = >
< / segment >
"< start of the segment =" "2013-01 - 01 T 00: 00:00" Finish = "2079-06 - 03 T 00: 00:00 ' rate '0.0' = >
< / segment >
< / segments >
< / curve >
< BaselineDetails >
< BaselineDetail
"Start =" "2008-10 - 02T 08: 00:00 ' baselineCode = 'Main' Finish =" 2008-10 - 02 T 17: 00:00.
costSum = "1283.2" usageSum = "144000.0" duration = "1.0" >
< curve name = "costCurve" type = "2" default "0,0" = >
<>segments
"< start of the segment =" "2008-10 - 02T 08: 00:00" end = "2008-10 - 02 T 17: 00:00" rate = "0.04455555555555556" / >
< / segments >
< / curve >
< curve name = "usageCurve" type = "2" default "0,0" = >
<>segments
"< start of the segment =" "2008-10 - 02T 08: 00:00" end = "2008-10 - 02 T 17: 00:00" rate = "5.0" / >
< / segments >
< / curve >
< / BaselineDetail >
< / BaselineDetails >
< / resource >
< resource
requestStatus = '1' lastUpdatedBy = "JRATAJAK" resourceID = "JZARIOUH" availTo = "" 2010-12 - 31 T 17: 00:00 ""
"openForTimeEntry ="true"availFrom =" "2009-01 - 05 T 00: 00:00" lastUpdatedDate = "2009-01 - 05 T 15: 19:32.
bookingStatus = "15" >
< curve name = "allowance" type = "1" default = "1.0" / >
< curve name = 'rate' type = '1' default = "1.0" >
<>segments
"< start of the segment =" ' 1900-01 - 01 T 00: 00:00 "Finish =" 2008-10 - 02 T 00: 00:00 ' rate '0.0' = >
< / segment >
"< start of the segment =" "2008-10 - 02T 00: 00:00" end = "2010-01 - 01 T 00: 00:00" rate = "0.008880555555555555" >
< / segment >
"< start of the segment =" "2010-01 - 01 T 00: 00:00" Finish = "2013-01 - 01 T 00: 00:00 ' rate '0.0' = >
< / segment >
"< start of the segment =" "2013-01 - 01 T 00: 00:00" Finish = "2079-06 - 03 T 00: 00:00 ' rate '0.0' = >
< / segment >
< / segments >
< / curve >
< / resource >
< / resource >
< task
UID = "AJ; & apos; Y6'? 1_'' ' ? & quot; GW:R'! '''? ' "P" ' 0 "baseTime =" "2008-10 - 02T 17: 33:10" start = "2009-02 - 16 T 08: 00:00.
proxy = 'false' critical = "false" status = '0' lastUpdatedDate = "" 2009-03 - 09 T 17: 25:03 "outlineLevel = '3'"
"baseFinish =" "2008-10 - 02T 17: 00:00" end = "2009-02 - 16 T 17: 00:00 ' summary = 'false' baseStart =" "2008-10 - 02 T 08: 00:00" "
baselineDuration = "1.0" milestone = "false" name = "RE7 - awareness" fixed = "false".
Locked = 'false' key = 'false' lastUpdatedBy = "lletaill" percComp = "0,0" unexpected = "false" >
<>assignments
< assignment
status = '0' lastUpdatedBy = "lletaill" actualWork = "0,0" ResourceID = "EDAUDIFF" start = "" 2009-02 - 16 T 08: 00:00 ""
baselineWork = "144000.0" unplanned = "false" estPattern = "3" actualThrough = "" 2009-02 - 16 T 00: 00:00 ""
«Finish = "" 2009-02 - 16 T 17: 00:00 "="144000.0"remainingWork lastUpdatedDate =" 2009-03 - 09 T 17: 25:03»
estMax = "1.0" >
< curve name = "basic" type '2' default = '0.0' = >
<>segments
"< start of the segment =" "2008-10 - 02T 08: 00:00" end = "2008-10 - 02 T 17: 00:00" rate = "5.0" >
< calendar >
< days >
< day dayOfWeek = 'SUN' isWorkDay = "false" / >
< day dayOfWeek = 'MY' isWorkDay = "true" >
< go >
< Shift start = "08:00:00" complete ="12:00:00" / > "
< Shift start = "13:00:00" complete ="17:00:00" / > "
< / travel >
< / day >
< day dayOfWeek = 'SAT' isWorkDay = "false" / >
< / days >
< / calendar >
< / segment >
< / segments >
< / curve >
< BaselineDetails >
< BaselineDetail
"Start =" "2008-10 - 02T 08: 00:00 ' baselineCode = 'Main' Finish =" 2008-10 - 02 T 17: 00:00.
costSum = "1283.2" usageSum = "144000.0" duration = "1.0" >
< curve name = "costCurve" type = "2" default "0,0" = >
<>segments
"< start of the segment =" "2008-10 - 02T 08: 00:00" end = "2008-10 - 02 T 17: 00:00" rate = "0.04455555555555556" / >
< / segments >
< / curve >
< curve name = "usageCurve" type = "2" default "0,0" = >
<>segments
"< start of the segment =" "2008-10 - 02T 08: 00:00" end = "2008-10 - 02 T 17: 00:00" rate = "5.0" / >
< / segments >
< / curve >
< / BaselineDetail >
< / BaselineDetails >
< / assignment >
< / assignments >
< BaselineDetails >
< BaselineDetail
"Start =" "2008-10 - 02T 08: 00:00 ' baselineCode = 'Main' Finish =" 2008-10 - 02 T 17: 00:00.
costSum = "1283.2" usageSum = "144000.0" duration = "1.0" >
< curve name = "costCurve" type = "2" default "0,0" = >
<>segments
"< start of the segment =" "2008-10 - 02T 08: 00:00" end = "2008-10 - 02 T 17: 00:00" rate = "0.04455555555555556" / >
< / segments >
< / curve >
< curve name = "usageCurve" type = "2" default "0,0" = >
<>segments
"< start of the segment =" "2008-10 - 02T 08: 00:00" end = "2008-10 - 02 T 17: 00:00" rate = "5.0" / >
< / segments >
< / curve >
< / BaselineDetail >
< / BaselineDetails >
< / task >
< / tasks >
< BaselineDetails >
< BaselineDetail
"Start =" "2008-10 - 02T 08: 00:00 ' baselineCode = 'Main' Finish =" 2008-10 - 02 T 17: 00:00.
costSum = "2566.4" usageSum = "288000.0" duration = "1.0" >
< curve name = "costCurve" type = "2" default "0,0" = >
<>segments
"< start of the segment =" "2008-10 - 02T 08: 00:00" end = "2008-10 - 02 T 17: 00:00" rate = "0.08911111111111111" / >
< / segments >
< / curve >
< curve name = "usageCurve" type = "2" default "0,0" = >
<>segments
"< start of the segment =" "2008-10 - 02T 08: 00:00" end = "2008-10 - 02 T 17: 00:00" rate = "10.0" / >
< / segments >
< / curve >
< / BaselineDetail >
< / BaselineDetails >
< / project >
< / project >
< / WORKBENCH_PROJECT >
-------------------------------
XSD is (it was automatically generated by the "Stylus Studio" tools... so I changed a few stuffs up):
<? XML version = "1.0" encoding = "UTF-8"? >
< xsd: Schema targetNamespace = "http://www.oracle.com/xsd/projet.xsd."
container = "http://www.w3.org/2001/XMLSchema" elementFormDefault = "unqualified".
xmlns:xdb = "http://xmlns.oracle.com/xdb".
xdb:storeVarrayAsTable = 'true '.
xmlns = "http://www.oracle.com/xsd/projet.xsd" >
< xsd: element name = "WORKBENCH_PROJECT" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT ref = "BaseCalendars" / >
< xsd: ELEMENT ref = "PoolResources" / >
< xsd: ELEMENT ref = "Projects" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "BaseCalendars" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT maxOccurs = "unbounded" ref = "Calendar" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "PoolResources" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT maxOccurs = "unbounded" ref = "PoolResource" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "PoolResource" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT ref = "Calendar" / >
< xsd: ELEMENT ref = "Curve" / >
< / xsd: SEQUENCE >
< xsd: attribute name = "category" / >
< xsd: attribute name = "emailAddress" / >
< xsd: attribute name = "employmentType" use = "required" type = "xsd: Integer" / >
< xsd: attribute name = "FirstName" type = "xsd:NCName" / >
< xsd: attribute name = "full name" use = "required" / >
< xsd: attribute name = "hireDate" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "inputTypeCode" type = "xsd: Integer" / >
< xsd: attribute name = "isActive" use = "required" type = "xsd: Boolean" / >
< xsd: attribute name = use "isExternal" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = use "isRole" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "lastName" use = "required" / >
< xsd: attribute name = "managerUserName" type = "xsd:NCName" / >
< xsd: attribute name = "ADO" use = "required" type = "xsd:NCName" / >
< xsd: attribute name = use "openForTimeEntry" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "Resource ID" use = "required" / >
< xsd: attribute name = "resourceType" use = "required" type = "xsd: Integer" / >
< xsd: attribute name = use "trackMode" = "required" type = "xsd: Integer" / >
< xsd: attribute name = use "userFlag1" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = use "userFlag2" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "userNumber1" type = "xsd: Decimal" / >
< xsd: attribute name = "userNumber2" type = "xsd: Decimal" / >
< xsd: attribute name = "userText1" / >
< xsd: attribute name = "userText2" type = "xsd:NCName" / >
< xsd: attribute name = "userText3" type = "xsd:NCName" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Projects" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT ref = "Project" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Project" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT ref = "Baselines" / >
< xsd: ELEMENT ref = "Resources" / >
< xsd: ELEMENT ref = "Tasks" / >
< xsd: ELEMENT ref = "BaselineDetails" / >
< / xsd: SEQUENCE >
< xsd: attribute name = use "UID" = "required" / >
< xsd: attribute name = "active" use = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "authorized" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = use "baseFinish" = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "baseStart" = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "baseTime" = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "closed" use = "required" type = "xsd: Boolean" / >
< xsd: attribute name = use "cpmType" = "required" type = "xsd: Integer" / >
< xsd: attribute name = "complete" use = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "finishImposed" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = use 'format' = "required" type = "xsd: Integer" / >
< xsd: attribute name = use "lastUpdatedBy" = "required" type = "xsd:NCName" / >
< xsd: attribute name = "lastUpdatedDate" use = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "name" use = "required" / >
< xsd: attribute name = use "openForTimeEntry" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "priority" use = "required" type = "xsd: Integer" / >
< xsd: attribute name = "programs" use = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "Use DΘmarrer" = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "startImposed" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = use "trackMode" = "required" type = "xsd: Integer" / >
< xsd: attribute name = "userText1" use = "required" / >
< xsd: attribute name = use "userText2" = "required" type = "xsd:NCName" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Base lines" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT ref = "Baseline" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "basic" >
< xsd: complexType >
< xsd: attribute name = "code" use = "required" type = "xsd:NCName" / >
< xsd: attribute name = "use" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "description" use = "required" / >
< xsd: attribute name = "name" use = "required" type = "xsd:NCName" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Resources" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT maxOccurs = "unbounded" ref = "Resource" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Resource" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT maxOccurs = "unbounded" ref = "Curve" / >
< xsd: ELEMENT minOccurs = '0' ref = "BaselineDetails" / >
< / xsd: SEQUENCE >
< xsd: attribute name = "availFrom" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "availTo" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "bookingStatus" = "required" type = "xsd: Integer" / >
< xsd: attribute name = use "lastUpdatedBy" = "required" type = "xsd:NCName" / >
< xsd: attribute name = "lastUpdatedDate" use = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "openForTimeEntry" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = 'requestStatus' use = "required" type = "xsd: Integer" / >
< xsd: attribute name = "Resource ID" use = "required" type = "xsd:NCName" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Tasks" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT maxOccurs = "unbounded" ref = "Task" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Task" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT minOccurs = '0' ref = "Assignments" / >
< xsd: ELEMENT minOccurs = '0' ref = "BaselineDetails" / >
< / xsd: SEQUENCE >
< xsd: attribute name = use "UID" = "required" / >
< xsd: attribute name = "baseFinish" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "baseStart" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "baseTime" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "baselineDuration" type = "xsd: Decimal" / >
< xsd: attribute name = "category" / >
< xsd: attribute name = "critical" use = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "complete" use = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use 'fixed' = "required" type = "xsd: Boolean" / >
< xsd: attribute name = use 'key' = "required" type = "xsd: Boolean" / >
< xsd: attribute name = use "lastUpdatedBy" = "required" type = "xsd:NCName" / >
< xsd: attribute name = "lastUpdatedDate" use = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use 'locked' = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "milestone" use = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "name" use = "required" / >
< xsd: attribute name = "outlineLevel" use = "required" type = "xsd: Integer" / >
< xsd: attribute name = use "percComp" = "required" type = "xsd: Decimal" / >
< xsd: attribute name = using the "proxy" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "Use DΘmarrer" = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "status" use = "required" type = "xsd: Integer" / >
< xsd: attribute name = "summarized" use = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "unexpected" use = "required" type = "xsd: Boolean" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Assignments" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT maxOccurs = "unbounded" ref = "Assignment" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Assignment" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT minOccurs = "0" maxOccurs = "unbounded" ref = "Curve" / >
< xsd: ELEMENT minOccurs = '0' ref = "BaselineDetails" / >
< / xsd: SEQUENCE >
< xsd: attribute name = use "actualThrough" = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "actualWork" = "required" type = "xsd: Decimal" / >
< xsd: attribute name = "baselineWork" type = "xsd: Decimal" / >
< xsd: attribute name = use "estMax" = "required" type = "xsd: Decimal" / >
< xsd: attribute name = use "estPattern" = "required" type = "xsd: Integer" / >
< xsd: attribute name = "Finish" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "lastUpdatedBy" = "required" type = "xsd:NCName" / >
< xsd: attribute name = "lastUpdatedDate" use = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "pendActSum" type = "xsd: Decimal" / >
< xsd: attribute name = "pendEstSum" type = "xsd: Decimal" / >
< xsd: attribute name = use "remainingWork" = "required" type = "xsd: Decimal" / >
< xsd: attribute name = "Resource ID" use = "required" type = "xsd:NCName" / >
< xsd: attribute name = "DΘmarrer" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "status" use = "required" type = "xsd: Integer" / >
< xsd: attribute name = "unexpected" use = "required" type = "xsd: Boolean" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Calendar" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT minOccurs = '0' ref = 'Days' / >
< / xsd: SEQUENCE >
< xsd: attribute name = "CalendrierBase" / >
< xsd: attribute name = "lastUpdatedBy" type = "xsd:NCName" / >
< xsd: attribute name = "lastUpdatedDate" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "name" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Days" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT minOccurs = "0" maxOccurs = "unbounded" ref = "Day" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Day" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT minOccurs = '0' ref = "Travel" / >
< / xsd: SEQUENCE >
< xsd: attribute name = "dayOfWeek" type = "xsd:NCName" / >
< xsd: attribute name = "Finish" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "isWorkDay" = "required" type = "xsd: Boolean" / >
< xsd: attribute name = "DΘmarrer" type = "xsd:NMTOKEN" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Travel" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT maxOccurs = "unbounded" ref = "Shift" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Shift" >
< xsd: complexType >
< xsd: attribute name = "complete" use = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "Use DΘmarrer" = "required" type = "xsd:NMTOKEN" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Curve" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT minOccurs = '0' ref = "Segments" / >
< / xsd: SEQUENCE >
< xsd: attribute name = "default" use = "required" type = "xsd: Decimal" / >
< xsd: attribute name = "name" use = "required" type = "xsd:NCName" / >
< xsd: attribute name = use "enter" = "required" type = "xsd: Integer" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Segments" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT maxOccurs = "unbounded" ref = "Segment" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "Segment" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT minOccurs = '0' ref = "Calendar" / >
< / xsd: SEQUENCE >
< xsd: attribute name = "complete" use = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "rate" use = "required" type = "xsd: Decimal" / >
< xsd: attribute name = "Use DΘmarrer" = "required" type = "xsd:NMTOKEN" / >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "BaselineDetails" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT ref = "BaselineDetail" / >
< / xsd: SEQUENCE >
< / xsd: complexType >
< / xsd: element >
< xsd: element name = "BaselineDetail" >
< xsd: complexType >
< xsd: SEQUENCE >
< xsd: ELEMENT maxOccurs = "unbounded" ref = "Curve" / >
< / xsd: SEQUENCE >
< xsd: attribute name = use "baselineCode" = "required" type = "xsd:NCName" / >
< xsd: attribute name = use "costSum" = "required" type = "xsd: Decimal" / >
< xsd: attribute name = "duration" use = "required" type = "xsd: Decimal" / >
< xsd: attribute name = "complete" use = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = "Use DΘmarrer" = "required" type = "xsd:NMTOKEN" / >
< xsd: attribute name = use "usageSum" = "required" type = "xsd: Decimal" / >
< / xsd: complexType >
< / xsd: element >
< / xsd: Schema >
---------------------------
Here is the procedure for registration of the scheme and rename XMLTYPE tables:
PROCEDURE install_schema (p_schema IN VARCHAR2)
IS
l_res BOOLEAN;
l_nested_table_name VARCHAR2 (50);
l_parent_table_name VARCHAR2 (50);
l_iot_index_name VARCHAR2 (50);
l_continue BOOLEAN: = TRUE;
BEGIN
BEGIN
-load XSD/XML in the table
sipmo_XML_utils.charger_xml ('XSD_DIR', p_schema);
EXCEPTION
WHILE OTHERS THEN
dbms_output.put_line (' error loading of in, err ='|) SQLERRM);
l_continue: = FALSE;
END;
IF l_continue = TRUE
THEN
-Diagram of the removal
BEGIN
dbms_output.put_line ('deleteSchema in progress...) ');
-"projet.xsd".
() DBMS_XMLSCHEMA.deleteSchema
SCHEMAURL = > 'http://www.oracle.com/xsd/ ' | p_schema
, DELETE_OPTION = > dbms_xmlschema. DELETE_CASCADE_FORCE);
EXCEPTION
WHILE OTHERS THEN
dbms_output.put_line (' ko deleteSchema ' |) SQLERRM);
NULL;
END;
END IF; -l_continue = TRUE
-Removal of resources:
IF l_continue = TRUE
THEN
IF (dbms_xdb.existsResource ('/ public /'| p_schema))
THEN
DBMS_XDB.deleteResource ('/ public /'| p_schema);
END IF;
l_res: = dbms_xdb.createResource ('/ public /'| p_schema, BFILENAME ('XSD_DIR', p_schema));
IF l_res
THEN
dbms_output.put_line ('createresource OK');
ON THE OTHER
dbms_output.put_line ('createresource KO');
END IF;
END IF; -l_continue = TRUE
-Schema of creation of the:
IF l_continue = TRUE
THEN
BEGIN
dbms_output.put_line ('REGISTERSCHEMA in progress...) ');
DBMS_XMLSCHEMA. REGISTERSCHEMA)
SCHEMAURL = > 'http://www.oracle.com/xsd/ ' | p_schema
, SCHEMADOC = > BFILENAME ('XSD_DIR', p_schema)
, CSID = > NLS_CHARSET_ID ('AL32UTF8')
local = > TRUE
, genTypes = > TRUE
, genBean = > FALSE
genTables = > TRUE);
EXCEPTION
WHILE OTHERS THEN
dbms_output.put_line (' ko REGISTERSCHEMA ' |) SQLERRM);
l_continue: = FALSE;
END;
END IF; -l_continue = TRUE
COMMIT;
IF p_schema = "projet.xsd".
AND l_continue = TRUE
THEN
dbms_output.put_line (' XML rename tables ' | p_schema);
-First... the enventuelle dropper table main "WORKBECH_PROJECT."
BEGIN
EXECUTE IMMEDIATE ' drop table 'WORKBENCH_PROJECT "";
EXCEPTION
WHILE OTHERS THEN
NULL;
END;
-Resource table
Select table_name
in l_nested_table_name
of user_nested_tables
where parent_table_column = ' "XMLDATA". "" "" PoolResources '. "" PoolResource' '
and parent_table_name like '% WORKBENCH_PROJECT ';
EXECUTE IMMEDIATE "Rename" ' | "" l_nested_table_name | "" "to PROJET_RESSOURCES ';
Select index_name
in l_iot_index_name
from user_indexes
where table_name = 'PROJET_RESSOURCES '.
and index_type = 'IOT - TOP';
Index of IMMEDIATE'alter EXECUTE ' ' |. ' l_iot_index_name |' "and rename it PROJET_RESSOURCES_I1';
-Table projects/tasks
Select table_name
in l_nested_table_name
of user_nested_tables
where parent_table_column = ' "XMLDATA". "Projects '." "Project '." "" Task"". "" The task""
and parent_table_name like '% WORKBENCH_PROJECT ';
EXECUTE IMMEDIATE "Rename" ' | "" l_nested_table_name | "" "to PROJET_TACHES ';
Select index_name
in l_iot_index_name
from user_indexes
where table_name = 'PROJET_TACHES '.
and index_type = 'IOT - TOP';
EXECUTE IMMEDIATE ' alter index ' ' |. ' l_iot_index_name |' "and rename it PROJET_TACHES_I1';
-Table of the project/tasks/Activities and (+ main table)
Select table_name, parent_table_name
in l_nested_table_name
l_parent_table_name
of user_nested_tables
where parent_table_column = ' "XMLDATA". "Projects '." "Project '." "" "" BaselineDetails '. "" "" "BaselineDetail '." " Curve"'
and parent_table_name like '% WORKBENCH_PROJECT ';
EXECUTE IMMEDIATE "Rename" ' | "" l_nested_table_name | "" "to PROJET_ACTIVITES ';
Select index_name
in l_iot_index_name
from user_indexes
where table_name = 'PROJET_ACTIVITES '.
and index_type = 'IOT - TOP';
EXECUTE IMMEDIATE ' alter index ' ' |. ' l_iot_index_name |' "and rename it PROJET_ACTIVITES_I1';
-Main table WORKBENCH_PROJECT
EXECUTE IMMEDIATE "Rename" ' | "" l_parent_table_name | "" "to WORKBENCH_PROJECT ';
dbms_output.put_line ('rename XML tables... end');
ON THE OTHER
dbms_output.put_line (' rename XML tables...) NOT DONE ");"
END IF; -p_schema = "projet.xsd".
END install_schema;
---------------------------------------
Here is the procedure of inserting data into XMLTYPE table (where I get the error)
* insert into WORKBENCH_PROJECT values (xmltype (bfilename('XML_DIR','P21002635_2.xml'), nls_charset_id ('AL32UTF8'))); *
+ In my idea, I think I should load the full XML in my table XMLTYPE WORKBENCH_PROJECT... +.
and more and then interrogate him with better performance... more
--------------------------------------
Note that the same XML file is already loaded into a table containing an XMLTYPE column...
So, I really wonder if I need to do both?
----------------------------------------
In any case, I hope that you will be able to help me... and that my explanation is clear...
Thanks in advance,
OlivierOliver
I don't know where you got the impression that I said that the DOM would be better. It will be definitely worse. The only advantage of the evaluation of DOM based (or functional) is that it can handle a much wider range of XQuery and XPath expressions. However there is nothing in what I saw in your examples the SQL execution path is not be be able to manage the only way you get the performance you need is to get the work of path of execution of SQL. To get the job of re - write, you will need to avoid wildcards and get the fix for the bug.
I hate to disappoint you, but your XML schema is actually quite simple, it is certainly not in a class, that I would not complex, for recording results in a hierarchical structure very simple, unique, with 42 nested tables, if you want to see an example of something I would consider as complex search the Web for the FpML or NIEM schemas , recording these patterns result in recursive structures with multiple nested tables 1000!
I see nothing in your XML schema that would make the use of wildcard characters required (with the exception of running in this bug). For tasks and Instance/tasks / * are identical in your use case as a tasks element can contain one or more elements of task, not do I see anything that would make me think that some how transform XML CSV would make it easier to load.
My number 1 recommendation is to apply the 10.2.0.4.0 patch or upgrade to GR 11, 1 material. According to your deadlines, you can also consider 11 GR 2 beta.
-Mark
Published by: mdrake on April 10, 2009 14:28
-
What trigger to use to insert data into the table db forms
Hello
My form is current having a block of database with the table reference. When you enter data into the form field and click Save. Automatically record is inserted in the database table.
I want to do this under manual insert. I changed the block of data to a data non-base. Where should I write the insert statement to insert data into the table.
Is - shutter release key of the form-level validation?
Please notify.
Thank you
Didi.You can guide me how to remove the message FRM-40401 no changes to save and instead, I wanted to put 1 transaction record successful... some like it like that.
Hi didi.
And this is my last post I'll sleep. ;)
Take form level trigger named preform
and write on it:SYSTEM.MESSAGE_LEVEL := 5;
I hope this works...
Hamid
Mark correct/good to help others to get the right answers. *
-
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 rows in multiple tables in a sql
I want to know how to insert multiple lines in a single sql statement.
Let's insert records into the table emp and dept in a sql statement.
Thank youIt's here
SQL>l 1 insert all 2 into emp values(8888,'WADE','MANAGER',7839,'01-MAR-2008',5000,100,20) 3 into dept values(50,'MARKETING','NEW YORK') 4* select * from dual SQL> / 2 rows created.
SS
-
Gears - error when you try to insert values into a table with multiple columns
Hello
I started playing with the gears and SQlLite today and I get an error when I try to insert values into a table with multiple columns.
I have:
var db = google.gears.factory.create('beta.database'); db.open('developerSet'); db.execute('create table if not exists Developers (DeveloperName text, DeveloperAge int)'); var devName = "Davy" var devAge = 32; try { db.execute('insert into Developers values (?, ?)', [devName, devAge]); alert('success'); } catch (e) { alert(e); }
I get the error:
net.rim.device.api.database.DatabaseException; insert into developers values (?,?): SQL logic error or missing database.
I use this reference: http://code.google.com/apis/gears/api_database.html
Everything works if I have only one field as:
var db = google.gears.factory.create('beta.database'); db.open('developerSet'); db.execute('create table if not exists Developers (DeveloperName text)'); var devName = "Davy" var devAge = 32; try { db.execute('insert into Developers values (?)', [devName]); alert('success'); } catch (e) { alert(e); }
I use the plug-in Visual Studio 2.0 for 2008 that are running Windows XP SP and Simulator 2.13.0.56
Thank you
Davy
Yes, a SQLite database will persist between battery pulls. The database is registered either to internal MEM or removable media (not the device memory), depending on which is available on your device.
In general, its not considered a best practice to remove your table as soon as it is empty and re - create it again when you want to add data. This adds extra overhead fresh for the final, delete and insert first for a given table. Instead, define and finalize your drawing before you create your table. Once created, review the static schema.
That being said, for development purposes, it may be easier to provide an easy way to drop your tables while you develop your schema.
See you soon,.
Adam
-
table name not valid error when inserting values into a table
I use the following statement to insert values into a table:
curs. Execute ("INSERT INTO _ * '%s' * _ VALUES ((SELECT MAX (REC_ID) + 1 OF GSAP_MSG_IN), (SELECT MAX (gsap_msg_id) + 1 OF GSAP_MSG_IN), 'SHELLSAP', sysdate, '%s', EMPTY_BLOB(), 1, SYSDATE, EMPTY_BLOB (), SYSDATE)" %(*table_name*,file_extension)) ")
whence table_name the following statement
table_name = ' config.staging_db_tablesNames ['in_msgs]
as I created a configuration file for all parameters that can change. The value of the table in the audit using a print command is correctly, but when put in the query above to run the insert statement gives an error. The following is the summary of comprehensive performance where you can see the table name as
$ python gsapscnr.py
Vote for the data files in/home/mh/inbox /...
GSAP_MSG_IN
Traceback (most recent call changed):
File "gsapscnr.py", line 147, in it?
poll_for_data()
File "gsapscnr.py", line 86, in poll_for_data
Sorter = load_details_first)
File "gsapscnr.py", line 42, survey
curs. Execute ("INSERT INTO '%s' VALUES ((SELECT MAX (REC_ID) + 1 OF GSAP_MSG_IN), (SELECT MAX (gsap_msg_id) + 1 OF GSAP_MSG_IN), 'SHELLSAP', sysdate, '%s', EMPTY_BLOB(), 1, SYSDATE, EMPTY_BLOB (), SYSDATE)" %(table_name,file_extension)) ")
cx_Oracle.DatabaseError: ORA-00903: invalid table name
Can anyone help with this problem please. I'm passing the value of the table in a bad way. Also if anyone can suggest a good tutorial for paythong programming using cx_Oracle.
ConcerningPrint the SQL string that you establish, cut and paste it this output in SQL * more and see if it runs. This may show you that you should remove the single quotes around the name of the table %s in the Python file.
-
Doubt about inserting data into a table
Hi all, when I try to insert data into a table through an anonymous block, the pl/sql block runs successfully, but the data are not get inserted. Can someone please tell me where I am doing wrong?
Thanks in advance!SQL> DECLARE 2 3 V_A NUMBER; 4 5 V_B NUMBER; 6 7 v_message varchar2(25); 8 9 10 BEGIN 11 12 13 select regal.regal_inv_landed_cost_seq.NEXTVAL into V_A from dual ; 14 15 select regal.regal_inv_landed_cost_seq.currval into V_B from dual ; 16 17 INSERT INTO rcv_transactions_interface 18 ( 19 INTERFACE_TRANSACTION_ID, 20 HEADER_INTERFACE_ID, 21 GROUP_ID, 22 TRANSACTION_TYPE, 23 TRANSACTION_DATE, 24 PROCESSING_STATUS_CODE, 25 PROCESSING_MODE_CODE, 26 TRANSACTION_STATUS_CODE, 27 QUANTITY, 28 LAST_UPDATE_DATE, 29 LAST_UPDATED_BY, 30 CREATION_DATE, 31 CREATED_BY, 32 RECEIPT_SOURCE_CODE, 33 DESTINATION_TYPE_CODE, 34 AUTO_TRANSACT_CODE, 35 SOURCE_DOCUMENT_CODE, 36 UNIT_OF_MEASURE, 37 ITEM_ID, 38 UOM_CODE, 39 EMPLOYEE_ID, 40 SHIPMENT_HEADER_ID, 41 SHIPMENT_LINE_ID, 42 TO_ORGANIZATION_ID, 43 SUBINVENTORY, 44 FROM_ORGANIZATION_ID, 45 FROM_SUBINVENTORY 46 ) 47 48 SELECT 49 regal.regal_inv_landed_cost_seq.nextval, --Interface_transaction_ id 50 V_A, --Header Interface ID 51 V_B, --Group ID 52 'Ship', --Transaction Type 53 sysdate, --Transaction Date 54 'PENDING', --Processing Status Code 55 'BATCH', --Processing Mode Code 56 'PENDING', --Transaction Status Cod e 57 lc.quantity_received, --Quantity 58 lc.last_update_date, --last update date 59 lc.last_updated_by, --last updated by 60 sysdate, --creation date 61 lc.created_by, --created by 62 'INVENTORY', --Receipt source Code 63 'INVENTORY', --Destination Type Code 64 'DELIVER' , --AUT Transact Code 65 'INVENTORY', --Source Document Code 66 msi.primary_uom_code , --Unit Of Measure 67 msi.inventory_item_id, --Item ID 68 msi.primary_unit_of_measure, --UOM COde 69 fnd.user_id, 70 V_A, --Shipment Header ID 71 V_B, --SHipment Line ID 72 82, --To Organization ID 73 'Brooklyn', --Sub Inventory ID 74 81, --From Organization 75 'Vessel' --From Subinventory 76 77 FROM 78 regal.regal_inv_landed_cost_tab lc, 79 fnd_user fnd, 80 mtl_system_items msi 81 82 WHERE 83 lc.organization_id = msi.organization_id 84 AND lc.inventory_item_id = msi.inventory_item_id 85 AND lc.created_by = fnd.created_by; 86 87 commit; 88 v_message := SQL%ROWCOUNT; 89 dbms_output.put_line('v_message'); 90 END; 91 / v_message PL/SQL procedure successfully completed. SQL> select * from rcv_transactions_interface; no rows selected
There is no problem with inserting data!
Only there is no data! This means that your select statement retrieves no rows.
You can see the output of your program (0). This means that there where no line in the result set.Please check the output of your tax return independently:
SELECT -- regal.regal_inv_landed_cost_seq.nextval, --Interface_transaction_id -- V_A, --Header Interface ID -- V_B, --Group ID 'Ship', --Transaction Type sysdate, --Transaction Date 'PENDING', --Processing Status Code 'BATCH', --Processing Mode Code 'PENDING', --Transaction Status Code lc.quantity_received, --Quantity lc.last_update_date, --last update date lc.last_updated_by, --last updated by sysdate, --creation date lc.created_by, --created by 'INVENTORY', --Receipt source Code 'INVENTORY', --Destination Type Code 'DELIVER' , --AUT Transact Code 'INVENTORY', --Source Document Code msi.primary_uom_code , --Unit Of Measure msi.inventory_item_id, --Item ID msi.primary_unit_of_measure, --UOM COde fnd.user_id, -- V_A, --Shipment Header ID -- V_B, --SHipment Line ID 82, --To Organization ID 'Brooklyn', --Sub Inventory ID 81, --From Organization 'Vessel' --From Subinventory FROM regal.regal_inv_landed_cost_tab lc, fnd_user fnd, mtl_system_items msi WHERE lc.organization_id = msi.organization_id AND lc.inventory_item_id = msi.inventory_item_id AND lc.created_by = fnd.created_by;
Published by: hm on 13.10.2011 23:19
I removed the references of the sequence and the variables V_A and YaeUb.
BTW: Why do you want to include V_A and YaeUb in two different columns?The use of sequences in your code seems a bit strange to me. But this has nothing to do with your question.
-
Hi all
I use forms [32 bit] Version 6.0.8.24.1 (Production)
Oracle Database 10g Release 10.2.0.1.0 - Production
I have settings such as the (optional) emp_code and the year (mandatory field - four digits).
Based on the setting that I have to get the detail of a table and these must be inserted at the other table with columns of additions (to hardcode the additional columns).
To achieve this, I intend to get a cursor by selecting the required fields in the table by the way the where clause of the cursor parameters.
by making a loop through the cursor I will insert the records in the other table.
Here, the thing is that the data is going to be huge (since the year is the parameter).
so my approach causes the performance issue.
I heard that there is a different method of insetions
can anyone suggest me the best way (performance wise) other than what I mentioned (if you are aware of)...
Thank you...user13329002 wrote:
Thanks for everyone.
I have to take the data from the table as e_name, e_code, of the table and insert it into another table with some other values such as
e_name, e_code, as well as I add 'n', 'o'.
its something likeinsert into e_emp(emp_name,emp_code,emp_add,emp_status,emp_type) select e_name,e_code,e_add,'O','N') from e_table where e_date = Parameter.
in other words, the values for Emp_status, emp_type I have no values in the e_table.so table and enter in e_table I have to hard code it.
CAL I hard code as I mentioned in my statement examplecan someone clear me of the foregoing.
Thank you...
Published by: user13329002 on February 15, 2011 20:11
Yes... You can hardcode the values for Emp_status, emp_type.
SQL> CREATE TABLE e_emp(emp_code NUMBER(10),emp_status VARCHAR2(1),emp_type VARCHAR2(1)); Table created. SQL> create table e_table as (select * from e_emp); Table created. SQL> INSERT INTO e_table(emp_code) VALUES('1111'); 1 row created. SQL> insert into e_table(emp_code) values('2222'); 1 row created. SQL> select * from e_table; EMP_CODE E E ---------- - - 1111 2222 SQL> insert into e_emp(emp_code,emp_status,emp_type) (select emp_code,'0','N' from e_table); 2 rows created. SQL> select * from e_emp; EMP_CODE E E ---------- - - 1111 0 N 2222 0 N SQL>
I hope this helps.
Kind regards
Claudy -
How can I insert html into the Actions Panel to format text?
I am trying to create text using html, so I could format it in html. I created a text box, it has given an instance name, "Dynamic text" selected and clicked 'display the text in html format. When I click F9 (go on the Panel shares) to insert my html code, I get the message "current selection cannot have actions applied to it. Am I missing something? How can I insert html into the Actions Panel to format text?
In order to assign html text to a textfield, you must assign your htmlText of a textfield property. If you must give a name of uinstance to the textfield and then assign the text. If you named the "tField" textfield, in the scenario that contains the textfield you EF text html as follows...
tField.htmlText ="
your text
";You should watch the TextFields htmlText property in the help documents to determine the limited number of html tags that are supported by Flash.
-
How to insert values into a view created on multiple tables
Hi all
My goal for insert values in a view
So for this I created a trigger
then I tried to insert the value in the view, im getting as inserted row, but the value is not getting inserted
Here are the steps I followed:
SQL > create table (x int primary key)
2.
Table created.
SQL > create table b (x references a, varchar2 (30)) y
2.
Table created.
SQL > insert into a values (1)
2.
1 line of creation.
SQL > insert into b values (1, 'One')
2.
1 line of creation.
SQL > create or replace view v
2 as
3 select a.x, b.x as b_x, a y, and b where a.x = b.x
4.
Created view.
SQL > select * from v
2.
X B_X Y
---------- ---------- ------------------------------
1 1 a
SQL > create or replace trigger v_t
2 instead of inserting it on v
3 for each line
4 start
case 5: old.x <>: new.x then
6. Insert in a values(:new.x);
7 end if;
case 8: old.b_x <>: new.b_x then
9 insert into b values (:new.b_x,:new.y);
10 end if;
11 * end;
SQL > /.
Trigger created.
SQL > insert into v values (20,20, 'Twenty')
2.
1 line of creation.
SQL > select * from v
2.
X B_X Y
---------- ---------- ------------------------------
1 1 a
Can anyone suggest me a valid query to insert data into a view that is created on several tables.
Thanks in advance,
ShaliniHi Shalini,
You don't need the code if in your trigger.
That's more like code when you update, you don't compare OLD and insert the NEW values on.MHO%xe> create table a(x int primary key); Tabel is aangemaakt. Verstreken: 00:00:00.11 MHO%xe> MHO%xe> create table b(x references a,y varchar2(30)); Tabel is aangemaakt. Verstreken: 00:00:01.09 MHO%xe> MHO%xe> insert into a values(1); 1 rij is aangemaakt. Verstreken: 00:00:00.01 MHO%xe> MHO%xe> insert into b values(1,'One'); 1 rij is aangemaakt. Verstreken: 00:00:00.06 MHO%xe> MHO%xe> create or replace view v as 2 select a.x 3 , b.x as b_x 4 , y 5 from a 6 , b 7 where a.x = b.x; View is aangemaakt. Verstreken: 00:00:01.07 MHO%xe> MHO%xe> select * from v; X B_X Y ---------- ---------- ------------------------------ 1 1 One Verstreken: 00:00:00.04 MHO%xe> MHO%xe> create or replace trigger v_t 2 instead of insert on v 3 for each row 4 begin 5 insert into a values(:new.x); 6 insert into b values(:new.b_x,:new.y); 7 end; 8 / Trigger is aangemaakt. Verstreken: 00:00:01.64 MHO%xe> MHO%xe> insert into v values(20,20,'Twenty'); 1 rij is aangemaakt. Verstreken: 00:00:00.06 MHO%xe> MHO%xe> select * from v; X B_X Y ---------- ---------- ------------------------------ 1 1 One 20 20 Twenty
Maybe you are looking for
-
I had a Handspring device and used the Palm Desktop 4.0.1 software on my laptop as an interface. I have a laptop running Windows XP and I want to spend my Palm (AddressBook and calendar) data to another piece of software that is compatible with Wind
-
Personas display only background colors, images, that I have the latest version
For a while now, I tried to use personas, but only some work, others show that background colors and images
-
Toshiba e-studio 5540C acting weird
On our 32-bit vista computers, I have a Toshiba 5540C (with latest drivers) when a user tries to print a word or pdf doc it bizzar error error codes.
-
I have an Epson CX7300 Scanner & printer.
I have an Epson CX7300 I lost the startup disk. Download a?
-
Windows Security Essentials problems
I have MS Windows Security Essentials installed on a laptop running Windows 7 64-bit. As much as I know it worked very well, but in the last day or two, my system slowed down and I'm taken to strange Web sites when I click on the links for some of my