Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by stefbv (Curate)
on Jan 24, 2013 at 19:27 UTC ( [id://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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1015213]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (7)
As of 2024-04-24 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found