How to replace a part of BLOB(XML)
Hi.
I would like to know how replace a part of BLOB.
For example, I have this code
<inscSufDestinatario>999999999</inscSufDestinatario>
<ufDestino>MG</ufDestino>
<ufOrigem>SP</ufOrigem>
<qtdeNF>#1</qtdeNF>
<notasFiscais>
and I need replace the "#1" for "5" or "10" and store him again in a blob.
I wait have been clear.
Tks
For sufficently small blobs you can work with utl_raw package.
Furthermore assuming you are working with real xml files you can do
SQL> with t as (
select to_blob(utl_raw.cast_to_raw('<xml><inscSufDestinatario>999999999</inscSufDestinatario>
<ufDestino>MG</ufDestino>
<ufOrigem>SP</ufOrigem>
<qtdeNF>#1</qtdeNF>
<notasFiscais/></xml>')) bl from dual
select bl,
to_blob(utl_raw.cast_to_raw(updatexml(xmltype(utl_raw.cast_to_varchar2(bl)), '//qtdeNF/text()','#5').getstringval())) new_bl
from t
BL NEW_BL
<xml><inscSufDestinatario>999999999</ins <xml><inscSufDestinatario>999999999</ins
cSufDestinatario> cSufDestinatario><ufDestino>MG</ufDestin
<ufDestino>MG</ufDestino> o><ufOrigem>SP</ufOrigem><qtdeNF>#5</qtd
<ufOrigem>SP</ufOrigem> eNF><notasFiscais/></xml>
<qtdeNF>#1</qtdeNF>
<notasFiscais/></xml>
1 row selected.
Similar Messages
-
JEditorPane: how to replace small parts of the document?
Hi
Im trying to create an application that will allow two people to type into two different JEditorPanes, but have the two people essentially editing the same document. So if one person types someting into thier frame, I want that modification sent to the other frame as well.
The problem I've come across is how to make changes to the contents of the frame without interfering with the person whos trying to type into it. That problem boils down to how do you replace only a small part of the document whithout taking control of the users caret?Hopfully I got your problem right. To change only small parts of the EditorPane's document should not be the probelm you can get it with EditorPane.getDocument(). But I think you have to take control over the caret, because the when user 1 has finished editing and sends the doc to user 2 who is editing the doc, user 2's caret position will change because the document length has changed.
The easiest way would be to add an input area (TextArea) for each user where they can type theit text and than to add the text into the document when they press enter, so you don't have the trouble with te caret position. If you don't want to do this then you could try that: the input of the users is cached while they are typing (not changing the doc) till they press enter. Then the doc is send to the other user, the users doc in the pane is updated and his current typing is added to the end of the new received doc. You can figure out the correct position by doc.getLength() and set the new caret position to doc.length + currentTyping.length
Hope that helps
Eryk -
How to replace NULL values from main table
Dear all,
I like to remove the NULL values from a main table field. Or the question is how to replace any part of the string field in MDM repository main table field.
e.g. I have a middle name field partly the value is NULL in some hundreds of records, I like to replace NULL values with Space
any recommendation.
Regards,
NaeemHi Naeem,
You can try using Workflows for automatically replacing NULLs with any specific value.
What you can do is: Create a workflow and set trigger action as Record Import, Record Create and Record Update. So, that whenever any change will occur in the repository; that workflow will trigger.
Now create an assignment expression for replacing NULLs with any specific value and use that assignment expression in your workflow by using Assign Step in workflow.
For exiting records, you will have to replace NULLs manually using the process given by Preethi else you can export those records in an Excel spreadsheet which have NULLs and then replace all NULLs with any string value and then reimport those records in your MDM repository.
Hope this will solve your problem.
Regards,
Varun
Edited by: Varun Agarwal on Dec 2, 2008 3:12 PM -
Videos for replacing ThinkPad parts available for streaming to your smartphones
Hello all,
Lenovo Service and Support Training site has added an additional
feature to the site which is viewing videos on how to replace FRU parts
I've tested it on the iPhone which I think is pretty helpful to watch
the video on how to replace the part when your laptop has been taken
apart.
Head to the site on your PC/laptop here -> http://www.lenovoservicetraining.com/ion/
For mobile devices (Android, iPhone, BlackBerry, Win Phone) here -> http://frusonfone.com/fof/
Thanks All
JameZ
Check out the Community Knowledge Base for hints and tips.
Did someone help you today? Press the star on the left to thank them with a Kudo!
If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
X240 | 8GB RAM | 512GB Samsung SSDHey Everybody!
I am also just now posting the videos and FRUSonFone for the:
X220 Tablet
E420
E420s
E220s
If there are any other machines that you might like to see on FRUs on Fone, make a good case for me to bring to my boss and I can go back and make a "Mobile" version!
Thanks,
Paul Vignola
Lenovo Training Solutions -
How can I delete only one part of my xml file?
Hello,
I stored more than 100 users in only one xmltype column. For instance
Create table agro(users XMLTYPE);
... and I inserted all users inside
INSERT INTO agro values(XMLTYPE
('<?xml version="1.0" encoding="ISO-8859-1"?>
<authentication><users><user>
<name>cocoon</name>
<password>cocoon</password>
<role>admin</role>
<title>Mr.</title>
<firstname>Walter</firstname>
<lastname>Cocoon</lastname>
<company />
<street />
<zipcode />
<city />
<country>DE</country>
<phone />
<fax />
<email />
<bankid />
<bankname />
<accountid />
</user>
... another user, etc.
</users></authentication>'));
Now I tried to delete only one part of this file. For example all persons with the name"cocoon".
I used for this target the following statement:
DELETE FROM agro agro
WHERE agro.users.extract('authentication/users/user/text()').getStringVal()= 'cocoon';
When I execute this statement, Oracle DB delete all users and not only with the name "Cocoon".
How can I delete only one part of my xml file?
Kind Regards
M RThis the expected behavoir. You uploaded a document containing multiple users and then asked XML DB to delete any documnet that contained a user with the name in question. The problem here is that you are creating a mega document that contains an aggregation of user documents but then trying to work with individual user documents. This is a bad idea.
In general XML does not understand the concept of a collection of documents. It can only operate on one document at a time. Hence the tendancy to aggregate individual documents into a single larger document. Once you have an XML database, you can perform operations on collections of document, as easily as you can perform operations on individual documents, so the need to aggregate the individual documents together disappears.
If you store each user document as a seperate document then your delete will work as expected. -
System Preferences quits suddenly. I have lost the dock, including the trash and ability to change desktop image. How can I replace this part of System Preferences? Where can I find Trash? All other aspects of System Preferences work.
just that that is one method, and lacks provision for working boot image and for an emergency - Lion gives a small minimal emergency boot environment but may lack all the utilities you need to use and run, even some drivers that your mac requires for add on PCIe.
Just grab and look through Help in Carbon Copy and SuperDuper, both excellent and each has their use - together - for cloning.
And do you have two TM backup sets? ought to consider that also, rotate daily or make a weekly set. Otherwise you are putting all your eggs in the proverbial one basket. -
How to pass a Statement to BLOB
i find this help and i show that very people
have the same problem.
if somebody of yours know how to transform
a Statement to BLOB .
thankyou are passng that as a string = '5,6' does not exist
try this : http://www.mssqltips.com/sqlservertip/1771/splitting-delimited-strings-using-xml-in-sql-server/
declare @table table(sno int)
insert into @table values(5),(6)
DECLARE @xml as xml,@txtSchedule as varchar(100),@delimiter as varchar(10)
SET @txtSchedule='5,6'
SET @xml = cast(('<X>'+replace(@txtSchedule,',','</X><X>')+'</X>') as xml)
select * from @table WHERE sno IN ( select N.value('.', 'varchar(10)') as value FROM @xml.nodes('X') as T(N))
Hope it Helps!! -
How can I use a 3rd party XML parser such as xerces with OC4J ?
Hi all tech experts,
I am using Oracle Application Server 10g Release 2 (10.1.2) and i have
installed Portal and Wireless and OracleAS Infrastructure on the same
computer.
i tried all the solutions on this thread
Use of Xerces Parser in out application with Oracle App Server 9.0.4
but still fighting.
I have also posted this query on OTN on following thread
How can I use a 3rd party XML parser such as xerces with OC4J?
but no reply....
Please help me on this issue.
Since OC4J is preconfigured to use the Oracle XML parser which is xmlparserv2.jar.
i have read the following article which states that
OC4J is preconfigured to use the Oracle XML parser. The Oracle XML parser is fully JAXP 1.1 compatible and will serve the needs of applications which require JAXP functionality. This approach does not require the download, installation, and configuration of additional XML parsers.
The Oracle XML parser (xmlparserv2.jar) is configured to load as a system level library of OC4J through it's inclusion as an entry in the Class-Path entry of the oc4j.jar Manifest.mf file. This results in the Oracle XML parser being used for all common deployment and packaging situations. You are not permitted to modify the Manifest.mf file of oc4j.jar.
It must be noted that configuring OC4J to run with any additional XML parser or JDBC library is not a supported configuration. We do know customers who have managed to successfully replace the system level XML parser and the Oracle JDBC drivers that ship with the product, but we do not support this type of configuration due to the possibility of unexpected system behavior and system errors that might occur from replacing the tested and certified libraries.
If you absolutely must use an additional XML parser such as xerces, then you have to start OC4J such that the xerces.jar file is loaded at a level above the OC4J system classpath. This can be accomplished using the -Xbootclasspath flag of the JRE.
i have also run the following command
java -Xbootclasspath/a:d:\xerces\xerces.jar -jar oc4j.jar
but no success.
How could i utilize my jar's like xerces.jar and xalan.jar for parsing instead of OC4J in-built parser ?
All reply will be highly appreciated.
Thnx in advance to all.
Neeraj Sidhaye
try_catch_finally @ Y !Hi Neeraj Sidhaye,
I am trying to deploy a sample xform application to the Oracle Application Server (10.1.3). However, I encountered the class loader issue that is similar to your stuation. I tried all the three solutions but the application is still use the Oracle xml paser class. I am wondering if you have any insight about this?
Thanks for your help.
Xingsheng Qian
iPass Inc.
Here is the error message I got.
Message:
java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
Stack Trace:
org.chiba.xml.xforms.exception.XFormsException: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
at org.chiba.xml.xforms.Container.dispatch(Unknown Source)
at org.chiba.xml.xforms.Container.initModels(Unknown Source)
at org.chiba.xml.xforms.Container.init(Unknown Source)
at org.chiba.xml.xforms.ChibaBean.init(Unknown Source)
at org.chiba.adapter.servlet.ServletAdapter.init(ServletAdapter.java:153)
at org.chiba.adapter.servlet.ChibaServlet.doGet(ChibaServlet.java:303)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassCastException: oracle.xml.parser.v2.XMLElement
at org.chiba.xml.xforms.Instance.iterateModelItems(Unknown Source)
at org.chiba.xml.xforms.Bind.initializeModelItems(Unknown Source)
at org.chiba.xml.xforms.Bind.init(Unknown Source)
at org.chiba.xml.xforms.Initializer.initializeBindElements(Unknown Source)
at org.chiba.xml.xforms.Model.modelConstruct(Unknown Source)
at org.chiba.xml.xforms.Model.performDefault(Unknown Source)
at org.chiba.xml.xforms.XFormsDocument.performDefault(Unknown Source)
at org.chiba.xml.xforms.XFormsDocument.dispatchEvent(Unknown Source)
at org.apache.xerces.dom.NodeImpl.dispatchEvent(Unknown Source)
... 18 more -
How to export a data as an XML file from oracle data base?
could u pls tell me the step by step procedure for following questions...? how to export a data as an XML file from oracle data base? is it possible? plz tell me itz urgent requirement...
Thankz in advance
BalaSQL> 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.
SQL> CREATE OR REPLACE directory utldata AS 'C:\temp';
Directory created.
SQL> declare
2 doc DBMS_XMLDOM.DOMDocument;
3 xdata XMLTYPE;
4
5 CURSOR xmlcur IS
6 SELECT xmlelement("Employee",XMLAttributes('http://www.w3.org/2001/XMLSchema' AS "xmlns:xsi",
7 'http://www.oracle.com/Employee.xsd' AS "xsi:nonamespaceSchemaLocation")
8 ,xmlelement("EmployeeNumber",e.empno)
9 ,xmlelement("EmployeeName",e.ename)
10 ,xmlelement("Department",xmlelement("DepartmentName",d.dname)
11 ,xmlelement("Location",d.loc)
12 )
13 )
14 FROM emp e
15 , dept d
16 WHERE e.DEPTNO=d.DEPTNO;
17
18 begin
19 OPEN xmlcur;
20 FETCH xmlcur INTO xdata;
21 CLOSE xmlcur;
22 doc := DBMS_XMLDOM.NewDOMDocument(xdata);
23 DBMS_XMLDOM.WRITETOFILE(doc, 'UTLDATA/marco.xml');
24 end;
25 /
PL/SQL procedure successfully completed.
. -
How Can I Attach and Link an XML file to a 3D Model in a PDF?
How Can I Attach and Link an XML file to a 3D Model in a PDF?
What I am trying to do is find out how to have a 3D model and a parts list linked to it within the PDF file. I would also like to be able to add to the parts list if at all possible once the pdf has been created. A template to create future PDF's with the 3D model and list might also be useful.
I am not entirely sure if this is all possible within a PDF file, but I have viewed a PDF (Adidas Trainer) example which has a Excel file attached to it which links to the 3D model. I have also had a look at partner products such as Lattice, Tetra4D, Anark, which can do animations and all sorts, but frankly it seems a bit overkill for what I am looking to do.
Please, any help would be appreciated. ThanksAlliCT59 wrote:
> Shared Object sounds like it would work, but hten agian,
I'm really stuck!
>
> Thanks for any help.
>
> Allison
I wrote about it while ago, let me paste the whole thing.
This example has simple
buttons which upon click go to new sites and in the same time
place record in form
of *.SOL file on user drive. That record is read when you hit
the next button and
based on that the button will be selected as the one last
clicked.
You could use the very same thing just instead of suppressing
button simply gotoAndPlay frame
to continue the part you need.
http://groups.google.com/group/macromedia.flash.actionscript/browse_thread/thread/36649453 1f4fd02d/245a57d0cdaa1d29?lnk=st&q=&rnum=3&hl=en#245a57d0cdaa1d29
The source is in a different place, i re-upload for you :
http://www.flashfugitive.com/stuff/SharedObj_urlcheck/
fla file
http://www.flashfugitive.com/stuff/SharedObj_urlcheck/beentourl.fla
Best Regards
Urami
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
How to replace/remove/change font color of a character at in output
Hi all,
I am using rtf template to get the output of a report, however i have a condition for field "Narratives" where if field A contains 'X', I need to either get rid of the 'X', replace with '' or change the font of X to white.
Meaning if the output is : My Name is BavaniX
I need it to look like : My Name is Bavani
I use the BI Publisher desktop tool to create the placeholders. Highly appreciate if someone could advise me on how to replace with '' or change X to white font or remove the X using the BI desktop tool.
The placeholder right now looks like this <?(NARRATIVES)?>.
Thank you.if you want to replace also look at
How to remove underscore in xml tag
Re: How to remove underscore in xml tag
Edited by: AlexAnd on Aug 2, 2012 5:55 AM -
How to set the root path of XML document when calling Inserting procedure
Hi,
I was create a procedure to insert XML Document in to DBMS Tables, but i am not able to set the Start root element in calling procedure.
My calling procedure is
exec insXmldoc('pmc_sample.xml', 'pmc')
When i am calling this procedure i got this error
11:23:54 Error: ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
ORA-06512: at "SCOTT.INSPROC", line 8
ORA-06512: at line 2
I am checking my XML file using XML Validator. My XML file was parsed with out errors.
Please give the solution,and tell me where i did wrong in my calling procedure.
suppose i have this XML file in local E drive ,how to set the path for that XML file in my calling procedure.Hi, I am doing the code likthis,please give the solution.
SQL> create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
2 insCtx DBMS_XMLSave.ctxType;
3 l_ctx dbms_xmlsave.ctxtype;
4 rows number;
5 begin
6 insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
7 rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
8 DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
9 end;
10 /
Procedure created.
SQL> begin
2 insProc('/usr/tmp/ROWSET.xml', 'emp');
3 end;
4 /
begin
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:
Start of root element expected.
ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
ORA-06512: at "SCOTT.INSPROC", line 7
ORA-06512: at line 2
Kishore B -
How to replace the root tag in ABAP Mapping
how to replace the root tag with the certain string in ABAP Mapping
just like
<?xml version="1.0" encoding="UTF-8"?>
<root>
<name>Lawrence</name>
</root>
into
<?xml version="1.0" encoding="UTF-8"?>
<myRootElement>
<name>Lawrence</name>
</myRootElement>
i don't want to implement it in message mapping
please give me the sample code
thanks in advanceUse below code
odocument = ixmlfactory->create_document( ).
msgtype = odocument->create_simple_element(
name = 'myRootElement'
parent = odocument ).
Thanks
Praveen -
How to place the images in Indesign xml file by Javascript?
How to place the images in Indesign xml file by Javascript?
We got the Indesign xml file, how to give the image placement link by Indesign javascript? Please help me its urgent.Hi,
You can pass the image url as a href attribute=> file:///Users/me/Documents/my_pic.jpg directly within your xml. It just needs that you pass a local, static and valid url.
If you want to add image later once the xml is flowed and so target specific nodes and inject images, it's a bit more complex. If the node is not part of the layout, you may try to reach the XMLElement objet and such an attribute, then layout the element.
var x = some XMLElement
x.xmlAttributes.add("href","file:///Users/m/Documents/my_pic.jpg" );
If already placed, then you have to get the associated pageItem, then place your file into it.
pagItm.place ( File ( "/Users/m/Documents/my_pic.jpg" ) );
Hope that helps,
Loic
http://www.loicaigon.com -
How to write the oracle data as XML format. (.XML file)
create or replace procedure pro(p_number )
is
cursor c1 is select *from emp where empno=p_number;
v_file utl_file.file_type;
begin
v_file := utl_file.fopen('dirc','filename.txt','w');
for i in c1 loop
utl_file.put_line(v_file,i.ename || i.empno ||i.job);
end loop;
closef(v_file);
end;
Now my client want instead of .txt file he need .xml files
File should contains xml tags. can any one help regarding this.. with one example.
How to write the oracle data as XML format. (.XML file)hi,
hope this example will do something....
SQL> select employee_id, first_name, last_name, phone_number
2 from employees where rownum < 6
EMPLOYEE_ID FIRST_NAME LAST_NAME PHONE_NUMBER
100 Steven King 515.123.4567
101 Neena Kochhar 515.123.4568
102 Lex De Haan 515.123.4569
103 Alexander Hunold 590.423.4567
104 Bruce Ernst 590.423.4568
SQL> select dbms_xmlgen.getxml('select employee_id, first_name,
2 last_name, phone_number from employees where rownum < 6') xml
3 from dual;
*<?xml version="1.0"?>*
*<ROWSET>*
*<ROW>*
*<EMPLOYEE_ID>100</EMPLOYEE_ID>*
*<FIRST_NAME>Steven</FIRST_NAME>*
*<LAST_NAME>King</LAST_NAME>*
*<PHONE_NUMBER>515.123.4567</PHONE_NUMBER>*
*</ROW>*
*<ROW>*
*<EMPLOYEE_ID>101</EMPLOYEE_ID>*
*<FIRST_NAME>Neena</FIRST_NAME>*
*<LAST_NAME>Kochhar</LAST_NAME>*
*<PHONE_NUMBER>515.123.4568</PHONE_NUMBER>*
*</ROW>*
*<ROW>*
*<EMPLOYEE_ID>102</EMPLOYEE_ID>*
*<FIRST_NAME>Lex</FIRST_NAME>*
*<LAST_NAME>De Haan</LAST_NAME>*
*<PHONE_NUMBER>515.123.4569</PHONE_NUMBER>*
*</ROW>*
*<ROW>*
*<EMPLOYEE_ID>103</EMPLOYEE_ID>*
*<FIRST_NAME>Alexander</FIRST_NAME>*
*<LAST_NAME>Hunold</LAST_NAME>*
*<PHONE_NUMBER>590.423.4567</PHONE_NUMBER>*
*</ROW>*
*<ROW>*
*<EMPLOYEE_ID>104</EMPLOYEE_ID>*
*<FIRST_NAME>Bruce</FIRST_NAME>*
*<LAST_NAME>Ernst</LAST_NAME>*
*<PHONE_NUMBER>590.423.4568</PHONE_NUMBER>*
*</ROW>*
*</ROWSET>*
ask if you want more assistance.
thanks.
Maybe you are looking for
-
My Safari is no longer working with many sites. However Chrome and Firefox work fine. I would like to re-install Safari in an effort to clear up the problem I can not resolve.
-
Error received when attempting to map a PeopleSoft role in CMC
We receive the error "Error occurred while updating PeopleSoft Enterprise authentication properties: The PeopleSoft Enterprise server returned an error. Error: (SOAP-ENV:Server) Server Error. Detail: Unable to find a Routing corresponding to the inco
-
often times when I have iTunes open in cover flow view and switch to another window using Exposé cover flow goes all whack (see photo). Has anybody else had this problem? What can I do about it? http://img221.imageshack.us/img221/8260/picture1lk8.png
-
Greetings! I recently purchased Adobe CS2 as well as Macromedia stuido 8. I was planning to upgrade to a new 20" intel iMac and I am curious about the performance of these products under rosetta. Anyone suggestions or additional info? Thanks -Sam
-
Time Machine backups cannot be restored to a new HDD
Steps to reproduce: - do a fresh backup using Time Machine to a USB drive (I tried two separate USB drives to make sure it is not a drive problem) - install new HDD in your Mac (tried two brand new HDD's) - boot from OS X Snow Leopard DVD - select "R