DBI select with memo fields 
Author Message
 DBI select with memo fields

Does anyone have any suggestions on selecting rows from a database that
include memo fields.

I have a select statement which works if the size of the contents from the
memo field are below 255.  Is there a hidden switch or something to retrieve
the information?

The result has been, if I leave the field in the database for one row
untouched, the fetch returns nothing saying that it couldn't find anything
that matched the index ID of the row that I want.  If I change the contents
of the memo field to something below 255 characters it returns fine.

I'm using Access at the moment for this, for testing purposes and for
development reasons.  IS it something particular to the DBI module that only
accepts fields smaller than 255 characters?

$database_run=$dbh->prepare("SELECT * FROM PROJECT_LIST WHERE Project_ID=
?");
database_check() || de{*filter*}("prepare select project by project
id","passed");
$database_run->execute("$project_id");
database_check() || de{*filter*}("execute select project by project
id","passed");

This seems to work fine when the memo field is below 255 characters.

For reference, the database_check sub routine does the error checking and
depending on whether the de{*filter*} sub is enabled prints the error directly
to browser/and or the database log file.  No errors show up in the database
log file, and nothing shows up in the trace log for the database either.

It just returns zero results from the search.

Since it isn't returning any errors I'm not sure if this is a constraint of
the DBI module or the ODBC interface.  I would love to have an actual error
to look at.



Thu, 14 Apr 2005 23:57:49 GMT  
 DBI select with memo fields


Quote:
> Does anyone have any suggestions on selecting rows from a database that
> include memo fields.

> I have a select statement which works if the size of the contents from the
> memo field are below 255.  Is there a hidden switch or something to
retrieve
> the information?

> The result has been, if I leave the field in the database for one row
> untouched, the fetch returns nothing saying that it couldn't find anything
> that matched the index ID of the row that I want.  If I change the
contents
> of the memo field to something below 255 characters it returns fine.

> I'm using Access at the moment for this, for testing purposes and for
> development reasons.  IS it something particular to the DBI module that
only
> accepts fields smaller than 255 characters?

> $database_run=$dbh->prepare("SELECT * FROM PROJECT_LIST WHERE Project_ID=
> ?");
> database_check() || de{*filter*}("prepare select project by project
> id","passed");
> $database_run->execute("$project_id");
> database_check() || de{*filter*}("execute select project by project
> id","passed");

> This seems to work fine when the memo field is below 255 characters.

> For reference, the database_check sub routine does the error checking and
> depending on whether the de{*filter*} sub is enabled prints the error directly
> to browser/and or the database log file.  No errors show up in the
database
> log file, and nothing shows up in the trace log for the database either.

> It just returns zero results from the search.

> Since it isn't returning any errors I'm not sure if this is a constraint
of
> the DBI module or the ODBC interface.  I would love to have an actual
error
> to look at.

Figures a few more hours later, a switch is revealed.  Actually 2 of them
for long objects.

LongReadLen switch and TruncLongOk switch apparently have to be specified
just before the preparation of the select statement, and is only required
for the select statement, if my documentation reads correctly.



Fri, 15 Apr 2005 07:53:26 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Perl DBI won't return Access Memo fields

2. DBI to MSAccess DB - truncates memo fields

3. Module DBI - MS-Access and MEMO-Field

4. DBD::ODBC DBI and MS Access memo field

5. DBD::ODBC DBI and Microsoft Access memo field

6. DBD/DBI ODBC and Microsoft Access 97 memo field

7. DBI and MSAccess - memo fields truncated

8. Using xbase.pm to slurp up images fronm a memo field

9. DBD:ODBC and memo fields

10. ODBC and Access memo fields

11. Write memo fields to files

12. DBD::ODBC truncates Memo type Access field

 

 
Powered by phpBB® Forum Software