Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^7: Problem with DBI, DBD::XBase

by stefbv (Curate)
on Jan 24, 2013 at 19:27 UTC ( #1015213=note: print w/replies, xml ) Need Help??

in reply to Re^6: Problem with DBI, DBD::XBase
in thread Problem with DBI, DBD::XBase

Hi Holger,

I see you have 'B' (binary?) type for many fields, I'm not familiar with this type, but the year and month data type should be integer or numeric with 0 decimal places - N(4,0) for example.

Regards, Stefan

Update: Table with the official list of column types supported by the module:

use strict; use warnings; use DBI; my $dbf_dir = '.'; my $table = 'test_types'; my $dbh = DBI->connect("DBI:XBase:$dbf_dir") or die $DBI::errstr; my $def =<<"STR"; CREATE TABLE $table ( str_1 CHAR, num_1 NUMERIC(8,2), num_2 INTEGER, num_3 FLOAT, bol_1 BOOLEAN, blb_1 BLOB, blb_2 MEMO, dat_1 DATE, tim_1 TIME, dat_2 DATETIME ) STR unlink "test_types.dbf", "test_types.dbt"; $dbh->do($def);

Update2: Interesting, the other interface (non DBD) XBase can make B type columns, but the length is 10 and decimal places 0, ignoring the parameters:

use strict; use warnings; use XBase; my $newtable = XBase->create( "name" => "with_b.dbf", "field_names" => [ "ID", "MSG", "BIN" ], "field_types" => [ "N", "C", "B" ], "field_lengths" => [ 6, 40, 18 ], "field_decimals" => [ 0, undef, 2 ] ) or die XBase->errstr;

So, my guess is that B(8,6) is a erroneous type.

Update3: 'B' = Type Double :)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015213]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2018-03-20 13:00 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (253 votes). Check out past polls.