I've got a few more issues with DBD::AnyData.  Sorry if it seems like
I'm spamming the group, but I have been researching all the docs and
can't seem to figure this stuff out:

#########
######### Item #1
#########

I've tried several different methods for passing $flags to the module,
but none seem to be working.  Here's what I've tried:

$flags{ad_eol} = "\n";
$flags{ad_quote_char} = "\"";
$flags{ad_escape_char} = "\"";

$dbh->func('datafile','CSV','/tables/datafile.csv',$flags,'ad_catalog');

- and -

$flags = {ad_eol => '\n' , ad_quote_char=> '"' , ad_escape_char=> '"' };

$dbh->func('datafile','CSV','/tables/datafile.csv',$flags,'ad_catalog');

- and -

$dbh->func('datafile','CSV','/tables/datafile.csv',{ad_eol => '\n' , ad_quote_char=> 
'"' , ad_escape_char=> '"' },'ad_catalog');

but when I view the file after updates, all the default flags are
still there.  I realize in my examples I'm using the defaults, but
I've tried different ones.  What gives?

#########
######### Item #2
#########

This may be a flag issue, but when I view any datafile after it's been
written to using Windows Notpad I see an unrecognized character as the
eol character.  It comes up as a square in Notepad.  Using Windows
Wordpad the eol is a space.  If I cat the file through the shell (I'm
using RedHat) everything looks great - all the output is on separate
lines.

If I open any updated datafile in Microsoft Excel, Excel reads the
..csv fine and when it writes it back out and the file is viewed in
Notepad or Wordpad all the eol's look good (like newlines).  That is
only after Excel saves the file as .csv after reading it.  I just use
a 'save' or 'save as'.

Do I need a different eol flag for everything to be ok across the
board?

#########
######### Item #3
#########

I'm having trouble doing a CREATE for tables.  My data dir is CHMOD
777 (fully writable) and I'm using the following code:

$dbh->func('datafiletwo','CSV','/tables/datafiletwo.csv','ad_catalog');

$dbh->do("
CREATE TABLE datafiletwo (id VARCHAR(12), value VARCHAR(12), PRIMARY KEY (id))
");

But the table never gets written out.  What's wrong with the picture?
I have even tried different metadata and eliminating the primary key.
Also done with and without the flags parameter.

#########
######### Item #4
#########

INSERTs are acting a little weird too.  Why is it that:

$dbh->func('datafile','CSV','/tables/datafile.csv','ad_catalog');

$dbh->do("
INSERT INTO datafile SET id = $id, value = $value
");

Doesn't work when:

$dbh->func('datafile','CSV','/tables/datafile.csv','ad_catalog');

$dbh->do("
INSERT INTO datafile VALUES ($id,$value)
");

Works perfectly?  I'm using $dbh->quote() on all values being
inserted, but I've also tried without that.

Any help on these items would be greatly appreciated.  Thanks very
much.

Nick Hendler
[EMAIL PROTECTED]

Reply via email to