Getting DTD structure from Oracle DOMParser
I am having trouble getting DTD structure from DOMParser after I parse the xml file with external DTD.
When I do:
xmlDOMParser.parse(new FileInputStream(xmlFile));
XMLDocument xmlDoc=xmlDOMParser.getDocument();
DTD docType=xmlDOMParser.getDoctype();
NamedNodeMap nodeMap=docType.getElementDecls();
the nodeMap is equal to null.
I need to get the element structure of DTD, how can I do that?
The below example is working fine for me
create table t1
as
select object_id id, object_name text
from all_objects;
Create table t2
as
select t1.*, 0 session_id
from t1
where 1=0;
CREATE OR REPLACE TYPE t2_type
AS OBJECT (
id number,
text varchar2(30),
session_id number
create or replace type t2_tab_type
as table of t2_type
create or replace
function parallel_pipelined( l_cursor in sys_refcursor )
return t2_tab_type
pipelined
parallel_enable ( partition l_cursor by any )
is
l_session_id number;
l_rec t1%rowtype;
begin
select sid into l_session_id
from v$mystat
where rownum =1;
loop
fetch l_cursor into l_rec;
exit when l_cursor%notfound;
-- complex process here
pipe row(t2_type(l_rec.id,l_rec.text,l_session_id));
end loop;
close l_cursor;
return;
end;
/And its getting executed in parallel
SQL> select DISTINCT session_id
2 from table(parallel_pipelined
3 (CURSOR(select /*+ parallel(t1) */ *
4 from t1 )
5 ))
6 ;
SESSION_ID
221
76
77
241
161
152
160
302
232
313
73
SESSION_ID
292
12 rows selected.But why its getting disconnected in my scenario. ???
Similar Messages
-
How get selected data from oracle data as per give input
sir i use Sun Java Studio Creator with oracle 10g
my direct want user give input through both listbox , textbox or string variable
how i pass this input in sessionbeen query and page give data in table as per user need
please give me step and code
this is urgent
thank'sYou would get hierarchical data from a functrion in the same way as you would any data. Create a function returning a cursor and then use your SQL statement to open the cursor. Very simplistically:
Create Function My_Func Return Sys_Refcursor As
l_cur Sys_Refcursos
Begin
Open l_cur For
'select EMPNO,ENAME,SYS_CONNECT_BY_PATH(ename, '/') "Path"
from EMP
start with MGR is null
connect by prior empno=mgr';
Return l_cur;
End;
Then, whatever calls the function would walk through the cursor an do whatever.
Jhn -
Problem of getting Result Set from Oracle 9iDB
I have Oracle 9i DB installed on Win NT system. I created a SCHEMA called SCHATTOP and created a TABLE TEAM. From Oracle SQL*Plus screen, I signed on with userID "SCHATTOP", and my password "ANU1SAL". Then at SQL> Connect SCHATTOP/ANU1SAL .. Getting msg Connected. Then I am doing Select * from SCHATTOP.TEAM; It shows the contents of the table. But when I wrote a small program like this .. when I am calling the program I am getting this msg
java DBLookup
Connection Successful to Oracle DataBase .. !!!!
SQLException caughtORA-00600: internal error code, arguments: [ttcgcshnd-1], [0], [], [], [], [], [], []
$
This is my program :
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class DBLookup {
public static void main(String[] args) throws Exception {
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
String url= "jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(HOST=9.5.185.229)(PROTOCOL=tcp)(PORT=1521))(CONNECT_DATA=(SID=SAL400)))";
con = DriverManager.getConnection(url,"SCHATTOP","ANU1SAL");
System.out.println("Connection Successful to Oracle DataBase .. !!!!");
stmt = con.createStatement( );
rs = stmt.executeQuery("SELECT * FROM SCHATTOP.TEAM");
while (rs.next()) {
System.out.println(rs.getString("FN") + " " + rs.getString("LN"));
catch (SQLException e) {
System.out.println("SQLException caught" + e.getMessage( ));
finally {
try {
if (con != null) con.close( );
catch (SQLException ignored) { }
Any help will be appreciated.Typically this error happens if a client tries to access a 9.0.1 database with an old 8.1.7 jdbc driver.
This should be fixed in the jdbc driver of the 8.1.7.2.1 Patchset for Windows.
Cheers
Stefan -
Nested XML structure from Oracle
Using the SQL Adapter i BizTalk, calling a SQL Stored procedure on a MS SQL DB, I can get a nice nested XML structure using p JOIN ii and FOR XML AUTO, like this
<p code="DK003">
<ii stamp="2013-01-14T10:27:38.790"value="180.702052"price="184.000000">
<d Dividend="2.50"DividendDate="2012-03-29T00:00:00" />
</ii>
<ii stamp="2013-01-14T10:27:38.790"value="181.702052"price="14.000000">
<d Dividend="2.50"DividendDate="2012-03-29T00:00:00" />
</ii>
</p>
How can I get the same on Oracle ??Hi E.,
I guess this an XML namespace issue. I'm creating XmlForms-style documents and had to add an XML namespace to my root element to make them visible as such:
Namespace xf = Namespace.getNamespace("xf", "http://www.sapportals.com/wcm/app/xmlforms");
root.addNamespaceDeclaration(xf);
So what I'd suggest to you is reading out the IResource and treating the content as XML:
Document document = new SAXBuilder().build(content.getInputStream());
Element root = document.getRootElement();
Namespace xf = Namespace.getNamespace("xf", "http://www.sapportals.com/wcm/app/xmlforms");
root.removeNamespaceDeclaration(xf);
Hope this helps!
regards,
Christian -
Getting XML result from Oracle request
We have Oracle 8i Entreprise Edition and We like to get XML result from an Oracle request. Can I use only Oracle 8i Entreprise Edition product or should i use another oracle product to do this job ?
Thank youDownload our XSQL Pages technology with the XSQL Servlet and you'll be in business in no time. If you want to just get XML programmatically from SQL in your own programs, you can try the XML SQL Utility (which XSQL Pages makes use of under the covers). XSQL Pages comes with lots of demos and a tutorial.
-
How to get tree structure from file list?
I have got following rows from my select query presenting a folder structure:
PATH
/KING/JONES/SCOTT
/KING/JONES/SCOTT/ADAMS
/KING/JONES/FORD
/KING/JONES/FORD/SMITH
/KING/BLAKE
/KING/BLAKE/ALLEN
/KING/BLAKE/WARD
/KING/BLAKE/MARTIN
/KING/BLAKE/TURNER
/KING/BLAKE/JAMES
/KING/CLARK
/KING/CLARK/MILLER
/PALO/TEMP
On base of this data I need to build tree in my application by effecient way.
Therefore i would like to achieve data (SELECT with two columns) as bellow:
FOLDER PARENTFOLDER
KING NULL
JONES KING
SCOTT KING/JONES
ADAMS KING/JONES/SCOTT
FORD KING/JONES
SMITH KING/JONES/FORD
BLAKE KING
ALLEN KING/BLAKE
WARD KING/BLAKE
MARTIN KING/BLAKE
TURNER KING/BLAKE
JAMES KING/BLAKE
CLARK KING
MILLER KING/CLARK
PALO NULL
TEMP PALOIs this possible to do it on SQL level(not PL SQL)?
ThanksPerhaps something like this?
SQL> ed
Wrote file afiedt.buf
1 with t as (select '/KING/JONES/SCOTT' as path from dual union all
2 select '/KING/JONES/SCOTT/ADAMS' from dual union all
3 select '/KING/JONES/FORD' from dual union all
4 select '/KING/JONES/FORD/SMITH' from dual union all
5 select '/KING/BLAKE' from dual union all
6 select '/KING/BLAKE/ALLEN' from dual union all
7 select '/KING/BLAKE/WARD' from dual union all
8 select '/KING/BLAKE/MARTIN' from dual union all
9 select '/KING/BLAKE/TURNER' from dual union all
10 select '/KING/BLAKE/JAMES' from dual union all
11 select '/KING/CLARK' from dual union all
12 select '/KING/CLARK/MILLER' from dual union all
13 select '/PALO/TEMP' from dual
14 )
15 --
16 -- END OF TEST DATA
17 --
18 select distinct substr(path,instr(path,'/',1,rn)+1,decode(instr(path,'/',1,rn+1),0,length(path)+1,instr(path,'/',1,rn+1))-instr(path,'/',1,rn)-1) as folder, substr(path,2,instr(path,'/',1,rn)-2) as parent
19 from t
20 cross join (select rownum rn from dual connect by rownum <= (select max(length(regexp_replace(path,'[^/]'))) from t)) x
21* where instr(path,'/',1,rn) > 0
SQL> /
FOLDER PARENT
BLAKE KING
SCOTT KING/JONES
JAMES KING/BLAKE
MARTIN KING/BLAKE
SMITH KING/JONES/FORD
KING
WARD KING/BLAKE
ADAMS KING/JONES/SCOTT
FORD KING/JONES
TURNER KING/BLAKE
MILLER KING/CLARK
PALO
TEMP PALO
JONES KING
CLARK KING
ALLEN KING/BLAKE
16 rows selected.
SQL> -
How to set/get URL-parameters from ORACLE -tag?
How do I set/get parameters in a URL, using the <ORACLE>-tag?
We are trying to create a UI Template containing a dynamic
stylesheet selection dialogue on top of every page. The question
we are facing now is how to pass parameters (in our case,
stylesheet settings) between different pages.
Any ideas/comments are appreciated!How do I set/get parameters in a URL, using the <ORACLE>-tag?
We are trying to create a UI Template containing a dynamic
stylesheet selection dialogue on top of every page. The question
we are facing now is how to pass parameters (in our case,
stylesheet settings) between different pages.
Any ideas/comments are appreciated! -
Flat file (csv) to oracle database - get dictionary data from oracle table
Hello,
I need to develop following scenario. I have flat csv file with some data, for example:
City;Address;Name
In oracle schema, there is table where data from imported csv should be written. Also, in the same schema, there is table named CityDictrionary. After ODI loads each row from csv, it should translate text representation of City to numerric ID got from CityDictionary table. And this numeric value should be placed to destination table, instead of direct text value from csv.
What is the simplest way to accomplish this task? Can you provide any tips?You can achieve this easily with a single ODI interface. The flat file and the CityDictionary tables are your sources. Identify the field on the CityDictionary table and the corresponding field on the flat file that will be used to join the data sets (e.g. the city name). Create a join between the sources using these fields. Because you're using a flat file as one of your sources, the join logic will have to be performed on either the staging or the target.
The target is your destination table, and you should map the ID from the CityDictionary table to the appropriate field in the target, as well as any other required fields from the flat file.
This type of interface is a fairly typical method of populating a normalized table.
Alternatively, you can use a lookup - see the following blog for an example. In your case, the flat file will be your source and the CityDictionary table will be used for the lookup.
http://www.odigurus.com/2012/02/lookup-transformation-using-odi.html
Edited by: _Phil on Oct 1, 2012 11:52 PM
Edited by: _Phil on Oct 1, 2012 11:57 PM -
Get Date +time from Oracle
hi ,
i saw that i can take date and time in seperate from the ResultSet .
how can i take the Time part as well from the date in the DB .
is there a way to create a new Date with the Time from the DB concatinated to it ?
doing as follows is apparently wrong ...
Date taskStartDate = rs.getDate("start_assign");
Time taskStartTime = rs.getTime("start_assign");
long tt= taskStartTime.getTime();
Date taskStartDate = new Date(taskStartDatetmp.getTime()+tt);please advise .You could convertjava.sql.Date sqlDate = resultSet.getDate("foo");
java.util.Date javaDate = new
java.util.Date(sqlDate.getTime());
This only works if the driver is ignorant enough to pass through millisecond values containing hours/minutes/seconds to the sql.Date, thus violating the contract of sql.Date. -
How do I get LONG RAW from Oracle with ASP page designed in Dreamweaver
Hello,
I have a single entry field the user enters a SSN to search a database, the query searches one table which returns the data.
Unfortunately one of the fields in the table is a LONG RAW field.
How do I create the ASP page to display the LONG RAW data correctly?
Thanks,
AdamYou can use XSU with Oracle 8.1.6:
xsu12_816.jar: for Java 1.2
xsu111_816.jar: for Java 1.1
Please refer to the following link to download the XDK for Java:
http://otn.oracle.com/software/tech/xml/xdk_java/content.html
For XSU document:
http://otn.oracle.com/docs/tech/xml/xdk_java/doc_library/Producti
on9i/java/xsu/readme.html
XSU provide both JAVA and PL/SQL APIs. -
Getting empty pdf from oracle reports
%PDF-1.4
1 0 obj
/Creator(Oracle11gR1 as Reports Services)
/CreationDate(D:20
Above is the content in the pdf when its gettig generated. My project involves multiple locations in the world. This error is happening only in particular location.
Can anyone help me on why this is happening?
Thanks,
Kaushik. G...from Java and returns an empty result setMy guess would be that something is wrong with your java code.
-
Are there any other ways to get automatical callback from Oracle
except Advanced Queuing.
I guess but that was what I was on earlier but it wasn't of much help.
I need to chat with an apple person but don't know how if I don't have a phone accessible.
Is there a way to connect thru a laptop or something? -
Tool generate xsd or dtd from oracle db table?
Hello everybody,
does anybody know a freeware-tool which generates xsd's or dtd's from oracle database tables?
Thanks a lot
Regards MarioHi,
Export from Oracle in XML format then use StylusStudio to generate from an XML. You can get it on a 30 day trial without paying.
(http://www.stylusstudio.com)
Cheers
Colin.
Message was edited by: Colin Bickell -
Are we going to get an explanation and an apology from Oracle?
Are we going to get any comment from Oracle about the forum upgrade debacle?
An unannounced upgrade, providing what seemed to be reduced functionality, followed by a rollback and loss of posts. And today, silence.Jim i hope oracle will revert back the same very soon and no loss of any post.Oracle should have backup before any maintenance job ,but question arise here there is also shuffling between accounts what can be done for that scenario.
user623560 is not my account
Khurram -
EXEC SQL - GET DATABASE STRUCTURE - RECREATE IN SAP
Our system is connected to PS.
II'd like to write a program that does the following
get the structure of the database
create the structure in SAP
SELECT THE DATA OF THE TABLE
This would be done in order to maintain the structure manually
The problem is to get the structure from external database (exec sql)
Thanks for your help!
Regards,Hi stephan,
1. In oracle , there is one standard view
eg. V_ALL_TAB_FIELDS
in which we pass the table name,
and it returns, the records,
for the fieldnames, field type, its length, its sequence number etc.
2. Similarly u may discover for PS also.
regards,
amit m.
Maybe you are looking for
-
What does VPN DO? And how to use it ?
What does VPN DO? And how to use it?
-
Design view not editable or viewable for validated site
I can see the site fine at http://www.wwu.edu/atustest - it validates and is viewable in the browser and in "Live" or "code" view in Dreamweaver. However when I try to display it in "Design" view nothing shows except the header, and that is garbled.
-
Unable to join home wireless network
One of my iPhones wont join my home wireless network. Keeps saying password is incorrect. Two other iPhones, 3 iPads, laptop all join no problem. Tried resetting wireless settings, did not work.
-
Processing in 2 internal tables -Performance wise better option
Hi Experts, I have 2 internal tables. ITAB1 and ITAB2 both are sorted by PSPHI. ITAB1 has PSPHI some more fields INVOICE DATE and AMT ITAB2 has PSPHI some more fields amount. Both itab1 and itab2 will always have same amount of data. I need to fi
-
HT2534 How to use my account to purchase apps on other iPad (which is not under my name)
How to purchase apps for other iPad (which is not under my name)?