XMLType.extract changes data?
declare
l_xml xmltype.
l_xml2 xmltype.
Start
l_xml: = xmltype.createxml (xmlData = > bfilename ('XMLDIR2', 'demo.xml'),)
CSID = > 0,
schema = > null);
l_xml2: = l_xml.extract('/UNIVERSITY/PKU/DEP/ART');
dbms_output.put_line (l_xml. GETSTRINGVAL);
l_xml2: = l_xml.extract('/UNIVERSITY/PKU/DEP/ART');
dbms_output.put_line (l_xml. GETSTRINGVAL);
end;
the outputs are
UNIVERSITY <>
< PKU >
< num DEP = "3" >
< ART / >
< AUTO / >
< CHEMICAL / >
< / DEP >
< / ECP >
< TSINGHUA >
< DEP num = "2" >
< BUILDING / >
< AUTO / >
< / DEP >
< / TSINGHUA >
< PKU >
< num DEP = "3" >
< ART / >
< AUTO / >
< CHEMICAL / >
< / DEP >
< / ECP >
< TSINGHUA >
< DEP num = "2" >
< BUILDING / >
< AUTO / >
< / DEP >
< / TSINGHUA >
< / UNIVERSITY >
UNIVERSITY <>
< PKU >
< num DEP = "3" >
< ART / >
< AUTO / >
< CHEMICAL / >
< / DEP >
< / ECP >
< TSINGHUA >
< DEP num = "2" >
< BUILDING / >
< AUTO / >
< / DEP >
< / TSINGHUA >
< PKU >
< num DEP = "3" >
< ART / >
< AUTO / >
< CHEMICAL / >
< / DEP >
< / ECP >
< TSINGHUA >
< DEP num = "2" >
< BUILDING / >
< AUTO / >
< / DEP >
< / TSINGHUA >
< PKU >
< num DEP = "3" >
< ART / >
< AUTO / >
< CHEMICAL / >
< / DEP >
< / ECP >
< TSINGHUA >
< DEP num = "2" >
< BUILDING / >
< AUTO / >
< / DEP >
< / TSINGHUA >
< / UNIVERSITY >
Cat demo.xml
UNIVERSITY <>
< PKU >
< num DEP = "3" >
< ART / >
< AUTO / >
< CHEMICAL / >
< / DEP >
< / ECP >
< TSINGHUA >
< DEP num = "2" >
< BUILDING / >
< AUTO / >
< / DEP >
< / TSINGHUA >
< / UNIVERSITY >
It seems l_xml changed every time an excerpt is called, why? Thank you very much!!!
Hello
I have the same problem on this version:
BANNER
--------------------------------------------------------------------------------
Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
AMT for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
5 selected lines.
The problem seems to use createxml and getstringval:
declare l_xml xmltype; l_xml2 xmltype; begin l_xml := xmltype.createxml(xmlData => bfilename('XMLDIR2', 'demo.xml'), csid => 0, schema => null); dbms_output.put_line('Run 1 (getstringval):'); dbms_output.put_line(l_xml.getstringval); dbms_output.put_line('Run 2 (getstringval):'); dbms_output.put_line(l_xml.getstringval); dbms_output.put_line('Run 3 (getstringval):'); dbms_output.put_line(l_xml.getstringval); end; /
Here is the result:
Race 1 (getstringval):
Race 2 (getstringval):
Race 3 (getstringval):
Replace getstringval with getclobval seems to fix the problem.
By creating the xml as literal does not show the same problem.
Probably a bug on this version.
Kind regards.
Alberto
Tags: Database
Similar Questions
-
Extraction of data from XMLType field
Sorry, I am not sure XMLQuery, this is probably a simple question. I am trying to extract data in a tabular form of an XMLTYPE field. I will use the following example to illustrate my question:
WITH a (too)
Select xmltype (')
< bugStatus >
< status >
< > 111 bugCode < / bugCode >
< number of bug = "12345" description = "Low severity bug" / >
< / status >
< status >
< > 222 bugCode < / bugCode >
< number of bug = "67890" description = "high severity bug" / >
< / status >
< / bugStatus >
XMLDATA') of double)
SELECT x.*
A xmltable (' bugStatus/status
by the way the columns in a.xmldata
status_code number path "bugCode.
) x ;
Run this code extracts block the "bugCode' fields successfully. But I would also to extract the 'bug number' and 'description' fields. Ideally in the independent columns. But even if only as a single line 'number of bug =... description =... ". "I could still do it analyze with SQL.
Can someone tell me please in the sense of how I can also extract additional data?
Thank you!
Attributes are processed by '@' so in your example (thank you), you can solve it through
WITH a (too)
Select xmltype (')
111 222 XMLDATA') of double)
SELECT x.*
A xmltable (' bugStatus/status
PASSAGE a.xmldata
COLUMNS
ROW_NUMBER for ordinalite,
path number bugCode "bugCode."
bugNumber path number "bug/@number."
path of varchar2 (4000) bugDescription 'bug/@description '.
) x ;
ROW_NUMBER BUGCODE BUGNUMBER BUGDESCRIPTION
---------- ---------- ---------- --------------------------------------------------
1 111 12345 low severity bug
2 222 67890 high severity bug
-
extract xml data in the collection
Hello
I want to extract xml data in a collection of collection
could any body you tell me if we succeed in sql
ex:
declare
type t_code is table of number;
type r_rec is record (c_name varchar2 (100),)
c_code vrachar2 (100),
c_code_number t_code);
type t_rec is the table of the r_rec;
l_xml xmltype: = xmltype (')
< body >
<>campaign
< code > < code > CAMP_1
< description > Campaign_1 < / description >
< rateplans >
< rateplanCode > 1 < / rateplanCode >
< rateplanCode > 2 < / rateplanCode >
< rateplanCode > 3 < / rateplanCode >
< / rateplans >
< / campaign >
<>campaign
< code > < code > CAMP_2
< description > Campaign_2 < / description >
< rateplans >
< > 11 rateplanCode < / rateplanCode >
< > 22 rateplanCode < / rateplanCode >
< rateplanCode > 33 < / rateplanCode >
< / rateplans >
< / campaign >
<>campaign
< code > < code > CAMP_3
< description > Campaign_3 < / description >
< rateplans >
< > 111 rateplanCode < / rateplanCode >
< > 222 rateplanCode < / rateplanCode >
< > 333 rateplanCode < / rateplanCode >
< / rateplans >
< / campaign >
< result >
< > 00 resultCode < / resultCode >
< resultText > success < / resultText >
< / result >
(< / body > ');
Start
Select / * logic exrat value of xml in the final collection * /.
Double;
end;
I want data in the model in my final collection t_rec
CAMP_1, Campaign_1, nested_table (1,2,3)
CAMP_2, Campaign_2, nested_table (11,22,33)
CAMP_3, Campaign_3, nested_table (111,222,333)
Published by: 948596 on May 17, 2013 05:17Like this
SQL> declare 2 type t_code is table of number ; 3 type r_rec is record 4 ( 5 c_name varchar2(100), 6 c_code varchar2(100), 7 c_code_number t_code 8 ); 9 type t_rec is table of r_rec ; 10 l_rec t_rec := t_rec(); 11 l_xml xmltype := xmltype 12 (' 13 14
15 23CAMP_1
16Campaign_1 1718 221 192 203 2124 32CAMP_2
25Campaign_2 2627 3111 2822 2933 3033 41CAMP_3
34Campaign_3 3536 40111 37222 38333 3942 45 ' 46 ) ; 47 begin 48 for i in ( 49 select rownum id 50 , t1.code 51 , t1.description 52 , t2.rate_plan_code 53 , row_number() over(partition by t1.code order by t2.rate_plan_code) rno 54 from xmltable 55 ( 56 '/body/campaign' passing l_xml 57 columns 58 code varchar2(100) path 'code', 59 description varchar2(100) path 'description', 60 rate_plans xmltype path 'rateplans' 61 ) t1 62 , xmltable 63 ( 64 '/rateplans/rateplanCode' passing t1.rate_plans 65 columns 66 rate_plan_code varchar2(100) path '.' 67 ) t2 68 ) 69 loop 70 if i.rno = 1 then 71 l_rec.extend; 72 l_rec(l_rec.count).c_name := i.description; 73 l_rec(l_rec.count).c_code := i.code; 74 l_rec(l_rec.count).c_code_number := t_code(); 75 end if; 76 l_rec(l_rec.count).c_code_number.extend; 77 l_rec(l_rec.count).c_code_number(i.rno) := i.rate_plan_code; 78 end loop; 79 for i in 1..l_rec.count 80 loop 81 dbms_output.put_line(l_rec(i).c_code || ' ' || l_rec(i).c_name); 82 for j in 1..l_rec(i).c_code_number.count 83 loop 84 dbms_output.put_line(l_rec(i).c_code_number(j)); 85 end loop; 86 end loop; 87 end; 88 / CAMP_1 Campaign_1 1 2 3 CAMP_2 Campaign_2 11 22 33 CAMP_3 Campaign_3 111 222 333 PL/SQL procedure successfully completed. SQL>00 43Success 44 -
Hello, since I've updated for Firefox 27.0.1 on Windows 7, I have a problem with Reporting Services on a Sharepoint site. It is a site of Sharepoint 2010 with SQL Server Reporting Services 2012 Sharepoint integrated mode. I was already on Firefox version 26 and didn't meet with this problem.
When a report is opened and you use the Actions link on the Reporting Services toolbar, I get the following error messages.
An error has occurred with the extraction of data. Please, refresh the page and try again.
I tried updating to the beta version of Firefox 28 but the same error occurs. I see that someone else is having the same problem here. http://SharePoint-community.NET/forum/topics/reporting-service-and-Firefox-27
Any help would be appreciated. Thank you!
Ryan
Firefox version 28.0 has corrected this problem. Thank you!
-
The batch change date and time
I have a lot of photos which, for some reason, have lost their correct dates and hours of creation, so I was eager to correct in an easy and enjoyable way. I unfortunately discovered that Photos is not the batch option to change that used to be in iPhoto.
When you try to find a solution to my problem, I fell on this batch Change Date and time on a fixed Date, which works well, but not quite how I want it. What I want to do, that's exactly what the script above does, but rather than increment by 1 minute of each photo, I want to increment by 1 second intervals by photo.
Having not really used AppleScript before, I tried to change the references to the 'minutes' to 'seconds' but that did not work. Is it possible to do using above seconds instead of minutes?
Any guidance would be greatly appreciated. Thank you.
Just delete the text "" * minutes ' in the lines where the date is changed. "
Then time will be incremented seconds.
For example, for the first version of the script use:
the value timeIncrement to 1 - increment of time in seconds
(* select at least 2 images in Photos *)
say application 'Photos '.
activate
game imageSel for (get selection)
if ({ is } imageSel) or (the length of imageSel < 2) then
error "Please select at least two images."
on the other
defined first_image to the point 1 of the imageSel
the value first_date to (the date of first_image) as date of
Repeat with I from 2 to the County of imageSel
put next_image to the point I of imageSel
the value next_date to (the date of next_image) as date of
the value time_difference to (first_date - next_date) + ((i-1) * timeIncrement)
say next_image
the value le Date of next_image to (next_date + time_difference) as date of
end say
end Repeat
end if
return "Set the date and time of" & (the length of the imageSel) & 'photos. The last date is "& ((the date of next_image) as date)"
end say
-
Greetings HP Forum,
Recently, I replaced a bad hard drive on my laptop. I need now step by step procedure to extract usable data from the wrong drive using 22 pins adapter usb to SATA on the new HD.
NOTE: I can't not all data that especially if some of the software downloaded on the replaced disk can be altered. Should I first download Internet Antivirus to protect my new hard drive? I'm not an expert, or even close to this when you work on the back of the laptop, so I'll have to step by step how to download and to partition the data recoverable and software, etc..
Thanks in advance for your help... I greatly appreciate it!
See you soon!
Wes
It is not complex. Attach the drive to the adapter and connect it to any other computer with good antivirus and antispyware installed. I use Malwarebytes and Avast. When you connect the adapter with the drive connected to the usb port, the drive will appear and it will be assigned a letter maybe E:\ or F:\ or something else. Immediately, he analyzes with the antivirus and anti-spyware. Quarantine or delete any virus or malware it finds. Then, it's just a matter of navigate the disk and copy and paste the contents of the host computer in a directory for this purpose. Obviously, you can copy from documents word, photos, music files, but you cannot copy the applications like Microsoft Word, iTunes. Photoshop. You may need to take ownership of the files on the old hard drive, but Windows will guide you through this. Don't know what else I can answer.
-
extract table data to different locations
Hello
I collected data in the format:
Temp: 25 Freq: 136 100 99.993 2998,581 0
Temp: 25 Freq: 136 125,89 125.991 2997,196-0.004
Temp: 25 Freq: 136 158,48 158.007 - 2995, 1 0.01
Temp: 25 Freq: 136 199,52 200.002 2991, 905 - 0.019
Temp: 25 Freq: 155 100 100.005 3000,866 0.003
Temp: 25 Freq: 155 125,89 126.003 3000,086 0.000
Temp: 25 Freq: 155 158,48 157.985 2996, 133 - 0.011
Temp: 25 Freq: 155 199,52 200.018 2992,644-0,021
Temp: 25 Freq: 174 100 100 3001,405 0.000
Temp: 25 Freq: 174 125,89 126.016 2997, 996 - 0.010
Temp: 25 Freq: 174 158,48 158.013 2996,371-0.015
Temp: 25 Freq: 174 199,52 199.983 2992, 315 - 0,026
Temp :-30 Freq: 136 100 99.993 2998,581 0
Temp :-30 Freq: 136 125,89 125.991 2997,196-0.004
Temp :-30 Freq: 136 158,48 158.007 - 2995, 1 0.01
Temp :-30 Freq: 136 199,52 200.002 2991, 905 - 0.019
Temp :-30 Freq: 155 100 100.005 3000,866 0.003
Temp :-30 Freq: 155 125,89 126.003 3000,086 0.000
Temp :-30 Freq: 155 158,48 157.985 2996, 133 - 0.011
Temp :-30 Freq: 155 199,52 200.018 2992,644-0,021
Temp :-30 Freq: 174 100 100 3001,405 0.000
Temp :-30 Freq: 174 125,89 126.016 2997, 996 - 0.010
Temp :-30 Freq: 174 158,48 158.013 2996,371-0.015
Temp :-30 Freq: 174 199,52 199.983 2992, 315 - 0,026
Temp: + 70 Freq: 136 100 99.993 2998,581 0
Temp: + 70 Freq: 136 125,89 125.991 2997,196-0.004
Temp: + 70 Freq: 136 158,48 158.007 - 2995, 1 0.01
Temp: + 70 Freq: 136 199,52 200.002 2991, 905 - 0.019
Temp: + 70 Freq: 155 100 100.005 3000,866 0.003
Temp: + 70 Freq: 155 125,89 126.003 3000,086 0.000
Temp: + 70 Freq: 155 158,48 157.985 2996, 133 - 0.011
Temp: + 70 Freq: 155 199,52 200.018 2992,644-0,021
Temp: + 70 Freq: 174 100 100 3001,405 0.000
Temp: + 70 Freq: 174 125,89 126.016 2997, 996 - 0.010
Temp: + 70 Freq: 174 158,48 158.013 2996,371-0.015
Temp: + 70 Freq: 174 199,52 199.983 2992, 315 - 0,026I am able to extract specific data and establish a curve for the different Freqs (see "extract file_for email.VI pivot table). I would like to help in order now to a parcel with a fixed frequency but different time (therefore field will be 3 Graphics: 25-30, + 70 for the same word of freq 136).
Thanks for your help and your time,
hiNi.
This code gross works for any number of temperatures and allow for different sizes of each table (say that you measured 3 points to 1, temp and 6 points to another). I strongly doubt this operation is necessary, but this is how the code works.
Just drop the and connect the tables correctly loaded from your text file to place the controls in table I used. (or you can wire up and use it as a subvi).
-
Extraction of data from MS SQL .bak file
Hi all
I received a MS SQL .bak file and need to extract the data into it, what should I do to achieve this?
In addition, what is a bak file? It's a backup for a database file? I remember that I read somewhere that backup database has several different method (for example, the differential backup, the full backup), which will affect the restoration?
Thank you
Lee
Hi Lee
Your best resource for information is the Forum dedicated to suppoeting SQL.
Category of the SQL Server:
http://social.msdn.Microsoft.com/forums/en-us/category/SQLServer
Concerning
-
the date on the camera was wrong when photographed I can change date right?
-
Hello
Calling a stored procedure from a MS - SQL database 2005, and he returned the 2 dozen fields. I need to combine the result data in a cluster for my client.
Its cluster contains booleans, strings and I32s and slna.
I need to do the same thing, but my data comes from the function "dbtools extract the data of the item. Problem is that I can't get output anywhere to convert native data types so that the function of the original function of the customer Cluster beam.
Can someone point me to an example of LV function for this code? I tried to use the "database of Variant data", but I have not found the magic way to make sure the function bundle sees a native data type.
Help to LV and this forum are not telling me what I need to know.
Any help is greatly appreciated!
Dave
OK maybe the 'database of Variant data"is most appropriate?
-
Extract ODBC data Long field names
I need to extract some data created by the 4 lookout data logging (files .thd). Is it possible to do so. I use a PC that does not have installed belvedere, I only database files
What I got so far is to export some fields whose names are less than 62 characters (using the program Logos 4.5 and driver ODBC database of 4 of Citadel by strict limitation of the field at 62 names). If I increase the limit to about 100 required to extract all the fields I can't export to Microsoft Query or any other software (which supports the import of ODBC database). I've tried several programs but usually they jump a message you can read that one point in time (or they do not see the fields or values at all)
Please, can you tell me a way I can extract the data?
The lifecycle of database is not applied in an aggressive manner. The database do not try and remove data simply because life has expired. On the contrary, the life expectancy is applied only when new data are currently recorded in the database and the log would need to increase the size of the database to store incoming data. The rate at which data are removed from the database may vary according to the rate at which new data are recorded in the database. If the frequency of recording is slow, it may take a long time for the data to be deleted.
J.D. Robertson
National Instruments
-
extraction of data on broken laptop
My laptop is saying there is Aproblem in the start screen, I need to extract a date before restoing manafactoring settings
Hello
- What exactly happens when you start?
- What is the exact error message you get?
I suggest you to follow these steps and check if that helps:
Method 1:
Try to run the Startup Repair and check if this may help:
http://Windows.Microsoft.com/en-us/Windows-Vista/startup-repair-frequently-asked-questionsMethod 2:
Try to restore the computer to system recovery options and check if it helps:
http://Windows.Microsoft.com/en-us/Windows-Vista/what-are-the-system-recovery-options-in-Windows-VistaIt will be useful.
-
Foglight v6 - FaultException: impossible to extract the data of inventory of the collector
After having modernized our virtual center to V4, the foglight fails to report all the details and only has the following alert:
"FaultException: impossible to extract the data of inventory of the collector: the parameter name cannot be null or an empty string."
' Parameter name: key to make sure the collection agent service is running.
If anyone else has had this problem and how to solve?
Thank you
KarimHi Joviyach,
I logged a call with Vizioncore and the resolution is as follows:
the problem you have is related to a VMware problem experienced during the upgrade to vSphere 4.0 as detailed in: kb.vmware.com/.../search.do
Bascially, you must run a SQL command of your Virtual Center via MS SQL Management Studio that will identify one or more VMs who have a missing entry in the VPX_VIRTUAL_SCSICONTROLLER table. Once this information is determined that you would follow the steps 2 to 6 of the reolution... basically remove these virtual machines of the inventory and adding them back.
When these steps are complete, you will re-start the vFoglight Collector of Vmware and Vmware vFoglight connector services. -
Extracting the data from QVariantMap
I have the following data :
QVariant (QVariantMap, QMap ((' data', QVariant (QVariantMap, QMap ((' current_condition', QVariant (QVariantList, ((QVariantMap, QMap... QVariant QVariant (QVariantMap, QMap ((' weather', QVariant (QVariantList, ((QVariantMap, QMap... QVariant QVariant (QVariantMap, QMap ((' weather_desc', QVariant (QVariantList, ((QVariantMap, QMap... QVariant
m_model-> insert(data.value
() .value ("data") .toMap ().value("weather").toList () .at (0) .toMap ()); Using the above line, I am able to extract relevant data from "current_condition and"weather".
What should I add to the line above to also extract data from 'weather_desc '?
Any help would be appreciated. Thank you.
Thank you! It is much easier to read when formatted, it's the first thing I did.
{ "data": { "current_condition": [ { "cloudcover": "0", "humidity": "18", "observation_time": "02:36 AM", "precipMM": "0.0", "pressure": "1007", "temp_C": "39", "temp_F": "102", "visibility": "10", "weatherCode": "113", "weatherDesc": [ {"value": "Sunny" } ], "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png" } ], "winddir16Point": "N", "winddirDegree": "10", "windspeedKmph": "46", "windspeedMiles": "29" } ], "request": [ { "query": "Melbourne, Australia", "type": "City" } ], "weather": [ { "date": "2013-01-04", "precipMM": "0.0", "tempMaxC": "37", "tempMaxF": "98", "tempMinC": "19", "tempMinF": "66", "weatherCode": "113", "weatherDesc": [ {"value": "Sunny" } ], "weatherIconUrl": [ {"value": "http:\/\/www.worldweatheronline.com\/images\/wsymbols01_png_64\/wsymbol_0001_sunny.png" } ], "winddir16Point": "N", "winddirDegree": "3", "winddirection": "N", "windspeedKmph": "21", "windspeedMiles": "13" } ] } }
To access weatherDesc in usage by time:
Data.value
.value("data").toMap ().value("weather").toList () .at (0) .toMap ().value("weatherDesc").toList () .at (0) .toMap .value ("value") ()) This will return "Sunny."
For readability, I suggest if this string to:
QMap
dataMap = data.value ().value("data").toMap(); QList weatherList = dataMap..value("weather").toList(); QVariant firstWeatherEntry = weatherList.at(0); QMap weatherEntryMap = firstWeatherEntry.toMap(); QList weatherDescList = weatherEntryMap.value("weatherDesc").toList(); QVariant firstWeatherDescEntry = weatherDescList.at(0); QMap weatherDescEntryMap = firstWeatherDescEntry.toMap(); QString value = weatherDescEntryMap.value("value").toString(); // "Sunny" Also, you can check intermediate outcomes at each stage by calling
qDebug()< weatherlist="">< "\n";="" and="" so="">
-
Changing data in a tabular view with Oracle MAF
Hello.
I need to change data in the table view, which component you would recommend me?
I use the "TABLE LAYOUT" component, but it is very uncomfortable when I try to change data on each row because it has lost focus on the selection.
Hello
There is no component entry in table form in the CRG at this stage. The disadvantage - as you mentioned - the use of tabular layout with an iterator is that you must follow and set the current line in the link layer
Frank
Maybe you are looking for
-
I had an account on swissmail earlier and removed today because my account was trying to connect to the server swissmail whenever I checked my e-mails. The swissmail account has expired in May and an account paying so I don't want to renew. I lost al
-
Tecra R10 - 10J - BSOD if I use WiFi
I have a new Tecra R10 - 10J. I installed Windows XP directly with the recovery disc, so I never used Vista. At the beginning I had problems getting 3 G to work, it is now OK. But I have another question unresolved: Blue notebooks accidents or restar
-
iPad Air keeps the beep when I connect it to my MacBook Pro 15 retina.
Hi, I have connected my Air iPad to my MacBook Pro 15 new retina and it maintains to the beep on and outside. It is a problem, I only experience with my MacBook Pro with two USB ports. When I connect the iPad to my MacPro, it works fine: it loads and
-
Want to update to adapter wireless on HP G70t-200 need advice
I have a hp g70t-200 with a map of Atheros AR5007 802.11 wireless network b/g. Comcast has recently upgraded my service to 60 down and 10 up led me to do a speed test revealing that I'm not faster than 25 speed to the top and 10 down through my Netge
-
Hi here is the id but I can't find anything on this driver is needed thanks in advance to all PCI\VEN_14F1 & DEV_1024 & SUBSYS_1006144F & REV_08PCI\VEN_14F1 & DEV_1024 & SUBSYS_1006144FPCI\VEN_14F1 & DEV_1024 & CC_178000PCI\VEN_14F1 & DEV_1024 & CC_1