Yes I do it too... but under sqlplus and it look like this...

SQL> select to_char(HORA_SUBG_HORA,'dd/mm/yy hh:mi:ss pm')
  2  from sm_subgrupos_horas_dat
  3  where IDEN_SUBG_SUBG_HORA = 131
  4  /

TO_CHAR(HORA_SUBG_HO
--------------------
07/10/01 11:08:00 am

SQL>


************************** Fragment of Perl Code
***************************
sub seleccion_subgrupo_horarios
{
use lib "/usr/lib/perl5/site_perl/5.6.0/i386-linux/";
use DBD::Oracle qw(ORA_VARCHAR2);
my($db, $sth);

   $ENV{ORACLE_HOME}  = "/u1/oracle/product/8.0.5";
   $db = DBI->connect("dbi:Oracle:host=mi_host;sid=gye", "HMORENO", "eri")
        or die "Unable to connect: $DBI::errstr";
  $db->{RaiseError} = 1;

 my $id_grupo=$_[0];

 my $query="select to_char(HORA_SUBG_HORA,'dd/mm/yy hh:mi:ss pm') from
sm_subgrupos_horas_dat where IDEN_SUBG_SUBG_HORA = $id_grupo";
 my ($horarios);
 $sth = $db->prepare($query);
 $sth->execute() or return undef;
 
my $temp="";
        while ($horarios = $sth->fetchrow_array )
    {            
     $temp="$temp$horarios";
        }
        
 return $temp;
}

****************************************************************************
***************************

It doesn�t work the variable returned is  ""


Saludos,
Hern�n Moreno

> -----Mensaje original-----
> De:    Laurie Gennari [SMTP:[EMAIL PROTECTED]]
> Enviado el:   Lunes 22 de Octubre de 2001 6:19 PM
> Para: [EMAIL PROTECTED]
> Asunto:       re: problem with select
> 
> You could do your select with a to_char(<column>, 'MM/DD/YY HH:MI:SS').
> 
> ltg
> -- 
> 

Reply via email to