And output:use strict; use warnings; use DBI; use Data::Dumper; use JSON::XS; my $dbh = DBI->connect (q{DBI:ODBC:test}) or die $DBI::errstr; my $sth = $dbh-> prepare("SELECT val from buf WHERE dd_mm_yyyy= ? ") o +r die $dbh->errstr(); $sth->execute('2012-07-22 00:00:00') or die $dbh->errstr(); my $table; my $tbl_ary_ref; $tbl_ary_ref = $sth->fetchall_arrayref; if (defined $tbl_ary_ref){ $table->{date} = $tbl_ary_ref; } $tbl_ary_ref = encode_json $table; print qq{JSON-------------------JSON\n}; print $tbl_ary_ref."\n"; $sth->finish; $dbh->disconnect;
Error at Line : syntax error near ? JSON-------------------JSON {"date":[]}
In reply to Re^6: Debian DBD::ODBC select row by timestamp
by alexx_sh
in thread Debian DBD::ODBC select row by timestamp
by alexx_sh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |