JDeveloper, Java & XML :: How To Use Sql To Bypass Xml Special Character
Jun 20, 2012
"SELECT xmltype(RCATT).extract('/JASON/RCA/SUB_PROBLEM_TYPE').getStringVal() as SPT,
xmltype(RCATT).extract('/JASON/RCA/SUB_ROOT_CAUSE').getStringVal() as SRC,
xmltype(RCATTT).extract('/JASON/RCA/ELABORATION').getStringVal() as ELA,
xmltype(RCATT).extract('/JASON/RCA/PREVENTION').getStringVal() as PRE
FROM table"
Above is my select statement
some explanation: the above select statement is to select the child node inside the xml content. But the child note contains some special character "<>" that illegally in xml.
Below is my xml content for the node of sub_problem_type
<JASON>
<RCA>
<SUB_PROBLEM_TYPE>
For <FS_PLS_WAIT>, it is appeared in both valid and invalid password entered case but in requirement, only valid case has stated the display of <FS_PLS_WAIT>. This is the legacy radio behavior.
</SUB_PROBLEM_TYPE>
</RCA>
</JASOn>
The result will generate the following issue.
ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00225: end-element tag "ELABORATION" does not match start-element tag "FS_PLS_WAIT" Error at line 10 ORA-06512: at "SYS.XMLTYPE", line 301 ORA-06512: at line 1
I wish to know where can i by pass the checking for special character.
I am trying to invoke program from my local Windows machine (exactly java executor, which is in my environment on c:javajdkinjava) using database package with Java stored procedure.
Everything is fired by SQLPLUS script, this script invokes package with Java stored procedure (jar loaded into Oracle) and that procedure is trying to invoke runtime process (syntax:
c:javajdkinjava -cp
and here ara my classes and main jar) using my local java executor. I added all permissions using dbms_java.grant_permisions (execution forced me to give permissions java.io.FilePermission to <<ALL_FILES>> for execute), moreover I added to my database user JAVASYSPRIV and JAVAUSERPRIV role. Unfortunately, beside this I am still getting error:
C:javajdkinjava not found (Note that lookup with PATH isn't done due to the oracle executable being setuid.)
I am writing a java stored procedure in my package. In the java procedure I want to issue a query to be fired on the user table from which I am calling the java procedure.
Some thing like following:
I am logged in to USER1 and my package is inside USER1. From this package I am calling the Java Stored Procedure. In java procedure I want to make a jdbc connection to USER2. The details of USER2(password, hostname,portno) are stored in a table called 'connection_details' and this table is in the USER1.
My problem is how can I issue the
SELECT details FROM CONNECTION_DETAILS for USER2
so that i can get the details..?
Do i need to first make jdbc connection to USER1 and then execute the above query for which i need similar details of USER1. How can i obtain the details of USER1 here.
I am thinking if I am already in USER1 then do I need to make the jdbc connection to USER1 and then execute the query?
I've this java source create or replace and compile java source named "Decodificador" as public class Decodificador { public static String decodifica(String codigo) return codigo;
and this function
create or replace function F_Decodificador(codigo varchar2) RETURN VARCHAR2 IS LANGUAGE java NAME 'Decodificador.decodifica(String) return String';
when I execute the function the result is:
ORA-29531: no method decodifica in class Decodificador
I need to call DB function through Java Hibernate.
My Sample XML File looks like. --------------------------------------------------------------- <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <sql-query name="getchequeno" callable="true"> ?:=call cz_nab_mw_fn_gen_ol_chq_no() </sql-query> </hibernate-mapping> --------------------------------------------------------------- I am getting below error while reading the file
"java.lang.RuntimeException: org.hibernate.HibernateException: Errors in named queries: getchequeno"
i`m trying to use pl/sql function to execute java class. I created 2 tables with around 100 values and java class with simple functionality. I need to create function to loop through my table1 and get with each iteration one value from table and pass that value as parameter to java class.
table1 is something like this:
ID NAME 1 name1 2 name2 3 name3 . . . . 100 name100
table2 is empty with same columns as table1 ( table2 is for data obtained from java returns ) I created in sql+ java class.
CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED "myClass" AS import java.io.*; import java.util.* public class myClass { public static String fun(String strName)
[code]....
Then i wanna make a pl/sql function for:
1)For i = 1 Obtain first value from table1 (column name) and pass it throught java class then return value and save it in table2 with the same id as id from table1
My requiremnt is that a field must contain on Alpha number value, no specail character allowed, how can we sure by query that string which is going to commit is alphanumeric.
I am using Release 10.2.0.1.0 version of oracle. I am getting a special character, but i suspect it as any other language character.
Its appearing in my 'TOAD editor/Sql prompt editor' as 'A?'. but when i am selecting it from the table using below query, its giving 'No rows Returned'.
select id from tab1 where id like 'A%';
How can i be able to see the exact character or which editor will enable me to see the character?
I think sql developer GUI might be able to show the same but i dont have sql developer with me.
I have a pl/sql question about interpreting special characters in pl/sql. I am generating an update statement and get an invalid character when the customer name has an ampersand in it (&). I�m now generating the update statement to include the customer name cut up with concatenation characters surrounding the ampersand, for example �CSCP-C�||�&�||�E�. However, pl/sql is still not executing the update.
Here is the code.
SET PAGES 2000; SET LINES 200; SET SERVEROUTPUT ON; SET VERIFY OFF; spool update_table.log ;
[code]....
The RESULTS follow. Of course, I can copy this statement and execute in sqlplus without a problem.
Still today user can enter any special character value in stud_name like L'Pradhan . I want to put a restriction on stud_name so that user can enter only alphabetical value into stud_name column.
This is the cursor which fetches from View uk_case_recommends_vw and this view calls the table ukcc_case_casenames below is the query
cursor cur_case_name_search is select a.*,DENSE_RANK() OVER (ORDER BY sc desc) rank from uk_case_recommends_vw a where rownum < 2 + 3; SELECT /*+first_rows(4) index(u ukcc_case_casename_idx)*/ persistentid, casename, FROM ukcc_case_casenames
Here in this table my case name may be with special character or normal .
For Ex ('R V Wilson') - With Special character ('R V Wilson') - Without Special character
Actually my cursor is not fetching with special character ..neither it is not mentioning as no data found. Find the piece of code below.. I am not getting values after opening the cursor.
open cur_case_name_search; loop fetch cur_case_name_search into v_case_name_row; exit when cur_case_name_search%notfound or v_case_name_row.rank > v_matchingvalue or [code]......
i want to store special characters in database. i have tried following but not succeed. how to store and retrieve it. Herewith i'm posting my try.I want to store and retrieve following character.
We need to maintain the day 0 value of special character "ÿÿ" for application. If i use the special character directly in sql file , it is getting inserted as junk character "?"
If i use workaround by using chr(255) function i am getting below behavior.
select chr(255) from dual --------------------------- ÿ
A database containing inventory data has been migrated from Oracle 10g to Oracle 11g. I have access to both the Oracle 10g and Oracle 11g database on different client computers. Both databases use the same character set, WE9MSWIN1252 (query shown below). However the results from the sql SELECT show incorrectly displayed characters. I would like the "1/2" character and degree character to show in the text. The ASCIISTR function shows that the underlying ascii is the same in the two copies of the databases.
Is there a setting that needs to be changed in Oracle 11g so that the saved special characters in the database show correctly (as in Oracle 10).
Query of database character set
SQL> Select value from SYS.NLS_DATABASE_PARAMETERS where PARAMETER = 'NLS_CHARACTERSET' WE8MSWIN1252
Under Oracle 11g, this is a query on DSI using SQLPLUS 11.2.0.1.0.
SQL> select description from part where id = '57234';
DESCRIPTION ---------------------------------------- KL BRKT PLN 22╜░ ANGLE (AMER BOT RAIL) SQL> select asciistr(description) from part where id='57234'; ASCIISTR(DESCRIPTION) --------------------------------------------------------------------------------
I have a file which i am loading , the last column is being loaded with special character which looks like sqare shape character for all the rows.How can i prevent it to load as it is not present in the file
data in file
Department|2|Tranport for London|Rail & Underground|ER|ER|ER|ER|ER|ER|555555555|Owner 8|8
the data once loaded for the last column on which is for above example last column value 8 will be loaded with 8 and square share character.
How to handle special charater '&' in stored procedure.
Following is a test code I want to Implement
CREATE OR REPLACE PROCEDURE SP_Test(QueryID NUMBER,DateFirst DATE,DateLast DATE) IS BEGIN INSERT INTO TempTable(QueryID,LineID,data,Datetime) SELECT 1,6,Emp,startdate FROM salary
[code]....
The code above resuts into INVALID state of stored procedure and cannot be executed.