Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by stefbv (Deacon)
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 :)


Comment on Re^7: Problem with DBI, DBD::XBase
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2015-07-01 19:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (17 votes), past polls