Re: Convert Long to Date
From: Tim Gorman <tim_at_evdbt.com>
Date: Thu, 26 Jun 2008 14:15:46 -0600
Message-ID: <4863F8F2.2040406@evdbt.com>
This is embedded deep within a couple thousand lines of PL/SQL package code posted on the internet. The package is named EXCHPART, the procedure is called ADD_NEWER_THAN, and its URL is http://www.EvDBT.com/exchpart.sql. Here it is excerpted into pseudo-PL/SQL...
Hope this helps...
Brady, Mark wrote:
Date: Thu, 26 Jun 2008 14:15:46 -0600
Message-ID: <4863F8F2.2040406@evdbt.com>
Mark,
This is embedded deep within a couple thousand lines of PL/SQL package code posted on the internet. The package is named EXCHPART, the procedure is called ADD_NEWER_THAN, and its URL is http://www.EvDBT.com/exchpart.sql. Here it is excerpted into pseudo-PL/SQL...
procedure add_newer_than ...So the end result is that the variable "v_day" has the value from HIGH_VALUE...
...
v_errcontext varchar2(500);
v_high_value varchar2(100);
v_day date;
type cType is ref cursor;
c cType;
...
cursor get_partition_info ...
is
select ...,
high_value,
high_value_length,
...
from all_tab_partitions
...;
begin
...
for p in get_partition_info ... loop
...
v_high_value := substr(p.high_value, 1, p.high_value_length);
v_errcontext := 'select ' || v_high_value || ' from dual';
open c for v_errcontext;
fetch c into v_day;
close c;
...
end loop;
...
end;
/
Hope this helps...
Tim Gorman consultant - Evergreen Database Technologies, Inc. P.O. Box 1802, Evergreen CO 80437-1802 website = http://www.EvDBT.com/ email = Tim@EvDBT.com mobile = +1-303-885-4526 fax = +1-303-484-3608 Yahoo IM = tim_evdbt
Brady, Mark wrote:
-- http://www.freelists.org/webpage/oracle-l Received on Thu Jun 26 2008 - 15:15:46 CDTConvert Long to Date Oracle stores the High Value of a Partition in a Long column. I swear I’ve searched the friendly web, and I just can’t figure out how to get this long column converted back to a date or char I can take a char to a date.
If it exists on the web, please tell me. I don’t know why this is so hard to find.
>>> This e-mail and any attachments are confidential, may contain legal, professional or other privileged information, and are intended solely for the addressee. If you are not the intended recipient, do not use the information in this e-mail in any way, delete this e-mail and notify the sender. CEG-IP2