XML DML XQuery Update syntax
Hi everybody,
Certainly my question will appear strange and even stupid , but I want to be sure to use the best syntax and also to be confirmed about some points.
In the document Oracle XML DB Best practices, we can find a lot of statements for modifying XML documents. In page 11 and 12 we have statements with and without XQuery syntax. What is exactly the best way ? Using insertchildxml, updatexml or the update statement with the XMLQuery clause ?
Why we use copy in these statement, but the keyword copy is not used in a XQuery expression.
I think copy is not specific to Oracle, is it used in XQuery language ?
In page 15, the SQL statement to modify XML document uses deletexml, not a XQuery update syntax.
I'm using Oracle 11G.
Thanks in advance for your explanations
user4423142 wrote:
In the document Oracle XML DB Best practices, we can find a lot of statements for modifying XML documents. In page 11 and 12 we have statements with and without XQuery syntax. What is exactly the best way ? Using insertchildxml, updatexml or the update statement with the XMLQuery clause ?The recommended way is closely tied to the version you're using, which you didn't give.
"11g" is not a version, it's a product name.
You can find the version by running :
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
XQuery Update on Oracle in available in the latest version only : 11.2.0.3.
If you're using this version, Oracle recommends you start using XQuery Update.
Why we use copy in these statement, but the keyword copy is not used in a XQuery expression.
I think copy is not specific to Oracle, is it used in XQuery language ?<tt>copy</tt> is specific to the XQuery Update Facility (XQUF) extension of the XQuery 1.0 language.
The XQUF was primarily intended to work with native XML databases where it's OK to directly invoke update primitives (insert, delete, replace etc.) to modify database content.
On Oracle, it's not possible and the current implementation only supports XQUF through the "transform" operation (copy/modify syntax) where a copy of the original document/fragment is modified and written back to the db.
However, XQuery rewrite and related optimizations may occur so that piecewise updates actually take place.
Similar Messages
-
Xml Validation & XQuery Update
Hello,
I have a question on xml validation in Berkeley DB XML (2.5.16).
I read in documentation that an xml can be validated against an xml DTD or Schema when is loaded into a container. However, when an XQuery Update is to be executed is there any configuration that allows checking if the XQuery Update leads to an xml that does not conform with the DTD/Schema? If so, how this case is managed? The XQuery is executed, or not? Is there any exception thrown?
I made a test over this: I wrote an xml (and a related DTD) where an element contains an id attribute and another element a referencing attribute to the aforementioned id. Then, an XQuery Update 'delete' expression deletes the element with the id attribute. The element is indeed deleted, the xml is left in an inconsistent state and I am allowed of making more update operations to this document...
I was wondering if there is any way of handling this case, except from being careful with what updates you choose, so that the xml is kept in a valid state. Is there something I am missing?
thank you in advance,
theoHello,
I believe that XQuery execution does not support DTD yet. I'll investigate further and let you know what else I can find.
Thanks,
Sandra -
Hello,
I seems that the CVS version of XQuilla implements a large part of the XQuery Update working draft, which is great !
Does it mean that it's usable with BDB XML as-is to get database updates ?
Thanks,
FabriceHi Fabrice,
I'm afraid there is significant work to do in DB XML before XQuery Update can be used from it. However, It is our intention to support XQuery Update in some future version.
John -
XQUERY / XMLTABLE Syntax to read and XML from a Windows local drive?
Hi,
Would someone post an example of the syntax to read a text file containing XML from the local Windows disk drive using xquery/xmltable syntax?
Thanks,
VictorDoes the following help...
SQL> conn test/test
Connected.
SQL> -- The test user has the DBA role...
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
5 rows selected.
/* The content of the data.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<ID>0</ID>
<INFO>
<INFO_ID>0</INFO_ID>
<INFO_CONTENT>Text</INFO_CONTENT>
</INFO>
</ROOT>
SQL> drop directory xmlstore;
Directory dropped.
SQL> -- the directory is on a Windows system...
SQL> create directory xmlstore as 'E:\temp';
Directory created.
SQL> create table test
2 (xmldata xmltype);
Table created.
SQL> INSERT into test
2 VALUES
3 (XMLTYPE(bfilename('XMLSTORE','data.xml'),NLS_CHARSET_ID('AL32UTF8')));
1 row created.
SQL> set long 100000000
SQL> select * from test;
XMLDATA
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<ID>0</ID>
<INFO>
<INFO_ID>0</INFO_ID>
<INFO_CONTENT>Text</INFO_CONTENT>
</INFO>
</ROOT>
1 row selected.
SQL> select XMLTYPE('<ROOT><ID>0</ID><INFO><INFO_ID>0</INFO_ID><INFO_CONTENT>Text</INFO_CONTENT></INFO></ROOT>') as "XDATA"
2 from dual;
XDATA
<ROOT><ID>0</ID><INFO><INFO_ID>0</INFO_ID><INFO_CONTENT>Text</INFO_CONTENT></INFO></ROOT>
1 row selected.
SQL> select XMLTYPE(bfilename('XMLSTORE','data.xml'),NLS_CHARSET_ID('AL32UTF8')) as "XDATA"
2 from dual;
ERROR:
ORA-21500: internal error code, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]
no rows selected
SQL> select extract((XMLTYPE(bfilename('XMLSTORE','data.xml'),NLS_CHARSET_ID('AL32UTF8'))),'*') as "XDATA"
2 from dual;
XDATA
<ROOT><ID>0</ID><INFO><INFO_ID>0</INFO_ID><INFO_CONTENT>Text</INFO_CONTENT></INFO></ROOT>
1 row selected.
SQL> select xdata
2 from (XMLTABLE('*'
3 PASSING (XMLTYPE(bfilename('XMLSTORE','data.xml'),NLS_CHARSET_ID('AL32UTF8')))
4 COLUMNS xdata xmltype PATH '/*'
5 )
6 )
7 ;
XDATA
<ROOT><ID>0</ID><INFO><INFO_ID>0</INFO_ID><INFO_CONTENT>Text</INFO_CONTENT></INFO></ROOT>
1 row selected. -
Dear all,
I am looking for some database systems that use the W3C XQuery Update facility specification to modify their data.
To the best of my knowledge, no of well-known commercial database systems uses XQuery Update primitives.
For instance, Oracle 11g defines some SQL/XML update functions (combined with some XQuery expressions) to modify XML data stored within the database through the XMLType data type.
IBM DB2 9 uses SQL update statement to modify the whole XML document stored as an XML column and no update is proposed to modify parts of the document.
Are there some database systems providing XQuery-Update-Facility-based update of their data.
Thank you in advance.
Best regards.Were you aware of
[url http://www.liberidu.com/blog/2011/09/22/oracle-xmldb-xquery-update-in-database-release-11-2-0-3-0/]Oracle XMLDB XQuery Update in Database Release 11.2.0.3.0
Given it is new, expect a few bugs, such as
{thread:id=2355054}
If you have specific questions related to XQuery Update, the best place to ask them is over in the {forum:id=34} forum. -
XQuery Update Facility in XMLDB?
Hi
I didn't find information about XQuery Update Facility
support or XUpdate support in Oracle XML DB. Do you have
such info?
Regards,
--drkmXquery update is NOT anywhere near well enougth defined for us to implement it at present. We are actively involved in the standards process for XQuery update. It's very unclear what the future of the XUpdate is at this point...
We support node-level updates through a set of SQL functions
updateXML (9iR2 and later), insertChildXML, appendChildXML, insertXMLBefore and deleteXML (10gr2 and later)
Message was edited by:
mdrake -
Decreasing performance when executing consecutive XQuery Update operations
hello,
I am writing an application in java using Berkeley DB XML (2.5.16). I have to run a test over the application, in which a lot of XQuery Update operations have to be executed. All update operations are insert statements. In the beginning the test works fine. However, as the number of updates increases (over 1000 XQuery Updates), there is also a great increase in time of execution. How can I enhance the performance of updates?
Note that:
1) The environment configuration is the following:
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setInitializeCache(true);
envConfig.setCacheSize(512*1024*1024);
envConfig.setInitializeLocking(false);
envConfig.setInitializeLogging(false);
envConfig.setTransactional(false);
2) No transactions are used
3) The container is a node container
4) Auto-indexing is on (I need that)
5) The container includes only one xml of 2,5MB size.
6) In some insert statements 1000 nodes are to be inserted.
7) I am running windows vista on a 4GB Ram pc.
Thank you in advance,
theoHi Lucas,
Thanks a lot for your reply! However, I have a few more questions.
Given that the xml is about 2.5MB size, is it considered to be that big for Berkeley DB so it needs to be break down into smaller documents?
Also, after having executed ~4000 xquery update insert operations and doubled xml’s size, the performance it’s really getting worse… An insertion may even take 1.5 min, when for each of the first 3000 insertions only less than 0.5 sec is needed… Is there something I am missing in the configuration of Berkeley DB? If I set autoindexing off and try to maintain fewer indexes, is it possible to see significantly better performance? Till now I am just getting the following error when I set my indexes and try to execute consequent insertions over the same node:
Exception in thread "main" com.sleepycat.dbxml.XmlException: Error: Sequence does not match type item() - the sequence does not contain items [err:XUDY0027], <query>:1:1, errcode = QUERY_EVALUATION_ERROR+
at com.sleepycat.dbxml.dbxml_javaJNI.XmlQueryExpression_execute__SWIG_1(Native Method)
at com.sleepycat.dbxml.XmlQueryExpression.execute(XmlQueryExpression.java:85)
+<myClasses>+
Thanks,
theo -
XQuery Update (11.2.0.3) and the path table
Hi,
I'm currently using XQuery update on 11.2.0.3 to merge 2 XML documents, having tried a number of approaches up to now on 11.2.0.2.
My table has one XMLType column (securefile binary containing unstructured xml) which has XML deltas applied to it via a stored procedure.
An unstructured XML index is defined on the column.
Previously, I was doing the following:
1) Merge documents using XMLQuery; only produce a merged document if changes were detected
2) Update the table if the merged document is non-null
i.e.
select XMLQuery(<merging code>) passing oldDoc as "oldDoc", delta as "delta" returning content) into mergedDoc from dual;
if (mergedDoc is not null) then
update myTable set xmlDoc = mergedDoc where id=v_id;
end if;However, this replaces the entire document if any changes are detected (with an obvious impact on the path table).
I then read (UpdateXML query rewrite with unstructured data? about the use of XQuery Update in 11.2.0.3 to only target the affected document fragments so my current approach is:
update myTable
set xmldoc =
xmlquery('declare namespace m="http://www.blah.com/merge";
(: See if two nodes have matching text (or no text which is an empty sequence :)
declare function m:matchText($one as element(), $two as element()) as xs:boolean {
if ($one/text() = $two/text() or count($one/text())=0 and count($two/text())=0) then true() else false()
declare updating function m:merge($old as element()?, $new as element()?) {
(for $o in $old/* return
for $n in $new/* where name($o) = name($n) return
if (count($n/*) > 0) then
m:merge($o, $n)
else
if (m:matchText($n, $o)) then () else replace value of node $o with $n,
for $n in $new/* where (not(some $o in $old/* satisfies name($o) = name($n))) return insert node $n into $old)
copy $d := .
modify (
(m:merge($d/*,$delta/*))
) return $d'
passing xmldoc, delta as "delta"
returning content)
where id = v_id;If no changes were detected between the documents (i.e. the XQuery update did not actually modify the document), would you expect this statement to have no impact on the path table? Is there any way to get more trace information which shows what the update is actually doing when it executes?
Apologies if this is overlong or if I have omitted any supplementary information.
Thanks for any assistance
LarryHi,
many thanks for your reply.
A simple testcase is below. The recursive approach is required because the documents may be hierarchial.
create table mytable (id number(19,0), xmldoc xmltype) xmltype column "XMLDOC" store as securefile binary xml;
insert into myTable values (1,xmltype('<xml><el1>1</el1><el2>2</el2><el3>3</el3></xml>'));
update myTable
set xmldoc =
xmlquery('declare namespace m="http://www.blah.com/merge";
(: See if two nodes have matching text (or no text which is an empty sequence :)
declare function m:matchText($one as element(), $two as element()) as xs:boolean {
if ($one/text() = $two/text() or count($one/text())=0 and count($two/text())=0) then true() else false()
declare updating function m:merge($old as element()?, $new as element()?) {
(for $o in $old/* return
for $n in $new/* where name($o) = name($n) return
if (count($n/*) > 0) then
m:merge($o, $n)
else
if (m:matchText($n, $o)) then () else replace value of node $o with $n,
for $n in $new/* where (not(some $o in $old/* satisfies name($o) = name($n))) return insert node $n into $old)
copy $d := .
modify (
(m:merge($d/*,$delta/*))
) return $d'
passing xmldoc, xmltype('<xml><el1>1-UPDATE</el1><el4>4</el4></xml>') as "delta"
returning content)
where id = 1;This results in one update and one insert:
<xml><el1>1-UPDATE</el1><el2>2</el2><el3>3</el3><el4>4</el4></xml>It currently produces the following trace:
*** 2012-03-13 10:13:34.708
not delete/insert/replace in modify clause
--------- XQuery NO rewrt expr END-----
--------- XQuery NO rewrt expr BEG-----
UDF with noderef
--------- XQuery NO rewrt expr END-----I've noticed that even with a simple XQuery update like the following:
update myTable set xmldoc =
xmlquery('copy $d := .
modify (
(replace value of node $d/xml/el1 with "1-UPDATE-2",insert node <el4>4</el4> into $d/xml)
) return $d'
passing xmldoc
returning content) where id = 1;I get the following trace:
*** 2012-03-13 10:31:42.280
--------- XQuery NO rewrt expr BEG-----
non-simple content in target expression
--------- XQuery NO rewrt expr END-----
--------- XQuery NO rewrt expr BEG-----
not delete/insert/replace in modify clause
--------- XQuery NO rewrt expr END-----
Non-iterator usage
Non-iterator usageDoes this also indicate that a rewrite is not occurring, or is this only when a message like "NO REWRITE Reason ==> xseq:not optuop" is traced?
I'll try XSLT in the meantime.
Regards
Larry -
Xml to Oracle (Update more than one row)
Hi,
I want to update more than one row in table from .xml file. My xml file is as follows:
<ROOT>
<PROFILE PROFILEMASTER_PKEY="54" DB_MSTR_PKEY="2" PROFILE_NAME="Bhushans" DELIMETER="~" PRE_PROCESSOR="1" POST_PROCESSOR="10" PRE_PROCESSOR_TYPE="1" POST_PROCESSOR_TYPE="2" GROUPID="2" />
<PROFILEDETAILS PROFILEMASTER_PKEY="54" TARGET_SOURCE_TABLE="FM_FEEDVALIDATION_LU" COLUMN_NAME="FEEDVALIDATION_ID" DATA_TYPE="NUMBER" DATA_SIZE="22" START_POSITION="12" END_POSITION="22" COLUMNORDER="1" PROFILEDETAILS_PKEY="399"/>
<PROFILEDETAILS PROFILEMASTER_PKEY="54" TARGET_SOURCE_TABLE="FM_FEEDVALIDATION_LU" COLUMN_NAME="CHANGE_TYPE" DATA_TYPE="VARCHAR2" DATA_SIZE="1" START_POSITION="12" END_POSITION="144" COLUMNORDER="5" PROFILEDETAILS_PKEY="403"/>
<OPTIONS PROFILEMASTER_PKEY ="54" LDR_SYNTX_DTLS_PKEY ="19" OPTIONVALUE="@" PROFILE_CFILE_PKEY="337" />
<OPTIONS PROFILEMASTER_PKEY ="54" LDR_SYNTX_DTLS_PKEY ="19" OPTIONVALUE="~" PROFILE_CFILE_PKEY="336" />
</ROOT>
To update according to xml file, I have written following procedure. My procedure updates the table if u r updating 1 row. If you try to update more than 1 row, I mean .xml file contains more than 1 row then my procedure doesn't work. Please help to solve this problem.
Procedure:
create or replace procedure fm_prc_xml_dup_up
as
f utl_file.file_type;
s varchar2(2000);
v varchar2(3000);
xml XMLType;
v_pmpk number;
v_sdtl_pk number;
chng_typ VARCHAR2(20);
type r1 is ref cursor;
rcur r1;
v1 varchar2(120);
v2 number;
begin
f := utl_file.fopen('CITI', 'S.XML', 'R');
loop
utl_file.get_line(f, s);
v := v || ' ' || s;
end loop;
exception
when no_data_found then
utl_file.fclose(f);
xml := xmltype(v);
SELECT extract(xml, 'ROOT/CHANGE/@CHANGETYPE').getstringval()
INTO CHNG_TYP
FROM DUAL;
UPDATE FM_PROFILEMAST
set db_mstr_pkey = extract(xml, 'ROOT/PROFILE/@DB_MSTR_PKEY').getnumberval(),
profile_name = extract(xml, 'ROOT/PROFILE/@PROFILE_NAME').getstringval(),
file_type = extract(xml, 'ROOT/PROFILE/@FILE_TYPE').getstringval(),
delimiter = extract(xml, 'ROOT/PROFILE/@DELIMETER').getstringval(),
pre_processor = extract(xml, 'ROOT/PROFILE/@PRE_PROCESSOR').getstringval(),
post_processor = extract(xml, 'ROOT/PROFILE/@POST_PROCESSOR').getstringval(),
pre_processor_type = extract(xml, 'ROOT/PROFILE/@PRE_PROCESSOR_TYPE').getstringval(),
post_processor_type = extract(xml, 'ROOT/PROFILE/@POST_PROCESSOR_TYPE').getstringval(),
groupid = extract(xml, 'ROOT/PROFILE/@GROUPID').getstringval(),
change_type = 'U',
change_by = chng_typ,
change_dt = default,
active_flag = default
WHERE profilemaster_pkey = extract(xml, 'ROOT/PROFILE/@PROFILEMASTER_PKEY').getnumberval();
UPDATE FM_PROFILEDET
SET target_source_table = extract(xml, 'ROOT/PROFILEDETAILS/@TARGET_SOURCE_TABLE').getstringval(),
column_name = extract(xml, 'ROOT/PROFILEDETAILS/@COLUMN_NAME').getstringval(),
data_type = extract(xml, 'ROOT/PROFILEDETAILS/@DATA_TYPE').getstringval(),
data_size = extract(xml, 'ROOT/PROFILEDETAILS/@DATA_SIZE').getnumberval(),
start_position = extract(xml, 'ROOT/PROFILEDETAILS/@START_POSITION').getnumberval(),
end_position = extract(xml, 'ROOT/PROFILEDETAILS/@END_POSITION').getnumberval(),
change_by = chng_typ,
change_dt = default,
columnorder = extract(xml, 'ROOT/PROFILEDETAILS/@COLUMNORDER').getstringval(),
column_format = extract(xml, 'ROOT/PROFILEDETAILS/@COLUMN_FORMAT').getstringval(),
nullable = extract(xml, 'ROOT/PROFILEDETAILS/@NULLABLE').getstringval(),
change_type ='U',
active_flag = default
WHERE profiledetails_pkey = extract(xml, 'ROOT/PROFILEDETAILS/@PROFILEDETAILS_PKEY').getstringval();
UPDATE FM_PROFILE_CFILE
SET profilemaster_pkey = extract(xml, 'ROOT/PROFILE/@PROFILEMASTER_PKEY').getnumberval(),
ldr_syntx_dtls_pkey = extract(xml, 'ROOT/OPTIONS/@LDR_SYNTX_DTLS_PKEY').getstringval(),
val = extract(xml, 'ROOT/OPTIONS/@OPTIONVALUE').getstringval(),
change_by = chng_typ,
change_dt = default,
sub_line_seq = extract(xml, 'ROOT/OPTIONS/@SUB_LINE_SEQ').getstringval(),
change_type = 'U',
active_flag = default
where profile_cfile_pkey = extract(xml, 'ROOT/OPTIONS/@PROFILE_CFILE_PKEY').getnumberval();
END;Hi Bhushan,
one where clause is missing in the main update.
update fm_profiledet
set (....)
=(select ....)
where id in (select your profiledetails_pkey from the xml). <--this where clause were missing.
if xml extracting is too slow(xml very large) then you can create a procedure where exract your data from the xml and then update rows in for loop.
something like this
create procedure up_xmls(p_xml xmltype) is
cursor cur_xml(p_xml xmltype) is
select ......<--here you extract your xml
begin
for r_row in cur_xml(p_xml) loop
update fm_profiledet set target_source_table=r_row.target_source_table
where profiledetails_pkey=r_row.profiledetails_pkey;
end loop;
end;this should work:
SQL> drop table fm_profiledet;
Table dropped.
SQL> create table fm_profiledet(
2 profiledetails_pkey number
3 ,target_source_table varchar2(100)
4 ,column_name varchar2(100)
5 ,data_type varchar2(100)
6 ,data_size number
7 ,start_position number
8 ,change_type varchar2(100)
9 )
10 /
Table created.
SQL>
SQL>
SQL> insert into fm_profiledet
2 values(399,'test','test1','test2',1,2,'A')
3 /
1 row created.
SQL>
SQL>
SQL> insert into fm_profiledet
2 values(403,'test3','test4','test5',3,4,'B')
3 /
1 row created.
SQL> insert into fm_profiledet
2 values(443,'test3','test4','test5',3,7,'B')
3 /
1 row created.
SQL>
SQL>
SQL> select * from fm_profiledet;
PROFILEDETAILS_PKEY TARGET_SOU COLUMN_NAM DATA_TYPE DATA_SIZE START_POSITION CHANGE_TYP
399 test test1 test2 1 2 A
403 test3 test4 test5 3 4 B
443 test3 test4 test5 3 7 B
SQL>
SQL> create or replace directory xmldir as '/home/ants';
Directory created.
SQL>
SQL>
SQL>
SQL> update fm_profiledet fm
2 set (target_source_table,column_name, data_type, data_size, start_position,change_type)
3 =(
4 select target_source_table
5 , column_name
6 , data_type
7 , data_size
8 , start_position
9 , change_type
10 from(
11 select
12 extractValue(value(x),'/PROFILEDETAILS/@PROFILEDETAILS_PKEY') profiledetails_pkey
13 , extractValue(value(x),'/PROFILEDETAILS/@TARGET_SOURCE_TABLE') target_source_table
14 , extractValue(value(x),'/PROFILEDETAILS/@COLUMN_NAME') column_name
15 , extractValue(value(x),'/PROFILEDETAILS/@DATA_TYPE') data_type
16 , extractValue(value(x),'/PROFILEDETAILS/@DATA_SIZE') data_size
17 , extractValue(value(x),'/PROFILEDETAILS/@START_POSITION') start_position
18 ,'U' change_type
19 from
20 table(xmlsequence(extract(xmltype(bfilename('XMLDIR','prof.xml')
21 ,nls_charset_id('AL32UTF8'))
22 , '/ROOT/PROFILEDETAILS'))) x
23 ) s
24 where s.profiledetails_pkey=fm.profiledetails_pkey)
25 where
26 fm.profiledetails_pkey in (select
27 extractValue(value(x),'/PROFILEDETAILS/@PROFILEDETAILS_PKEY') profiledetails_pkey
28 from
29 table(xmlsequence(extract(xmltype(bfilename('XMLDIR','prof.xml')
30 ,nls_charset_id('AL32UTF8'))
31 , '/ROOT/PROFILEDETAILS'))) x
32 );
2 rows updated.
SQL>
SQL>
SQL> select * from fm_profiledet;
PROFILEDETAILS_PKEY TARGET_SOU COLUMN_NAM DATA_TYPE DATA_SIZE START_POSITION CHANGE_TYP
399 FM_FEEDVAL FEEDVALIDA NUMBER 22 12 U
IDATION_LU TION_ID
403 FM_FEEDVAL CHANGE_TYP VARCHAR2 1 12 U
IDATION_LU E
443 test3 test4 test5 3 7 B
SQL> spool off;Ants
Message was edited by:
Ants Hindpere -
Hi,
I keep getting a java update syntax error and can't for the life of me figure out where it is. Help?
criteria = "UPDATE Customer SET CustomerID = '" + txtCustomerID.getText() + "', " +
"CompanyName = '" + txtCompanyName.getText() + "', BusinessAddress = '" + txtBusinessAddress.getText() +
"', City = '" + txtCity.getText() + "', State = '" + txtState.getText() + "', ZIP = '" + txtZIP.getText() +
"', ContactName = '" + txtContactName.getText() + "', CustomerSince = #" + myDate + "#, ContactPhone = '" +
txtContactPhone.getText() + "', FaxNumber = '" + txtFax.getText() + "', OtherPhone = '" + txtAltPhone.getText() +
"', EmailAddress = '" + txtEmail.getText() + "', Note = '" + txtNotes.getText() + "' WHERE CustomerID = '" +
txtCustomerID.getText() + "'";And the resulting SQL query is:
UPDATE Customer SET CustomerID = '000-0002', CompanyName = 'Stink Inc.', BusinessAddress= '103 N University St.', City = 'West Lafayette', State = 'IN', ZIP = '47906', ContactName = 'Ryan Hedlund', CustomerSince = #2005-12-25#, ContactPhone = '317-545-8766', FaxNumber = '3178789964', OtherPhone = '3178446555', EmailAddress = '[email protected]', Note = 'Hedlund is a smelly smelly man.' WHERE CustomerID = '000-0002'Nevermind, saw I was using "Note" instead of "Notes" like I shoulda been embarrassed
-
Hello,
is it possible to get prerelease of the next version of DBXML or at least the documentation focused on XQuery Update implementation.
Thanks
MarioMario,
2.4 will be generally available quite soon. The Getting Started Guides in the documentation have sections on basic XQuery Update usage (replacing the old sections on XmlModify). The candidate recommendation is a detailed (if not user-friendly) source of information:
http://www.w3.org/TR/xquery-update-10/
Regards,
George -
Xquery update transaction (xqilla)
Hi,
it seems that when performing an xquery update such as 'insert node' that a transaction is allocated for this query, so that (using the Java API) there is no need to explicitly create a transaction - is this true?
If it is, then just using xquery gets rid of a transaction management problem and the try/finally.
thanks,
NormanAn updating query is auto-transacted if a transaction is not provided. However, auto-transacted methods still need to catch deadlock exceptions and retry.
John -
I see on the Wikipedia article for XQuery Update Facility, that XQilla, which BDBXML uses, implements the XQUF (not sure to which degree though). Can you utilize these commands in any XQuery, and does it require a special use of the API? Any documentation on your site? This looks like a very exciting language extension to have available.
thank you,
BrettBrett,
Thanks. This also means XmlModify will eventually disappear since it's no longer
necessary (and now implemented in terms of XQuery Update anyway). It's still around for
now.
As for security, we're considering one or both of:
1. bool XmlQueryExpression::isUpdateExpression() to allow the application
to ask the question and decide.
2. A flag (e.g. DBXML_NO_UPDATES) passed to the relevant execute() and query() functions. In Java it'd be a new configuration option in XmlDocumentConfig
Do you have a preference? I'm leaning toward (1) -- it's a slightly simpler change
and just as easy to use.
Regards,
George -
Where I can find examples with OLAP DML to update the cube cells?
Hi,
Where I can find examples with OLAP DML to update/calculate the cube measure/cells?
I would like to insert data into the cube by OLAP DML.
Regards,
TomBNot sure about examples but this is how you should proceed
1. Limit all your dimension to the leaf level values.
lmt financialperiod to '200901'
lmt geography to 'XYZ'
lmt product to 'LAPTOP'
2. Limit your measure variable to one measure(this is applicable if you have more than one stored measure in the cube).
for 10g
lmt <cube name>prtmeasdim to '<MEASURE NAME>'
for 11g
lmt <cube name>measuredim to '<MEASURE NAME>'
3. Write into the variable.
for 10g
<cube name>prttopvar = 100 -- this variable is created for a compressed & partitioned cube. for uncompressed cube the variable name is <cube name>_stored.
Thanks
Brijesh -
Textfields iOS not updated when the XML allready is updated
Hi,
I am testing an app for iOS and later on also for Android. I am using an XML from PHP with and also without a MySQL database.
In one case I only use the current date to be published in the app in a textfield. Problem is that to get all ML connected textfields updated even when the XML allready is updated I have to completely restart the iPod Touch which I use to test on. Is there a way that the user is able to push a button to manually update the app without closing down the device? In addition, is there away that the app automaticaly refreshes its content?
Any help is greatly appreciated.Took me some time to find out why I didn't succeed.
I finally succeeded in the way kglad suggested.
Problem was that when you close the app and later on open it the information for example a date/time through php/xml doesnot change.
That is untill you click something.
So my test with just the date didnot seem to change anything.
But when I hit a button to another frame and send it back
The date/time are updated.
Thanks kglad for pointing me in the right direction.
Maybe you are looking for
-
let me explain my situation. quite a while ago i purchased a 4th generation ipod touch from apple, it was all looking fine until i tried to use the home button, it didn't work. so i took it down to regent street apple store who happily told me it cou
-
HOW CAN I START ORACLE REPORT SERVER BY USING ORACLE DEVELOPER 10G R2
-
Passing parameters from oracle form to html
Hello, I have an application that requires me to take data from an oracle web form and pass many fields as parameters into an html table. Is this possible?
-
Converting from Deski to Webi - Error
Hi Everybody, when I try to convert the DeskI report to WebI, it is partially converted because of the following error: Failed: Page Setup Options : (Report Name)- Page setup options are not implemented in Web Intelligence (First page number, page or
-
Lightweight Installation - What dependencies am I missing?
Hi there, Im trying to do a lightweight installation of ArchLinux. Im having issues with mkinitcpio, when I make the kernel. /sbin/mkinitcpio -k 2.6.21 -ARCH -c /etc/mkini /lib/initcpio/functions: line 143: find: command not found ERROR module 'ata[