> I think, you should better describe what the actual problem is?

When using DBD::Proxy without my patch and dbish to test I get the
following error message when requesting a list of tables.

DBI::Shell: table_info failed: DBD::Proxy::st execute failed: Server returned error: 
Failed to execute method CallMethod: DBD::ODBC::db prepare failed:
[Microsoft][ODBC Microsoft Access Driver] 
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 
'UPDATE'. 
(SQL-37000)(DBD: st_prepare/SQLPrepare err=-1) at 
t:\devstudio\myprojects\perl\dbi-1.14\lib/DBI/ProxyServer.pm line 256.

What I traced down was the statement handle being created with "SHOW
TABLES" as the SQL.

> The "SHOW TABLES" thing is just, because the DBI specs require to
> return a statement handle, which in turn requires a "Statement"
> attribute. We could choose whatever else for "SHOW TABLES", it's
> merely a placeholder.

That's later prepared, again, as a statement a new statement handle.

sub execute

         undef $sth->{'proxy_data'}; The data returned from the table_info is gone.
...
my $rsth = $sth->{proxy_sth};  This is undefined.
...                                                                        
if (!$rsth) {
...
($rsth, $numFields, $numParams, $names, $types, $numRows, @outParams) =
    eval { $rdbh->prepare($sth->{'Statement'},
                          $sth->{'proxy_attr'}, $params) };
return DBI::set_err($sth, 1, $@) if $@;

Here the SQL statement "SHOW TABLES" is prepared against the remote server, it
fails returning an error message.

Does this better describe the problem?

Tom


[t:\devstudio\myprojects\perl\proxy]set DBI_AUTOPROXY=hostname=localhost;port=1234

[t:\devstudio\myprojects\perl\proxy]dbish
DBI::Shell 10.7 using DBI 1.14

WARNING: The DBI::Shell interface and functionality are
=======  very likely to change in subsequent versions!


Use of uninitialized value in length at T:/Perl-5.6/site/lib/DBI/Shell.pm line 734.
Connecting to 'dbi:ODBC:photo' as ''...
@dbi:ODBC:photo> /tab
DBI::Shell: table_info failed: DBD::Proxy::st execute failed: Server returned error: 
Failed to execute method CallMethod: DBD::ODBC:
:db prepare failed: [Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; 
:expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'. (SQL-37000)(DBD: 
:st_prepare/SQLPrepare err=-1) at 
:t:\devstudio\myprojects\perl\dbi-1.14\lib/DBI/ProxyServer.pm lin

[t:\devstudio\myprojects\perl\dbi-1.14]dbish
Argument "1.1.1.1 " isn't numeric in addition (+) at lib/DBI/Format.pm line 26.
DBI::Shell 10.7 using DBI 1.14

WARNING: The DBI::Shell interface and functionality are
=======  very likely to change in subsequent versions!


Connecting to 'dbi:ODBC:photo' as ''...
@dbi:ODBC:photo> /ta
TABLE_CAT,TABLE_SCHEM,TABLE_NAME,TABLE_TYPE,REMARKS
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'MSysAccessObjects','SYSTEM
 TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'MSysACEs','SYSTEM 
TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'MSysObjects','SYSTEM 
TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'MSysQueries','SYSTEM 
TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'MSysRelationships','SYSTEM
 TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'bb','TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'bbb','TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'bt','TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'myt','TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'UserID','TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'xx','TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'yy','TABLE',undef
'T:\DevStudio\MyProjects\Perl\DBD-ADO\database\photos',undef,'myv','VIEW',undef
[13 rows of 5 fields returned]
@dbi:ODBC:photo>


On Thu, Mar 15, 2001 at 11:13:43PM +0100, Wiedmann, Jochen wrote:

> sorry for replying so late, but my time for Perl development
> gets fewer and fewer.

I understand that.

> >     I've included a patch to fix the a problem using table_info
> >     and DBD::Proxy.  Currently the DBD::Proxy attempts to execute a
> >     statement called "SHOW TABLES".
> 
> Sorry, but that's not the case. The table_info method of
> DBD::Proxy does indeed execute a table_info method on the server
> side:
> 
>     my($numFields, $names, $types, @rows) = eval { $rdbh->table_info(@_) };


-- 
Thomas A. Lowery        [EMAIL PROTECTED]
http://tlowery.hypermart.net

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to