Using perl Syntax Highlighting
- sub getSectionDescription {
- my $section_code = shift;
- my $dbh = &EMIS::Database::gethandle('CEICP');
- my $sql = '';
- my $sth = undef;
- my $row = {};
- my $section_name = undef;
- if ($dbh) {
- $sql = " SELECT SECTION_NAME \n";
- $sql.= " FROM LAYOUT_PATHTREE_MVS \n";
- $sql.= " WHERE NODE_CODE = '$section_code' \n";
- $sth = $dbh->prepare($sql);
- $sth->execute;
- # foreach ($row = $sth->fetchrow_hashref()) {
- # push @{$section_name}, $row;
- # }
- $sth->finish();
- $dbh = releaseDBHandler($dbh);
- $section_name = $sql;
- return $section_name;
- }
- }
Coloreado en 0.004 segundos, usando GeSHi 1.0.8.4
Y trato de retornar el valor de la siguiente manera:
Using perl Syntax Highlighting
- $section_name = getSectionDescription($Data->{SECTION_CODE});
- @{$section_name}[0]->{SECTION_NAME}
Coloreado en 0.001 segundos, usando GeSHi 1.0.8.4
Pero me da este error cuando ejecuto mi .pl:
Can't use an undefined value as a HASH reference at
No sé qué será, lo he hecho de varia formas pero nada.
Gracias, Saludos.