Updating an xmltype table
hi,
I have two xmltype tables(eg. testTableSB and testTableNSB), first one is schema-based(conforms to schemaA) and the other one is non-schema-based.
So the default storage will be object-relational and CLOB respectively.
I load the same xml document in both the tables. Each table has one row only(suppose).
Later I use the update statement with updateXML() in RHS as following:
update testTableSB x
set value(x)=updatexml(value(x),'/Company/Person[2]/@Degree','PHD');
update testTableNSB x
set value(x)=updatexml(value(x),'/Company/Person[2]/@Degree','BA');
Both updates work. From the documentation, I came to know that in the first table it only updates the node or attribute value whereas in the second update, the whole document is repalced because it is CLOB based.
My confusion is in the second update since it seems updating (in this case) only the attribute value.
Please suggest.
One more question, how to check whether the storage option for the table is object-relational or CLOB. One option is to describe the table. In this way, it gives info for object-relational only not for CLOB. what is the other way to check it? Any data_dictionary table?
SQL> create table testTableNSB of XMLType;
Table created.
SQL> describe testTableNSB;
Name Null? Type
TABLE of XMLTYPE
Thanking in advance.
Hi
I as wrote I never tested this possibility... therefore I did the following test.
A table contains the following XML data:
SQL> select extract(value(o), '/optw/person')
2 from optw1_or_ot o
3 where existsnode(value(o), '/optw/person[@id=5]') = 1;
EXTRACT(VALUE(O),'/OPTW/PERSON')
<person id="5">
<lastname>String</lastname>
<firstname>String</firstname>
<sex>F</sex>
</person>
If I access the underlying structure, the query looks like this (notice that birthday is NULL):
SQL> select x.id, x.lastname, x.firstname, x.birthday, x.sex
2 from optw1_or_ot o, table(o.xmldata.persons) x
3 where x.id = 5;
ID LASTNAME FIRSTNAME BIRTHDAY SEX
5 String String F
If I update the data, it seams to work...
SQL> update table(select o.xmldata.persons
2 from optw1_or_ot o, table(o.xmldata.persons) x
3 where x.id = 5) t
4 set t.birthday = sysdate;
1 row updated.
SQL> select x.id, x.lastname, x.firstname, x.birthday, x.sex
2 from optw1_or_ot o, table(o.xmldata.persons) x
3 where x.id = 5;
ID LASTNAME FIRSTNAME BIRTHDAY SEX
5 String String 06-FEB-04 F
But if I select the XML data again, the data isn't available...
SQL> select extract(value(o), '/optw/person')
2 from optw1_or_ot o
3 where existsnode(value(o), '/optw/person[@id=5]') = 1;
EXTRACT(VALUE(O),'/OPTW/PERSON')
<person id="5">
<lastname>String</lastname>
<firstname>String</firstname>
<sex>F</sex>
</person>
It seams that Oracle also stores "control" information in another columns.
Therefore the only way to add such an element is through the updatexml() function.
Chris
Similar Messages
-
Correct way to handle updates of XMLtype columns in standard tables.
Hello to whoever may read this,
I am currently studying the XML functionality of oracle DB for a uni project.
We have been asked to compare/contrast solutions to publishing product and price data for data stored in standard relational tables, and data stored in XML type tables. For extra marks, i am looking at a table containing an XMLType column for multiple items of data relating to the primarykey.
I have managed to get my head around publishing the data - pretty straight forward, but we have also been asked to show how we can update data, which isn't a problem within the standard tables/columns, but when it comes to the XMLType columns/tables, i dont have a clue.
At the moment i am working on trying to update an XMLtype column. The table itself is a "product" table, and contains product information, as well as an XMLType column containing multiple changes to the prices. In the relational tables, this "product" table has a one-to-many link to another table called price_history which contains details about past prices (which is populated by a trigger on update/insert of a new price). But in this table all the product changes are stored in XML format in the XML type column "prices".
Table columns: id number(4), name varchar2(25), prices xmltype;
example data: 1781, CDW 20/48/E, <product_prices><price_change>
<change_id>1</change_id>
<date_changed>2009-10-13</date_changed>
<details>price increased</details>
<new_value>234</new_value>
</price_change>
<price_change>
<change_id>2</change_id>
<date_changed>2009-10-13</date_changed>
<details>price increased</details>
<new_value>235</new_value>
</price_change></product_prices>
We need to give examples of an update. I have been looking around the net, and these forums for a solution now for about 4 hours. My own thoughts are that to update this with a new price change i need to, SELECT the current data INTO a variable, then concatenate that variable with the new price change info e.g.
<price_change>
<change_id>3</change_id>
<date_changed>2009-10-13</date_changed>
<details>price decreased</details>
<new_value>230</new_value>
</price_change>
then insert that whole chunk of data again to overwrite the old data.
Now im fairly certain there is some function somewhere which will allow me to do this update/insert operation without going through this process... After i am done with this update of XMLType column data, i need to tackle updating data in an XMLType Table with XQuery(? apparently), so if you have any pointers for that please let me know.
Could one of you experts point me in the right direction for this? Any advice at this stage is a great help and will stop me losing my mind.
p.s. im sorry about the lengthy description of the problem/solution required. How to describle something i dont understand? I ask myself.Hi,
You really need to take a look at the XMLDB Developers guide.
For updating XML with SQL/XML see UPDATEXML and for XQuery see [Using XQuery with Oracle XMLDB|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14259/xdb_xquery.htm#sthref1673]
HTH,
Chris -
Updating a very large xmltype table in xmldb
Hi,
I am working on storing a large collection of xml files inside XMLDB (Oracle 10g database). I choose to use the object-relational storage instead of CLOB storage because of the type of queries that have to be performed on this database. The files were loaded successfully into an xmltype table and currently there are more than15million records in the database. I have built functional indexes and text index to improve query performance.
I would like to know the best way to run regular updates on this database(about once in every two weeks). The update xml files(Five 40MB files with 10,000 records each) contain both old records to be updated and new records to be inserted.
Each record has a unique id element which can be used in checking to see if it already exists in the database. So the update procedure would require a select on the database to check and see if the record already exists and then update if it exists or insert if it does not.
Any ideas on how to acheive this within a reasonable amount of time will be greatly appreciated.
Thanks,
UmaThanks Mark,
I have modified the SAXLoader to use a stored procedure inside Oracle which would insert/update as the case may be. It's taking 10 minutes to load a single update file (50MB in size with 10,000 xml records). I have built a text index on this table and it takes 20 to 30 minutes to synchronize the index. I am relatively new to XMLDB and text indexing, and was wondering if there's a way to speed up this process.
Thanks once again,
Uma -
Insert XML file into Relational database model without using XMLTYPE tables
Dear all,
How can I store a known complex XML file into an existing relational database WITHOUT using xmltypes in the database ?
I read the article on DBMS_XMLSTORE. DBMS_XMLSTORE indeed partially bridges the gap between XML and RDBMS to a certain extent, namely for simply structured XML (canonical structure) and simple tables.
However, when the XML structure will become arbitrary and rapidly evolving, surely there must be a way to map XML to a relational model more flexibly.
We work in a java/Oracle10 environment that receives very large XML documents from an independent data management source. These files comply with an XML schema. That is all we know. Still, all these data must be inserted/updated daily in an existing relational model. Quite an assignment isn't it ?
The database does and will not contain XMLTYPES, only plain RDBMS tables.
Are you aware of a framework/product or tool to do what DBMS_XMLSTORE does but with any format of XML file ? If not, I am doomed.
Constraints : Input via XML files defined by third party
Storage : relational database model with hundreds of tables and thousands of existing queries that can not be touched. The model must not be altered.
Target : get this XML into the database on a daily basis via an automated process.
Cheers.
Luc.Luc,
your Doomed !
If you would try something like DBMS_XMLSTORE, you probably would be into serious performance problems in your case, very fast, and it would be very difficult to manage.
If you would use a little bit of XMLType stuff, you would be able to shred the data into the relational model very fast and controlable. Take it from me, I am one of those old geezers like Mr. Tom Kyte way beyond 40 years (still joking). No seriously. I started out as a classical PL/SQL, Forms Guy that switched after two years to become a "DBA 1.0" and Mr Codd and Mr Date were for years my biggest hero's. I have the utmost respect for Mr. Tom Kyte for all his efforts for bringing the concepts manual into the development world. Just to name some off the names that influenced me. But you will have to work with UNSTRUCTURED data (as Mr Date would call it). 80% of the data out there exists off it. Stuff like XMLTABLE and XML VIEWs bridge the gap between that unstructured world and the relational world. It is very doable to drag and drop an XML file into the XMLDB database into a XMLtype table and or for instance via FTP. From that point on it is in the database. From there you could move into relational tables via XMLTABLE methods or XML Views.
You could see the described method as a filtering option so XML can be transformed into relational data. If you don't want any XML in your current database, then create an small Oracle database with XML DB installed (if doable 11.1.0.7 regarding the best performance --> all the new fast optimizer stuff etc). Use that database as a staging area that does all the XML shredding for you into relational components and ship the end result via database links and or materialized views or other probably known methodes into your relational database that isn't allowed to have XMLType.
This way you would keep your realtional Oracle database clean and have the Oracle XML DB staging database do all the filtering and shredding into relational components.
Throwing the XML DB option out off the window beforehand would be like replacing your Mercedes with a bicycle. With both you will be able to travel the distance from Paris to Rome, but it will take you a hell of lot longer.
:-) -
Exporting xmltype table data into xml/txt file
I want to export data stored in oracle as xmltype table into xml format file.
I want to use alternatives to the method shown below as my xml file is large.
set long 10000000
spool c:\\StudentXMLJan08.xml
SELECT
XMLElement("Student",
XMLForest(s.studentid "studentid",
s.firstname "firstname",
s.lastname "surname"),
XMLElement("enrollments",
(SELECT XMLAGG(
XMLForest(sc.coursecode "courseid"))
FROM studentcourse sc
WHERE sc.studentid = s.studentid
and sc.is_approved='Y'
and sc.takenyear='2008'
and sc.takenterm='1')))
FROM student s
where s.statuscode in (select studentstatuscode from studentstatus where studentstatusactive=1)
order by s.studentid;
spool off
please help, thank youHow's this one for size
SQL> create or replace view DEPARTMENT_XML of xmltype
2 with object id
3 (
4 'DEPARTMENT'
5 )
6 as
7 select xmlElement
8 (
9 "Departments",
10 (
11 select xmlAgg
12 (
13 xmlElement
14 (
15 "Department",
16 xmlAttributes( d.DEPARTMENT_ID as "DepartmentId"),
17 xmlElement("Name", d.DEPARTMENT_NAME),
18 xmlElement
19 (
20 "Location",
21 xmlForest
22 (
23 STREET_ADDRESS as "Address", CITY as "City", STATE_PROVINCE as "State",
24 POSTAL_CODE as "Zip",COUNTRY_NAME as "Country"
25 )
26 ),
27 xmlElement
28 (
29 "EmployeeList",
30 (
31 select xmlAgg
32 (
33 xmlElement
34 (
35 "Employee",
36 xmlAttributes ( e.EMPLOYEE_ID as "employeeNumber" ),
37 xmlForest
38 (
39 e.FIRST_NAME as "FirstName", e.LAST_NAME as "LastName", e.EMAIL as "EmailAddre
ss",
40 e.PHONE_NUMBER as "Telephone", e.HIRE_DATE as "StartDate", j.JOB_TITLE as "Job
Title",
41 e.SALARY as "Salary", m.FIRST_NAME || ' ' || m.LAST_NAME as "Manager"
42 ),
43 xmlElement ( "Commission", e.COMMISSION_PCT )
44 )
45 )
46 from HR.EMPLOYEES e, HR.EMPLOYEES m, HR.JOBS j
47 where e.DEPARTMENT_ID = d.DEPARTMENT_ID
48 and j.JOB_ID = e.JOB_ID
49 and m.EMPLOYEE_ID = e.MANAGER_ID
50 )
51 )
52 )
53 )
54 from HR.DEPARTMENTS d, HR.COUNTRIES c, HR.LOCATIONS l
55 where d.LOCATION_ID = l.LOCATION_ID
56 and l.COUNTRY_ID = c.COUNTRY_ID
57 )
58 )
59 from dual
60 /
View created.
SQL> create or replace trigger DEPARTMENT_DML
2 instead of INSERT or UPDATE or DELETE
3 on DEPARTMENT_XML
4 begin
5 null;
6 end;
7 /
Trigger created.
SQL> declare
2 cursor getDepartments is
3 select ref(d) XMLREF
4 from DEPARTMENT_XML d;
5 res boolean;
6 targetFolder varchar2(1024) := '/public/Departments';
7 begin
8 if dbms_xdb.existsResource(targetFolder) then
9 dbms_xdb.deleteResource(targetFolder,dbms_xdb.DELETE_RECURSIVE_FORCE);
10 end if;
11 res := dbms_xdb.createFolder(targetFolder);
12 for dept in getDepartments loop
13 res := DBMS_XDB.createResource(targetFolder || '/Departments.xml', dept.XMLREF);
14 end loop;
15 end;
16 /
PL/SQL procedure successfully completed.
SQL> select path
2 from path_view
3 where equals_path(RES,'/public/Departments/Departments.xml') = 1
4 /
PATH
/public/Departments/Departments.xml
SQL> select xdburitype('/public/Departments/Departments.xml').getXML()
2 from dual
3 /
XDBURITYPE('/PUBLIC/DEPARTMENTS/DEPARTMENTS.XML').GETXML()
<Departments>
<Department DepartmentId="60">
<Name>IT</Name>
<Location
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\Temp>ftp localhost
Connected to mdrake-lap.
220- mdrake-lap
Unauthorised use of this FTP server is prohibited and may be subject to civil and criminal prosecution.
220 mdrake-lap FTP Server (Oracle XML DB/Oracle Database) ready.
User (mdrake-lap:(none)): SCOTT
331 pass required for SCOTT
Password:
230 SCOTT logged in
ftp> cd /public/Departments
250 CWD Command successful
ftp> ls -l
200 EPRT Command successful
150 ASCII Data Connection
-rw-r--r-- 1 SCOTT oracle 0 NOV 10 20:18 Departments.xml
226 ASCII Transfer Complete
ftp: 71 bytes received in 0.01Seconds 7.10Kbytes/sec.
ftp> get Departments.xml -
200 EPRT Command successful
150 ASCII Data Connection
<Departments><Department DepartmentId="60"><Name>IT</Name><Location><Address>2014 Jabberwocky Rd</Address><City>Southlak
e</City><State>Texas</State><Zip>26192</Zip><Country>United States of America</Country></Location><EmployeeList><Employe
e employeeNumber="103"><FirstName>Alexander</FirstName><LastName>Hunold</LastName><EmailAddress>AHUNOLD</EmailAddress><T
elephone>590.423.4567</Telephone><StartDate>2006-01-03</StartDate><JobTitle>Programmer</JobTitle><Salary>9000</Salary><M
anager>Lex De Haan</Manager><Commission></Commission></Employee><Employee employeeNumber="105"><FirstName>David</FirstNa
me><LastName>Austin</LastName><EmailAddress>DAUSTIN</EmailAddress><Telephone>590.423.4569</Telephone><StartDate>2005-06-
25</StartDate><JobTitle>Programmer</JobTitle><Salary>4800</Salary><Manager>Alexander Hunold</Manager><Commission></Commi
ssion></Employee><Employee employeeNumber="106"><FirstName>Valli</FirstName><LastName>Pataballa</LastName><EmailAddress>
VPATABAL</EmailAddress><Telephone>590.423.4560</Telephone><StartDate>2006-02-05</StartDate><JobTitle>Programmer</JobTitl
e><Salary>4800</Salary><Manager>Alexander Hunold</Manager><Commission></Commission></Employee><Employee employeeNumber="
107"><FirstName>Diana</FirstName><LastName>Lorentz</LastName><EmailAddress>DLORENTZ</EmailAddress><Telephone>590.423.556
7</Telephone><StartDate>2007-02-07</StartDate><JobTitle>Programmer</JobTitle><Salary>4200</Salary><Manager>Alexander Hun
old</Manager><Commission></Commission></Employee><Employee employeeNumber="104"><FirstName>Bruce</FirstName><LastName>Er
nst</LastName><EmailAddress>BERNST</EmailAddress><Telephone>590.423.4568</Telephone><StartDate>2007-05-21</StartDate><Jo
bTitle>Programmer</JobTitle><Salary>6000</Salary><Manager>Alexander Hunold</Manager><Commission></Commission></Employee>
</EmployeeList></Department><Department DepartmentId="50"><Name>Shipping</Name><Location><Address>2011 Interiors Blvd</A
ddress><City>South San Francisco</City><State>California</State><Zip>99236</Zip><Country>United States of America</Count
ry></Location><EmployeeList><Employee employeeNumber="120"><FirstName>Matthew</FirstName><LastName>Weiss</LastName><Emai
lAddress>MWEISS</EmailAddress><Telephone>650.123.1234</Telephone><StartDate>2004-07-18</StartDate><JobTitle>Stock Manage
r</JobTitle><Salary>8000</Salary><Manager>Steven King</Manager><Commission></Commission></Employee><Employee employeeNum
ber="122"><FirstName>Payam</FirstName><LastName>Kaufling</LastName><EmailAddress>PKAUFLIN</EmailAddress><Telephone>650.1
23.3234</Telephone><StartDate>2003-05-01</StartDate><JobTitle>Stock Manager</JobTitle><Salary>7900</Salary><Manager>Stev
en King</Manager><Commission></Commission></Employee><Employee employeeNumber="121"><FirstName>Adam</FirstName><LastName
Fripp</LastName><EmailAddress>AFRIPP</EmailAddress><Telephone>650.123.2234</Telephone><StartDate>2005-04-10</StartDate><JobTitle>Stock Manager</JobTitle><Salary>8200</Salary><Manager>Steven King</Manager><Commission></Commission></Employee
<Employee employeeNumber="124"><FirstName>Kevin</FirstName><LastName>Mourgos</LastName><EmailAddress>KMOURGOS</EmailAddress><Telephone>650.123.5234</Telephone><StartDate>2007-11-16</StartDate><JobTitle>Stock Manager</JobTitle><Salary>5800<
/Salary><Manager>Steven King</Manager><Commission></Commission></Employee><Employee employeeNumber="123"><FirstName>Shan
ta</FirstName><LastName>Vollman</LastName><EmailAddress>SVOLLMAN</EmailAddress><Telephone>650.123.4234</Telephone><Start
Date>2005-10-10</StartDate><JobTitle>Stock Manager</JobTitle><Salary>6500</Salary><Manager>Steven King</Manager><Commiss
ion></Commission></Employee><Employee employeeNumber="128"><FirstName>Steven</FirstName><LastName>Markle</LastName><Emai
lAddress>SMARKLE</EmailAddress><Telephone>650.124.1434</Telephone><StartDate>2008-03-08</StartDate><JobTitle>Stock Clerk
</JobTitle><Salary>2200</Salary><Manager>Matthew Weiss</Manager><Commission></Commission></Employee><Employee employeeNu
mber="127"><FirstName>James</FirstName><LastName>Landry</LastName><EmailAddress>JLANDRY</EmailAddress><Telephone>650.124
.1334</Telephone><StartDate>2007-01-14</StartDate><JobTitle>Stock Clerk</JobTitle><Salary>2400</Salary><Manager>Matthew
Weiss</Manager><Commission></Commission></Employee><Employee employeeNumber="126"><FirstName>Irene</FirstName><LastName>
Mikkilineni</LastName><EmailAddress>IMIKKILI</EmailAddress><Telephone>650.124.1224</Telephone>
<StartDate>2002-06-07</St
artDate><JobTitle>Public Relations Representative</JobTitle><Salary>10000</Salary><Manager>Neena Kochhar</Manager><Commi
ssion></Commission></Employee></EmployeeList></Department></Departments>226 ASCII Transfer Complete
ftp: 40392 bytes received in 0.08Seconds 480.86Kbytes/sec.
ftp> -
HI Gentlemen,
Given a schema-based XMLTYPE table with one big XML instance stored in it. I would like to select a subtree like <gnr V="12345" ...> ... </gnr> where the attribute could be a bind parameter dynamically changing. As an output I would like to have the whole subtree with XML tags, for which I already have a perfectly good XSL stylesheet to display contents. It is working well when the subtree is stored in an .xml file which references the .xsl stylesheet. My question is: How can I organize that the ADF view is connected to the stylesheet and how can I apply all that to a .jspx ADF page? Updating the table is not a matter. Please help if you can.
Thanks, regards
Miklos HERBOLYIf you already have the correct xsl file to use, you might consider creating a xsql page instead of a jspx page:
http://people.cis.ksu.edu/~hankley/d764/tut05/Kamath_XSQL.html
NA
http://nickaiva.blogspot.com -
Jython error while updating a oracle table based on file count
Hi,
i have jython procedure for counting counting records in a flat file
Here is the code(took from odiexperts) modified and am getting errors, somebody take a look and let me know what is the sql exception in this code
COMMAND on target: Jython
Command on source : Oracle --and specified the logical schema
Without connecting to the database using the jdbc connection i can see the output successfully, but i want to update the oracle table with count. any help is greatly appreciated
---------------------------------Error-----------------------------
org.apache.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "<string>", line 45, in ?
java.sql.SQLException: ORA-00936: missing expression
---------------------------------------Code--------------------------------------------------
import java.sql.Connection
import java.sql.Statement
import java.sql.DriverManager
import java.sql.ResultSet
import java.sql.ResultSetMetaData
import os
import string
import java.sql as sql
import java.lang as lang
import re
filesrc = open('c:\mm\xyz.csv','r')
first=filesrc.readline()
lines = 0
while first:
#get the no of lines in the file
lines += 1
first=filesrc.readline()
#print lines
## THE ABOVE PART OF THE PROGRAM IS TO COUNT THE NUMBER OF LINES
## AND STORE IT INTO THE VARIABLE `LINES `
def intWithCommas(x):
if type(x) not in [type(0), type(0L)]:
raise TypeError("Parameter must be an integer.")
if x < 0:
return '-' + intWithCommas(-x)
result = ''
while x >= 1000:
x, r = divmod(x, 1000)
result = ",%03d%s" % (r, result)
return "%d%s" % (x, result)
## THE ABOVE PROGRAM IS TO DISPLAY THE NUMBERS
sourceConnection = odiRef.getJDBCConnection("SRC")
sqlstring = sourceConnection.createStatement()
sqlstmt="update tab1 set tot_coll_amt = to_number( "#lines ") where load_audit_key=418507"
sqlstring.executeQuery(sqlstmt)
sourceConnection.close()
s0=' \n\nThe Number of Lines in the File are ->> '
s1=str(intWithCommas(lines))
s2=' \n\nand the First Line of the File is ->> '
filesrc.seek(0)
s3=str(filesrc.readline())
final=s0 + s1 + s2 + s3
filesrc.close()
raise finali changed as you adviced ankit
am getting the following error now
org.apache.bsf.BSFException: exception from Jython:
Traceback (innermost last):
File "<string>", line 37, in ?
java.sql.SQLException: ORA-00911: invalid character
here is the modified code
sourceConnection = odiRef.getJDBCConnection("SRC")
sqlstring = sourceConnection.createStatement()
sqlstmt="update tab1 set tot_coll_amt = to_number('#lines') where load_audit_key=418507;"
result=sqlstring.executeUpdate(sqlstmt)
sourceConnection.close()
Any ideas
Edited by: Sunny on Dec 3, 2010 1:04 PM -
I cannot see XMLType table in sql*plus
Hi,
Although I have wokred extensively with Oracle, I am new to Oracle XMLdb. My problem is I cannot see the XMLType tables created under my schema. I can see the tables when I do a select from user_xml_tables. But if I do a 'desc' or 'select from', I get ORA-04043 or ORA-00942. I can desc an XMLType table owned by xdb. I am using Oralce 10g. Please provide a solution asap as a customer is waiting on this.
Thanks,
Jayati RayRaghu !!
GREAT!!!
It was a BUG in Oracle sql developer, I installed the new version v3.0, It WORKS like a CHARM.
Thanks a million for your help!!!
Cheers
Tony -
The currency is not getting updated in the table VBAP
Hi ,
The currency is not getting updated in the table VBAP. The currency was suppossed to be copied from the header table VBAK for a Sales Order. When the user creating a Sales Order the currency WAERK is not shown in VBAP table. VBAK-WAERk is in EUR . Does anyone know why is this happenning?
Currency is maintained in the Customer Master, Material Master and Sales Org. Any suggestions?.
Also it is happened for only one line item in a set of line items , Other line items did display the currency field.
The net Value has data in it .
The system is ECC 5.0
Regards,
SenthilDear Senthil,
Please apply the following notes (if they apply to your support pack level) and retest:
1460621 VBAP-WAERK is deleted after the sold-to party is changed
1426441 VBAP-WAERK deleted for subitems
1493998 VBAP-WAERK deleted for subitems
This should resolve the issue. I hope this helps.
Best regards,
Ian Kehoe -
Data is not getting updated in DB table
hi all
i am doing IDOC to jdbc scenario
i am triggering idoc from R/3 and the data is going into DB table
sender side: ZVendorIdoc
receiver side:
DT_testVendor
Table
tblVendor
action UPDATE_INSERT
access 1:unbounded
cVendorName 1
cVendorCode 1
fromdate 1
todate 1
Key
cVendorName 1
if i trigger idoc for example vendor 2005,2006 and 2010 data is getting updated in the table
but again if i trigger idoc for same vendor nos data does not get updated in DB table while message is successfull in moni and RWB both
plz suggest if any change need to be done to update the data
Regards
sandeep sharmaHi Ravi
you are right, vendor no is my key field . problem is when i send data again then it should Update the data but it's not updating the data again
i did on exp with this : i deleted all the record from the table and then triggered idoc for vendor 2005 , 2006,2010 after this data is updated in the table i deleted the rows for vendor no 2006 and 2010 and kept the row for vendor 2005
then i again trigered the idoc for vendor no 2005,2006 and 2010 now this should update and it should insert rows for vendor no 2006 and 2010 but i am surprised its not updating the data
Thanks
sandeep -
TDS amount not getting updated in the table under the field QBSHB
Dear Friends,
The TDS amount entered while booking the vendor invoices through MIRO T-cde, is not getting updated in the table BSEG under the field QBSHB.
Kindly let me know the reason for the same and guide me to correct it
TIA.
Regards,
VincentHI Vincent,
Bseg-QBSHB field is relavent for classic WT.
I hope you are using the EWT.
Hence if you post a document through MIRO it will not update
(but if you post document FB60 it will update but wrongly).
Reason is Miro document is posted through interface.
Hence SAP is suggested to not refer the Bseg-QBSHB and etc., fields.
refer only with_item table.
Please refer the below replay from SAP
Please refer the below note .363309
Please review attached note 363309 for detailed explanation
BSEG-QBSHB is designed to fill for the classic withholding tax. And
extended withholding tax information is stored exclusive in table
WITH_ITEM.
You can check in table BSEG for the fields and will find that system
do NOT update field BSEG-QBSHB.
In your line layout,you define a field BSEG-QBSHB. But actully the field
of vendor/customer line item is filled with zero from FI. Thus,it shows
zero in line item display.
And as note 363309 says,
"Remove the field which contains the withholding tax information
from your display variant.
If you want to display the withholding tax information, double-click on
the document number and subsequently choose 'Withholding tax' button."
(BSEG-QSSKZ, BSEG-QSSHB, BSEG-QBSHB) field is not relavent for
Extended withholding tax and not suppose to use in report FBL1N.
It basically does not make any sense to use the withholding tax fields
of the document line items (BSEG-QSSKZ, BSEG-QSSHB, BSEG-QBSHB) with the
activated extended withholding tax.
regards
Madhu M
Edited by: M Madhu on Jan 31, 2011 1:19 PM -
Can't update a sql-table with a space
Hello,
In a transaktion I'm getting some Values from a SAP-ERP System via JCO.
I update a sql-table with this values with a sql-query command.
But sometimes the values I get from SAP-ERP are empty (space) and I'm not able to update the sql-table because of a null-value exception. (The column doesn't allow null-values). It seems that MII thinks null and space are the same.
I tried to something like this when passing the value to the sql-query parameter but it didn't work:
stringif( Repeater_Result.Output{/item/SCHGT} == "X", "X", " ")
stringif( Repeater_Result.Output{/item/SCHGT} == "X", "X", " ")
this works but I don't want to have a "_"
stringif( Repeater_Result.Output{/item/SCHGT} == "X", "X", "_")
Any suggestions?
thank you.
MatthiasThe problem is Oracle doesn't know the space function. But it knows a similar function: NVL --> replaces a null value with something else. So this statement works fine for me:
update marc set
LGort = '[Param.3]',
dispo = '[Param.4]',
schgt = NVL('[Param.5]', ' '),
dismm = '[Param.6]',
sobsl = NVL('[Param.7]',' '),
fevor = '[Param.8]'
where matnr = '[Param.1]' and werks = '[Param.2]'
If Param.5 or Param.7 is null Oracle replaces it with a space in every other case it is the parameter itself.
Christian, thank you for your hint with the space function. So I remembered the NVL-function.
Regards
Matthias -
Update or delete table from XML
Is it possible to update or delete table's row from XML file?
Thanks
Prasanta DeHi Steve,
Thanks for your reply but I could not find any example from the documentation for update-request or delete-request. I need your help in this regards.
1. I have emp table with many rows and the simple structure like this
DEPTNO NUMBER(2)
EMPNO NUMBER(2)
EMPNAME VARCHAR2(20)
EMPSAL NUMBER(8,2)
Key is defined on deptno and empno
2. I have a xml file like this
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1">
<DEPTNO>1</DEPTNO>
<EMPNO>11</EMPNO>
<EMPSAL>1111.11</EMPSAL>
</ROW>
<ROW num="2">
<DEPTNO>1</DEPTNO>
<EMPNO>12</EMPNO>
<EMPSAL>2222.22</EMPSAL>
</ROW>
<ROW num="3">
<DEPTNO>1</DEPTNO>
<EMPNO>13</EMPNO>
<EMPSAL>3333.33</EMPSAL>
</ROW>
</ROWSET>
3. I want that xsql servlet will read this xml file and update EMPSAL column depending upon the value of DEPTNO and EMPNO from xml file.
Please let me know how I should use update-request in xsql page.
Thanks
Prasanta De
null -
How to delete an .xml file from xmltype table?
Hi expert,
I am in I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
I have inserted 3 .xml files into an xmltype table: DOCUMENT
SQL> SELECT OBJECT_VALUE FROM document;
OBJECT_VALUE
<?xml version="1.0" encoding="WINDOWS-1252"?>
<?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
<document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc
ation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd" classCode="DOC">
<id root="5ca4e3cb-7298-4948-8cc2-58e71ad32694"/>
<code code="51725-0" c
<?xml version="1.0" encoding="WINDOWS-1252"?>
<?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
<document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc
ation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd" classCode="DOC">
<id root="03d6a2cd-fdda-4fe1-865d-da0db9212f34"/>
<code code="51725-0" c
<?xml version="1.0" encoding="WINDOWS-1252"?>
<?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
<document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoc
ation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd" classCode="DOC">
<id root="09ff06d6-8b85-43dd-b5cc-e22d00f02bd0"/>
<code code="51725-0" c
I tried to delete one xml file which with id root="03d6a2cd-fdda-4fe1-865d-da0db9212f34'
delete from DOCUMENT
where xmlexists('$p/document/id[@root="03d6a2cd-fdda-4fe1-865d-da0db9212f34"]'PASSING OBJECT_VALUE AS "p");
but failed.
Is there any expert can help?
Thanks a lot!
Cow
Edited by: Cow on Mar 11, 2011 7:02 PMHi,
Namespace issue.
You have to declare it in the XQuery prolog :
DELETE FROM document
WHERE XMLExists( 'declare default element namespace "urn:hl7-org:v3"; (::)
$p/document/id[@root=$root_value]'
passing object_value as "p",
'03d6a2cd-fdda-4fe1-865d-da0db9212f34' as "root_value" )
; -
Automatic payment program (F110) document are not update in PAYR table
Hi all,
I have make payment in F110 (automatic payment) to customer
But it is not update in PAYR table
Please guide me what I have to do for documents update in PAYR table
Thanks and Regards,
PrudhviHi,
It is possible to enter multiple documents.
You can enter a list of single documents or in intervals.
Enter the document number in ascending order.
Ex:
Individual documents.
10001,10003,10011
If the documents are in a sequence you can enter the Interval like this
(10001,10011)
Hope it helps you
Regards
Andrew
Edited by: Andrew J on May 28, 2009 4:26 PM
Maybe you are looking for
-
BI Publisher report setting in APEX
Dear All, I have created an some rtf file and done some steps for report query and report layout . It is working in apex.oracle .com. When i tried the same into my local system , it is showing an error like below. Error: ==== ORA-29273: HTTP request
-
In our business, we were looking for a functionality to update the delivery details ( components provided to vendor ) under purchase order history. It is found that same is not possible through ME2O but we have transaction called ADSUBCON and it is p
-
BORGR 649 error message while posting with 105 mov type
Hi Gurus, I faced a problem when I try to post with 105 mov type, when material doc is related to Inbound delivery. Explained better: I did a purchase order with inbound delivery confirmation. I carried out Good Receipt (related to Inb delievery) wit
-
Can I install Photoshop 7.0 for Windows onto my new MacBook?
Ages ago I purchased Photoshop 7.0 for Windows. When my laptop died I decided to change to a MacBook, not even considering I might not be able to reinstall it. Well I put the CDROM in, it recognises something is there, but I can't get it to do anythi
-
Index file corrupted.. how we will get index file back?
Hi, I am very new to the ESSBASE. I got some issue, Index file is corrupted in one application (BSO). How can i recover it? Please help me on this issue. thanks.