Using CURRENT_DATE function in DATE column
Hi
I am not able to use CURRENT_DATE function in my target DATE column.I am getting error like "EDATE": invalid identifier with defintion as 'Insert PK error'. This column is not there in the source table.
Data Transfer from Oracle to Oracle
IKM = SQL Incremental Update
CKM = SQL Check
LKM = LKM SQL to SQL
Hi Shaishavi,
check your Target datastore in Model whether it contains the DATE column or Not.
have you use this Date column in PK?.
Colud you please sent me the Error command which you have faced? And tell me about the interface detaily.
Thanks,
Madha.
Similar Messages
-
How to use TRUNC function with dates in Expression Builder in OBIEE.
Hi There,
How to use TRUNC function with dates in Expression Builder in OBIEE.
TRUNC (SYSDATE, 'MM') returns '07/01/2010' where sysdate is '07/15/2010' in SQL. I need to use the same thing in expression builder in BMM layer logical column.
Thanks in advanceuse this instead:
TIMESTAMPADD(SQL_TSI_DAY, ( DAYOFMONTH(CURRENT_DATE) * -1) + 1, CURRENT_DATE) -
Using number datatype for date column
Hi
Is there a side effect for using "number" datatype for "date" column?
If so, what is the disadvantage?
Many thanksHi,
Ora_83 wrote:
Hi
Is there a side effect for using "number" datatype for "date" column?
If so, what is the disadvantage?Yes, there's a definite disadvantage.
Oracle provides date arithmetic and a number of functions for manipulating DATEs. None of them work with numbers.
For example,
SELECT TRUNC (order_date, 'MONTH') AS order_month
, AVG (ship_date - order_date) AS avg_delay
FROM orders
GROUP BY TRUNC (order_date, 'MONTH')
;order_month involves a DATE function; it's pretty easy to find the month that conatins order_date.
avg_delay involves date arithmetic. It's extrememly easy to find how much the time passed between order_date and ship_date.
Depending on how you code dates as numbers, doing either one of the above may be just as easy, but doing the other will be very difficult. You'll waste a lot of effort converting the NUMBERs to real DATEs whenever you need to manipulate them.
Validation can be very difficult for NUMBERs, also.
Watch this forum. It's a rare day when there's not some question about how to get around a problem caused by storing dates in a NUMBER (or VARCHAR2) column. Don't add to that. Always use DATE columns for dates. -
How to use aggregate function with Date
Hi All,
I have a group of date from that is it possible to Max and Min of date.
I have tried like this but its errored out <?MIN (current-group()/CREATION_DATE)?>.
I have also tried like this but it doesnt works
<?xdoxslt:minimum(CREATION_DATE)?>
Is it possible to use aggregate function with date values.
Thanks & Regards
SrikkanthHi KAVI PRIYA,
if date is not in cannonical format, how can we change it in BI publisher, then how to calcualte minimum and as well as maximum.
please advise me,
Thanks,
Sri -
Math function ' ' on Date columns is showing incorrect results. Pls xplain!
Hi guys,
I'm having a query wherein two date columns are used. One holds just the date part and the other date+time.
Columns are: - processing_date (holds on date)
authorised_ts (holds date+time)
The query is : -
SELECT a.processing_date,a.authorised_ts,
SUBSTR(a.processing_date,1,9),SUBSTR(a.authorised_ts,1,9)
FROM TEBINS01 a WHERE a.ref_instty_code = 'BULK'
AND a.status_code = 'PPAY'
AND SUBSTR(a.processing_date,1,9) < SUBSTR(a.authorised_ts,1,9)
I know that the substr function is creating the problem as it is converting the columns into characters.
*****The results show that 22-NOV-04 is greater than 12-JAN-05****
I've tried to use the below query to convert the above 2 dates into number(using to_number) via: -
SELECT TO_NUMBER(SUBSTR('22-NOV-04', LENGTH(RTRIM('22-NOV-04','1234567890'))-LENGTH('22-NOV-04'))) FROM dual
The result is 4
and when I use the above query for 12-JAN-05 the result is 5.
So even when I convert to number 5 is definitely greater than 4. But how and why is the substr function in the original query giving the wrong results?
Thanks in advance guys
BAs David points out, if the two columns are stored as dates, then you do not need to convert them at all to compare them. The only possible issue may be the fact that processing_date has no time component and authorised_ts has a time component.
Given the following:
SQL> DESC t;
Name Null? Type
ID NUMBER
PROCESSING_DATE DATE
AUTHORISED_TS DATE
SQL> SELECT * FROM t;
ID PROCESSING_DATE AUTHORISED_TS
1 10-Aug-2005 00:00:00 09-Aug-2005 03:51:47
2 06-Aug-2005 00:00:00 11-Aug-2005 07:44:42
3 10-Aug-2005 00:00:00 08-Aug-2005 17:18:07
4 08-Aug-2005 00:00:00 09-Aug-2005 11:45:59
5 12-Aug-2005 00:00:00 08-Aug-2005 12:56:49
6 06-Aug-2005 00:00:00 10-Aug-2005 01:43:02
7 08-Aug-2005 00:00:00 07-Aug-2005 09:23:19
8 10-Aug-2005 00:00:00 10-Aug-2005 11:04:21
9 05-Aug-2005 00:00:00 08-Aug-2005 11:29:47
10 11-Aug-2005 00:00:00 07-Aug-2005 14:51:53You obvioulsy would want id's 2, 4, 6, and 9, but what about 8? The two dates are on the same day. If you only want to consider cases where the day is less (i.e. exclude id 8) then you should query:
SQL> SELECT * FROM t
2 WHERE processing_date < TRUNC(authorised_ts);
ID PROCESSING_DATE AUTHORISED_TS
2 06-Aug-2005 00:00:00 11-Aug-2005 07:44:42
4 08-Aug-2005 00:00:00 09-Aug-2005 11:45:59
6 06-Aug-2005 00:00:00 10-Aug-2005 01:43:02
9 05-Aug-2005 00:00:00 08-Aug-2005 11:29:47However, if you hink that id 8 should be included then it is simply:
SQL> SELECT * FROM t
2 WHERE processing_date < authorised_ts;
ID PROCESSING_DATE AUTHORISED_TS
2 06-Aug-2005 00:00:00 11-Aug-2005 07:44:42
4 08-Aug-2005 00:00:00 09-Aug-2005 11:45:59
6 06-Aug-2005 00:00:00 10-Aug-2005 01:43:02
8 10-Aug-2005 00:00:00 10-Aug-2005 11:04:21
9 05-Aug-2005 00:00:00 08-Aug-2005 11:29:47Note that the comparision does not depend on the display format of the date:
SQL> ALTER SESSION SET nls_date_format = 'mm/dd/yy';
Session altered.
SQL> SELECT * FROM t
2 WHERE processing_date < TRUNC(authorised_ts);
ID PROCESSI AUTHORIS
2 08/06/05 08/11/05
4 08/08/05 08/09/05
6 08/06/05 08/10/05
9 08/05/05 08/08/05HTH
John -
Using TRUNC function on partitioned column
Hi All,
I have a table as follows:
STEP1
CREATE TABLE TEST_PARTITION
EMP_ID VARCHAR2(10 BYTE),
CREATE_DT DATE,
EMP_RGN_NM VARCHAR2(2 BYTE),
DSPTCH_CNT NUMBER
PARTITION BY RANGE (CREATE_DT)
SUBPARTITION BY LIST(EMP_RGN_NM)
SUBPARTITION TEMPLATE(
SUBPARTITION RGN_E VALUES ('E') ,
SUBPARTITION RGN_MW VALUES ('MW') ,
SUBPARTITION RGN_SW VALUES ('SW') ,
SUBPARTITION RGN_W VALUES ('W') ,
SUBPARTITION RGN_SE VALUES ('SE')
PARTITION aug2008 VALUES LESS THAN (TO_DATE('01-Sep-2008', 'DD-MON-YYYY')),
PARTITION sep2008 VALUES LESS THAN (TO_DATE('01-Oct-2008', 'DD-MON-YYYY')),
PARTITION oth VALUES LESS THAN (MAXVALUE)
ENABLE ROW MOVEMENT;
STEP 2
insert into TEST_PARTITION values(1000,TO_DATE('01-Aug-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',10)
insert into TEST_PARTITION values(1000,TO_DATE('02-Aug-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',20);
insert into TEST_PARTITION values(1000,TO_DATE('03-Aug-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',0);
insert into TEST_PARTITION values(1000,TO_DATE('01-sep-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',10);
insert into TEST_PARTITION values(1000,TO_DATE('02-sep-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',10);
insert into TEST_PARTITION values(1000,TO_DATE('01-Oct-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',10);
insert into TEST_PARTITION values(1001,TO_DATE('01-Aug-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',1);
insert into TEST_PARTITION values(1001,TO_DATE('02-Aug-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',2);
insert into TEST_PARTITION values(1001,TO_DATE('03-Aug-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',0);
insert into TEST_PARTITION values(1001,TO_DATE('01-sep-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',10);
insert into TEST_PARTITION values(1001,TO_DATE('02-sep-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',5);
insert into TEST_PARTITION values(1001,TO_DATE('01-Oct-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',10);
insert into TEST_PARTITION values(1001,TO_DATE('02-Oct-2008 12:02:02', 'DD-MON-YYYY HH:MI:SS'),'SE',10);
STEP 3
I need to get all the dispatches on 1st of August and hence issue the statement as follows:
select * from test_partition where TRUNC(CREATE_DT)='01-Aug-2008' and EMP_RGN_NM = 'SE'
Using a function over the partitioned column, will it avaoid partition pruning? I mean will it scan all the partitiones instead of going to specific partition?
I need this urgently since we are having a discussion on this in few minutes from now.
Thanks so much
SaffWhat about a function based index ?
SQL> select * from test_partition where TRUNC(CREATE_DT)='01-Aug-2008' and EMP_RGN_NM = 'SE';
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 32 | 4 (0)| | |
| 1 | PARTITION RANGE ALL | | 1 | 32 | 4 (0)| 1 | 3 |
| 2 | PARTITION LIST SINGLE| | 1 | 32 | 4 (0)| KEY | KEY |
| 3 | TABLE ACCESS FULL | TEST_PARTITION | 1 | 32 | 4 (0)| KEY | KEY |
Note
- 'PLAN_TABLE' is old version
SQL> create index idx on test_partition (TRUNC(CREATE_DT));
Index created.
SQL> select * from test_partition where TRUNC(CREATE_DT)='01-Aug-2008' and EMP_RGN_NM = 'SE';
Execution Plan
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 32 | 2 (0)| | |
| 1 | TABLE ACCESS BY GLOBAL INDEX ROWID| TEST_PARTITION | 1 | 32 | 2 (0)| ROWID | ROWID |
| 2 | INDEX RANGE SCAN | IDX | 1 | | 1 (0)| | |
Note
- 'PLAN_TABLE' is old version
I need this urgently since we are having a discussion on this in few minutes from now.It is not our problem, but yours.
Nicolas. -
Pivot table in BI Publisher: Different aggregate functions in data columns
Hi, everyone!
I`ve got some troubles with pivot table in my rtf-template.
Here is my xml:
<ROWSET>
<ROW>
<_BI_SUBRF_MO_._MUN_NAME_>МО Петроградский р-н</_BI_SUBRF_MO_._MUN_NAME_>
<_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>714000003</_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>
<_BI_MONTH_DEBET_._BI_DEBET_SUM_>0.0</_BI_MONTH_DEBET_._BI_DEBET_SUM_>
<_BI_CALENDAR_._YEAR__>2009</_BI_CALENDAR_._YEAR__>
<_BI_CALENDAR_._MONTH__>8</_BI_CALENDAR_._MONTH__>
</ROW>
<ROW>
<_BI_SUBRF_MO_._MUN_NAME_>МО Петроградский р-н</_BI_SUBRF_MO_._MUN_NAME_>
<_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>714000004</_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>
<_BI_MONTH_DEBET_._BI_DEBET_SUM_>165.58</_BI_MONTH_DEBET_._BI_DEBET_SUM_>
<_BI_CALENDAR_._YEAR__>2009</_BI_CALENDAR_._YEAR__>
<_BI_CALENDAR_._MONTH__>7</_BI_CALENDAR_._MONTH__>
</ROW>
<ROW>
<_BI_SUBRF_MO_._MUN_NAME_>МО Петроградский р-н</_BI_SUBRF_MO_._MUN_NAME_>
<_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>714000004</_BI_PERS_ACCOUNT_CARD_._BI_PAC_NMB_>
<_BI_MONTH_DEBET_._BI_DEBET_SUM_>165.58</_BI_MONTH_DEBET_._BI_DEBET_SUM_>
<_BI_CALENDAR_._YEAR__>2009</_BI_CALENDAR_._YEAR__>
<_BI_CALENDAR_._MONTH__>7</_BI_CALENDAR_._MONTH__>
</ROW>
...... and so on..
</ROWSET>
In the pivot table i`d like to see one row for every BISUBRF_MO_._MUN_NAME_ using BICALENDAR_._YEAR__ and BICALENDAR_._MONTH__ as measures and sum of BIMONTH_DEBET_._BI_DEBET_SUM_ and count of unique (or at least just count of) BIPERS_ACCOUNT_CARD_._BI_PAC_NMB_ in cells.
I create a pivot table using wizard, everything ok except one thing: as i understand, in pivot table for data in rows we can use only one kind of aggregate function e.g. only sum or only count.
Is there any way to use different aggregate functions in data cells?
Thank youAs you can see, when we use crosstab tag we can specify only one aggregate function for data cells.
Is there any way to get in XSL-FO (where we can what really happens) instead of:
<T1>
<xsl:value-of select="sum(current-group()/_BI_PERS_ACCOUNT_CARD_._BI_PAC_UNID_)"/>
</T1>
<T2>
<xsl:value-of select="sum(current-group()/_BI_MONTH_DEBET_._BI_DEBET_SUM_)"/>
</T2>
this
<T1>
<xsl:value-of select="sum(current-group()/_BI_PERS_ACCOUNT_CARD_._BI_PAC_UNID_)"/>
</T1>
<T2>
<xsl:value-of select="count(current-group()/_BI_MONTH_DEBET_._BI_DEBET_SUM_)"/>
</T2>
Edited by: user12115038 on 26.10.2009 8:08 -
Using sqlldr when source data column is 4000 chars
I'm trying to load some data using sqlldr.
The table looks like this:
col1 number(10) primary key
col2 varchar2(100)
col3 varchar2(4000)
col4 varchar2(10)
col5 varchar2(1)
... and some more columns ...
For current purposes, I only need to load columns col1 through col3. The other columns will be NULL.
The source text data looks like this (tab-delimited) ...
col1-text<<<TAB>>>col2-text<<<TAB>>>col3-text
more-col3-text
more-col3-text
more-col3-text
more-col3-text
more-col3-text
END-OF-RECORD
There's nothing special about the source data for col1 and col2.
But the data for col3 is (usually) much longer than 4000 chars, so I just need to truncate it to fit varchar2(4000), right?
The control file looks like this ...
LOAD DATA
INFILE 'load.dat' "str 'END-OF-RECORD'"
TRUNCATE
INTO TABLE my_table
FIELDS TERMINATED BY "\t"
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
col1 "trim(:col1)",
col2 "trim(:col2)",
col3 char(10000) "substr(:col3,1,4000)"
I made the column 3 specification char(10000) to allow sqlldr to read text longer than 4000 chars.
And the subsequent directive is meant to truncate it to 4000 chars (to fit in the table column).
But I get this error ...
Record 1: Rejected - Error on table COL3.
ORA-01461: can bind a LONG value only for insert into a LONG column
The only solution I found was ugly.
I changed the control file to this ...
col3 char(4000) "substr(:col3,1,4000)"
And then I hand-edited (truncated) the source data for column 3 to be shorter than 4000 chars.
Painful and tedious!
Is there a way around this difficulty?
Note: I cannot use a CLOB for col3. There's no option to change the app, so col3 must remain varchar2(4000).You can load the data into a staging table with a clob column, then insert into your target table using substr, as demonstated below. I have truncated the data display to save space.
-- load.dat:
1 col2-text col3-text
more-col3-text
more-col3-text
more-col3-text
more-col3-text
more-col3-text
XYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
END-OF-RECORD-- test.ctl:
LOAD DATA
INFILE 'load.dat' "str 'END-OF-RECORD'"
TRUNCATE
INTO TABLE staging
FIELDS TERMINATED BY X'09'
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
col1 "trim(:col1)",
col2 "trim(:col2)",
col3 char(10000)
SCOTT@orcl_11gR2> create table staging
2 (col1 varchar2(10),
3 col2 varchar2(100),
4 col3 clob)
5 /
Table created.
SCOTT@orcl_11gR2> host sqlldr scott/tiger control=test.ctl log=test.log
SCOTT@orcl_11gR2> select * from staging
2 /
COL1
COL2
COL3
1
col2-text
col3-text
more-col3-text
more-col3-text
more-col3-text
more-col3-text
more-col3-text
XYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
1 row selected.
SCOTT@orcl_11gR2> create table my_table
2 (col1 varchar2(10) primary key,
3 col2 varchar2(100),
4 col3 varchar2(4000),
5 col4 varchar2(10),
6 col5 varchar2(1))
7 /
Table created.
SCOTT@orcl_11gR2> insert into my_table (col1, col2, col3)
2 select col1, col2, substr (col3, 1, 4000) from staging
3 /
1 row created.
SCOTT@orcl_11gR2> select * from my_table
2 /
COL1
COL2
COL3
COL4 C
1
col2-text
col3-text
more-col3-text
more-col3-text
more-col3-text
more-col3-text
more-col3-text
XYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
1 row selected. -
Using Upload function module data is truncated to 255 characters
I am using FM UPLOAD. However, when I bring in the file, it is truncated to 255 characters.
Here is what I have:
DATA: BEGIN OF rec_input2 occurs 0,
line TYPE string,
END OF rec_input2.
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = 's:\ersd20100217'
FILETYPE = 'ASC'
TABLES
DATA_TAB = rec_input2
Please advise how I can upload this file without truncation.
Thanks.
MichaelModerator message - FAQ Please search before asking - post locked
Rob -
How to use MAX() function with date field
Hi Frzz,
I have created a Graphical calculation view in which i have multiple records for each employee with different dates. But my requirement is to take the records which have maximum date.
I have converted the date into Integer and applied the MAX() function. But still am getting multiple records.
Is there is any other way we can achieve this requirement in Graphical Calculation view?? Your suggestion will really help me.
Thank you.
Krishna.Hmm... what have you tried out so far?
Look, I took the effort and created a little example, just for you
Assume we have a table that contains the logon dates of users.
Every line contains the logon date and some info on the user.
Very much like a not-normalized log file could look like.
Now, the output we want is: one line per user with the most current logon time.
Not too difficult:
1. Have a aggregation node that gives you the distinct user details - one line for every user:
2. Have another aggregation node that gives you the last (MAX) logon date per user:
Finally you do a 1:1 join on the USER_ID and map the result to the output.
Easy as pie
- Lars -
Using UPPER function with LONG datatype column
Hi,
Can anyone tell that how can I use UPPER function on a column which has data type as-- LONG?
For ex--
SELECT * FROM TABLE WHERE UPPER(LONG_COL) LIKE 'MYTEXT%';
thanks,
Abhijeet
Edited by: @bhijeet ☻☻☻ on Nov 18, 2009 5:20 AM@bhijeet ☻☻☻ wrote:
Yes I know that that's why I am asking about an alternate solution for it. Could you please let me know if you have any solution to do it?
Thanks,
AbhijeetI think you'll have to write a function to do this for you. You can use DBMS_SQL to break a LONG into pieces and work with 32K segments. I am not sure how to put the converted data back into the LOB at that point, though DBMS_SQL might provide a way to do this. -
OBIEE - Use CURRENT_DATE in where condition
Hello All,
I want to use CURRENT_DATE in one column named "Incident Date/System"."Submit Date(GMT)". I just want to extract CURRENT_DATE(06-02-2013) data.
I want to use that field like "Incident Date/System"."Submit Date(GMT)" = CURRENT_DATE. But i am not able to do it. Please help me on this.
*<code>*
SELECT CURRENT_DATE saw_0, "Incident Basic Details"."Incident ID" saw_1, "Incident Basic Details".Impact saw_2, "Incident Basic Details"."Incident Details" saw_3, "Incident Customer"."Customer Name" saw_4, "Incident Customer"."Customer ID" saw_5, "Incident Assignment"."Assigned Group" saw_6 FROM "Enterprise Remedy" WHERE "Incident Assignment"."Assigned Group" = 'Standard Oracle Production Support' ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6
*<code>*
With CURRENT_DATE
*<code>*
SELECT CURRENT_DATE saw_0, "Incident Basic Details"."Incident ID" saw_1, "Incident Basic Details".Impact saw_2, "Incident Basic Details"."Incident Details" saw_3, "Incident Customer"."Customer Name" saw_4, "Incident Customer"."Customer ID" saw_5, "Incident Assignment"."Assigned Group" saw_6 FROM "Enterprise Remedy" WHERE "Incident Assignment"."Assigned Group" = 'Standard Oracle Production Support' AND "Incident Date/System"."Submit Date(GMT)" = CURRENT_DATE ORDER BY saw_0, saw_1, saw_2, saw_3, saw_4, saw_5, saw_6
*<code>*
Thanks,
JitenOn Column "Incident Date/System"."Submit Date(GMT)" click on Filter->Add Button->SQL Expression and then use current_date
or else
On Column "Incident Date/System"."Submit Date(GMT)" click on Filter->Advanced Button->Convert this filter to SQL
and then use current_date
Before doing this I would suggest to validate the data format and values, you might need to cast where ever needed.
Mark if helps -
Performance tuning -index on big table on date column
Hi,
I am working on Oracle 10g with Oracle Apps 11i on Sun.
we have a large non-partition table "GL_JE_HEADERS" with 7 million rows.
Now we want to run the query for selecting rows using between clause on date column.
I have created Btree index on the this table.
Now how can I tune the query? Which hint should I use for the query?
Thanks,
raneHi Rane,
Now how can I tune the query?Indexes on DATE datatypes are tricky, as the SQL queries must match the index!
For example, an index on ship_date would NOT match a query:
WHERE trunc(ship_date) > trunc(sysdate-7);
WHERE to_char(ship_date,’YYYY-MM-DD’) = ‘2004-01-04’;
You may need to create an function-basd index, so that the DATE reference in your SQL matches the index:
http://www.dba-oracle.com/oracle_tips_index_scan_fbi_sql.htm
To start testing, go into SQL*Plus and "set autotrace on" and run the queries.
Then confirm that your index is being used.
Which hint should I use for the query?Hints are a last resort!
Your query is fully tuned when it fetches the rows you need with a minimum of block touches (logical reads, consistent gets).
See here for details:
http://www.dba-oracle.com/art_sql_tune.htm
Hope this helps . . .
Donald K. Burleson
Oracle Press author
Author of "Oracle Tuning: The Definitive Reference"
http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm -
Use EVALUATE function in obiee
Hi ALL
i hv a database query like this;
select
deptno,
rtrim (xmlagg (xmlelement (e, ename || ',')).extract ('//text()'), ',') enamesfrom
emp
group by
deptno;
now, i want to use this using Evaluate function in obiee column formula.
thn how to do it.
Please reply.
THX
SAPHello SAP,
I have seen you for sometime and one thing I came to know is you are creating threads and once you got your solution or you dont feel to follow up you are just leaving the thread.
see few here,
Sorting month name
Drill down problem
Re: Filter in Union Request
so please better close the threads which are answered and proceed further. -
Best practices on using EVALUATE functions
hi, experts,
I wanna know what is the best practices on using EVALUATE functions on obiee (calling oracle user defined functions)
I found that if I use evaluate functions in Answers,
obiee will construct a sql behind and then execute.
sometimes, obiee contructs some unexpected sqls, and returns errors.
so, is it better to use EVALUATE functions in logical columns ?
thanksEVALUATE('DB_Function(%1)' as returntype, {Comma separated Expression})
even when used in Logical columns, its gonna fire the same sql.
Maybe you are looking for
-
Help required - frequent hang and slow down in my MBP
Hi, My MBP get slow down frequently with the colour circle come up and need a few minute to resume and hang again. ANd this hang seem can stop the hold machine even for Force quit and Activity Monitor And it seem most likely that, if I quite Safari a
-
Below is the code I added to the behavior for a graphic image to show in the layer. It works perfectly on my computer. But not working after uploading page. It seems that the image is not loading from my server? The image is in my httpdocs/images fol
-
Issues after Tiger to SL Upgrade
About 5 months ago I upgraded from Tiger to SL... although Tiger never gave me any issues I wanted to be on the latest version. I have an older MAC so needed to upgrade via the (expensive) Box Set. I did the change via the "upgrade" and not the compl
-
Every time i lock my iPhone 5 the time stays the same for when i unlock it, any help?
I have an iPhone 5 and every time i lock it ( press the sleep button ) it will keep that time so when i next unlock it displays the time of when i locked it. example, i lock it a 7:10pm and half an hour later i will unlock it but it sill say its 7:10
-
Hi all. In my code, before to delete a register, I would like the user confirm the operation. I know javascrip dialog can make it for me. But (using JSF / JSC) I don�t know how to. Somebody could send me a piece code for that? Thanks in advance.