Date query return empty
EVENTDATE = 07/10/2004 15:25:06
Hi, I have the following query that is return nothing / white how can I find the file above using query below
SELECT * FROM TESTDATE WHERE to_DATE(event_dte_tme,'YYYY/MM/DD fmHH:MI:SS PM') between to_date('2004/10/12 3:25:06 PM','YYYY/MM/DD fmHH:MI:SS PM') and to_date('2004/10/07 3:25:06 PM','YYYY/MM/DD fmHH:MI:SS PM')
So why you use to_date in date field... Simply delete to_date and run the below...
SELECT * FROM TESTDATE
WHERE the event_dte_tme between to_date('2004/10/06 3:25:06 PM','YYYY/MM/DD fmHH:MI:SS PM') and to_date('2004/10/12 3:25:06 PM','YYYY/MM/DD fmHH:MI:SS PM')
Thank you
Ann
Tags: Database
Similar Questions
-
XML query returns empty when tags no data
Hi all
I have a problem that I can't solve.
I have the following query:
The query returns the XML code in the desired structure.select xmlelement ( "users", xmlagg ( xmlelement ( "user", xmlelement ( "username", e.pin ), xmlagg ( xmlelement ( "details", xmlforest ( e.password as "password" ,e.first_name as "forename" ,e.surname as "surname" ,'0' as "retired" ,e.email_address as "email" ,e.telephone_number as "phone" ,'No External Ref' as "externalRef" ,add_months(sysdate,+60) as "expiryDate" ) ) ) ) ) ) xml_out from aqaost_examiners e group by e.pin;
But the problem I have is that when there is no data found by the query, I always get a single row returned by the following: < user > < / users >
I tried so many things to try to have the query return nothing if there is no data available, but I can't do without something else goes wrong (to mess up the XML structure, etc.).
Please is - can anyone help or point me in the right direction?
I thank very you much in advance!
RobinHello
Peter,
This is the GROUP that does this.
Actually no, the GROUP BY refers to the deepest XMLAgg and is required if e.pin is not unique.
Let it out, and you also seem to have of many XMLAGG (?)
That's assuming that e.pin is unique within the table (which is probably a fair assumption in this case).
In fact, the behavior comes from the XMLAgg in the foreground:
SQL> select xmlelement("users", 2 xmlagg( 3 xmlelement("user", 4 xmlelement("username", e.empno) 5 , xmlelement("details", 6 xmlforest( 7 e.ename as "name" 8 , e.job as "job" 9 ) 10 ) 11 ) 12 ) 13 ) xml_out 14 from scott.emp e 15 where 1 = 0 16 ; XML_OUT -------------------------------------
As with other global functions (such as SUM or AVG) adding a GROUP OF 'something' solves the problem:
SQL> select xmlelement("users", 2 xmlagg( 3 xmlelement("user", 4 xmlelement("username", e.empno) 5 , xmlelement("details", 6 xmlforest( 7 e.ename as "name" 8 , e.job as "job" 9 ) 10 ) 11 ) 12 ) 13 ) xml_out 14 from scott.emp e 15 where 1 = 0 16 group by null 17 ; no rows selected
Robin,
So the more intimate XMLAgg is really necessary, you can use a subquery:select xmlelement("users", v.users) from ( select xmlagg( xmlelement("user", xmlelement("username", e.empno) , xmlagg( xmlelement("details", xmlforest( e.ename as "name" , e.job as "job" ) ) ) ) ) as users from scott.emp e group by e.empno ) v where v.users is not null ;
-
AOP "Query was empty" [from: cannot insert data with the PDO function]
Now try to DELETE a record. I select a list and go to the routine to delete. The record appears, but when I delete, I get an error saying
Fatal error : Eception exception 'Exception PDOException' with message ' SQLSTATE [42000]: syntax error or access violation: 1065-query was empty ' in /home1/sainttim/public_html/DeleteRec.php:53 stack trace: home1/sainttim/public_html/DeleteRec.php(53) #0: PDOStatement-> execute (Array) #1 {main} thrown in /home1/sainttim/public_html/DeleteRec.php online 53
I do not understand why the query is empty because the data are displayed on the screen, but assume that I see on the screen is not what is in the table ($_POST ['delete']). I'm stuck!
My code:
$OK = false;
$deleted = false;
If (isset($_GET['varpage'])) {}
$varpageSend = $_GET ['varpage'];
$NextPage = ' DisplayText.php? varpage = ". $varpageSend;"»
}
If ((isset($_GET['recid'])) & & ($_GET ['recid']! = "")) {}
$delrec = $_GET ['recid'];
}
on the other
{
$error = "record does not exist!"
}
If (isset($_GET['recid']) & &! $_POST)
{
prepare the SQL query to view folder
$sql = "SELECT home_key, enriched, h_date, h_seq, h_col, p_heading, p_text, h_hide FROM Homepage_text WHERE home_key =?";
RS1 $= $sainttim-> prepare ($sql);
$OK = $rs1-> execute (array($_GET['recid']));
$row = $rs1-> fetch();
$home_key = $row ["home_key"];
$textpage is "enriched" $row;.
$h_date = $row ["h_date"];
$h_seq = $row ["h_seq"];
$h_col = $row ["h_col"];
$p_heading = $row ["p_heading"];
$p_text = $row ["p_text"];
$h_hide = $row ["h_hide"];
If ($h_hide == 0) {}
$h_hide = 'n';
}
else {}
$h_hide = 'y ';
}
If (isset ($rs1) & &! $OK) {}
$error = $rs1-> errorInfo();
If (isset($error[2])) {}
store the error message if the request fails
$error = $error [2];
}
}
}
If (isset($_POST['delete']))
{
NEW code
$deletesql = "DELETE FROM Homepage_text WHERE home_key =?';"
$stmt = $sainttim-> prepare ($deleteSQL);
$deleted = $stmt-> execute ($row);
If (! $deleted)
{
$error = "There is a problem to remove the record.";
}
else {}
Header ('Location: '. $deleteGoTo);
"exit";
}
}
Form:
Entry < h1 > delete of <? PHP echo $varpageSend;? > Page < / h1 >
<? PHP if (isset ($error)) {}
echo "class < p > 'errormsg' = > error:". " $error. "< /p > ';
} ? >
< are method = "POST" name = "form1" id = "form1" >
< table class = "DisplayTable" align = "center" >
< b >
< td align = "right" > Page: < table >
< td > <? PHP echo $textpage? > < table >
< /tr >
< tr valign = 'of basic">
< td align = "right" > Date: < table >
< td > <? PHP echo $h_date? > < table >
< /tr >
< b >
< td align = "right" > sequence: < table >
< td > <? PHP echo $h_seq? > < table >
< /tr >
< b >
< td align = "right" > Col: < table >
< td > <? PHP echo $h_col? > < table >
< /tr >
< b >
< td align = "right" > title: < table >
< td > <? PHP echo $p_heading? > < table >
< /tr >
< b >
< td align = "right" > text content: < table >
< td > <? PHP echo $p_text? > < table >
< /tr >
< b >
< td align = "right" > content hide? : < table >
< td > <? PHP echo $h_hide? > < table >
< /tr >
< b >
< display td = "hidden" > < input value = <? PHP echo $delrec? > name = 'deletekey"id ="deletekey"/ > < table >
< display td = "hidden" > < table >
< /tr >
< b >
< td align = "right" > < a href = "DisplayText.php? varpage = <?" PHP echo $Thistextpage;? > "> < span class ="Red"> CANCEL </span > < /a > < table >.
< td align = "left" > < input name = "remove" id = 'delete' type = 'submit' class = 'GreenButton"value ="Confirm deletion"/ > < table >
< /tr >
< /table >
< / make >
The reason why the query is empty lies in the lack of uniformity in the spelling of your variable to the prepared statement:
$deletesql = "DELETE FROM Homepage_text WHERE home_key =?";
$stmt = $sainttim-> prepare ($deleteSQL);
The query is stored in the form of $deletesql, but the value you pass to the prepare() method is $deleteSQL. PHP variables are case-sensitive. Use is $deletesql in both cases, or store the query as $deleteSQL.
-
Empty data service returns an object
Hello
I'm calling from the flex data service to load my data grid. In debugging, I see the arrraycollection in the fill method is returned empty. Here are the details...
My .java file has the same name with the game and have access to functions that are set by my assembler of java class.
I'm calling other methods of filling and they seem to work except this one, well...
The problem was that the name of the destination 'codecoverage' was identical to that of one of the packages where my .java file was there. Changed this name and things started working... :-)
-
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 -
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
-
Data tab returns data differently in different instances of SQL Developer
On my instance of SQL Developer, when I click on the data tab, the data is returned immediately via a select * table query, but on one of the machines of my developer, when she clicks on the data tab, Developer SQL executes a select query * table... order in...
The column it is order by is NOT indexed and the query takes a long time to return data. We cannot understand where SQL Developer's store this particular query and associating it with the data on its instance SQL Developer tab.
Anyone can shed some light?
Right click on the grid, and then select "remove persisted settings...". »
-
reload the page when SQL query returns a value
Hello world
the title of this discussion may seem strange, but I'll try to explain why I need this:
A user has the ability to connect on my APEX application. There are several tabs in my application that are visible only if a certain SQL statement returns a value which is not the case by default. The user has also the ability to download a file that is transferred to an external system that analyzes the file and writes the data in the database. During this writing process - which may take several minutes - conditions for some of the tabs to show the will becomes real (-> the query will return a value). When the user refreshes the page manually, the tabs will be displayed. However, I want the tabs will appear automatically when the condition is met.
Is it possible to refresh the page as soon as the query returns a value? It is perhaps possible to check it on the client side and trigger a refresh of the page when the condition is met. It would be even better if only the tabset has been updated, but refreshing the full page is fine as well.
Thank you!
Here is an overview of how it can be done
This is possible thanks to a dynamic action being performed on a timer.
View default tabs and dynamic action hide them on loading the page if they are not to be considered
Create a dynamic action that will execute your query every 5 seconds or more
If the query returns data, you can use the dynamic action to show your tabs using javascript
-
Metric expansion - fire if all data is returned
Hi all
EM12CI want to create an extension of metric than the locked user feedback in the database - a single colum USER_NAME.
I want to create an alert if one or more rows are returned.
Comparison operator what do I use to 'nothing' returned by a string variable. (IE light if it contains something, not the fire if it is empty).
Also can I use an extension of the metric of return "multiple values" - that is to say: If the query returns multiple lines?I tried with a query of type 'count ('x')' and a number variable and that works fine, but now I want to try to return the locked user real name?
Something like this should work...
Here is a sample sql but locked users maybe you ' and lock_date > sysdate-7 ' for example.
Limit the rownum to not overflow the returned value metric.
Select listagg (': ' | username) within the Group (order by user name) metricname from dba_users where lock_date is not null and rownum<>
Then launch the alert whenever the foregoing ' is contains:< need="" to="" find="" something="" ..="" may="" need="" to="" play="" around="" with="">
The foregoing would return a nice as string ' SCOTT: JSMITH:JDOE "and since there is a ':' in there, it would have triggered the alert.
You can simply use listagg (username,', ') because it can simply return 'SCOTT' for a single line and so you have nothing to trigger off of.
I don't think that you can use NOT EQUAL (empty)... but it might be interesting to try - so much worse, that it is not a comparison between "is not null" :-(
Daryl.
-
copy of XSLT creates a xml that returns empty while trying to access the elements using XPATH
Hello
I'm doing a copy - of the function by using the XSLT in jdev. That's what I do
< xsl: param name = "appdataDO" / >
< xsl: template match = "/" >
< ns1:applicationData >
< ns1:applicationId >
< xsl: value-of select = "$appdataDO / ns1:applicationData / ns1:applicationId" / >
< / ns1:applicationId >
< xsl: copy-of select = "/ fslo:ExternalapplicationData / fslo:ApplicationsHDRAddInfo" >
< / xsl: Copy - of >
< / ns1:applicationData >
< / xsl: template >
< / xsl: stylesheet >
After that, I can see the document created in the flow of process like this:
< ns1:applicationData >
< ns1:applicationId > MMMM < / ns1:applicationId >
< ns2:ApplicationsHDRAddInfo >
< ns3:genericFromBasePrimitive > iuoui < / ns3:genericFromBasePrimitive >
< ns4:EstimatedMarketValue > 77 < / ns4:EstimatedMarketValue >
Jih < ns4:PropertyInsuranceFee > < / ns4:PropertyInsuranceFee >
hjh < ns4:LoanOriginationFee > < / ns4:LoanOriginationFee >
KKKKK < ns4:RegistrarFee > < / ns4:RegistrarFee >
hjh < ns4:LoanCashInFee > < / ns4:LoanCashInFee >
< ns4:LoanPaidInCashFlag > cddffgd < / ns4:LoanPaidInCashFlag >
< / ns2:ApplicationsHDRAddInfo >
< / ns1:applicationData >
But whenever I am trying to extract all nodes output I get an empty result. I can copy the whole dataset in the same type of variable.
But I am unable to get the individual elements using XPATH.
I tried to use the exslt for all nodes and xslt 2.0 without success.
Namespaces may be the culprit here. The test in the jdev method can produce a result, but during the execution, the xpath expression returns empty.
I created another transformation where I try to copy the data from the DataObject precious a simple string in an another data object.
This is the test sample source xml transformation created by jdev when testing with all the namespaces, where I try to copy the data into a simple string in an another data object.
" < applicationData xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "xsi: schemaLocation =" http://xmlns.Oracle.com/bpmpa/FS/ulo/types file:/C:/JDeveloper/NewAPP/Xfrm/xsd/ApplicationData.xsd "xmlns =" http://xmlns.Oracle.com/bpmpa/FS/ulo/types "> "
applicationId289 < applicationId > < / applicationId >
< ApplicationsHDRAddInfo >
" < genericFromBasePrimitive xmlns =" http://xmlns.Oracle.com/BPM/PA/Extn/types/BasePrimitive "> genericFromBasePrimitive290 < / genericFromBasePrimitive > .
" < EstimatedMarketValue xmlns =" http://xmlns.Oracle.com/BPM/PA/Extn/headerCategories/ "> 291 < / EstimatedMarketValue > .
" < PropertyInsuranceFee xmlns =" http://xmlns.Oracle.com/BPM/PA/Extn/headerCategories/ "> PropertyInsuranceFee292 < / PropertyInsuranceFee > .
" < LoanOriginationFee xmlns =" http://xmlns.Oracle.com/BPM/PA/Extn/headerCategories/ "> LoanOriginationFee293 < / LoanOriginationFee > .
" < RegistrarFee xmlns =" http://xmlns.Oracle.com/BPM/PA/Extn/headerCategories/ "> RegistrarFee294 < / RegistrarFee > .
" < LoanCashInFee xmlns =" http://xmlns.Oracle.com/BPM/PA/Extn/headerCategories/ "> LoanCashInFee295 < / LoanCashInFee > .
" < LoanPaidInCashFlag xmlns =" http://xmlns.Oracle.com/BPM/PA/Extn/headerCategories/ "> LoanPaidInCashFlag296 < / LoanPaidInCashFlag > .
< / ApplicationsHDRAddInfo >
< / applicationData >
And the xslt transformation
< xsl: template match = "/" >
< ns1:DefaultOutput >
< ns1:attribute1 >
< xsl: value-of select = "/ fslo:applicationData / fslo:ApplicationsHDRAddInfo / custom: LoanOriginationFee" / >
< / ns1:attribute1 >
< / ns1:DefaultOutput >
< / xsl: template >
The result is an empty attribute1. Any help will be appreciated.
Please remove attributeFormDefault = "qualified" elementFormDefault = "qualified" in your XSD
Please visit the following link:
-
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
-
Enter data into the empty cell inserts the invalid main character
When I enter data in an empty cell, for example 1 in a column, and then click validation I get the error ORA-01722: invalid number. Although I do not see the character in front of the 1 I use RIGHT twice after reaching HOME in this cell to get the cursor to the right of the 1, if a character appeared in front of the 1. Hit the BACKSPACE deletes the invisible character, and now I can commit the data entered.
The same thing seems to happen when you remove a date using backspace in a date column. The use of return back once led to an error "ORA-01858: a non-digit character was found here where was waiting for a digital". I have to use the BACKSPACE again to get the empty cell.
And the same thing happens in a varchar column too, although sometimes when he gets that space seems to be inserted in front of the text I entered, but this space is visible only when the cursor is not in the cell.
What causes this? Bug in the developer SQL, SQL Developer settings, settings of the keyboard, something else?
(Oracle SQL developer 3.1.0.7 64bits)This is a bug and has been fixed for the next version.
Brian Jeffries
SQL development team -
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}
-
CONNECT BY QUERY returns different number of Clotilde in 10g or 11g databases
People,
I put just a problem of bellows in our databases.
1.) 10 g database:
2 Database 11 gConnected to: Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Production With the Partitioning, OLAP and Data Mining options SQL> select * from global_name; SQL> SELECT ROWNUM 2 FROM dual 3 CONNECT BY ROWNUM <= 2; ROWNUM ---------- 1 2 3 SQL>
As you can see in 10g above query returns 3 records in 11 g only 2.Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select * from global_name; SQL> SELECT ROWNUM 2 FROM dual 3 CONNECT BY ROWNUM <= 2; ROWNUM ---------- 1 2 SQL>
Why is it like that? It's sort of adjustable, to produce the same result?
Thank you very much
TomasHello
If you have access to metalink, see no bug no 6031397.
It is fixed in version 10.2 -
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?
Maybe you are looking for
-
FIRST HP - problems with typing
Hello, I have a HP first graphing calculator but I can't type more than 10 characters (letters, numbers or symbols) in any part of the calculator, weather, it is in the home, CASE or Notes view. How should I do? Sometimes I can cheat this bug and typ
-
After you have installed the MS16-065 update, our services are unable to communicate. There seems to be a problem with the decryption. One of the suggested solutions was to enable TLS 1.1 and TLS 1.2, what has worked in the case of the .net 4.5 appli
-
This has happened several times randomly. Also, it is the case for setting power and network options. Several times the parametersbecome operational, to restart windows. But this time the Volume adjustment control screen remains dimmed out and corr
-
BlackBerry Smartphones Memory Cleaner cause error when you save the storm?
So, I recently started using memory cleaner on my bb storm. I think that it is causing my bb storm not being able to save to the Desktop Manager. This happened to someone else, or is there another program I should use to clean the memory?
-
Hi allPlease I need help with th following question:WITH some_data LIKE)SELECT "CNDMNL75P65L736C" FC, "cp" cr, 0 as I1, 1 as I2, I3 OF double 0UNION ALLSELECT "PNZGCM74M24L736C", "cp" cr, 5, 0, 0 DOUBLEUNION ALLSELECT "," cp, '1', 675,0, 0 DOUBLE crU