Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
A poster migrating code from Oracle to Informix asked for an equivalent of Oracle's EXTRACT to pull hour, minute and second from a timestamp, having only found DAY(), MONTH() and YEAR(). Replies pointed to Informix's EXTEND function, with examples such as EXTEND(current, hour to hour), EXTEND(current, minute to minute) and EXTEND(current, second to second), substituting the relevant datetime column for 'current'. The rest of the thread drifts into joking about Oracle-to-Informix migrations.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Hi! I'm new in this, in my work, we are migrating to Informix from
Oracle and I have to migrate some chunks of code and I have a problem
when I gotta translate the function "Extract" from Oracle to something
similar in Informix. This function "extract" - as the word says -,
extarct from a time stamp the day, month and year and the hour, minute
or second. I find the functions DAY(), MONTH() and YEAR() for do
something similar; but just with day, month and year; and now i need
this for hour, minute and second. Can someone give me a tip?
Thanx 4 all!
PS: Sorry about my English...I hope u can understand.
Jorge said:
>
> Hi! I'm new in this, in my work, we are migrating to Informix from
> Oracle and I have to migrate some chunks of code and I have a problem
> when I gotta translate the function "Extract" from Oracle to something
> similar in Informix. This function "extract" - as the word says -,
> extarct from a time stamp the day, month and year and the hour, minute
> or second. I find the functions DAY(), MONTH() and YEAR() for do
> something similar; but just with day, month and year; and now i need
> this for hour, minute and second. Can someone give me a tip?
> Thanx 4 all!
>
> PS: Sorry about my English...I hope u can understand.
I think you might be looking for EXTEND. It's in the SQL Syntax manual at
http://www-306.ibm.com/software/data/informix/pubs/library/
--
Bye now,
Obnoxio
"C'est pas parce qu'on n'a rien ' dire qu'il faut fermer sa gueule"
- Coluche
did i mention i like nulls? heck, i even go so far as to say that all
columns in a table except the primary key could/should be nullable. this
has certain advantages, for example, if you need to insert a child record
and you don't have a parent row for it, just do an insert into the parent
table with the primary key value (everything else null), and voila,
relational integrity is preserved. but this is, admittedly, a bit
controversial among modellers.
--r937, dbforums.com
select extend(current, hour to hour) from .....
select extend(current, second to second) from ...
select extend(current, minute to minute) from ...
Instead of current, you can use the appropriate datetime column.
VG.
Some people are saying that Informix is getting no new wins...
so what is this guy doing then?
To Informix From Oracle...
so that would be a new win then?
↪ replying to david@smooth1.co.uk
Mark Townsend — — source: Usenet: comp.databases.informix
david@smooth1.co.uk wrote:
> so what is this guy doing then?
Commiting the IT equivalent of seppuku ?
With a very blunt, very rusty knife ?
Mark Townsend said:
>
> david@smooth1.co.uk wrote:
>
>> so what is this guy doing then?
>
> Commiting the IT equivalent of seppuku ?
> With a very blunt, very rusty knife ?
Au contraire: he is using a shiny new DataBlade!
:o)
--
Bye now,
Obnoxio
"C'est pas parce qu'on n'a rien ' dire qu'il faut fermer sa gueule"
- Coluche
did i mention i like nulls? heck, i even go so far as to say that all
columns in a table except the primary key could/should be nullable. this
has certain advantages, for example, if you need to insert a child record
and you don't have a parent row for it, just do an insert into the parent
table with the primary key value (everything else null), and voila,
relational integrity is preserved. but this is, admittedly, a bit
controversial among modellers.
--r937, dbforums.com
↪ replying to Obnoxio The Clown
Mark Townsend — — source: Usenet: comp.databases.informix
Obnoxio The Clown wrote:
> Mark Townsend said:
>
>>david@smooth1.co.uk wrote:
>>
>>
>>>so what is this guy doing then?
>>
>>Commiting the IT equivalent of seppuku ?
>>With a very blunt, very rusty knife ?
>
>
> Au contraire: he is using a shiny new DataBlade!
>
> :o)
>
But we agree, still seppuku nonetheless
Happy New Year BTW.
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.