Re: Selecting Date/Time columns in Pro*C

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 04 Jan 1999 18:29:58 GMT
Message-ID: <369d0868.18203004_at_192.86.155.100>


A copy of this was sent to "Mike Isaac" <michael.isaac_at_matrikon.com> (if that email address didn't require changing) On Mon, 4 Jan 1999 10:59:53 -0700, you wrote:

>I am writing an application using Pro*c and I cannot select a FULL date/time
>column using a cursor fetch statement. The date time column appears like
>this: 1998-08-21 12:34:00. When I try to fetch the value, I get
>everything upto the space. Could anyone who has a work around for this
>problem please send it to me.
>
>thanks.
>

give us an example of what your code looks like including variable defines and all please. For example, the following subroutine:

void process( void )
{
varchar datestr[40];

    EXEC SQL WHENEVER SQLERROR DO sqlerror_hard();

    exec sql select to_char( sysdate, 'yyyy-mm-dd hh24:mi:ss' ) into :datestr

               from dual;

    printf( "%.*s\n", datestr.len, datestr.arr ); }

produces this output:

1999-01-04 13:26:25

with no problems. Need to see what you are doing exactly....  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA

--
http://govt.us.oracle.com/    -- downloadable utilities
 
----------------------------------------------------------------------------
Opinions are mine and do not necessarily reflect those of Oracle Corporation
 
Anti-Anti Spam Msg: if you want an answer emailed to you, 
you have to make it easy to get email to you.  Any bounced
email will be treated the same way i treat SPAM-- I delete it.
Received on Mon Jan 04 1999 - 19:29:58 CET

Original text of this message