Re: SQL PLUS question
Posted in 1997
Topics: General Discussion
chalu kim wrote:
>
> We are moving data from ORACLE to Informix; we are having a problem with
> SQLPLUS while trying to dump the data to file. How can we control the
> way SQLPLUS outputs a DATE type field. Currently when running a select
> statement to output a DATE type field, it outputs in form of
> DAY-MONTH-YEAR, EX: 27-JAN-97. Is there some way to have a DATE field
> output in a format that INFORMIX dbload command could work with?
> EX: MONTH-DAY-YEAR 01-27-97.
Use TO_CHAR function.
Example, SELECT TO_CHAR(date_field_name,'mm-dd-yy') FROM ....
There are a lot of options regarding to TO_CHAR.
Hope this helps.
PS. We are moving from Informix to Oracle.
Luca
/********************************************************
* LET MyName = 'Luca Tseng'; *
* $EmailAddress = "luca@nakita.sdit.com.tw"; *
* CompanyName := 'Consilium'||'Taiwan'; *
* #ifdef OFFICE *
* static char *Telephone = "886-3-5278000" *
* else /* HOME */ *
* static char *Telephone = "886-3-4610012" *
* #endif *
********************************************************/