Fetch records having timing before 3 PM
Hellow All,
We are using Oracle 10G R2 on windows.
I have a requirment that i need to fetch the records which are having cut off time before 3 pm.
query should not fetch records after 3 pm.
Please help how we can achive this.
For testing purpose I have records like below
SQL> select empno,emptype,to_char(jdate,'dd-mm-yyyy hh:mi:ss')jdate from test;
EMPNO EMPTYPE JDATE
6 back office 24-12-0012 03:00:00
1 HR 01-01-2012 03:01:00
2 Admin 01-12-2011 03:20:00
3 MARKETING 01-01-2012 03:00:00
4 FACILITY 12-02-2012 03:00:00
8 IT 10-06-2010 03:14:00
9 Finance 07-11-2012 03:10:00
10 "100HR" 07-11-2012 03:31:00
8 rows selected.In the above case records having time more than 3 pm should not fetch.
I have tried below query, it is giving me
/* Formatted on 1/21/2013 3:25:20 PM (QP5 v5.215.12089.38647) */
WITH test
AS (SELECT 6 empno,
'back office' emptype,
TO_DATE ('24-12-2012 15:00:00', 'dd-mm-yyyy hh24:mi:ss')
jdate
FROM DUAL
UNION ALL
SELECT 6 empno,
'back office' emptype,
TO_DATE ('24-12-2012 15:40:00', 'dd-mm-yyyy hh24:mi:ss')
jdate
FROM DUAL
UNION ALL
SELECT 1,
'HR',
TO_DATE ('01-01-2012 03:01:00', 'dd-mm-yyyy hh24:mi:ss')
FROM DUAL
UNION ALL
SELECT 2,
'Admin',
TO_DATE ('01-12-2011 03:20:00', 'dd-mm-yyyy hh24:mi:ss')
FROM DUAL
UNION ALL
SELECT 3,
'MARKETING',
TO_DATE ('01-01-2012 03:00:00', 'dd-mm-yyyy hh24:mi:ss')
FROM DUAL
UNION ALL
SELECT 4,
'FACILITY',
TO_DATE ('12-02-2012 03:00:00', 'dd-mm-yyyy hh24:mi:ss')
FROM DUAL
UNION ALL
SELECT 8,
'IT',
TO_DATE ('10-06-2010 03:14:00', 'dd-mm-yyyy hh24:mi:ss')
FROM DUAL
UNION ALL
SELECT 9,
'Finance',
TO_DATE ('07-11-2012 03:10:00', 'dd-mm-yyyy hh24:mi:ss')
FROM DUAL
UNION ALL
SELECT 10,
'100HR',
TO_DATE ('07-11-2012 03:31:00', 'dd-mm-yyyy hh24:mi:ss')
FROM DUAL)
SELECT empno, emptype, TO_CHAR (jdate, 'dd-mm-yyyy hh24:mi:ss') jdate
FROM test
WHERE TO_CHAR (jdate, 'hh:mi:ss') <= '03:00:00'records for 6, 3 and 4 empno's check if this is your requirement
Similar Messages
-
Query - to fetch records - before particular date
I need to retrive last analyzed table prior to 28/Nov/2010 - to put into simple wanted to fetch records from a table which are created before the above mentioned date.
Thanks,
SteveSpade wrote:
I need to retrive last analyzed table prior to 28/Nov/2010 - to put into simple wanted to fetch records from a table which are created before the above mentioned date.
Thanks,
SteveYou want to fetch the rows which were "inserted" before that date?
Then you either:
a) Need to have a timestamp column on the row or
b) Use ORA_ROWSCN pseudo-column if you created your table(s) with row-level dependency tracking or
c) Install log miner and query the necessary archive logs.
:p -
How to fetch records between two seq uence numbers?
We have thousands of records with seq uence numbers in the oracle database, we need to retrieve a number of records between two seq uence numbers, i.e. to retrieve records between 100 and 200 seq uence numbers. Could some one help me to find a query to fetch records.
I'll be waiting for your response..
Edited by: sumant on Jul 27, 2010 12:42 PMIs this is what you are looking for?
SQL> create table tab1 (id number);
Table created.
SQL> insert into tab1 values (1);
1 row created.
SQL> insert into tab1 values (2);
1 row created.
SQL> insert into tab1 values (3);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from tab1;
ID
1
2
3
SQL> select round(dbms_random.value(max(id)+1,max(id)+50)) random_number
2 from tab1;
RANDOM_NUMBER
43
SQL> select round(dbms_random.value(max(id)+1,max(id)+50)) random_number
2 from tab1;
RANDOM_NUMBER
39
SQL> select round(dbms_random.value(max(id)+1,max(id)+50)) random_number
2 from tab1;
RANDOM_NUMBER
13 This will generate a random number that will be greater then the maximum value in the table and lower then the maxvalue + 50. Having the range starting from maxvalue in the table you will never get a number generated which already exists in the table.
As you see in the above number genrated they are all between 4 and 53.
If you want to increase the range from where the number are generated just increase the value 50 that I used in the query. -
in internal table
list of records (dates), with one record i want to fetch another record nearest (Date) which is specified.
for example
Rrecords
01/10/2005
02/10/2005
03/10/2005
04/10/2005
05/10/2005
06/10/2005
07/10/2005
08/10/2005
09/10/2005 'this record
10/10/2005
11/10/2005
12/10/2005 "Fetch record
01/10/2006
02/10/2006
03/10/2006
04/10/2006
Here i want to fetch 12/10/2009 based on 09/10/2009
I am looking FM, Input is 09/10/2009 output is 12/10/2009
Thanks,
SonarI have internal table itab1 having two records
DATEField
20090915 (Sept)
20097715 (JULY)
Here my requirement is , to look whether input dates is existing in this internal table or not
if doesn't exist error it.
ex: inputdate: 20090813
loop at itab1 where DATEField GE inputdate
DATEField LE inputdate
endloop.
Thanks,
Sonar -
PDE-PLI031 Unable to fetch record from table tool_modulre
Dear ALL
I am creating PL/SQL Libraries in report builder.
but When I try to save the Library to database, a error
PDE-PLI031 Unable to fetch record from table tool_modulre.
Would you please tell me how to solve this problem
and why it coming
thankyou very much
pritam singhHi ,
Saving a library (.pll) to database would store the object inside specific tables that are to be created.
If you are using 6i, then you should find toolbild & toolgrnt.sql files which you have to run in the order specified. The above scripts creates the necessary tables and henceforth you won't get those errors while saving.
Hope this helps.
Thanks,
Vinod. -
How to fetch records from the database into a combo box?
Hi:
I´m really new with ABLBPM and I´m trying to fetch records from the database to display them into a combo box as valid values for a presentation but I´m using a dynamic method with this code:
<em>for each row in SELECT campo1, campo2 from TABLE</em>
<em>do</em>
<em>solicitudes[] = [row.campo1, row.campo2]</em>
<em>end</em>
<em>return solicitudes
</em>And the debugger says that SQL instructions can be used only in fuctions and procedures that are executed on the server.
Do you know another way to do it?
P.D. Sorry for my terrible english
GreetingsHi Steve,
Thank you, your idea is perfect, but when I try to run the screenflow where the combo should be filled I get this error:
fuego.lang.ComponentExecutionException: No se ha podido ejecutar correctamente la tarea.
Motivo: 'java.lang.NullPointerException'.
at fuego.web.execution.InteractiveExecution.setExecutionError(InteractiveExecution.java:307)
at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:166)
at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
at fuego.webdebugger.servlet.DebuggerServlet.redirect(DebuggerServlet.java:136)
at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:85)
at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at fuego.web.execution.servlet.ServletExternalContext.forwardInternal(ServletExternalContext.java:197)
at fuego.web.execution.servlet.ServletExternalContext.processAction(ServletExternalContext.java:110)
at fuego.webdebugger.servlet.DebuggerExecution.dispatchComponentExecution(DebuggerExecution.java:64)
at fuego.web.execution.InteractiveExecution.invokePrepare(InteractiveExecution.java:351)
at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:192)
at fuego.web.execution.impl.WebInteractiveExecution.process(WebInteractiveExecution.java:54)
at fuego.web.execution.InteractiveExecution.process(InteractiveExecution.java:223)
at fuego.webdebugger.servlet.DebuggerServlet.doDebug(DebuggerServlet.java:148)
at fuego.webdebugger.servlet.DebuggerServlet.doPost(DebuggerServlet.java:82)
at fuego.webdebugger.servlet.DebuggerServlet.doGet(DebuggerServlet.java:66)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
Any ideas??
Thanks and greetings -
Sender JDBC Adapter : Fetch records from multiple tables
Hi Friends,
I am using sender JDBC adapter to select few records from DB2 database table.
This scenario is working fine.
Now my requirement is to fetch records from 3 tables. These table are independent to each other. There is no primary key or foreign key.
Please let me know how to write the sql in sender JDBC adapter to fetch records from these 3 tables.
Thanks,
Sandeep Mauryahi sandeep...
if the tables are completely independent and do not share any primary / foreign key relation ship...
why dont u think towards creating a seperate interface for each of them..
or if u still want to select from multiple table at once..the best way would be to write a stored procedure on the sender side which do all the fetching n processing and pass the final resultset to PI
or u can think towards fetching the data from 1 table and then in UDF do lookup from other tables..which again is tricky and performace intensive -
JDBC Sender Adapter - NOT FETCHING RECORDS...
Hello Experts,
I know this was answered in a separate thread (JDBC Sender Adapter - NOT FETCHING RECORDS -PROCESSING STARTED).
However, my question is, Is there a way that we can be notified if a channel has stopped fetching records?
or is there a reporting tool that can be used to check/monitor if a channel is not processing any messages?
Thanks & Kregards,
allarHi Sreedhar,
Thanks for your reply.
These case is not being captured by our alert configuration because its not throwing any error.
in the communication channel monitoring, we see only something like this..:
3/16/09 8:25:19 PM Processing started
3/16/09 8:34:20 PM Processing started
3/16/09 8:33:55 PM Processing started
3/16/09 8:32:54 PM Processing started
but no error is being displayed nor sent.
Also, there was a case that the channel just stopped fetching, even though everything is active.
example log:
3/12/09 8:32:54 PM Processing started
We're looking for ways on how we can trap these scenarios as early as possible, get us notified and perform adapter-lock release when needed.
Regards,
allar -
Finding Keywords on a Harddrive without haveing been before to the folder
Hello Helpful People,
I am Kaj and would like to add Keywords to a bunch of images in the size of 2-4 Mb.
The total amount of the images would be 200 Gb.
This images are in several different folders, which are all in one bigger archive folder. The archive folder is not located on my PC
,it is located on a server.
I would like to find the keyworded-images via Bridge by searching with the search-box or the further search-box panel ( strg F )
The problem is that when I have not been before in each folder, Bridge is not able to locate the keyworded-images.
I spoke to the Bridge-Helpdesk Germany. but they could not help me with this issue, instead they forwarded me to this forum.
MY REQUEST IS:
to find a solution to locate keyworded-images by searching them without having been before in this particular folder.
If there is any one out there who has an idea or knows a plug-in for Bridge or even another program which is able to do so,
or even where I can find further help.
That would be very helpful.
Thank you in advance!
Kindest Regards,
KajFor the search function to work the folder has to be indexed. By visiting the folder is one way, the other is to click "include non-indexed files".. This last option can ge very slow if there are a lot of images in the folder.
If you are running Vista you can use the advanced search and bring up the keywords (tags to MS).. It is fast if MS has indexed the folder. Again, if not indexed it can be slow. -
Time out error while fetching records from table BKPF
Hi,
I am fetching records from table BKPF using BUKRS & AWKEY in where clause. Query is as follows:
SELECT BELNR XBLNR AWKEY
FROM BKPF
INTO TABLE L_I_BKPF_TEMP
PACKAGE SIZE 500
WHERE BUKRS LIKE L_C_EG
AND AWKEY IN L_R_AWKEY .
APPEND LINES OF L_I_BKPF_TEMP TO I_BKPF .
ENDSELECT .
Program is giving time out error. There are 25628 records in range L_R_AWKEY , i m fetching 500 records at a time using PACKAGE SIZE. But the execution of prog stops on this query.
Please suggest something to overcome this problem.Hi
Rui is right,
if you need to get the data by operation parameters u have to use the fields AWTYP and AWKEY.
In this selection u can omit the company code.
SELECT BELNR XBLNR AWKEY FROM BKPF
INTO TABLE L_I_BKPF_TEMP
PACKAGE SIZE 500
WHERE AWTYP = <......> "<------------
AND AWKEY IN L_R_AWKEY .
APPEND LINES OF L_I_BKPF_TEMP TO I_BKPF .
ENDSELECT .
Max -
How can i fetch records from 3 tables in a single query without using join
Hi.
Can any body please tell me <b>How can i fetch records from 3 tables with a single query without using joins</b>
Thanx
prabhuduttaHi Prabgudutta,
We can fetch the data by using the views concept.
Go throuth this info we can know the how to create view and same like database table only we can fetch the data.
Views conatin the data at runtime only.
Four different view types are supported. These differ in the
way in which the view is implemented and in the methods
permitted for accessing the view data.
Database views are implemented with an equivalent view on
the database.
Projection views are used to hide fields of a table (only
projection).
Help views can be used as selection method in search helps.
Maintenance views permit you to maintain the data
distributed
on several tables for one application object at one time.
step by step creation of Maintenance view:
With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.
It can be set in transaction SE11 - Tools - Table maintenance generator.
Table maintanance Generator is used to manually input values using transaction sm30
follow below steps
1) go to se11 check table maintanance check box under attributes tab
2) utilities-table maintanance Generator-> create function group and assign it under
function group input box. Also assign authorization group default &NC& .
3) select standard recording routine radio in table table mainitainence generator to move table
contents to quality and production by assigning it to request.
4) select maintaience type as single step.
5) maintainence screen as system generated numbers this dialog box appears when you click on create button
6) save and activate table
One step, two step in Table Maintenance Generator
Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
SM30 is used for table maintenance(addition or deletion of records),
For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30
Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..
It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..
In the SE11 delivery and maintenance tab, keep the maintenance allowed..
Then come to the SM30 and then enter the table name and press maintain..,
Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..
Then create,,,
Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...
We use SM30 transaction for entering values into any DB table.
First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.
Then it will create a View.
After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.
Hope this resolves your query.
Reward all the helpful answers.
Rgds,
P.Naganjana Reddy -
Writing OR query for fetching records
Hi,
I have dowloaded a custom wsdl and generated a java client from it using Jdeveloper.
I have a method named customObject1QueryPage(QueryInputObj) which is used to query the CRM oD to fetch records.
I have successfully queried using the above method for one condition:-
QueryInputObj param= new QueryInputObj();
QueryType q = new QueryType();
q.set_value("='" + "ABC'");
//q.set_value("LIKE 'A*'");
param.setAccountName(q);
customObject1QueryPage(param);
But now I want to query using "OR" condition with multiple names in the condition and I don't know how to
write query for that.
SQL query would be like "Select * from table where name='ABC' OR name='PQR' OR name ='XYZ' ";
I want to execute same query for CRM oD but have no idea how to write it.
Can somebody please help me as soon as possible.
Thanks.Hi,
If your intent to Use OR Condition on a field with multiple Values
say, AccountName = 'xyz' OR AccountName= 'abc' the syntax would be *(='xyz') OR (='abc')*
say, AccountName = 'xyz' OR AccountName= 'abc' OR AccountName = 'pqr' the syntax would be *((='xyz') OR (='abc'))OR(='pqr')*
You can find similar example under On Demand Web Service Documentation
Regards
Deepak H Andeli -
SQL query to fetch records from 26 onwards
Want to know SQL query to fetch records from 26 onwards.
See the fifth entry on the FAQ page:
Re: How to attach a java bean in forms6i -
Fetch records from Database based on Input value
Hi Experts,
In my mobile application, I have designed one input field with F4 help or input assist. I need to fetch records from database based on that input and need to display records in table.
My question is:
How to fetch the records from database/back end based on the input value and display them as table format as we are doing in SAP ABAP?
Here, I need to fetch the records based on input value available in the UI screen and pass that value to gateway, fetch the records from database and need to bind with table in SAPUI5.
Kindly share the whole process flow with sample code for this requirement. Hope I have explained the requirement in detail.
Thanks In Advance..
Regards,
Arindam Samanta.Hi,
Try something like this.
In this, I am passing From date, To date, RelGrp, RelStr, Uname as input. Then I am storing those values in variables and passing this data in Odata request.
OData.read({ requestUri: "http://xxxx:8000/sap/opu/odata/sap/Z188_PO_SRV/pos?$filter=Docdate le datetime'"
+ todateformat+"T00:00:00' and Docdate ge datetime'"
+ fromdateformat+"T00:00:00' and RelGrp eq '"
+ relcode +"'and RelStr eq '"
+ relstg +"'and Uname eq '"
+ username+ "' "},
function (data) {
console.log(data);
When we are giving correct inputs it will goes to Success function and get the data from back end.
In console we can see the data.
Hope this will helps to you.
Thanks&Regards
Sridevi -
How to fetch records with two recordset
i want fetch records from the table using two recordset like
ResultSet r1=stmt.executeQuery("select * from pf_data");
i want to take another recodeset
ResultSet r2=stmt.executeQuery("select * from finyr");
I am using Microsoft SQL server as my database.
I am also closing the recordset like r1.close();
then i cannot take two recordset at the same time.Hi,
This is an example of a Top-N problem, and here's one way to do it:
WITH got_r_num AS
SELECT item_id, supp_id, rnk -- RANK is not a good column name
, DENSE_RANK () OVER ( PARTITION BY item_id -- Just guessing
ORDER BY rnk
) AS r_num
FROM table_x
WHERE item_id = 2 -- If desired
SELECT item_id, supp_id. rnk
FROM got_r_num
WHERE r_num <= 2
RANK is the name of a built-in function in Oracle, so it will cause lots of trouble if you use it as a column name. (The RANK function is closely related to DENSE_RANK, used above.)
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Point out where the query above is giving the wrong results, and explain, using specific examples, how you get the correct results from the given data in those places. If you changed the query at all, post your code.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002
Maybe you are looking for
-
Is there any way I can move my email and sub accounts over to my verizon business accounts?
-
Hope this is a problem that can be answered by the website. I continually receive a message Program: ssvagent.exe Publisher: unknown File origin: HD on computer asking if I want to install this This started happening after I updated Java I cannot get
-
Managing Windows Server licences (please suggest some tool)
Hi Does any body know any good tool for discovering Windows Server keys, and managing licences on different Windows Server versions? I Tried VAMT, but i would preffer something with keys database, that could tell me "You have this many keys left for
-
Apply adjustments thru process_order API
I have created an order and order lines . Then I am trying to apply a modifier ( manual ) thru process_order API by giving the header_id of order , list_header_id,list_line id of modifier , line_index as 1 ( for line 1 ) , automatic_flag as 'N' . But
-
How performance is increased in Weblogic 10.3
Hi All, Everywhere i am reading that using Weblogic 10.3 increases the over all performance of the application.Could anybody please help me in understanding the parameters that has resulted in the performance improvement of Weblogic 10.3. Edited by: