How to analysis of the XML in the sql statement?
Hi friends, I have a table that contains a column of type CLOB, stores in xml format. For example, the data are like that
<Employees xmlns="http://TargetNamespace.com/read_emp"> <C1>106</C1> <C2>Harish</C2> <C3>1998-05-12</C3> <C4>HR</C4> <C5>1600</C5> <C6>10</C6> </Employees>
So how can I write the sql statement for the analysis of the data at the top
create or replace procedure parsing_xml
(
clob trans_payload
trans_dir varchar2
)
as
Start
if(trans_dir='inbound/emp')
then
insert into emp_proj
(
employee_id
last_name
hire_date
job_id
salary
department_id
)
Select t1.c1
t1.c2
t1.c3
t1.c4
t1.c5
t1.c6
from xmltable
(
XmlNamespaces ('http://TargetNamespace.com/read_emp' as 'emp').
' / ' emp:Employees by the way of xmltype (trans_payload)
columns
whole path of C1 'emp:C1. "
path of varchar2 (10) C2 'emp:C2. "
C3 varchar2 (10) path "emp:C3."
C4 varchar2 (10) path "emp:C4."
whole path of C5 "emp:C5."
C6 varchar2 (10) path 'emp:C6 '.
) t1;
end if;
commit;
end;
Tags: Database
Similar Questions
-
copy and paste the sql statement into sql * more
How do you paste the sql statement into sql * more... I tried the following options, get the windows interface for this sequel to the documentation below, but that did not work
http://download.Oracle.com/docs/HTML/A88829_01/ch3.htm
then I tried to create a simple .txt file with my sql statement and tried to run using @name (where name is the name of the file) and it gives me the following error SP2-0310: cannot open the file 'firstscriot.sql '.You name the file name.txt? Then you cannot start with @name, because SQL * PLUS will add the extension .sql
Try instead the @name.txt or name the file name.sql
And check if you have the correct path.
Concerning
Marcus -
In an interview, no one asked me a question. How the sql statement
ex: select * from emp;
I answered him as if the select statement is in the library cache then it will retrieve data from the cache, otherwise it will retrieve data from database files. On this, he asked to go. I could not years itself. Anyone like elobarate me on the analysis?SMON,
I would have preferred the official documents from Oracle, as suggested by
http://download.Oracle.com/docs/CD/E11882_01/server.112/e16508/sqllangu.htm#CHDFCAGA
Concerning
Peter -
Hard analysis of the same statement
Simple example:
SQL > select * from table_1 where col_1 =: b; -can also use literal here
Use "INDEX RANGE SCAN.
SQL > alter session set OPTIMIZER_INDEX_COST_ADJ = 1000;
Will cause the same instruction to use "TABLE ACCESS FULL".
Why the database generates new plan? When the same statement is still hard analyzed, assuming there is enough space in the shared pool and the statement is not 'Compatible with Bind?Thank you.
The view V$ SQL_SHARED_CURSOR shows some of the causes as to why the optimizer will choose not not to share an existing child cursor.
Change OPTIMIZER_INDEX_COST_ADJ falls under the cover of OPTIMIZER_MISMATCH.
The question that arises is almost reversed from what you ask.
It is not so when the optimizer chooses to make a difficult analysis.
It's more when a cursor existing being/not reusable.
that is, you will get an analysis hard whenever there is no such thing as an existing child shareable cursor.
So, if you run the SQL statement in a session and lend an existing child cursor reuse does not exist, then you will get a difficult analysis.
-
How do we improve the SQL Loader for EBS?
Hi all
We would like to use some of the new features like the FILLING and the EXPRESSION in the 10g version of SQL * Loader with the concurrent Manager.
EBS 11i version SQL Loader is 8i.
How do we improve the SQL Loader for EBS?
Thanks in advance!If you are referring to executable files under ORACLE_HOME 8.0.6, then it cannot be migrated to 10 g / 11 g - upgrade developer 6i with Oracle Applications 11i [125767.1 ID]
For executable files of database, please visit:
Interoperability Notes Oracle EBS 11i with Oracle Database 11 g 2 (11.2.0).) [ID 881505.1]
Oracle Applications Release 11i with Oracle 10 g Release 2 (10.2.0) [ID 362203.1]Thank you
Hussein -
How to see all the sql on sql statements commands under 'history' link
Hi all
How to see the history of sql on sql commands tab.
I want to see all the sql statements.
Where we set if we need to store more sql statements in history.
We use Apex3.2 and 10g (EE) database.
Thank you
NrIs there a limitation to the Apex 3.2, there are only 200 files...
Not sure about this, as I said earlier, the report is configured to display a maximum of 1,000 records, perhaps during the in-house data entry in the apex, she could to check something. In any case, all these are an internal feature and is not supposed to be "messed" with and could lead to no support.
Your alternative uses the same method I proposed, and you can query manually (after granting dba) table of APEX_040000.wwv_flow_sw_sql_cmds or even do a report in your application with a csv export.
-
How can I pass a condition of the table in the sql statement?
For example, in the table in the COND Varchar2 column (200) there is the value ' VAR > 10'.
| COND |
|' VAR > 10' |
where VAR is the name of the table column. I would like to make statement CASE WHEN VAR > 10 AND 0... I tried with as subquery
WHEN BOX (SELECT COND FROM TABLE WHERE...) THEN 0, but it does not work.
Hello
You can do this by using dynamic SQL.
that is to say:
declare v_stm varchar2(4000); v_cond varchar2(100); v_result integer; begin select cond into v_cond from yourtable where a=1; v_stm := 'select case when '||v_cond||' then 0 ...'; -- dynamic sql execute immediate v_stm into v_result; end; /
Remember that, in general, dynamic SQL has a performance degradation that SQL static and should be avoided when possible.
Storage condition or the SQL statements in the tables is not a good practice.
Kind regards.
Alberto
-
Get the SQL statement error programmatically
Hello
error SQL in the FORMS, you can display the erroneous SQL statement pressing (shift) (Ctrl) E on the screen. Is there a way to get the text of the SQL statement in a PL/SQL function for logging purposes?
I get the error using SQLERRM, it's not a problem. But how can I get the SQL text of the statement?
Thanks and regards,
Sascha
Sascha,
You should be able to use the: SYSTEM. System LAST_QUERY variable forms.
Craig...
-
the SQL statements used to create views
Hello
How can I see the full text (with table) to create a sql view:
Thank you.SQL> select text from dba_views where rownum=1; TEXT -------------------------------------------------------------------------------- select "LIB_IDX","LIB_NAME","VENDOR_NAME","PROTOCOL_NUM","VERSION_NUM","PATH_NAM
Try the following in the SQL * faster before executing the SQL statement:
SET LONG 1000
If this does not work, increase it if necessary.
-
Hi all
I just created a function that returns a TABLE;
I am grateful if some body guide me how to display the values in the table at the call of my sqlplus as function
Select * from func_avg_cost() of double;
its fine when you return a single value of work. But I'm back a table to retrieve the value from the table in the sql statement
Thank you!now, I must return two numbers function. as possible through table.
which is also possible with a simple object:
SQL> create or replace type my_number_typ as object (n1 number, n2 number) / Type created. SQL> create or replace function my_numbers (n1 number := 0, n2 number := 0) return my_number_typ as begin return my_number_typ (n1, n2); end my_numbers; / Function created. SQL> select my_numbers (2, 3) from dual / MY_NUMBERS(2,3) -------------------------------------------------- (2; 3) 1 row selected. SQL> select my_numbers (sal, deptno) my_numbers from emp where empno = 7788 / MY_NUMBERS -------------------------------------------------- (3000; 20) 1 row selected. SQL> select my_numbers (sal, deptno).n1 sal, my_numbers (sal, deptno).n2 deptno from emp where empno = 7788 / SAL DEPTNO ---------- ---------- 3000 20 1 row selected.
-
Identify the SQL statements that are executed frequently
I would like to identify SQL statements that are executed may times (e.g., > 1000 times) during an interval AWR.
I am aware of coloring a SQL_ID with exec ('...') dbms_workload_repository.add_colored_sql; but then the SQL ID must be known.
Is it also possible to do the same for the (not yet known) SQL statements that are executed > 1000 times? I think that the SQL statements that run very quickly (for example 1 s <) won't be captured automatically in a CWA even if those statements are frequently performed.
Version 11.2.0.4 on SLES11
Try this...
fixed lines 155
execs from collar to 999 999 999
Col min_etime to 999,999.99
Col max_etime to 999,999.99
Col avg_etime to 999,999.999
Col avg_lio to 999,999,999.9
Col norm_stddev to 999,999.9999
Col begin_interval_time to a30
node of col to 99999
break on plan_hash_value on startup_time skip 1
Select * from)
Select sql_id, sum (execs), min (avg_etime) min_etime, max (avg_etime) max_etime stddev_etime/min (avg_etime) norm_stddev
de)
Select sql_id, execs, plan_hash_value, avg_etime,
StdDev (avg_etime) on stddev_etime (sql_id partition)
de)
Select sql_id, plan_hash_value,.
Sum (NVL(executions_delta,0)) execs,
(sum (elapsed_time_delta) /decode (sum (nvl(executions_delta,0)), 0.1, sum (executions_delta)) / 1000000) avg_etime
-sum ((buffer_gets_delta/decode (nvl(buffer_gets_delta,0), 0.1, executions_delta))) avg_lio
DBA_HIST_SQLSTAT s, DBA_HIST_SNAPSHOT SS
where ss.snap_id = S.snap_id
and ss.instance_number = S.instance_number
and executions_delta > 0
Group of sql_id, plan_hash_value
)
)
Group of sql_id, stddev_etime
)
where norm_stddev > nvl (to_number('&min_stddev'), 2)
and max_etime > nvl (to_number('&min_etime'),.1)
order of norm_stddev
/
-
Why the sql statement was extucted twice in shell script?
I tried to test the rac load balancing using the shell script depending on suse 10 + oracle 10g rac.
After run the shell script, I got the result to follow.oracle@SZDB:~> more load_balance.sh #!/bin/bash for i in {1..20} do echo $i sqlplus -S system/oracle@ORA10G <<EOF select instance_name from v\$instance; / EOF sleep 1 done exit 0
Seem that the sql statement was run twice in each loop. If you help please take a look. Thanks in advance.oracle@SZDB:~> ./load_balance.sh 1 INSTANCE_NAME ---------------- ora10g2 INSTANCE_NAME ---------------- ora10g2 2 INSTANCE_NAME ---------------- ora10g1 INSTANCE_NAME ---------------- ora10g1 3 INSTANCE_NAME ---------------- ora10g1 INSTANCE_NAME ---------------- ora10g1
RobinsonBecause you have one; and one.
-
CALL THE PROCEDURE IN THE SQL STATEMENT
Why we cannot call a procedure inside the SQL statement?Hello
Usually when you select an item should return you data. In the case of a procedure, you cannot return any return value from the procedure directly it has to be done through some settings and to access these settings, you cannot use a simple sql statement. Where as in a function, you must return one of data that can be easily obtained accordingly.
see you soon
VT
-
Tuning sql of a product to the seller without changing the sql statement
Hello
We have a product of the provider that generates the SQL statement. For a query, we get the answer in 15 seconds. But users are asking if we can bring it back to 5 seconds. Limitation is the query can not be changed. He used about 10 to 12 tables and bit complex query.
What kind of options could be evaluated if we are to improve the performance of a query (not sure if she could never be reduced to 5 seconds)
without making any change to the query.
Database Version: Oracle 10.2.0.4
Thank you
DelphineHello
http://www.Oracle-base.com/articles/10G/AutomaticSQLTuning10g.php
your software is enterprise or standard?
Tuning Pack & pack diagnosis are extra cost option with the standard edition.
& the useful note * automatic SQL Tuning - SQL [271196.1 ID] profiles *.
http://www.Oracle.com/us/corporate/pricing/technology-price-list-070617.PDF
Thank you
Published by: CKPT November 5, 2010 11:12
-
Need help to resolve the error - below the SQL statement to execute cannot be
Below is my CO as, which creates a callable statement.
try {}
OAApplicationModule oaapplicationmodule = (webBean) pageContext.getApplicationModule;
OADBTransactionImpl t = (OADBTransactionImpl) oaapplicationmodule.getOADBTransaction ();
OracleCallableStatement proc = (OracleCallableStatement) t.createCallableStatement (lquery,-1);
proc. Execute();
t.Commit ();
}
catch (SQLException sqlexception)
{
throw OAException.wrapperException (sqlexception);
}
After the execution of the page, get the below error... (Please find below stack error)
I have referred the development guide but did not get something useful.
Please give me clues about the same.
Raghu cordially
-- Error Stack ---------------------------------------------------------
Error page
Details of the exception.
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: Houston-27123: SQL error in the preparation of the call statement. Statement: null
at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:888)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1145)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1408)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2637)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
in OA. jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
# # 0 in detail
java.sql.SQLException: the SQL statement to execute cannot be empty or null
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleConnection.privatePrepareCall(OracleConnection.java:1138)
at oracle.jdbc.driver.OracleConnection.prepareCall(OracleConnection.java:1054)
at oracle.jbo.server.DBTransactionImpl.createCallableStatement(DBTransactionImpl.java:3033)
at cisco.oracle.apps.xxchr.element.server.webui.XXCHRElementSetSearchCO.processFormRequest(XXCHRElementSetSearchCO.java:343)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
in OA. jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
java.sql.SQLException: the SQL statement to execute cannot be empty or null
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.driver.OracleConnection.privatePrepareCall(OracleConnection.java:1138)
at oracle.jdbc.driver.OracleConnection.prepareCall(OracleConnection.java:1054)
at oracle.jbo.server.DBTransactionImpl.createCallableStatement(DBTransactionImpl.java:3033)
at cisco.oracle.apps.xxchr.element.server.webui.XXCHRElementSetSearchCO.processFormRequest(XXCHRElementSetSearchCO.java:343)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
in OA. jspService(OA.jsp:40)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
to EDU.oswego.cs.dl.util.concurrent.PooledExecutor$ Worker.run (PooledExecutor.java:803)
at java.lang.Thread.run(Thread.java:534)
Published by: Rambeau on Oct 14, 2010 02:58check the code stuck by me again
Connection Conn = pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();
Connection conn = oaapplicationmodule.getOADBTransaction().getJdbcConnection(); //Right one
Thank you
-Anil
Maybe you are looking for
-
Satellite P200 and new update of BIOS 1.70
Hello Toshiba just released update 1.70 for their P200 model BIOS. Notice that I've seen is that the Logo has changed since in touch ith tomorrow at Toshiba leading an and the Intel logo is now black.haven't noticed all the new settings.
-
Problem of DNS in Windows server 2012
Hi guys,. I'm a newbie here and I hope to get help with my question. I have a server DNS (192.168.1.55/24). Everything is already configured, the IP address and host names are already mapped and is already working. Now the problem is... I example. Me
-
I have my product key, but not the cd of windows!
Greetings to all! OK, 2 years ago, I bought my laptop. He gave me the laptop but he gave me the windows cd so I can format it and I was pretty beginner do not ask. The thing is that the laptop has the product key (25 digit code) on the real sticker o
-
Upgrade from Windows XP to Windows Vista Edition Home Premium
When I try to upgrade to windows Vista my freze computer when you complete the last upgrade operation. Then I have no key board, no mouse, and I have to close it manually. When I reboot it is reinstalled windows XP. I get no error message. What can b
-
Audio capture lost "what you hear" of conexant
I have a laptop HP Pavilion DV2278ea under Vista 32 bit, and have all the updates of the BONE apart from those announced in the past weeks. I recently updated the software for the integrated sound card Conexant High Definition for 08 August last vers