Basic there IS NO query didn't return any results
DB version: 10 gr 2One of our tables in the schema of the test is to have less number of columns as the shema of PROD.
To determine missing columns of this table in the Test schema, I did the following.
-----In Test Schema
CREATE TABLE XYZ2
(COL1 NUMBER); ----------only one column
SQL > CREATE TABLE tables_test_list AS SELECT TABLE_NAME,COLUMN_NAME FROM USER_TAB_COLS;
Table created.
-In the scheme of prodSQL> CREATE TABLE XYZ2
2 (COL1 NUMBER,
3 COL2 NUMBER ----------- same table name with an extra column
4 );
Table created
And the scheme of PROD I have run the following SQL to determine what are the columns that do not appear in the TEST schemaselect column_name from User_Tab_Cols outer
where table_name='XYZ2'
and not exists (select 1 from TEST_SCHEMA.tables_test_list inner where outer.TABLE_NAME=inner.TABLE_NAME )
But the above query returns no results. No idea why?
10 gr 2 is not a version. Version numbers have four numbers and no letters.
Your statement is simply not true.
It returns nothing if registration occurs in both tables, as you test existence: the number of records, according to your request is irrelevant.
Differences can and should be identified by a simple less,
Select...
FROM table1
less
Select...
from table2
----------
Sybrand Bakker
Senior Oracle DBA
Tags: Database
Similar Questions
-
Help with the query to return the results of the group in the table?
Hello
Im a total noob, so please be nice...!
I'm looking around a table contains a column of WORD and a WORD_TYPE_ID column.
Words can have the same type_id.
What I'm trying to do is to write a query that will return the longest word for each word_type_id.
I tried for hours to get it and everything seems to get is two error messages or just the longest word in the whole WORD column.
Is the furthest I can get before things break down...
Select Word
table
where
Length (Word) =
(
Select
Max (length (Word))
table
)
Any help on this or if I could be pointed in the right direction it would be greatly appreciated.
Thank youHello
Welcome to the forum!
Here's one way:
SELECT word_type_id , MIN (word) KEEP (DENSE_RANK LAST ORDDER BY LENGTH (word)) AS longest_word FROM table_x GROUP BY word_type_id;
If there be a tie in some word_type_id (i.e. 2 or more words have exactly the same length, which is the longest in this group) the expression above will return the first one alphabetically. (This is what means here MIN.)
Published by: Frank Kulash, 11 August 2009 13:56
You almost had it.
As you have noticed, you get the longest line across the table. This is because your subquery was watching the entire table.
If you to correlate the subquery to the row in the main table, as shown below, you can get the longest word in each group:select word from table m -- m for main where length (word) = ( select max (length(word)) from table where word_type_id = m.word_type_id -- New );
-
Query of query count (column) returns empty not zero
This seems to be a bug in 7,0,1,116466 and 8,0,1,195765
Query of query count (column) or count (*) returns empty not zero when there is no match. Correctly returns a number when there is query matches.
For example select count (i_id) of PersonnelQuery where i_id < 100
Where does a report these?scottcook,
It's a known bug in ColdFusion 6.x which apparently has not been set.
Bug in CF6 (see the comments section of the page linked below)
http://livedocs.Adobe.com/ColdFusion/6.1/htmldocs/using_29.htmWorkaround
http://www.bennadel.com/blog/244-ColdFusion-query-of-queries-odd-count-behavior.htmReport it as a bug
http://www.Adobe.com/cfusion/mmForm/index.cfm?name=wishform -
Original title: breakdown of pen deskjest d4160
I have a HP Deskjet D4160 printer. The reset button will Flash. When I ran the HP diagnostic he said there was a 'pen failure' that had to be fixed, but he didn't give any directions on how to fix it.
Hi Fred Cornell,.
· You have any problems with the performance of the printer?
· What operating system is installed on your computer?
· The printer works well before?
You can check the link mentioned on official website of HP that describes the problem for the specific printer model you are using.
Flashing lights in the HP Deskjet D4160 printer
http://h10025.www1.HP.com/ewfrf/wc/document?DocName=c00635074&cc=us&DLC=en&LC=en&product=501857#n129
Alternatively, you can contact HP support for help on the issue.
HP support
http://WWW8.HP.com/us/en/support-drivers.html
Let us know the results.
-
PLSQL function to return the result of the query
Dear all,
Oracle Database SE1 11.2.0.1
I need to create a plsql function which should accept SQL as a parameter, execute it and return the result set.
Is this possible?
Madhu.149 wrote:
I need to create a plsql function which should accept SQL as a parameter, execute it and return the result set.
Be careful - results games indicate a set of data stored in memory. This is not what are sliders. This isn't how Oracle should be used.
Imagine that you implement such a result set function - which, on average, requires 1 MB of memory (private server) to store the results of the SQL query. A 100 users mean a 100 MB of memory required server. This is not suitable. Not at all. Never.
The correct back 'thing' is a handle to SQL cursor (called a ref cursor in this case). A SQL cursor is a "program" - that the appellant runs via the fetch command and generates one or more lines accordingly. Appellant repeatedly runs this slider through calls to fetch until this slider found and returns all rows affected (using consistent readings).
If you want an abstraction interface that the client can call via PL/SQL code in the database, so this crafting optimal SQL interface, creates the SQL cursor and returns the handle of the cursor (via the ref cursor data type) to the client.
-
SQL query return different result 11 GR 1 material and GR 11, 2
Problem: SQL returns different results in 11 GR 1 material and GR 11, 2 games.
Example script:
create the table tab_main
(
SOS number (2) not null,
contract number (2) null
)
/create the table tab_sub
(
number (2) of contract non-null,.
SOS number (2) null
)
/insert into tab_main values (1, 10);
insert into tab_main values (2, 20);
insert into tab_main values (3, null);
insert into tab_main values (4, null);insert into tab_sub values (1, 10);
insert into tab_sub (20, 2) values;
commit;The SQL code:
SELECT *.
OF tab_main.
tab_sub
WHERE tab_main.sos = tab_sub.sos (+) AND
tab_main. Contract = tab_sub.contract (+) and
tab_main. Contract not in (select 1 of the double);The above query gives more results
-by 11.2.0.4
1 10 10 1
2 20 20 2-in 11.1.0.7
1 10 10 1
2 20 20 2
4
3
Please tell us what could be the reason for the behaviour of offset lines thie.
Thank youPiesset
I think it is probably a bug in 11.1.0.7 (and possibly other versions), I get the same results as your 11.2.0.4 9.2.0.7, 10.2.0.3 and 11.2.0.3, and this is the result, I expect.
Your not in the paragraph is equivalent to:
SELECT *.
OF tab_main, tab_sub
WHERE tab_main.sos = tab_sub.sos (+) AND
tab_main. Contract = tab_sub.contract (+) and
tab_main. Contract <> 1;
Since you have null values in tab_main.contract they are lost by the predicate since null = value is never true (or false).
John
-
Hi, I deleted my acrobat application on my mobile by mistake and therefore lost all of my files... Is there a way to retrieve pdf files... I didn't save any to my laptop? Re
PDF files are not saved in the application. They must be in the local memory of the mobile device or if they are stored on the cloud of document, then they will be available under the cloud of document tab.
Please reinstall the Acrobat Reader application on your mobile device to access the document.
To transfer the PDF files from mobile device on laptop: -.
If the files are saved on the cloud of document, then you can access the file on your laptop using this link https://cloud.acrobat.com/folder/7efb457b-c1b5-4d6b-89d1-96b1ede2a167 , the files can be downloaded from here.
Otherwise, if the files are on the local memory of the mobile device, then you can send the file or transfer them using a data cable.
Kind regards
Nicos -
My 2015 Indesign is annoyingly slow, wait for wheel rotation for very simple things all the time. Is there a way that I can return to Indesign 2014 please?
Hello
Please see: -.
http://blogs.Adobe.com/adobecare/2015/06/16/how-to-find-and-install-previous-version-of-ad obe-apps-in-cc-2015. -
SELECT returns no results when there is a default namespace definition inXML
Hello
I have a problem that my select returns no results when there is a default namespace definition in my XML file.
I'm using oracle 11g release 1
XML file that is stored as a binary XML:
< SIMS xmlns = "http://sims.ics.muni.cz" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://sims.ics.muni.cz jh_sims_matricni_vystupy_or.xsd" >
< Vystup Datum = '2006-07-18' type = '2' Nazev = 'Last etapy' PocetStudentu = '1' PocetStudii = '2' >
< Student RodneCislo = "8001011001" >
Petr < name > < / name >
< / student >
< / Vystup >
< / SIMS >
This select return no results:
SELECT s jh_sims_bin_no_schema student.jmeno, XMLTable ('/ the SIMS/Vystup/student ' PASSAGE s.OBJECT_VALUE jmeno PATH VARCHAR2 COLUMNS (10) 'Name') student
When I remove the definition of default namespace (xmlns = "http://sims.ics.muni.cz") everything works well and even SELECT returns "Petr". When the file is stored in the storage object relational everything works great too!
< SIMS xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: schemaLocation = "http://sims.ics.muni.cz jh_sims_matricni_vystupy_or.xsd" >
< Vystup Datum = '2006-07-18' type = '2' Nazev = 'Last etapy' PocetStudentu = '1' PocetStudii = '2' >
< Student RodneCislo = "8001011001" >
Petr < name > < / name >
< / student >
< / Vystup >
< / SIMS >
Thanks for any help!
Jan HrubyLazy response:
See the post "How to declare mapping prefix to namespace with XMLTable()?" in the {: identifier of the thread = 410714} stickied to the top of this forum.
aka
XMLTable (XMLNamespaces (...), "/ the SIMS/Vystup/student")Published by: A_Non on June 16, 2010 13:07
Beat in a few seconds -
I need to return the result of a query on a stored procedure
I need to return the result of a query to a stored procedure, I mean when I run a stored procedure it returns a result set in a select statement.
Best regards...Hello.
Do you really want a stored procedure for this?
Why not just a script that contains the query?Assuming that you don't really want a stored procedure, you'll have to decide what to do with the results.
An option is a slider.For example, you can write a procedure of this type to hold the query:
CREATE OR REPLACE PROCEDURE USP_TEST ( out_cursor OUT SYS_REFCURSOR ) IS BEGIN OPEN out_cursor FOR SELECT * FROM scott.emp; END USP_TEST; / SHOW ERRORS
You can move the cursor to another procedure for handling.
You could test this in SQL * more by creating a variable blond:
VARIABLE usp_test_cursor REFCURSOR; EXEC usp_test (:usp_test_cursor); PRINT :usp_test_cursor
-
query returns different results depends on the length of the day
Hello!
I have a query:
This query returns different results in the morning (09:00) and afternoon (16:00) on the same database for the same input data (I have prepared a script to test).INSERT /*+ APPEND */ INTO pwa_process ( id, id_session, id_customer, s2k_account, service_seq_num, msisdn, id_tariff, contract_end_date, last_contract_date, next_available_contract_date, tariff_name, description, description_long, imei_old, activation_date, id_customer_number, arpu, value0, value1, value2, value3, value4, value5, id_pricing_plan) WITH msisdns AS (SELECT msisdn ms FROM customer_number cn JOIN customer_s2kaccount cs ON cn.s2k_account = cs.s2k_account AND cs.id_customer = v_customerId) SELECT seq_pwa_process.NEXTVAL, v_sessionId, customer_s2kaccount.id_customer, customer_s2kaccount.s2k_account, customer_number.service_seq_num, msisdn.msisdn, tariff.id, NVL(CASE WHEN date_contract_end IS NULL AND le_contract_end_date IS NOT NULL OR (date_contract_end < le_contract_end_date) THEN le_contract_end_date ELSE NVL(date_contract_end, ADD_MONTHS(customer_number.date_start, customer_number.ada_availability)) END, TO_DATE('01.01.1970', 'DD.MM.YYYY')) contract_end_date, CASE WHEN NOT customer_number.date_first_activation IS NULL AND customer_number.date_first_activation > (CASE WHEN ada_priority = 1 THEN ada_date_pwa WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) THEN exchange_date ELSE date_pwa END) THEN customer_number.date_first_activation ELSE (CASE WHEN ada_priority = 1 THEN ada_date_pwa WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) THEN exchange_date ELSE date_pwa END) END last_contract_date, ADD_MONTHS(CASE WHEN NOT customer_number.date_first_activation IS NULL AND customer_number.date_first_activation > NVL( (CASE WHEN ada_priority = 1 THEN ada_date_pwa WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) THEN exchange_date ELSE date_pwa END) , NVL(customer_number.date_first_activation, NVL(customer_number.date_start, customer_number.date_effective))) THEN customer_number.date_first_activation ELSE NVL( (CASE WHEN ada_priority = 1 THEN ada_date_pwa WHEN ada_priority <> 1 AND (date_pwa IS NULL AND exchange_date IS NOT NULL OR date_pwa < exchange_date) THEN exchange_date ELSE date_pwa END) , NVL(customer_number.date_first_activation, NVL(customer_number.date_start, customer_number.date_effective))) END, customer_number.ada_availability - DECODE(NVL(customer_number.current_contract_type, 0), 2, DECODE(customer_number.reduced_contract_used, 0, NVL(customer_number.el_contract_calculated_reduc,0), 0), 0)) next_available_contract_date, tariff.name_ada, DECODE(msisdn_group.def_column, 0, msisdn.value0, 1, msisdn.value1, 2, msisdn.value2, 3, msisdn.value3, 4, msisdn.value4, 5, msisdn.value5, msisdn.value0), msisdn.value0 || ';' || NVL(msisdn.value1, '') || ';' || NVL(msisdn.value2,'') || ';' || NVL(msisdn.value3,'') || ';' || NVL(msisdn.value4, '') || ';' || NVL(msisdn.value5, ''), customer_number.imei, NVL(customer_number.date_first_activation, NVL(customer_number.date_start, customer_number.date_effective)) date_start, customer_number.id, NVL(s2kaccount.arpu1,0), msisdn.value0, msisdn.value1, msisdn.value2, msisdn.value3, msisdn.value4, msisdn.value5, customer_number.id_pricing_plan FROM customer_s2kaccount JOIN customer_number ON customer_number.s2k_account = customer_s2kaccount.s2k_account AND customer_number.service_state = 'AB' JOIN msisdn ON msisdn.msisdn = customer_number.msisdn JOIN TABLE(CAST(v_tmp_table AS ADA.NUMBER_TABLE)) ids ON ids.column_value = msisdn.id JOIN msisdn_group ON msisdn_group.id = msisdn.id_msisdn_group JOIN pricing_plan ON pricing_plan.id = customer_number.id_pricing_plan AND pricing_plan.is_for_pwa = 1 JOIN tariff ON tariff.name = pricing_plan.id JOIN s2kaccount ON s2kaccount.s2k_account = customer_number.s2k_account LEFT JOIN (SELECT msisdn, exchange_date, ADD_MONTHS(exchange_date, MAX(prolongation)) le_contract_end_date FROM loyalty_exchange a, msisdns WHERE a.msisdn = msisdns.ms AND exchange_date >= ALL (SELECT exchange_date FROM loyalty_exchange b WHERE b.msisdn = a.msisdn) GROUP BY msisdn, exchange_date) le ON le.msisdn = customer_number.msisdn WHERE customer_s2kaccount.id_customer = v_customerId;
Oracle 9.2.0.6 @solaris
I checked the query plans, but they look the same in the morning and the afternoon. I don't know where to look for a problem/bug.
Please help me with suggestions. is in bug with join ansi? or a left outer join?
Published by: batonoff on February 16, 2009 16:56
Published by: batonoff on February 16, 2009 16:58
Published by: batonoff on February 16, 2009 17:00I recommend you post your declaration in the {} code tags (without the spaces) so that we can actually read.
You are absolutely positive that nothing has changed on the data between when you run in the morning and in the afternoon?
-
Hi all
We are on 10.1.3.4... I created a job popping up every day and all is well when there are data addressing for that day (emails get generated without problems) but I get this error when no data is returned. I cannot ignore the emails but y at - it a way to avoid the error if there is no data to process for I can be sure that I am not ignoring real issues when there is a real treatment error out?
Thanks in advance for your time.
Kind regards
PJ
oracle.apps.xdo.servlet.scheduler.ProcessingException: java.lang.NullPointerException
at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.java:2163)
at oracle.apps.xdo.servlet.scheduler.XDOJob.execute(XDOJob.java:371)
at org.quartz.core.JobRunShell.run(JobRunShell.java:195)
to org.quartz.simpl.SimpleThreadPool$ WorkerThread.run (SimpleThreadPool.java:520)
Caused by: java.lang.NullPointerException
at com.sun.java.util.collections.Hashtable.get(Hashtable.java:321)
at oracle.apps.xdo.batch.bursting.ProcessEnterpriseDocument.processLayout (unknown Source)
at oracle.apps.xdo.batch.BurstingProcessorEngine.addDocument2Queue (unknown Source)
at oracle.apps.xdo.batch.BurstingProcessorEngine.createBurstingDocument (unknown Source)
at oracle.apps.xdo.batch.BurstingProcessorEngine.endDocument (unknown Source)
at oracle.xml.parser.v2.XMLContentHandler.endDocument(XMLContentHandler.java:119)
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:311)
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:263)
at oracle.apps.xdo.batch.BurstingProcessorEngine.burstingRequest (unknown Source)
at oracle.apps.xdo.batch.BurstingProcessorEngine.process (unknown Source)
at oracle.apps.xdo.servlet.scheduler.XDOJob.runBurstingReport(XDOJob.java:2055)
... 3 more
Hi PJ,.
If the model of data or rupture of query query returns no rows - BEEP will throw Null pointer Exception error.
THUS, our goal is to have 1 row who always gets compensated regardless of the logic of the report.
It is only through a work around on the SQL query.
Before spend you with this
1. how many reports does need this change?
2 are going you to the 11 g version all earlier?
3. If you think that his evidence for this change just to make the fake success on your Planner screen message, then proceed to test the approach below.
Application of model data:
****************
For example
/ real request * /.
Select empid as busrt_key,
EmpName,
empsal
WCP
where empdept in (10.20)
Union of all the
/ * query dummy to return 1 row always regardless of actual query * /.
Select 'burst_flag' busrt_key,
empname null,
empsal null
of the double
Bursting of query:
***************
Choose burst_key KEY,
'template_name' MODEL,
"rtf" TEMPLATE_FORMAT,
'pdf' OUTPUT_FORMAT,
cases where burst_key = 'burst_flag' then 'NA' else 'EMAIL' end DEL_CHANNEL, - note here, for dummy value used to send us emails with just the key to the success.
'- at-'email' "Parameter1".
"e-mail-cc" PARAMETER2,
"email - of" parameter3,.
"email subject" parameter4
PARAMETER5 "-body of the email."
PARAMETER6 'true '.
Of
(
/ * your logical real burst of request but just only the select clause that you will use in the KEY * /.
Select empid as burst_key
WCP
where empdept in (10.20)
Union of all the
/ * query dummy to return 1 row always * /.
Select "burst_flag" as burst_key - this value hardcoded must be synchronized in the data model and query failure
of the double
)
Impact of the model
***************
If you have aggregation functions in your RTF model such as sum() and count(), let me know.
Due to the addition of an additional dummy query, 1 row with a null value is generated which cause problem NAN (not a number) to your model. But that can be handled.
Thank you...
-
OBIEE logical column has same SQL but returns different results
I have a SQL query with a case statement that returns the correct results by operating in Oracle SQL Developer. I've created several logical columns in OBIEE, one for each case in the original query. However, the results returned by each logical column OBIEE are radically different from the original SQL query results, even if the SQL code is virtually identical.
For example, a column logical OBIEE that returns incorrect results contains the following SQL code:
SUM (CASE when
("Registration - College". "" Effective colleges F. ("" Postal code "like '% a %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%B %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%c %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like"% %") or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%G %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like"hour %") or
("Registration - College". "" Effective colleges F. ("" Postal code "like"%%J") or
("Registration - College". "" Effective colleges F. ("' Postal code ' like '%R %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%s %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%T %') or
("Registration - College". "" Effective colleges F. ("" Postal code "like"% %") or
("Registration - College". "" Effective colleges F. ("" Postal code "like '%x %') or
("Registration - College". "" Effective colleges F. ("' Postal code ' like '%Y %')
THEN 0 OTHERWISE 1 END)
The case statement in the original SQL query, which returns the correct results, is as follows:
CASE
WHEN (postal_zip_code_permanent like "%%K") or (postal_zip_code_permanent like '% %') or (postal_zip_code_permanent like '%m %') or (postal_zip_code_permanent like '%n %') or (postal_zip_code_permanent like "%p %") THEN "Ontario".
WHEN (postal_zip_code_permanent like '% a %') or (postal_zip_code_permanent like '%B %') or (postal_zip_code_permanent like '%c %') or (postal_zip_code_permanent like '% %') or (postal_zip_code_permanent like '%G %') or (postal_zip_code_permanent like "%hour") or (postal_zip_code_permanent like "%%J") or (postal_zip_code_permanent like "%%R") or (postal_zip_code_permanent like '%s %') or (postal_zip_code_permanent like '%t %') or (postal_zip_code_permanent like '% %') or (postal_zip_ code_permanent like '%x %') or (postal_zip_code_permanent like "%%Y") THEN "Canada, other than Ontario.
WHEN (substr(postal_zip_code_permanent,1,1) IN ('1 ', '2', '3', '4', '5', '6' ', 7',' 8 ', ' 9',' 0') or (postal_zip_code_permanent like '%d %') or (postal_zip_code_permanent like '%f %') or (postal_zip_code_permanent like ' % I %') or (postal_zip_code_permanent like "% O") or (postal_zip_code_permanent like "%%Q") or (postal_zip_code_permanent like "%%U") or (postal_zip_code_permanent like ' % W ') or (postal_zip_code_permanent like "%%Z")) THEN 'other')
WHEN (postal_zip_code_permanent like '% + %') or (postal_zip_code_permanent like '%. %') or (postal_zip_code_permanent like ' %? %') or (postal_zip_code_permanent like '% %') or postal_zip_code_permanent IN ('+ ','.', '?)) (',',') And THEN "Invalid."
WHEN postal_zip_code_permanent is null THEN 'Blank '.
Of OTHER postal_zip_code_permanent
END
Now I see what the problem was. In the original SQL query, each condition is exclusive, for each record will only be categorized in one of the scenarios WHEN. But in OBIEE, each logical column is autonomous, so some records were classified into more than logical column, even if each logical column was supposed to be exclusive.
-
Return custom results, the value of the service
Hi all
Can return us customized results, the value of a personalized service?
We plan to write a wrapper for the Service of research and return the result set custom when that service is called. Any body tried this approach before and do you know what are the advantages and disadvantages of this approach.
1. resources Service file. CheckReleaseState is the personal name of resultset.
2 file query of the resource.
Run your custom service and then access the resultset in java using the line below:
DataResultSet searchDataResultSet = new DataResultSet();
searchDataResultSet.copy (binder.getResultSet ("CheckReleaseState"));
-
XMLTable returns no results if you use an optional element in line-generations. exp
Hello
I need assistance with a view that returns no data. Point of view joined relational columns from two tables with the binary XML column values. The problem is that if the XML element in the expression of generators on the line of the function XMLTable does not exist, the view returns 0 rows, despite the use of a left outer join.
It is an example of a document:SQL> select * from V$Version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production PL/SQL Release 11.2.0.3.0 - Production CORE 11.2.0.3.0 Production TNS for Linux: Version 11.2.0.3.0 - Production NLSRTL Version 11.2.0.3.0 - Production
The display should return a line by EPC and the corresponding mycorp:quantity of the list. If the mycorp:quantity of the element does not exist, I still want three rows back, one for each EPC, but with empty columns of quantity.<ObjectEvent> <eventTime>2009-03-10T01:02:00.827-06:00</eventTime> <eventTimeZoneOffset>-06:00</eventTimeZoneOffset> <epcList> <epc>urn:epc:id:sgtin:030093.0098109.100000000001</epc> <epc>urn:epc:id:sgtin:030093.0098109.100000000002</epc> <epc>urn:epc:id:sgtin:030093.0098109.100000000003</epc> </epcList> <bizStep>urn:epcglobal:bizstep:commissioning</bizStep> <mycorp:quantity xmlns:mycorp="http://www.mycorp.com" epc="urn:epc:id:sgtin:030093.0098109.100000000001">10</mycorp:quantity> <mycorp:quantity xmlns:mycorp="http://www.mycorp.com" epc="urn:epc:id:sgtin:030093.0098109.100000000002">20</mycorp:quantity> <mycorp:quantity xmlns:mycorp="http://www.mycorp.com" epc="urn:epc:id:sgtin:030093.0098109.100000000003">30</mycorp:quantity> </ObjectEvent>
It's point of view:
The result looks OK if the < mycorp:quantity > element exists in the document:SELECT e.event_id, e.epc, UNIT_QUANTITY, UNIT_QUANTITY_EPC FROM EVENTSCHEMA.event z , EVENTSCHEMA.epc e LEFT OUTER JOIN XMLTABLE (XMLNAMESPACES ('http://www.mycorp.com' AS "mycorp"), '$e/*/mycorp:quantity' passing z.EVENTXMLTEXT as "e" COLUMNS UNIT_QUANTITY NUMBER(10) PATH '.', UNIT_QUANTITY_EPC VARCHAR (2000) PATH '@epc' ) t1 ON t1.UNIT_QUANTITY_EPC = e.epc WHERE e.event_id = z.event_id;
However, if this element does not exist in the document, the view returns an empty result set. It seems that the left outer join is thrown because the path of generating line expression expression ("$e / * / mycorp:quantity" "") does not actually exist in the document. My application needs to support Oracle and DB2. On DB2 that this point of view works as expected, so the syntax seems to be OK.EVENT_ID EPC UNIT_QUANTITY UNIT_QUANTITY_EPC ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1020 urn:epc:id:sgtin:030093.0098109.100000000003 30 urn:epc:id:sgtin:030093.0098109.100000000003 1020 urn:epc:id:sgtin:030093.0098109.100000000001 10 urn:epc:id:sgtin:030093.0098109.100000000001 1020 urn:epc:id:sgtin:030093.0098109.100000000002 20 urn:epc:id:sgtin:030093.0098109.100000000002
My next attempt was to add a case distinction to the term generating line, as described in this article from devWorks . The article recommends to add a set of two expressions, which is always empty. In my example, the bizStep item is returned if there is no such thing as the mycorp:quantity element:
This works well if the mycorp:quantity element does not exist:SELECT e.event_id, e.epc, UNIT_QUANTITY, UNIT_QUANTITY_EPC FROM EVENTSCHEMA.event z , EVENTSCHEMA.epc e LEFT OUTER JOIN XMLTABLE (XMLNAMESPACES ('http://www.mycorp.com/pedigree' AS "mycorp"), '$e/*/(mycorp:quantity,.[fn:not(mycorp:quantity)]/bizStep)' passing EVENTXMLTEXT as "e" COLUMNS UNIT_QUANTITY NUMBER(10) PATH '.[../mycorp:quantity]', UNIT_QUANTITY_EPC VARCHAR(2000) PATH '.[../mycorp:quantity/@epc]' ) t1 ON t1.UNIT_QUANTITY_EPC = e.epc WHERE e.event_id = z.event_id;
but does not return any rows if the mycorp:quantity exists!EVENT_ID EPC UNIT_QUANTITY UNIT_QUANTITY_EPC --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1020 urn:epc:id:sgtin:030093.0098109.100000000001 1020 urn:epc:id:sgtin:030093.0098109.100000000002 1020 urn:epc:id:sgtin:030093.0098109.100000000003
Can someone help me? Is an expression of step parent in the COLUMN of output expression supported in Oracle? I also tried
but who would return ORA-19110: unsupported XQuery expression.UNIT_QUANTITY NUMBER(10) PATH '../mycorp:quantity'
Thank you!
Daniela
Published by: dwersin on July 19, 2012 14:28
Maybe you are looking for
-
Satellite A300D - 156 BIOS update failed - I need assistance with recovery
Hello I know it is old enough, but until now, it was just good enough for my use.In any case, after I did a restore of the Windows Vista operating system came with my computer, I got a notification of one of the tools of Toshiba that an updated BIOS
-
Logitech TrackMan disables the update of security for Vista (KB973565)
When I install the update of security KB973565 it disables my Logitech TrackMan (trackball) wireless and may not be re-connected thereafter. I can only restore the TrackMan to uninstall this update of Windows Vista. Can I use a wireless mouse Logitec
-
I need a new hard drive. How can I reload windows?
I had a SMART failure had predicted the message of hard drive on my laptop. If I have to get a new hard drive, how can I reload windows? I have not all discs with my computer, but I have a product key,
-
I have a problem and don't know wot to say solve a problem with asus fbAgent he said press it down the udate I click on low loadit asim woundering ifits just as stopn Wichis me putn in mymcafee as when tryn to install thatit sayn error couldsumonehel
-
increase o meu pc som comoposso
baixo o fazer com o som meu pc bem works?