RE: Problem running Perl DBD-DB2-0.78 on AIX 5.3 using the DB2 UDB v8.2 (on AIX 5.3) client libraries
Hi, I am having problems running DBI-1.48 using DBD-DB2-0.78. The issue is that when I run a make test prior to running a make install for the compilation of the Perl DBD-DB2-0.78 module on AIX 5.3 using the client libraries that come with DB2 UDB v8.2 (installed on AIX 5.3 as well) only 60% of the tests pass (The IBM VAC v6.0 C/C++ compiler was used for compilation) . The make install when invoked complains that it cannot load the following two libraries: libdb2.a and libdb2osse.a even though the $DB2_HOME directory is set using the export DB2_HOME=/db2home/db2fald1; both of the aforementioned libraries exist under the $DB2_HOME/sqllib/lib directory. The make install for the DBD-DB2-0.78 Perl module will compile without any fatal errors. However, when the DBI-1.48/ DBD-DB2-0.78 combination is called within the body of a main Perl script the following errors are produced: Can't load '/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/DBD/DB2/DB2.so ' for module DBD::DB2: 0509-022 Cannot load module /db2home/db2fald1/sqllib/lib/libdb2.a(shr.o). 0509-150 Dependent module /db2home/db2fald1/sqllib/lib/libdb2osse.a(shr.o) could not be loaded. 0509-152 Member shr.o is not found in archive 0509-022 Cannot load module /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/DBD/DB2/DB2.so. 0509-150 Dependent module /db2home/db2fald1/sqllib/lib/libdb2.a(shr.o) could not be loaded. at /usr/opt/perl5/lib/5.8.2/aix-thread-multi/DynaLoader.pm line 229. at ./falcon_bmg.pl line 5 Compilation failed in require at ./falcon_bmg.pl line 5. BEGIN failed--compilation aborted at ./falcon_bmg.pl line 5. It still complains about not being able to load the shared object libraries libdb2.a and libdb2osse.a ; any thoughts and/or insights you might have to possibly solve this, would be highly appreciated. Thanks C.L. Grassi
Pg 'v' Mysql primary_key_info() foreign_key_info()
Hi Folks At http://savage.net.au/Perl/list-indexes.pl you can download a demo program. Comments within the code are: # Set DBI_DSN=dbi:mysql:name-of-db # or DBI_DSN=dbi:Pg:dbname=name-of-db # Set DBI_USER=a-name # Set DBI_PASS=a-password Give the program 1 table name of an existing database on the command line, where there are other tables with foreign keys pointing to the primary key of that table. Here are my results: OS: GNU/Linux 2.4.21 Perl: 5.8.0 DBI 1.48 Postgres: 7.4.7 DBD::Pg: 1.42 Primary keys found: 1 (correct) Foreign keys found: 4 (correct) OS: WinXP Perl: 5.8.6 DBI: 1.48 MySQL: 4.1.10 DBD::mysql: 2.9007 Primary keys found: 0 (wrong) Foreign keys found: 0 (wrong) Where exactly is the error? I assume in my code (hope not) or in DBD::mysql. Could readers please run this code on their systems, and post their results here? TIA. -- Cheers Ron Savage, [EMAIL PROTECTED] on 22/06/2005 http://savage.net.au/index.html Let the record show: Microsoft is not an Australian company
DBI installation in windows
Hi, i want to use perl DBI for Using XML and Relational Databases with Perl. I am using a package called apachefriends/xampp, where perl comes with that package,which do not have the DBI package. so i want to install it, but i dont know much about perl as i am a php user. can someone please guide me how to incorporate DBI package for windows. Thanks babu - How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos
Re: Attempt to initiate a new SQL Server operation with results pending.
As far as I am aware this is a limitation of the TDS protocol used and your example code will not work unless you force a server-side cursor (see DBD::ODBC pod and look for odbc_SQL_ROWSET_SIZE but I warn you that you really will need to close everything i.e. force SQLFreeStmt(SQL_CLOSE) or you will get hangs). BTW, the example in the pod should be $dbh-{odbc_SQL_ROWSET_SIZE} = 2 not $dbh-{SQL_ROWSET_SIZE} = 2. I would seriously suggest you try and avoid multiple active statements - there is nearly always a SQL or some other way. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Jun-2005 Daniel Kasak wrote: Jeff Urlwin wrote: Hi all. I've just ( barely ) managed to get DBD::ODBC == UnixODBC == FreeTDS working on my system. I took a Perl-Gtk2 app which has been running fine, and substituted the old DBD::Sybase connection with the DBD::ODBC one, and then discovered I could only run one query on SQL Server, and then all subsequent queries gave: DBD::ODBC::st execute failed: [unixODBC][FreeTDS][SQL Server]Attempt to initiate a new SQL Server operation with results pending. (SQL-07005)(DBD: st_execute/SQLExecute err=-1) Damn! So I started going through my code and adding $sth-finish after all recordset operations, and that seems to be fixing things. Please see if you can provide a small, self-contained example. (i.e. one that creates tables and inserts data, then reproduces the problem, such that it can be run simply (or, feel free to add it to some of the DBD::ODBC t/20sqlserver.t tests, if you feel slightly more inclined), then I can refine the implementation to ensure that you don't have to call finish each time. It's supposed to be that way, but if it's not working, I'd like to know. It's been quite a while, but I've gotten around to building an example application. The application gives the 'Attempt to initiate a new SQL Server operation with results pending.' error and then exits when it can't fetch any data. It *should* fetch each row and dump the values to the console. I'm using DBD::ODBC, compiled against UnixODBC FreeTDS. The code below works if I use DBD::Sybase instead of DBD::ODBC You'll have to create a 'test' database in SQL Server, and change the password in the script below. Other than that ( and having a working DBD::ODBC setup ), it should be right to go. --- #!/usr/bin/perl use strict; use DBI; # Connect to SQL Server my $dbh = DBI-connect(dbi:ODBC:SQLServer, 'sa', '_ENTER_PASSWORD_HERE', {PrintError = 1}) || die Database connectin not made: $DBI::errstr; $dbh-do(use test); $dbh-do(create table some_table ( ID integer identity (1,1), CompanyName varchar(50), SomeNote varchar(255) )); my $sth = $dbh-prepare(insert into some_table ( CompanyName, SomeNote ) values ( ?, ? )); foreach my $company ( [ McDonalds, Wants monopoly on fast foods ], [ Monsanto, All-round evil company in food production ], [ BAE Systems,Manufactures Weapons of Mass Destruction (TM) ], [ Advanta BV, Poisons food supply with GM products ] ) { $sth-execute( $$company[0], $$company[1] ); } $sth = $dbh-prepare(select ID from some_table) || die $dbh-errstr; $sth-execute || die $dbh-errstr; while (my $row = $sth-fetchrow_hashref) { my $little_sth = $dbh-prepare(select * from some_table where ID= . $row-{ID}); $little_sth-execute; my $little_row = $little_sth-fetchrow_array; print Got some data: \n . Company: . $$little_row[0] . ... Note: . $$little_row[1]; } --- -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: [EMAIL PROTECTED] website: http://www.nusconsulting.com.au
´how to install perl DBI for windows
Hi, i want to use perl DBI for Using XML and Relational Databases with Perl. I am using a package called apachefriends/xampp, where perl comes with that package,which do not have the DBI package. so i want to install it, but i dont know much about perl as i am a php user. can someone please guide me how to incorporate DBI package for windows. Thanks babu - Yahoo! Messenger NEW - crystal clear PC to PCcalling worldwide with voicemail
RE: �how to install perl DBI for windows
-Original Message- From: babu [mailto:[EMAIL PROTECTED] Sent: 22 June 2005 09:52 To: dbi-users@perl.org Subject: ´how to install perl DBI for windows Hi, i want to use perl DBI for Using XML and Relational Databases with Perl. I am using a package called apachefriends/xampp, where perl comes with that package,which do not have the DBI package. so i want to install it, but i dont know much about perl as i am a php user. can someone please guide me how to incorporate DBI package for windows. Bring up a dos Cmd window ppm install DBI You will probably want to install some other modules that don't come presupplied, like the database driver (DBD) for the database you are using. For MySQL, this is DBD::Mysql. Ivor.
Building DBD::Oracle with Oracle 10g
Just a quick note you might want to add to the README.clients file for DBD::Oracle ... To build DBD::Oracle against a minimally built/configured instalation of Oracle 10g 10.1, download and unzip the Instant Client from Oracle's web site and then either copy the libraries to somewhere your OS knows about or set LD_LIBRARY_PATH. Then sacrifice a goat and chant ... perl Makefile.PL -m $ORACLE_HOME/rdbms/demo/demo_rdbms32.mk This is using Linux/x86 and perl 5.8.5. Presumably you'd substitute demo_rdbms64.mk on a 64 bit platform. -- David Cantrell | top google result for internet beard fetish club
Re: Building DBD::Oracle with Oracle 10g
On Wed, Jun 22, 2005 at 11:45:01AM +0100, David Cantrell wrote: Just a quick note you might want to add to the README.clients file for DBD::Oracle ... To build DBD::Oracle against a minimally built/configured instalation of Oracle 10g 10.1, download and unzip the Instant Client from Oracle's web site and then either copy the libraries to somewhere your OS knows about or set LD_LIBRARY_PATH. Then sacrifice a goat and chant ... perl Makefile.PL -m $ORACLE_HOME/rdbms/demo/demo_rdbms32.mk This is using Linux/x86 and perl 5.8.5. Presumably you'd substitute demo_rdbms64.mk on a 64 bit platform. I'm glad that worked for you, but I suspect it's not a reliable recipe. Better built-in support for Instant Client should be in the next release. Tim.
export in perl
Hi Conrad, I have a doubt regarding the usage of export.pm. The doubt is I have an xx.pl file which uses yy.pm (use yy;) Now this yy.pm has all subroutines and it tooo uses some other packages.. Now the doubt is, if I call some subroutine of yy.pm in xx.pl which isn't mentioned in @EXPORT = qw() of yy.pm . would it work in xx.pl I know the ones mentioned for the EXPORT would be inherited to the caller's namespace by default. I thought for the subroutines not mentioned in EXPORT could be used by other packages only in their complete qualified form. Ie (yy::sample) and not by simply calling sample() in xx.pl Please correct me if I am wrong. Thanks, Vamsi Satyam computers Ltd DISCLAIMER: This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
Re: Attempt to initiate a new SQL Server operation with results pending.
Hi, You should only have to clear the statement if you are fetching a single row or fetching into a set variables. This will happen even if the result set on the backend contains only one record. If you are fetching row by row in a loop, fetching one more time beyond the last record should clear out the result table. If you execute a command that fetches all the rows, I would think you shouldn't see the problem. (the code should take care of this) The fact that the older connection didn't exhibit this problem may be that it calls a diffent set of lib calls in TDS that cleans up after itself, or, the module cleans up after itself. I have seen this dual behavior in another product that I use to connect to sybase, Studio. If I use their V2 dams, I don't have to worry about cleared result sets. If use their newer, object oriented V3 dams, I have to execute a StatementObj.$clear after any $fetch into a row or fetchinto a set of variables, even if the query is expected to find only one row. When I fetch into a list, the dam clears out the result set (presumably, the internal code executes row fetches until it receives no return) terry
OCI.dll cannot be found
Thanks for all the great help! When I try and connect to the Oracle server I get the following Unable to Locate Component error box: This application has failed to start because OCI.dll was not found. Re-installing the application may fix this problem. The OCI.dll is installed as part of the Oracle Thick Client. Do I have to have this client installed on my machine to connect to an Oracle server? I have not had to have a client installed to interface with a MySql database. I am running Windows XP Pro, Perl 5.8.4, and DBD-Oracle9-1.16. I am trying to go against an Oracle 9i database. Thanks for all the previous great help! I am getting close, Larry Lords -- This message may contain confidential information, and is intended only for the use of the individual(s) to whom it is addressed. --
RE: OCI.dll cannot be found
Can you log in via sqlplus from the \OCI directory? Also did you make sure you set the proper environmental variables in your environment? On XP you need (at least) NLS_LANG=american_america.we8iso8859p1 (or you may have funky script issues) ORACLE_HOME=c:\orahome1 (or whatever yours is) ORACLE_SID=yoursid -Matt -Original Message- From: Larry Lords [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 22, 2005 1:08 PM To: dbi-users@perl.org Subject: OCI.dll cannot be found Thanks for all the great help! When I try and connect to the Oracle server I get the following Unable to Locate Component error box: This application has failed to start because OCI.dll was not found. Re-installing the application may fix this problem. The OCI.dll is installed as part of the Oracle Thick Client. Do I have to have this client installed on my machine to connect to an Oracle server? I have not had to have a client installed to interface with a MySql database. I am running Windows XP Pro, Perl 5.8.4, and DBD-Oracle9-1.16. I am trying to go against an Oracle 9i database. Thanks for all the previous great help! I am getting close, Larry Lords -- This message may contain confidential information, and is intended only for the use of the individual(s) to whom it is addressed. --
Connection Issue with DBI::DBD::mysql
Hi everyone, Trying to connect to a MySQL database from a Linux Server using PERL to a Windows Machine with a MySQL database (5.0.6). I can connect successfully on the windows box but cannot on the Linux server! I ran a SQLTRACE (DBD) with the following output: imp_dbh-connect: dsn = database=userdb:hostname=192.168.2.113:port=3307, uid = user1, pwd = user1 imp_dbh-MyLogin: dbname = userdb, uid = user1, pwd = user1,host = 192.168.2.113, port = 3307 imp_dbh-mysql_dr_connect: host = 192.168.2.113, port = 3307, uid = user1, pwd = user1 imp_dbh-mysql_dr_connect: client_flags = 2 imp_dbh-mysql_dr_connect: -Access denied for user 'user1'@'192.168.3.90' (using password: YES) error 1045 recorded: Access denied for user 'user1'@'192.168.3.90' (using password: YES) What disturbs me is that the return error comes back with a different IP address than what I sent out. Anyone have any idea as to why? That would seem to be the problem with the access denied! The machine address that issues the connect is 192.168.3.190 but the address comming back is totally different. George __ Switch to Netscape Internet Service. As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register Netscape. Just the Net You Need. New! Netscape Toolbar for Internet Explorer Search from anywhere on the Web and block those annoying pop-ups. Download now at http://channels.netscape.com/ns/search/install.jsp
Re: Connection Issue with DBI::DBD::mysql
Sounds like a windows feature, does user1 have an account on the windows host ? are you using any type of firewall or other security related software ? [EMAIL PROTECTED] wrote: Hi everyone, Trying to connect to a MySQL database from a Linux Server using PERL to a Windows Machine with a MySQL database (5.0.6). I can connect successfully on the windows box but cannot on the Linux server! I ran a SQLTRACE (DBD) with the following output: imp_dbh-connect: dsn = database=userdb:hostname=192.168.2.113:port=3307, uid = user1, pwd = user1 imp_dbh-MyLogin: dbname = userdb, uid = user1, pwd = user1,host = 192.168.2.113, port = 3307 imp_dbh-mysql_dr_connect: host = 192.168.2.113, port = 3307, uid = user1, pwd = user1 imp_dbh-mysql_dr_connect: client_flags = 2 imp_dbh-mysql_dr_connect: -Access denied for user 'user1'@'192.168.3.90' (using password: YES) error 1045 recorded: Access denied for user 'user1'@'192.168.3.90' (using password: YES) What disturbs me is that the return error comes back with a different IP address than what I sent out. Anyone have any idea as to why? That would seem to be the problem with the access denied! The machine address that issues the connect is 192.168.3.190 but the address comming back is totally different. George __ Switch to Netscape Internet Service. As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register Netscape. Just the Net You Need. New! Netscape Toolbar for Internet Explorer Search from anywhere on the Web and block those annoying pop-ups. Download now at http://channels.netscape.com/ns/search/install.jsp
Re: Attempt to initiate a new SQL Server operation with results pending.
Terence, I could be wrong but from what little I remember from TDS I think that unless you enable a server-side cursor, once you start retrieving data from the server you have no choice but to keep reading it until it is exhausted - this is why SQL Server ODBC driver only supports 1 active statement (by default). When you enable server-side cursors the whole ball game changes. The code previously posted works when you do this. Not that I'm saying your statement contradicts this - certainly, fetching all the data on one statement satisfies the continue reading until nothing left. The problem comes when you start fetching on one statement (not complete) and then attempt to create a new active statement. To my knowledge, nothing other than server-side cursors or closing one cursor before opening another gets around this. The posted code attempts to get two open/active statements. If you start fetching on one statement then close (in DBI terms finish) it the ODBC driver still has to read the remaining data - you can demonstrate this quite easily by selecting a long image/text column from a table, reading a few bytes then closing the statement - the close takes a long time (as even though you didn't need it the ODBC driver has to read the rest of the text/image data) before it can start a new request. Martin Terence J. Young, D.C. wrote: Hi, You should only have to clear the statement if you are fetching a single row or fetching into a set variables. This will happen even if the result set on the backend contains only one record. If you are fetching row by row in a loop, fetching one more time beyond the last record should clear out the result table. If you execute a command that fetches all the rows, I would think you shouldn't see the problem. (the code should take care of this) The fact that the older connection didn't exhibit this problem may be that it calls a diffent set of lib calls in TDS that cleans up after itself, or, the module cleans up after itself. I have seen this dual behavior in another product that I use to connect to sybase, Studio. If I use their V2 dams, I don't have to worry about cleared result sets. If use their newer, object oriented V3 dams, I have to execute a StatementObj.$clear after any $fetch into a row or fetchinto a set of variables, even if the query is expected to find only one row. When I fetch into a list, the dam clears out the result set (presumably, the internal code executes row fetches until it receives no return) terry
Re: Attempt to initiate a new SQL Server operation with results pending.
Martin J. Evans wrote: As far as I am aware this is a limitation of the TDS protocol used and your example code will not work unless you force a server-side cursor (see DBD::ODBC pod and look for odbc_SQL_ROWSET_SIZE but I warn you that you really will need to close everything i.e. force SQLFreeStmt(SQL_CLOSE) or you will get hangs). I see. Sounds good. BTW, the example in the pod should be $dbh-{odbc_SQL_ROWSET_SIZE} = 2 not $dbh-{SQL_ROWSET_SIZE} = 2. Just tried that. Doesn't seem to have any effect on my system. Here's the line I added right after create $dbh : $dbh-{odbc_SQL_ROWSET_SIZE} = 2; I would seriously suggest you try and avoid multiple active statements - there is nearly always a SQL or some other way. Perhaps. To be honest I'm not that concerned. If it was DBD::mysql I'd be mortified, but I don't have too much to do with SQL server, so I'll just create lots of $dbh things and -finish all the statements and hope that things hold together while I'm sitting around twiddling my thumbs waiting for MySQL-5.0.x to stabalise ( stored procedures views ). Thanks for your help. -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: [EMAIL PROTECTED] website: http://www.nusconsulting.com.au
Re: Problem running Perl DBD-DB2-0.78 on AIX 5.3 using the DB2 UDB v8.2 (on AIX 5.3) client libraries
Chris: This sounds very much like the problem noted under Hints at http://www-306.ibm.com/software/data/db2/perl/: Having trouble running perl with DB2 UDB Version 8 64-bit for AIX 5.2? Check out this technote. (http://www-1.ibm.com/support/docview.wss?rs=71context=SSEPGGuid=swg21181032loc=en_UScs=utf-8lang=en) which goes on to describe an incompatibility between 32-bit and 64-bit libraries (and a solution, thankfully!) Dan On 6/21/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I am having problems running DBI-1.48 using DBD-DB2-0.78. The issue is that when I run a make test prior to running a make install for the compilation of the Perl DBD-DB2-0.78 module on AIX 5.3 using the client libraries that come with DB2 UDB v8.2 (installed on AIX 5.3 as well) only 60% of the tests pass (The IBM VAC v6.0 C/C++ compiler was used for compilation) . The make install when invoked complains that it cannot load the following two libraries: libdb2.a and libdb2osse.a even though the $DB2_HOME directory is set using the export DB2_HOME=/db2home/db2fald1; both of the aforementioned libraries exist under the $DB2_HOME/sqllib/lib directory. The make install for the DBD-DB2-0.78 Perl module will compile without any fatal errors. However, when the DBI-1.48/ DBD-DB2-0.78 combination is called within the body of a main Perl script the following errors are produced: Can't load '/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/DBD/DB2/DB2.so ' for module DBD::DB2: 0509-022 Cannot load module /db2home/db2fald1/sqllib/lib/libdb2.a(shr.o). 0509-150 Dependent module /db2home/db2fald1/sqllib/lib/libdb2osse.a(shr.o) could not be loaded. 0509-152 Member shr.o is not found in archive 0509-022 Cannot load module /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/DBD/DB2/DB2.so. 0509-150 Dependent module /db2home/db2fald1/sqllib/lib/libdb2.a(shr.o) could not be loaded. at /usr/opt/perl5/lib/5.8.2/aix-thread-multi/DynaLoader.pm line 229. at ./falcon_bmg.pl line 5 Compilation failed in require at ./falcon_bmg.pl line 5. BEGIN failed--compilation aborted at ./falcon_bmg.pl line 5. It still complains about not being able to load the shared object libraries libdb2.a and libdb2osse.a ; any thoughts and/or insights you might have to possibly solve this, would be highly appreciated. Thanks C.L. Grassi
Re: export in perl
On 06/22/2005 04:06 AM, Vamsi_Doddapaneni said: I have a doubt regarding the usage of export.pm. This is not a DBI question, you would be better off asking on a general Perl forum. -- Mac :}) ** I usually forward private questions to the appropriate mail list. ** Ask Smarter: http://www.catb.org/~esr/faqs/smart-questions.html Give a hobbit a fish and he eats fish for a day. Give a hobbit a ring and he eats fish for an age.