Export query returns no rows
Dear guy,
I jam with this problem for 2 days and have you guy help me to check it out. Here's my parfile
TABLES IS UMARKETADM. TRANS_DATA
CONTENT = DATA_ONLY
EXCLUDE = STATISTICS
QUERY = UMARKETADM. TRANS_DATA: "WHERE transid in (select id from umarketadm.trans t where t.last_modified > to_date (5 January 2014 00:00:00 ',' DD/MM/YYYY hh24:mi:ss') and t.state in (2.6))" "
DUMPFILE = SHARED_DIR:Demand.dmp
Network_link = remote_db
and the result is:
. . exported "UMARKETADM." "" TRANS_DATA ". | 6,398 KB | 0 rows |
Main table 'SYSTEM '. "" SYS_EXPORT_TABLE_01 "properly load/unloaded
But when I check in, select the table:
Select count (*) in umarketadm.trans_data
where transid in (select id from umarketadm.trans t where t.last_modified > to_date (5 January 2014 00:00:00 ',' dd/mm/yyyy hh24:mi:ss') and t.state in (2.6));
then it results in: 1271258 lines
Yes, is there some things wrong with my parfile?
So thank you and best regards
Ch
Hello
I think that maybe it's a quirk of how works on network lnk datapump. I think the memory some of the rferences becomes 'local' rather than distance.
You can try?
TABLES IS UMARKETADM. TRANS_DATA
CONTENT = DATA_ONLY
EXCLUDE = STATISTICS
QUERY = UMARKETADM. TRANS_DATA: "WHERE transid in (select id from umarketadm.trans@remote_db t where t.last_modified > to_date (5 January 2014 00:00:00 ',' DD/MM/YYYY hh24:mi:ss') and t.state in (2.6))" "
DUMPFILE = SHARED_DIR:Demand.dmp
Network_link = remote_db
See you soon,.
Rich
Tags: Database
Similar Questions
-
Oracle Text multi column index based query returns no rows
Hello
I have a MAH_KERESES_MV table with 3 columns OBJEKTUM_NEV, KERESES_SZOVEG_1, KERESES_SZOVEG_2. I create the following Oracle multi column text index:
ctx_ddl.create_preference exec ('MAH_SEARCH', 'MULTI_COLUMN_DATASTORE');
ctx_ddl.set_attribute exec ('MAH_SEARCH', 'COLUMNS', 'OBJEKTUM_NEV, KERESES_SZOVEG_1, KERESES_SZOVEG_2');
create index MAX_KERES_CTX on MAH_KERESES_MV (OBJEKTUM_NEV)
indexType is ctxsys.context
parameters ("DATASTORE MAH_SEARCH");
But the query returns no rows, although if I make the query with the 'like' operator, and then I get the results as expected:
SELECT id, OBJEKTUM_NEV
OF MAH_KERESES_MV
WHERE CONTAINS (OBJEKTUM_NEV, "C") > 0;
Can some body please help? TIA,
TamasYou can do it in Oracle Text, well it is not necessarily desirable.
You can search the
WHERE CONTAINS(OBJEKTUM_NEV, '%C%')>0;
And it will probably work in a simple test. However, using a leader like this wildcard prevents them the index on the table "list of words" used, so such a request can be very slow on a large system.
You can improve this by using SUBSTRING_INDEX, but making your much bigger index. And you could always hit the 'expansions too' problem if %C % expansion is more than about 15,000 words (depending on version and different settings).Also be aware of differences in case - %C % will match 'fact' or 'FACT', as part of a CONTAINS, but not part of a TYPE.
-
How to know what sub query returns multiple rows
Hi all
Someone can give me hints, how to know what sub query returns many rows in the following query.
Kind regards/* Formatted on 2011/05/17 19:22 (Formatter Plus v4.8.8) */ SELECT a.*, ROWNUM AS rnm FROM (SELECT DISTINCT '1' AS "Page View", ou.org_unit_name AS "Org", prxm.mbr_idntfr AS "Beneficiary ID", md.last_name || ', ' || md.first_name AS "Beneficiary Name", pci.idntfr AS "Tracking No.", TO_CHAR (TRUNC (req.pa_rqst_date), 'MM/dd/yyyy' ) AS "Request Date", sts.status_name AS "Status", req.pa_rqst_sid AS "Request #", prxm.mbr_sid AS "Mbr_sid", TO_CHAR (TRUNC (req.pa_revision_date), 'MM/dd/yyyy' ) AS "Last Updated", TO_CHAR (psd.TO_DATE, 'MM/dd/yyyy') AS "TO_DATE", prxpl.prvdr_lctn_iid AS "PRVDR_LCTN_IID", pd.prvdr_sid AS "PRVDR_SID", 'Y' AS "State View", DECODE ((SELECT DISTINCT pd.national_prvdr_idntfr FROM pa_request_x_provider_location prxplo WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid AND prxplo.oprtnl_flag = 'A' AND prxplo.pa_prvdr_type_lkpcd = 'RR'), 0, (SELECT prxplo.prvdr_lctn_idntfr FROM pa_request_x_provider_location prxplo WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid AND prxplo.oprtnl_flag = 'A' AND prxplo.pa_prvdr_type_lkpcd = 'RR'), NULL, (SELECT prxplo.prvdr_lctn_idntfr FROM pa_request_x_provider_location prxplo WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid AND prxplo.oprtnl_flag = 'A' AND prxplo.pa_prvdr_type_lkpcd = 'RR'), (SELECT DISTINCT pd.national_prvdr_idntfr FROM pa_request_x_provider_location prxplo WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid AND prxplo.oprtnl_flag = 'A' AND prxplo.pa_prvdr_type_lkpcd = 'RR') ) AS "NPI/ID", DECODE ((SELECT pd.org_bsns_name FROM pa_request_x_provider_location prxplo WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid AND prxplo.oprtnl_flag = 'A' AND prxplo.pa_prvdr_type_lkpcd = 'RR'), NULL, (SELECT pd.last_name || ', ' || pd.first_name || ' ' || pd.middle_name FROM pa_request_x_provider_location prxplo WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid AND prxplo.oprtnl_flag = 'A' AND prxplo.pa_prvdr_type_lkpcd = 'RR'), (SELECT pd.org_bsns_name FROM pa_request_x_provider_location prxplo WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid AND prxplo.oprtnl_flag = 'A' AND prxplo.pa_prvdr_type_lkpcd = 'RR') ) AS "Prvdr Name", TO_CHAR (psd.from_date, 'MM/dd/yyyy' ) AS "Srvc From Date", TO_CHAR (req.validity_start_date, 'MM/DD/YYYY' ) AS "Due Date", (fn_get_busniess_days (TRUNC (req.validity_start_date)) ) AS "Days<br>Left", req.pa_mode_type_lkpcd AS "Source", TO_CHAR (TRUNC (wmdtl.rtng_date), 'MM/dd/yyyy' ) AS "Assigned On", NVL (wmdtl.assigned_to_user_name, 'Not Assigned' ) AS "Assigned To", req.org_unit_sid AS "OrgUnitSid", TO_CHAR (wmdtl.modified_date, 'MM/dd/yyyy hh24:mi:ss' ) AS "WTRD_MODIFIED_DATE", TO_CHAR (wmdtl.rtng_date, 'MM/dd/yyyy' ) AS "WTRD_RTNG_DATE", req.status_cid AS "PA_STATUS_CID", TO_CHAR (req.modified_date, 'MM/dd/yyyy' ) AS "PA_REQ_MODIFIED_DATE", prs.state_pa_srvc_type_code AS "STATE_PA_SRVC_TYPE_CODE", wmdtl.wm_pa_task_rtng_dtl_sid AS "WM_TASK_RTNG_DTL_SID", wmdtl.assigned_to_user_acct_sid AS "WTRD_Assigned_to_user_acct_sid", (fn_get_busniess_days (TRUNC (req.validity_start_date)) ) AS "Days<br>LeftSort", wmdtl.assigned_to_org_unit_sid AS "WTRD_Assigned_to_OrgUntSid", DECODE ((SELECT COUNT (*) FROM pa_request_status prs WHERE prs.pa_rqst_sid = req.pa_rqst_sid AND prs.status_cid = 5 AND prs.oprtnl_flag = 'I'), 0, 'N', 'Y' ) AS "SHOW_UTILIZATION" FROM pa_request req, pa_certification_identifier pci, status sts, pa_request_x_member prxm, wm_pa_task_routing_detail wmdtl, pa_service_date psd, org_unit ou, pa_request_service prs, pa_request_x_provider_location prxpl, provider_location pl, provider_detail pd, provider p, mbr_dmgrphc md WHERE req.oprtnl_flag = 'A' AND req.status_cid NOT IN (20, 30, 70, 25, 80, 96, 85, 5, 97, 98, 101) AND req.org_unit_sid IN (3057, 3142, 3058, 3143, 3059, 3144, 3060, 3145, 3061, 3146, 3062, 3147, 3063, 3148, 3064, 3149, 3065, 3150, 3066, 3151, 3067, 3152, 3068, 3153, 3069, 3154, 3070, 3155, 3071, 3156, 3072, 3157, 3073, 3158, 3074, 3159, 3075, 3160, 3076, 3161, 3077, 3162, 3078, 3163, 3079, 3164, 3080, 3165, 3081, 3166, 3082, 3167, 3083, 3168, 3084, 3169, 3085, 3170, 3086, 3171, 3087, 3172, 3088, 3173, 3089, 3174, 3090, 3175, 3091, 3176, 3092, 3177, 3093, 3178, 3094, 3179, 3095, 3180, 3096, 3181, 3097, 3182, 3098, 3183, 3099, 3184, 3100, 3185, 3101, 3186, 3102, 3187, 3103, 3003, 75000104, 75000108, 2006, 75000103, 75000102, 75000113, 75000111, 75000109, 2001, 2009, 75000105, 75000107, 2004, 2010, 2013, 2014, 2005, 2011, 75000112, 2002, 1001, 2012, 75000106, 2007, 75000101, 2003, 75000110, 2008, 3001, 3002, 3019, 3104, 3020, 3105, 3021, 3106, 3022, 3107, 3023, 3108, 3024, 3109, 3025, 3110, 3026, 3111, 3027, 3112, 3028, 3113, 3029, 3114, 3030, 3115, 3031, 3116, 3032, 3117, 3033, 3118, 3034, 3119, 3035, 3120, 3036, 3121, 3037, 3122, 3038, 3123, 3039, 3124, 3040, 3125, 3041, 3126, 3042, 3127, 3043, 3128, 3044, 3129, 3045, 3130, 3046, 3131, 3047, 3132, 3048, 3133, 3049, 3134, 3050, 3135, 3051, 3136, 3052, 3137, 3053, 3138, 3054, 3139, 3055, 3140, 3056, 3141) AND req.pa_rqst_sid = prs.pa_rqst_sid AND prs.oprtnl_flag = 'A' AND prs.pa_rqst_srvc_sid = psd.pa_rqst_srvc_sid AND psd.oprtnl_flag = 'A' AND req.pa_rqst_sid = pci.pa_rqst_sid AND pci.oprtnl_flag = 'A' AND req.pa_rqst_sid = prxm.pa_rqst_sid AND prxm.oprtnl_flag = 'A' AND md.oprtnl_flag = 'A' AND md.status_cid = 2 AND TRUNC (SYSDATE) BETWEEN md.from_date AND md.TO_DATE AND prxm.mbr_sid = md.mbr_sid AND ou.org_unit_sid = req.org_unit_sid AND ou.oprtnl_flag = 'A' AND req.pa_rqst_sid = prxpl.pa_rqst_sid AND prxm.pa_rqst_sid = prxpl.pa_rqst_sid AND pci.pa_rqst_sid = prxm.pa_rqst_sid AND pci.pa_rqst_sid = wmdtl.subsystem_task_sid AND pci.pa_rqst_sid = prxpl.pa_rqst_sid AND prxpl.pa_prvdr_type_lkpcd = 'RR' AND prxpl.oprtnl_flag = 'A' AND req.status_cid = sts.status_cid AND sts.status_type_cid = 3 AND sts.oprtnl_flag = 'A' AND prxpl.prvdr_lctn_iid = pl.prvdr_lctn_iid AND p.prvdr_sid = pd.prvdr_sid AND p.prvdr_sid = pl.prvdr_sid AND pd.oprtnl_flag = 'A' AND pd.status_cid = 2 AND TRUNC (SYSDATE) BETWEEN pd.from_date AND pd.TO_DATE AND wmdtl.subsystem_task_sid = req.pa_rqst_sid AND wmdtl.subsystem_lkpcd = 'PA' AND wmdtl.oprtnl_flag = 'A' AND req.pa_rqst_date > (SYSDATE - 365) ORDER BY TO_DATE ("Request Date", 'MM/dd/yyyy hh24:mi:ss') DESC, "Beneficiary Name" ASC) a WHERE ROWNUM < 102;
Prakash P
Published by: BluShadow on May 17, 2011 15:01
addition of {noformat}{noformat} tags around the code
3360 wrote:
See point 9 of this section of the FAQ on how to format the code.I see that you did.
No, I did. It's pretty easy to change if the code seems formatted anyway below. It's when I go to edit the message and find no sense because it is not formatted in all cases, I despair. {noformat} :) {noformat}
-
If a view object query returns no rows, can the vacuum to be tested at all?
All those who know or have also experienced:
I guess that the answer should be Yes, but I tried anyway, I still didn't worked. Here is the code (it's a method behind a command button, a bean of support (I use JDeveloper 10.1.3.4).) In the code, LoggedInStudent is the name of a view object; ZBLCModule is the name of the application module):
When the view object query returns a line, the whole of the application works without error. When the query returns no rows, test (1) always bombs toward the top of the application, prompting a Houston-30003 error.public String commandButton1_action() { FacesContext fc = FacesContext.getCurrentInstance(); ValueBinding vb = fc.getApplication().createValueBinding("#{data}"); BindingContext bc = (BindingContext)vb.getValue(fc); DCDataControl dc = bc.findDataControl("ZBLCModuleDataControl"); ApplicationModule am = (ApplicationModule)dc.getDataProvider(); ZBLCModuleImpl zblcam = (ZBLCModuleImpl)am; LoggedInStudentImpl studentsFound = (LoggedInStudentImpl)zblcam.getLoggedInStudent(); String navCase = null; // Test (1): if the view cache is empty; always bombs up the application if it IS empty: if(studentsFound.getAllRowsInRange().length == 0) { navCase = "userNotFound"; // (2) The following three tests gets to run only when the cache is not empty; they work fine. } else if (((Number)studentsFound.first().getAttribute("HoursAttm")).floatValue() == 0.0) { navCase = "noHours"; } else if (((Number)studentsFound.first().getAttribute("Balance")).floatValue() > 0.0) { navCase = "notZero"; } else if (!(studentsFound.first().getAttribute("Validated").equals(" "))) { navCase = "validated"; } else { navCase = "zeroBal"; } return navCase; }
(1) test, I tried the following:
With each of these events, I got an error of Houston-30003. It does not matter what looks like the conditional test; It is important only when the objects from view cache is empty. If the view cache is not empty, everything, including the test (1), works very well. And when the cache is empty is not because of the failure of the connection to the database, but because the student is not in the data table and line are for the student.if (studentsFound.getAllRowsInRange().length == 0) if (studentsFound.first() == null) if (studentsFound.getEstimatedRowCount() == 0) if (studentsFound.isDead()) //I do not know what isDead() does; just tried desperately. if (studentsFound.equals(null)) if (studentsFound.getCurrentRow() == null)
It is a requirement of the company to do something when the view object query returns no rows. Can it be tested at all? How?
Or is there something wrong in the first lines in the method before the {color: green} String navCase = null; {color} line?
Thank you very much for your help!
NewmanHello
What you have done, is to get a handle to the object that CAN execute queries to the database.
However, you do not query the database.Just add:
LoggedInStudentImpl studentsFound = (LoggedInStudentImpl)zblcam.getLoggedInStudent(); //New line studentsFound.executeQuery();
The code that Shay has given you is when you do not have a request for all module, but since you are talking about a command etc button I guess that the module of the application is already active.
The line I gave you should be enough to make it work.I'd be careful with the
studentsFound.hasNext();
I suggest to use estimatedRowCount();
-Anton
-
Stupid old backpacker (me) cannot understand why this query returns 1 row
Hi all
In reference to {: identifier of the thread = 2456973}, why do
only 1 rank and not 1 for each task? In fact, I had to test it myself to believe.select sum(count(decode(job, 'CLERK', 1, null))) CLERKS , sum(count(decode(job, 'SALESMAN', 1, null))) SALESMANS from emp group by job;
It returns the data as if the query were
Using only a single aggregate (count or sum) returns 1 row per job, as expectedselect sum(CLERKS), sum(SALESMANS) from (select count(decode(job, 'CLERK', 1, null)) CLERKS, count(decode(job, 'SALESMAN', 1, null)) SALESMANS from emp group by job)
John Stegeman wrote:
It returns the data as if the query wereselect sum(CLERKS), sum(SALESMANS) from (select count(decode(job, 'CLERK', 1, null)) CLERKS, count(decode(job, 'SALESMAN', 1, null)) SALESMANS from emp group by job)
Exactly the point ;-)
It seems that Oracle actually do, a group of 'double' in the same operation.
Attend plans to explain in this example:SQL> select count(decode(job, 'CLERK', 1, null)) CLERKS 2 , count(decode(job, 'SALESMAN', 1, null)) SALESMANS 3 from scott.emp group by job; CLERKS SALESMANS ---------- ---------- 0 0 0 0 0 0 0 4 4 0 Execution Plan ---------------------------------------------------------- Plan hash value: 1697595674 --------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | --------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 5 | 40 | 4 (25)| 00:00:01 | | 1 | HASH GROUP BY | | 5 | 40 | 4 (25)| 00:00:01 | | 2 | TABLE ACCESS FULL| EMP | 14 | 112 | 3 (0)| 00:00:01 | ---------------------------------------------------------------------------
And compare it to the one with the double aggregates:
SQL> select sum(count(decode(job, 'CLERK', 1, null))) CLERKS 2 , sum(count(decode(job, 'SALESMAN', 1, null))) SALESMANS 3 from scott.emp group by job; CLERKS SALESMANS ---------- ---------- 4 4 Execution Plan ---------------------------------------------------------- Plan hash value: 417468012 ---------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 8 | 4 (25)| 00:00:01 | | 1 | SORT AGGREGATE | | 1 | 8 | 4 (25)| 00:00:01 | | 2 | HASH GROUP BY | | 1 | 8 | 4 (25)| 00:00:01 | | 3 | TABLE ACCESS FULL| EMP | 14 | 112 | 3 (0)| 00:00:01 | ----------------------------------------------------------------------------
There are GROUP BY hash and SORT GLOBAL times.
It is really unnecessary to an aggregate on an aggregate - if two aggregates are used "in the same group level.
Sum() aggregates are used on an already aggregated value, so it doesn't look like Oracle which actually cures like 'first do the internal aggregate using the group specified by and then do the external aggregation on the result with any group.'Look at this example where I combine aggregates "double" with "single" aggregates:
SQL> select sum(count(decode(job, 'CLERK', 1, null))) CLERKS 2 , sum(count(decode(job, 'SALESMAN', 1, null))) SALESMANS 3 , count(decode(job, 'SALESMAN', 1, null)) SALESMANS2 4 , count(*) COUNTS 5 from scott.emp group by job; CLERKS SALESMANS SALESMANS2 COUNTS ---------- ---------- ---------- ---------- 4 4 1 5 Execution Plan ---------------------------------------------------------- Plan hash value: 417468012 ---------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 8 | 4 (25)| 00:00:01 | | 1 | SORT AGGREGATE | | 1 | 8 | 4 (25)| 00:00:01 | | 2 | HASH GROUP BY | | 1 | 8 | 4 (25)| 00:00:01 | | 3 | TABLE ACCESS FULL| EMP | 14 | 112 | 3 (0)| 00:00:01 | ----------------------------------------------------------------------------
When you mix "doubles" and "single" aggregates, Oracle decides that unique aggregates belong to the 'outer' aggregation
SALESMAN2 did a count on the aggregated work column which is the result of the 'internal' group by - so only 1.
The count (*) is also the result of the aggregation of the 'internal '.I don't know if it's documented or if it is an 'effect' of internal code used for GROUPING SETS or the internal code used to enable the analytical functions like this:
SQL> select count(decode(job, 'CLERK', 1, null)) CLERKS 2 , count(decode(job, 'SALESMAN', 1, null)) SALESMANS 3 , sum(count(decode(job, 'CLERK', 1, null))) over () CLERKS2 4 , sum(count(decode(job, 'SALESMAN', 1, null))) over () SALESMANS2 5 from scott.emp group by job; CLERKS SALESMANS CLERKS2 SALESMANS2 ---------- ---------- ---------- ---------- 0 0 4 4 4 0 4 4 0 0 4 4 0 0 4 4 0 4 4 4 Execution Plan ---------------------------------------------------------- Plan hash value: 4115955660 ---------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 5 | 40 | 4 (25)| 00:00:01 | | 1 | WINDOW BUFFER | | 5 | 40 | 4 (25)| 00:00:01 | | 2 | SORT GROUP BY | | 5 | 40 | 4 (25)| 00:00:01 | | 3 | TABLE ACCESS FULL| EMP | 14 | 112 | 3 (0)| 00:00:01 | ----------------------------------------------------------------------------
Personally, I think that I would have preferred if Oracle has raised an error on this "double aggregation" and therefore require me to write this way (if it's the result I wanted):
select sum(CLERKS), sum(SALESMANS) from (select count(decode(job, 'CLERK', 1, null)) CLERKS, count(decode(job, 'SALESMAN', 1, null)) SALESMANS from emp group by job)
I don't really see a good use case for aggregations of 'double'-, but rather that he could give you undetected bugs in your code, if you happen to do double aggregation without noticing.
Interesting thing to know ;-)
-
Attributes XML makes my query returns no rows
Hi all
I have a strange problem.
I ask an XML, but the attributes in one of the tags my query will return no rows. If I delete the attributes, the query works as expected.
The XML code is below; This is the Report tag attributes that cause problems:
My query is:<result errorCode="0"> <return> <Report xsi:schemaLocation="Items_x0020_status_x0020_information http://******-****/ReportServer?%2FReports%2FContent%20Producer%20Reports%2FItems%20status%20information&rs%3AFormat=xml&rc%3ASchema=True" Name="Items status information" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="Items_x0020_status_x0020_information"> <Tablix1> <Details_Collection> <Details ItemId="914P7" Username="test" user_role="IT" first_name="Barry" last_name="Donovan" organisation="" content_format="On_Screen" modified_date="26/05/2011 13:16:49" item_status="Draft" status_date="" component_name="" demand="" /> </Details_Collection> </Tablix1> </Report> </return> </result>
I tried to strip the attributes to the tag, which works, but some XML I look back are large enough (number of records), so that cause problems in itself. I would rather deal with it and don't mess with the XML itself if possible.select a.item_id ,a.username ,a.user_role ,a.first_name ,a.last_name ,a.supplier_id ,a.format ,a.modified_date ,a.item_status ,a.completion_date ,a.component_code from dual ,xmltable ('/result/return/Report/Tablix1/Details_Collection/Details' passing p_xml columns item_id varchar2(1000) path '@ItemId' ,username varchar2(1000) path '@Username' ,user_role varchar2(1000) path '@user_role' ,first_name varchar2(1000) path '@first_name' ,last_name varchar2(1000) path '@last_name' ,supplier_id varchar2(1000) path '@organisation' ,format varchar2(1000) path '@content_format' ,modified_date varchar2(1000) path '@modified_date' ,item_status varchar2(1000) path '@item_status' ,completion_date varchar2(1000) path '@status_date' ,component_code varchar2(1000) path '@demand' ) a;
Any help would be much appreciated!
Thank you much in advance.
Robin
Published by: User_resU on April 12, 2012 14:50The element of report and its children belong to a default namespace.
You have stated that in the request too:xmltable ( xmlnamespaces('Items_x0020_status_x0020_information' as "ns0"), '/result/return/ns0:Report/ns0:Tablix1/ns0:Details_Collection/ns0:Details' passing
-
SQL query returning no rows, please help!
I have a table that contains the user checks for a specific procedures alongwith the date stamp. Now, I want the list of all procedures that are not accessible by users in the last 6 months. Or, all of the procedures that have not been used/accessible during the last 6 months.
That's what I'm trying, but is does not return all rows:
SELECT DISTINCT proc_name,
TRUNC (entry_date)
OF log_web
WHERE NOT IN (SELECT proc_name proc_name
OF log_web
WHERE TRUNC (entry_date) > TRUNC (SYSDATE - 180))
ORDER BY DESC 2
Please notify.
Thank you in advance.Hello
NOT IN never returns TRUE if the subquery returns NULL values. If proc_name doesn't have a NOT NULL constraint, change the subquery to
WHERE proc_name NOT IN ( SELECT proc_name FROM log_web WHERE entry_date > TRUNC (SYSDATE - 180) AND proc_name IS NOT NULL )
I don't see any other suspect.
Post a small example of data (CREATE TABLE and INSERT statements) where the query produces results worng. -
single line sub query returns multiple rows
Hi, please help me to solve this, working with oracle 11g.
Update t1 set t1.twyindex = twypoly (select twyindex from twyinfo where t1.id = t2.id t2);
the error message is:
*
ERROR on line 1:
ORA-01427: einreihig subquery returns multiple rows
Thank youdon123 wrote:
Hi paul, thanks...duplicate existing due to the business logic data.
can I use the SQL mentioned above for all cases?
is it mandatory to remove duplicates?
Please provide your suggestions...
If the company says duplicates are allowed, you have to ask the person who wants what, of the different twyindexes, that they want to use
updating twyinfo table...I use the SQL proposed until they tell you that twyindex to use.
-
User_Scheduler_Jobs query returns no row in the version 2.1.0.63
Using the 2.1.0.63 version, "select * from user_scheduler_jobs;" returns no rows. It works fine in version 1.5.5.
Published by: User65423 on February 8, 2010 09:24Refer to this topic, when the cause seems to be due to SQL Developer manages not null interval data types.
bug? F9 gives no output dba_scheduler_jobs, version: 2.1.0.63.73
As mentioned in this thread, you can use to_char on the columns of the interval as a workaround...
SELECT source, destination, comments, flags, job_name, job_creator, client_id, global_uid, program_owner, program_name, job_type, job_action, number_of_arguments, schedule_owner, schedule_name, start_date, repeat_interval, end_date, job_class, enabled, auto_drop, restartable, state, job_priority, run_count, max_runs, failure_count, max_failures, retry_count, last_start_date, TO_CHAR(last_run_duration), next_run_date, TO_CHAR(schedule_limit), TO_CHAR(max_run_duration), logging_level, stop_on_window_close, instance_stickiness, system, job_weight, nls_env FROM user_scheduler_jobs a;
-
SQL query returns no row vs. multiple lines
Hello
I am trying to get the result of a simple sql query,
If there is no row returned, he would have "No. ROWS" in the result set.
Other wise all the rows containing data is necessary.
Let me know how this could be achieved. Under query works for the latter and not first case as mentioned below
OUTPUT
+ (box 1) when we use B_ID = 123456 +.
IDS
-----
'NO LINE '.
+ (box 2) when we use B_ID = 12345 +.
IDS
-----
1 11112345
2 22212345
create table TEMP_AAA ( A_ID VARCHAR2(10), B_ID VARCHAR2(10) ) INSERT INTO TEMP_AAA(A_ID,B_ID) VALUES('111','12345'); INSERT INTO TEMP_AAA(A_ID,B_ID) VALUES('222','12345'); INSERT INTO TEMP_AAA(A_ID,B_ID) VALUES('333','12000'); INSERT INTO TEMP_AAA(A_ID,B_ID) VALUES('444','10000');
WITH MATCH_ROWS AS ( SELECT A_ID||B_ID IDS FROM TEMP_AAA WHERE B_ID=12345 ), MATCH_ROW_COUNT AS ( SELECT COUNT(1) AS COUNTS FROM MATCH_ROWS ), PROCESSED_ROWS AS ( SELECT CASE WHEN COUNTS = 0 THEN (SELECT NVL((SELECT IDS FROM TEMP_AAA WHERE B_ID=12345),'NO ROWS') IDS FROM DUAL) ELSE MATCH_ROWS.IDS END IDS FROM MATCH_ROWS,MATCH_ROW_COUNT ) SELECT * FROM PROCESSED_ROWS;
Hello
I think you want to put this on a report or something. I have what would be easier to do this logic there. But if you want that this is possible.
Like thiswith temp_aaa as (select '111' a_id ,'12345' b_id from dual union all select '222' ,'12345' from dual union all select '333' ,'12000' from dual union all select '444' ,'10000' from dual ) , wanted_rows as ( select '123456' B_ID from dual) select temp_aaa.A_ID || temp_aaa.B_ID IDS from temp_aaa ,wanted_rows where temp_aaa.b_id = wanted_rows.b_id union all select 'NO ROWS' FROM DUAL WHERE (SELECT COUNT(*) FROM TEMP_AAA, wanted_rows WHERE TEMP_AAA.B_ID = wanted_rows.B_ID) = 0
In addition, you mix var and number of always use the same type or convert explicitly (to_number or to_char)
WITH MATCH_ROWS AS ( SELECT A_ID||B_ID IDS FROM TEMP_AAA WHERE B_ID =12345 -- varchar2(10) number ), ...
And again in the
THEN (SELECT NVL((SELECT IDS FROM TEMP_AAA WHERE B_ID =12345),'NO ROWS') IDS FROM DUAL) -- varchar2(10) number
Kind regards
Peter
-
Large type query returning no rows
Hello
Posted in right forum hope eth, I also posted this in SQl & PL/SQL which is not the right forum, I think.
I'm running a kind of large select query, counties of table is as shown below.
The lines are not returned which is quite impossible.
What could be the reason. Tablespace TEMP has run out or optimizer does not?
My Oracle version: 10 G R/2
I tried to update the statistics for each table, I am unable to check the TEMP tblspace as am not the ADMINISTRATOR.
COUNT (*) TABLE IS
--------------------------------------------------------------------------------
13047187
COUNT (*) TABLE B
--------------------------------------------------------------------------------
618194
COUNT (*) TABLE C
--------------------------------------------------------------------------------
18058
COUNT (*) TABLE D
--------------------------------------------------------------------------------
9
COUNT (*) TABLE E
--------------------------------------------------------------------------------
11813966
COUNT (*) TABLE F
--------------------------------------------------------------------------------
18093
COUNT (*) TABLE G
--------------------------------------------------------------------------------
13099
COUNT (*) TABLE:
--------------------------------------------------------------------------------
12000000
COUNT (*) TABLE I
--------------------------------------------------------------------------------
5285
Anyy help is appreciatedSeems to me that if the pid is different.
Select * from where a pid = "ACT714";<-- no="">-->
Select * from b where pid = "ACT714";<-- trailing="">-->Try
Select count (*) of a, b
where trim (a.pid) = trim (b.pid);If it works, you might want to consider how you store data, if they are supposed to be equal.
Check also if you compare with the data type varchar2, char data type.
I generally avoid the reasons char data type. -
Hi all
This query returns all rows, but ideally it should.below I enclose the query
select * FROM SERIAL_NO WHERE serialno not in (SELECT SERIALNO FROM COB_T_SERIAL_NO union select serialno from genealogy union select lastarchivedby from genealogy union select serialno from asset union select serialno from code_serial_number union select serialno from cost union select serialno from cost_detail union select serialno from disposition union select serialno from disposition_content union select serialno from disposition_line union select serialno from disposition_test_reason union select serialno from inventory_count_serial_no union select serialno from inventory_serial_no union select serialno from inventory_serial_transit union select serialno from material_order_serial_no union select serialno from material_content_serial_no union select serialno from resource_content union select serialno from receipt_container_serial_no union select serialno from resource_serial_no union select serialno from sequence_queue_item union select serialno from serial_no_hold union select serialno from wip_order_content_serial union select serialno from wip_serial_no union select serialno from wip_serial_no_content union select a.serialno from resource_labor_detail a inner join resource_labor_detail_approval b on b.resourcelabordetailid=a.id union select c.serialno from labor_detail c inner join labor_detail_approval d on d.labordetailid = c.id union select e.serialno from disposition_reading e inner join disposition_resource f on f.dispositionreadingid = e.id union select g.serialno from quality_defect g inner join quality_defect_location h on h.qualitydefectid=g.id inner join quality_defect_loc_dimension i on i.qualitydefectlocationid=h.id )
Hello
964145 wrote:
right... I understand that it is difficult for you to help without data... it is syntactically correct?Yes, the syntax is very well. The fact that it runs (no matter how many rows it returns, if any) tells you that there is no syntax error.
also, I want only distinct values, so I used the union rather than union all the
Why do you want only the distinct values? The reulsts will be the same if there are duplicates or not.
can I use like this? Please suggest
with union_data as (SELECT SERIALNO FROM COB_T_SERIAL_NO union select serialno from genealogy ... inner join quality_defect_loc_dimension i on i.qualitydefectlocationid=h.id ) DELETE serial_no where serialno not in (SELECT serialno FROM union_data WHERE serialno IS NOT NULL ) ;
What happens when try you it?
A query can start with the keyword WITH.
A DELETE statement cannot.
You can do soemthing like this:DELETE serial_no WHERE serialno NOT IN ( WITH union_data AS ( SELECT serialno FROM cob_t_serial_no UNION SELECT serialno FROM genealogy UNION ... ) SELECT serialno FROM union_data WHERE serialno IS NOT NULL ) ;
Published by: Frank Kulash, November 12, 2012 16:22
-
subquery returns no row in the main query, but hard returns the value of the master query
Oracle 11g, Solaris SPARC 64-bit:
This is the master query: its not to return all the lines
Select count (*) in the sadmin.usr_mods where to_char (ts_id) in ((select to_char (rtrim (ltrim(TS_MODULES,','), ',')) in the sadmin.usr_rfc where TS_KINTANA_PACKAGE_NUMBER = '123' and ts_projectid = 3));
COUNT (*)
----------
0
But wherever if I use subquery only returns he lines:
SQL > select rtrim (ltrim(TS_MODULES,','), ',') from the sadmin.usr_rfc where TS_KINTANA_PACKAGE_NUMBER = '123' and ts_projectid = 3;
RTRIM (LTRIM(TS_MODULES,','), ',')
--------------------------------------------------------------------------------
49,54
If I use these values as hardcoded to a select master it will return 2 rows:
SQL > select count (*) in the sadmin.usr_mods where to_char (ts_id) in ('49 ', ' 54');
COUNT (*)
----------
2
TS_MODULES datatype is CLOB
TS_ID datatype is set to number
Help, please
with
usr_rfc as
(select 3 ts_projectid, 123 ts_kintana_package_number, to_clob(',49,54,') ts_modules
of the double
),
usr_mods as
(select ts_id 49 Union double all the)
Select 50 in all double union
Select double 54
)
Select count (*)
of usr_mods
where to_char (ts_id) in (select regexp_substr (to_char (rtrim (ltrim(TS_MODULES,','), ',')),'[^,] +', 1, level))
of usr_rfc
where TS_KINTANA_PACKAGE_NUMBER = '123'
and ts_projectid = 3
connect by level<= regexp_count(to_char(rtrim(ltrim(ts_modules,','),',')),',')="" +="">=>
)
COUNT (*) 2 Concerning
Etbin
Select count (*)
of usr_mods
where instr ((select ',' | to_char (rtrim (ltrim(TS_MODULES,','), ',')) |)) ','
of usr_rfc
where TS_KINTANA_PACKAGE_NUMBER = '123'
and ts_projectid = 3
),
',' || TO_CHAR (TS_ID) | ','
) > 0
-
A row of Sub query returns more than 1 row!
I'm trying to update the values in one table from another table and get the error: void line query returns More Than 1 row.
I want to PRV_NAME B chart updated in the table A PRV_NAME where A.PRVID = B.PRVID where B.PRV_TYPE = M"
The two paintings were all unique PRVID, however, table B has PRVID that have the same name. So the data in table B can look like this:
PRVID PRV_NAME
1234 PHOENIX MED
1235 MED BAG
1236 MED BAG
1237 OVERLAND
etc...
So, as you can see are the unique PRVID, but not the PRV_NAME. Is this the reason why I get this error?
I do not build the tables and have no control over what is put in them. If this is the reason for the error, is there a way to fix this?
For reference, here's the request. Maybe there's something wrong with that?
Update msb_prv_source ps
Set ps.prv_name =
(select prv00.prv00_prv_name
of prv00_prv prv00
Join msb_prv_source ps
On prv00.prv00_prv_id = ps.prvid
where prv00.prv00_prv_type = am')
Published by: user12296489 on April 19, 2013 10:46/* Formatted on 4/19/2013 2:00:43 PM (QP5 v5.185.11230.41888) */ MERGE INTO msb_prv_source a USING (SELECT * FROM prv00_prv WHERE prv00_prv_type = 'M') b ON (a.prv00_prv_id = b.prvi) WHEN MATCHED THEN UPDATE SET a.prv_name = prv00_prv_name
-
XMLTable query returns one line per element multiple
Hello
Using Oracle 11 g Release 2, I have a XML file that is stored in the following table:
CREATE TABLE XML_FILES
(
FILENAME VARCHAR2 (1000).
FILECONTENT XMLTYPE
);
The sample XML file:
< includedClaimProcessingResult >
< ClaimRecordIdentifier > 1000 < / ClaimRecordIdentifier >
< ClaimIdentifier > 0x1ABC2D123456789 < / ClaimIdentifier >
< classifyingProcessingStatusType >
< statusCode > R < / statusCode >
< / classifyingProcessingStatusType >
< recordedError >
Pharmacy claim < name > < / name >
< value > < / value >
< > 1.2.3 ErrorCode < / ErrorCode >
< > < ErrorCode > 4.5.6 ErrorCode
< ErrorMessage > claim rejected because the claimIdentifier already exist in the database < / ErrorMessage >
input < ErrorMessage > claim must match a claim < / ErrorMessage >
< ErrorDetail > identifier request already exists in the DB < / ErrorDetail >
< ErrorDetail > < / ErrorDetail >
< / recordedError >
< / includedClaimProcessingResult >
All items have a frequency of 1, with the exception of the error code (1 or more), ErrorMessage (0 or more), & the ErrorDetail (0 or more).
Here's my query:
Select
r.REC_ID,
r.NAME,
r.VALUE,
EC. ERR_CODE,
Ed. ERR_DTL,
EM. ERR_MSG
of xml_files xf,.
XMLTable ('/ includedClaimProcessingResult' in passing xf.filecontent)
columns
Path of REC_ID NUMBER (10) "ClaimRecordIdentifier."
Path NAME VARCHAR2 (20) recordedError/name"."
Path of ELMNT_VAL VARCHAR2 (5) ' recordedError/value. '
IERRC xmltype path recordedError/ErrorCode"."
ierrd ' recordedError/ErrorDetail, xmltype path
r ierrm xmltype path "recordedError/ErrorMessage"),
XMLTable ('ErrorCode' adoption r.ierrc
columns
Path of ERR_CODE VARCHAR2 (15) '.') EC,
XMLTable ('ErrorDetail' adoption r.ierrd
columns
Path of ERR_DTL VARCHAR2 (100) '.') (+) ed,.
XMLTable ('ErrorMessage' adoption r.ierrm
columns
Path of ERR_MSG VARCHAR2 (100) '.') (+) em;
I try to return the item corresponding to the first occurrence of several elements in a row values, the second occurrence is in another line, etc. (the number of possible occurrences is not static):
REC_ID NAME VALUE ERR_CODE ERR_DTL ERR_MSG
---------------------- -------------------- --------- --------------- ----------------------------------- -----------------------------
1000 pharmacy claim 1.2.3 that request identifier already exists in the DB claim rejected because the claimIdentifier already exist in the database
1000 pharmacy claim 4.5.6 incoming claim must correspond to a claim
Thanks for any help!
It would be much easier if the person who designed the XML thought first about the consequences of their design...
We can do it, but it will not perform...
One option would be to apply an XSL to transform XML into something more logical...
The other would be to use XQUERY...
SQL > with MY_BAD_XML like
() 2
3. Select XMLTYPE)
4'
51000
60x1ABC2D123456789
7
8R
9
10
11request for pharmacy
12
131.2.3
144.5.6
15application rejected because claimIdentifier already exist in the database
16Inbound claim must correspond to a claim
17request identifier already exists in the DB
18
19
20 ') of the double OBJECT_VALUE
21)
22. Select c.
MY_BAD_XML 23,
24 XMLTABLE)
25 ' for $i in $XML / includedClaimProcessingResult
26 return result {} element
27 for $j to $pos in $ recordedError/i/ErrorCode
28 return element row {}
$i 29/ClaimRecordIdentifier,
$i 30/ClaimIdentifier,
$i 31/classifyingProcessingStatusType/statusCode,
$i 32/recordedError/Name,
$i 33/recordedError/value,
$i 34/recordedError/ErrorCode [$pos],
$i 35/recordedError/ErrorMessage [$pos],
$i 36/recordedError/ErrorDetail [$pos]
37 }
38} / row
39 '
40 from OBJECT_VALUE as 'XML '.
41 columns
42 path of the ClaimRecordIdentifier VARCHAR2 (32) "ClaimRecordIdentifier".
43, path of the ClaimIdentifier VARCHAR2 (32) "ClaimIdentifier".
44, path VARCHAR2 (32) statusCode 'statusCode '.
45, path name VARCHAR2 (32) 'name '.
46, path of VARCHAR2 value (32) 'value '.
47, path VARCHAR2 (32) error code "error Code".
48, path VARCHAR2 (32) ErrorMessage "ErrorMessage".
49, path of ErrorDetail VARCHAR2 (32) "ErrorDetail.
(50) c
51.CLAIMRECORDIDENTIFIER CLAIMIDENTIFIER
-------------------------------- --------------------------------
STATUSCODE NAME
-------------------------------- --------------------------------
ERRORCODE VALUE
-------------------------------- --------------------------------
ERRORMESSAGE ERRORDETAIL
-------------------------------- --------------------------------
1000 0x1ABC2D123456789
Pharmacy claim R
1.2.3
Request rejected because claimIden request identifier already existsCLAIMRECORDIDENTIFIER CLAIMIDENTIFIER
-------------------------------- --------------------------------
STATUSCODE NAME
-------------------------------- --------------------------------
ERRORCODE VALUE
-------------------------------- --------------------------------
ERRORMESSAGE ERRORDETAIL
-------------------------------- --------------------------------
1000 0x1ABC2D123456789
Pharmacy claim R
4.5.6
Incoming claim must correspond to a claimSQL >
Maybe you are looking for
-
Satellite P200-RT2 - need help with recovery
I made a Boo-Boo and need advice/help to get things fixed. My husband has a Satellite P200-RT2 running Win XP 32 bit (included with Vista, but had been upgraded). The battery needs to be replaced, does not load and he made the mistake to disconnect w
-
Question about keyboards keys Tecra A3
I have a whole new Tecra A3 and when you type certain keys randomly will work. Occasions, I can type or press a key several times until it works.Is there something I can do before I return it to the dealer?
-
Need help with Satellite L305 S5928
Can someone give me on this power supply module? This will be for my grandson who is 12. It has enough horse power to its needs. It is on sale at Wal Mart for $373,00 marked down to $498.All comments will be greatly appreciated. Thank you navydad
-
How to convert video in photos
convert a video in photos convert stills from video to the windows photo gallery to produce paper prints
-
When I click on a link in the email it opens in microsoft office 2007
last month, something sent to me in e-mail is opened in office 2007, which was installed a few years ago. is okay if it's a youtube, banking, purchasing anything link. It opens in the office and of course is not readable. When I click on a sidebar li