ANNOUNCE: Class::DBI 0.89
Class::DBI is a simple database-object mapping system. Simply point it at your database, set up some classes to represent your tables, tell it the relationships between your tables, and let it handle all the 'simple' SQL for you (more complex queries can be written in SQL). [See http://poop.sourceforge.net/ for comparison with similar modules] Version 0.89 of Class::DBI is the first version released to CPAN since 0.86. As such it contains many bug fixes and tweaks and a few new concepts. The biggest change is probably the might_have() method to set up 1 to 0/1 relationships. We also have a new (undocumented as yet) 'column_type' based on ideas from Matthew Simon Cavalletto and Tatsuhiko Miyagawa which can auto_inflate values to objects. So, for instance: __PACKAGE__-column_type(created = 'Date::Simple'); would make the result of your $obj-created() call be a Date::Simple object rather than a plain string. Other fixes and enhancements include: - better MySQL autoincrement code (fixes occassional problems under mod_perl) [Thanks to Tatsuhiko Miyagawa] - fix for hasa() and create() with modified accessor/mutator names (Thanks to Schwern) - handle primary/foreign key value of zero better (reported by Jim O'Brien) - brought delete triggers in line with documentation (reported by Barry Hoggard, fixed by Tatsuhiko Miyagawa) - deprecated many methods to avoid clashing with potential column names. These will remain until shortly before version 1.0 but will issue warnings if used. Available from CPAN, or http://www.tmtm.com/CPAN/Class-DBI-0.89.tar.gz Tony
Re: Help!
Yes, I have substitued -fPIC. but i have another error: gcc -c -xO3 -xdepend -DVERSION=\1.18\ -DXS_VERSION=\1.18\ -fPIC -I/usr/perl5/5.00503/sun4-solaris/CORE -DDBI_NO_THREADS Perl.c gcc: language depend not recognized gcc: Perl.c: linker input file unused since linking not done /bin/perl -I/usr/perl5/5.00503/sun4-solaris -I/usr/perl5/5.00503 /usr/perl5/5.00503/ExtUtils/xsubpp -typemap /usr/perl5/5.00503/ExtUtils/typemap DBI.xs xstmp.c mv xstmp.c DBI.c gcc -c -xO3 -xdepend -DVERSION=\1.18\ -DXS_VERSION=\1.18\ -fPIC -I/usr/perl5/5.00503/sun4-solaris/CORE -DDBI_NO_THREADS DBI.c gcc: language depend not recognized gcc: DBI.c: linker input file unused since linking not done Running Mkbootstrap for DBI () chmod 644 DBI.bs LD_RUN_PATH= cc -o blib/arch/auto/DBI/DBI.so -G DBI.o /usr/ucb/cc: language optional software package not installed *** Error code 1 make: Fatal error: Command failed for target `blib/arch/auto/DBI/DBI.so' Do you known about this error? jingyuan. Andrew Crum wrote: Yes. gcc does not understand -KPIC. For gcc, substitute -fPIC. Look for it in the Makefile.PL or possibly in the Makefile generated by 'make Makefile.PL'. At 03:55 PM 6/21/2002 +0200, you wrote: Hallo, I have tried to install the Mysql module. By the instruction of http://www.mysql.com/doc/P/e/Perl_installation.html I have a problem in the 3 step:make!!!(I have the sun solaris 8 system.) I have following errors:gcc -c -xO3 -xdepend -DVERSION=\2.101\ -DXS_VERSION=\2.101\ -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE Dumper.c gcc: unrecognized option `-KPIC' gcc: language depend not recognized gcc: Dumper.c: linker input file unused since linking not done LD_RUN_PATH= gcc -o blib/arch/auto/Data/Dumper/Dumper.so -G Dumper.o gcc: Dumper.o: No such file or directory gcc: No input files *** Error code 1 make: Fatal error: Command failed for target `blib/arch/auto/Data/Dumper/Dumper.so' I can't understand option `-KPIC'. Can anybody help me? jingyuan. -- Sitz: Unter den Linden 6, Raum 1054d Telefon:+49 (030) 2093-2667 E-Mail:[EMAIL PROTECTED] Postanschrift:Humboldt-Universität zu Berlin ZE Rechenzentrum Unter den Linden 6 10099 Berlin Aufgabengebiet(e):xml Portal,OAI -- Sitz: Unter den Linden 6, Raum 1054d Telefon:+49 (030) 2093-2667 E-Mail:[EMAIL PROTECTED] Postanschrift:Humboldt-Universität zu Berlin ZE Rechenzentrum Unter den Linden 6 10099 Berlin Aufgabengebiet(e):xml Portal,OAI
Re: DBI Author?
On Sun, 23 Jun 2002 21:41:28 -0700 (PDT), Clarence Snivellwitz wrote: Can someone tell me who authored the DBI module? I'm trying to locate the documentation on CPAN, and I come up with too many results when I use just use DBI for the search. You shouldn't bother the author of such a widely used module with such basic questions. If everybody did that, he wouldn't have a chance to do anything else in his life. It's a good thing you found this mailing list, if you're having any questions that you can't resolve yourself, this is the place to ask. You can start exploring at DBI's homepage; http://dbi.perl.org. There's a bunch of links there, with, oddly enough, one major exception: DBI's very own docs that come with the module. Well, you can find those on CPAN, at (very narrow search) http://search.cpan.org/search?dist=DBI. All clickable links from the heading Modules downward, are documentation. Start with DBI and maybe DBI::FAQ (which appears to be on the homepage as well). If you find there's still too much to read, you can get the DBI book from O'Reilly, which gets plugged in a highly visible manner on the DBI homepage. It will cost you some money, but nothing else will get you up and running as fast as this book. -- Bart.
Re: Can't bind unknown placeholder ':p2' (2)
Attached is my entire perl script, and the DBI-trace(2) output that I created with it. Just as a reminder, I am running Red Hat 7.3, and oracle client 8.1.7. I installed all of the compatibility libraries and set ORACLE_HOME, ORACLE_SID, and LD_ASSUME_KERNEL=2.2.5 before I set any of those, I source /usr/i386-glibc21-linux/bin/i386-glibc21-linux-env.sh so that I can even run the sqlplus client. Please let me know if you need any more information. Dave Totten On Sat, Jun 22, 2002 at 07:56:00PM +0100, Tim Bunce wrote: Please include the current code and corresponding trace file. Thanks. Tim. On Thu, Jun 20, 2002 at 06:26:07PM +0100, David Totten wrote: On Thu, Jun 20, 2002 at 01:07:23PM -0400, Ronald J Kimball wrote: Now I am getting: Can't bind :p1, ora_type 2 not supported by DBD::Oracle at load.pl line 118. Does it work if you don't specify the type for the numeric argument? It shouldn't be necessary. Well, if I do that, I get the following: DBD::Oracle::st execute failed: ORA-00932: inconsistent datatypes: expected NUMBER got CLOB (DBD ERROR: OCIStmtExecute) at load.pl line 120. Error message was: DBI::db=HASH(0x824fd28)-errstr For the change, all I did was remove the ora_type = ORA_NUMBER part. Dave Totten DBI 1.25-nothread dispatch trace level set to 2 - DBI-connect(DBI:Oracle:fred2_neon, dave, , HASH(0x80fbb0c)) - DBI-install_driver(Oracle) for linux perl=5.006001 pid=13646 ruid=501 euid=501 install_driver: DBD::Oracle version 1.12 loaded from /usr/lib/perl5/site_perl/5.6.1/i386-linux/DBD/Oracle.pm - install_driver= DBI::dr=HASH(0x81adae0) - connect for DBD::Oracle::dr (DBI::dr=HASH(0x81adae0)~0x824fbec 'fred2_neon' 'dave' HASH(0x8189488)) - connect= DBI::db=HASH(0x824fbbc) at DBI.pm line 491 - STORE for DBD::Oracle::db (DBI::db=HASH(0x824fb2c)~INNER 'PrintError' 1) - STORE= 1 at DBI.pm line 533 - STORE for DBD::Oracle::db (DBI::db=HASH(0x824fb2c)~INNER 'AutoCommit' 1) - STORE= 1 at DBI.pm line 533 - STORE for DBD::Oracle::db (DBI::db=HASH(0x824fb2c)~INNER 'LongTruncOk' 0) - STORE= 1 at DBI.pm line 536 - connect= DBI::db=HASH(0x824fbbc) - prepare for DBD::Oracle::db (DBI::db=HASH(0x824fbbc)~0x824fb2c 'insert into dave2 (idnum, xml) values (?, ?)') dbd_preparse scanned 2 distinct placeholders - prepare= DBI::st=HASH(0x824fcac) at load2.pl line 85 - bind_param for DBD::Oracle::st (DBI::st=HASH(0x824fcac)~0x824fb14 1 1) bind :p1 == 1 (type 0) bind :p1 == 1 (size 1/2/0, ptype 5, otype 1) - bind_param= 1 at load2.pl line 86 - bind_param for DBD::Oracle::st (DBI::st=HASH(0x824fcac)~0x824fb14 2 '?xml version=1.0 encoding=UTF-8? !DOCTYPE sciserv PUBLIC -//ScienceServer LLC//DTD SciServ 2.1//EN http://192.246.204.91:1959/dtd/sciserv.dtd; !-- This data came from the following dataset: /bb3/sdos_1998/OHL0103A T1 LINE: 23911 T2 LINE: 23913 T3 LINE: 24039 Supplemental SGML data came from: /bb3/sdos_1998/OHL0103A/00100277/V0062I01//0780.SGC -- sciserv dtdver=2 d...') bind :p2 == '?xml version=1.0 encoding=UTF-8? !DOCTYPE sciserv PUBLIC -//ScienceServer LLC//DTD SciServ 2.1//EN http://192.246.204.91:1959/dtd/sciserv.dtd; !-- This data came from the following dataset: /bb3/sdos_1998/OHL0103A T1 LINE: 23911 T2 LINE: 23913 T3 LINE: 24039 Supplemental SGML data came from: /bb3/sdos_1998/OHL0103A/00100277/V0062I01//0780.SGC -- sciserv dtdver=2 d...' (type 0) bind :p2 == '?xml version=1.0 encoding=UTF-8? !DOCTYPE sciserv PUBLIC -//ScienceServer LLC//DTD SciServ 2.1//EN http://192.246.204.91:1959/dtd/sciserv.dtd; !-- This data came from the following dataset: /bb3/sdos_1998/OHL0103A T1 LINE: 23911 T2 LINE: 23913 T3 LINE: 24039 Supplemental SGML data came from: /bb3/sdos_1998/OHL0103A/00100277/V0062I01//0780.SGC -- sciserv dtdver=2 d...' (size 5556/5557/0, ptype 4, otype 1) - bind_param= 1 at load2.pl line 87 - execute for DBD::Oracle::st (DBI::st=HASH(0x824fcac)~0x824fb14) dbd_st_execute INSERT (out0, lob0)... !! ERROR: 1461 'ORA-01461: can bind a LONG value only for insert into a LONG column (DBD ERROR: OCIStmtExecute)' - execute= undef at load2.pl line 89 DBD::Oracle::st execute failed: ORA-01461: can bind a LONG value only for insert into a LONG column (DBD ERROR: OCIStmtExecute) at load2.pl line 89. - finish for DBD::Oracle::st (DBI::st=HASH(0x824fcac)~0x824fb14) - finish= 1 at load2.pl line 92 - disconnect for DBD::Oracle::db (DBI::db=HASH(0x824fbbc)~0x824fb2c) - disconnect= 1 at load2.pl line 31 -- DBI::END - disconnect_all for DBD::Oracle::dr (DBI::dr=HASH(0x81adae0)~0x824fbec) - disconnect_all= '' at DBI.pm line 553 - DESTROY for
Problems while running perl with Oracle DBI as CGI by Apache
Hi, starting the following Perl-Script located in cgi-bin-directory through a web browser a problem with the dbd::Oracle module occurs: #! /usr/bin/perl use DBI; $dbhp = DBI-connect('DBI:Oracle:host=billix;sid=phoenix', 'username', 'password', { RaiseError = 1, AutoCommit = 1 }); with the error message: install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.005/i586-linux/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.1.0: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.00503/i586-linux/DynaLoader.pm line 169. at (eval 1) line 3 at /usr/local/httpd/cgi-bin/kunden_aus_phoenix.pl line 14 [Mon Jun 24 14:35:08 2002] [error] [client 172.16.4.90] Premature end of script headers: /usr/local/httpd/cgi-bin/kunden_aus_phoenix.pl We already changed all the access rights so that is allowed everything (intranet server, so no problem) but this didn't help either. While running the script from console we do not have any problems. Any ideas? Maybe the apache user? Thanks for your help Thomas
AW: Exporting umlaut characters using DBD::Oracle
I think it's the other way round: On the client side (perl cgi) set NLS_LANG=GERMAN_GERMANY.WE8ISO8859P1;export NLS_LANG (syntax: NLS_LANG = language_territory.charset) Yes, indeed. Like this it worked. Thanks for your help. Thomas
Re: DBI Author?
On Sun, Jun 23, 2002 at 09:41:28PM -0700, Clarence Snivellwitz wrote: Can someone tell me who authored the DBI module? I'm trying to locate the documentation on CPAN, and I come up with too many results when I use just use DBI for the search. Giving a search engine a single word rarely leads to happiness. I think you'll find that author of the DBI will give good results. :-) Tim.
Re: DBI Author?
And it wouldn't happen to be Tim Bunce would it? Oh, and some fellow by the name of Alligator Descartes?? You are too modest Tim! I have been using the DBI for at least 5 years now and it is the one module I totally rely upon to get my work done. Maybe it doesn't get said often enough, but thank you from a truly appreciative user! John Day Words Images Toronto, Canada At 02:52 PM 6/24/2002 +0100, Tim Bunce wrote: On Sun, Jun 23, 2002 at 09:41:28PM -0700, Clarence Snivellwitz wrote: Can someone tell me who authored the DBI module? I'm trying to locate the documentation on CPAN, and I come up with too many results when I use just use DBI for the search. Giving a search engine a single word rarely leads to happiness. I think you'll find that author of the DBI will give good results. :-) Tim.
Re: HELP ME !! Can't locate object method connect via package DBI
On Mon, 24 Jun 2002 11:23:51 -0400, [EMAIL PROTECTED] wrote: i have the following problem: can't locate object method connect via package DBI. Does your script even do: use DBI; ? -- Bart.
FW: HELP ME !! Can't locate object method connect via package DBI
German, Estoy apesadumbrado. No tengo ninguna experiencia con el perlcc. --Thunder dbi-users, TRANSLATION: When I execute with Perl, I don't have any problems. When I do an executable with perlcc, at the moment I execute the archive, I get the message 'Can't locate object method connect via package DBI' -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 8:47 AM To: PARLEY,JON (HP-MountainView,ex1) Subject: RE: HELP ME !! Can't locate object method connect via package DBI Importance: High Cuando lo ejecuto con Perl no tengo problemas pero cuando hago un ejecutable con perlcc al momento de ejecutar el archivo me sale el mensaje Can't locate object method connect via package DBI El codigo es super simple: Agradezco desde ya su ayuda es de vital importancia. #!/usr/local/bin/perl -w use DBI; $dbh; $sth; { $v_dbname = $ENV{ORACLE_SID}; $v_userDB = 'fa'; $v_passDB = 'af1'; $v_dbd = 'Oracle'; #= Conexión a BD $dbh=DBI-connect($v_dbname,$v_userDB,$v_passDB,$v_dbd) || die Error de Conexión: $DBI::errstr. \n; $sth=$dbh-prepare( select to_char(sysdate, 'dd/mm/ hh24:mm:dd') from dual ); $sth-execute; @row=$sth-fetchrow_array; print La fecha del sistema es: $row[0]\n; } Muy atentamente, Germán Marambio Vargas -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 8:24 AM To: [EMAIL PROTECTED] Subject: HELP ME !! Can't locate object method connect via package DBI Hi dears Excuseme, my english is very poor. My Name is Germán i live in Chile(South America), i have the following problem: can't locate object method connect via package DBI. If your have the solution help me, please...!!! How can solution? Thanks a lot Muy atentamente, Germán Marambio Vargas
Re: need execute perms?
1.. Have you made the scripts executable? by using CHMOD 755 or something similar. You can often do this in your ftp client. 2.. Who is your provider, so we may all studiously avoid them in the future? John Day Words Images Toronto, Canada At 11:07 AM 6/24/2002 -0400, Nick Hoffman [UWO] wrote: Hi. The hosting company that I am with says that you only need execute for scripts permissions to run Perl scripts in my cgi-bin directory. However, I'm unable to run *any* of my scripts. Might anyone know why that may be? Whenever I try to, I get a 403.1 Forbidden: Execute Access Forbidden. The hosting company refuses to tell me how to get my scripts working, and cling to this motto We provide accessibility, not functionality. So, I have no idea how to get my scripts going. Below is one of my many scripts that simply won't run. Thanks for your help Nick Hoffman #!perl\perl.exe use DBI; use strict; use CGI::Carp qw(fatalsToBrowser); #data source name my ($dsn) = DBI:ODBC:ebahoops; #for holding the username and password that the user entered my (username, password); #for holding the usernameS and passwordS in the pwd file my (unames, pwds); #whether the username and password exist AND match my ($match) = false; #file that holds the different EBA divisions my ($DivisionsFile) = divisions.dat; my (division_contents); #path to pwd file my ($pwd_file) = dont_delete.dat; #for converting query string my ($NameValue, $Name, $Value); #array for holding query data my (data); #database and statement handles my ($dbh); my ($sth); #array for holding team names and numbers my (COEDTeamNames, COEDTeamNums, COEDDivisions); my (BoysTeamNames, BoysTeamNums, BoysDivisions); my (GirlsTeamNames, GirlsTeamNums, GirlsDivisions); #temp vars my (temp, params, $counter, $temp); #put each param into the array params = split(, $ENV {'QUERY_STRING'}); #convert ugly chars to regular chars $counter = 0; while (params[$counter]) { ($Name, $Value) = split(=, params[$counter]); $Value =~ tr/+/ /; $Value =~ s/%([\dA-Fa-f][\dA-Fa-f])/ pack (C, hex($1))/eg; params[$counter] = $Name . = . $Value; $counter++; } print HTMLSTUFF; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta name=description content=The Official Etobicoke Basketball Association's Web Page meta name=keywords content=EBA, Etobicoke Basketball Association, Basketball, League, BBall, Ball, Sport, Sports, fun, games, activity, activities, net titleEtobicoke Basketball Association - Registration Form/title /head body bgcolor=#FF link=#FF vlink=#FF alink=#FF table border=0 cellpadding=0 cellspacing=0 width=600 tr td valign=top width=600 table border=0 cellpadding=0 cellspacing=0 width=100% tr td colspan=2 center table border=3 cellpadding=10 cellspacing=0 tr td center bETOBICOKE BASKETBALL ASSOCIATION/bbr bAdministration Page/b /center /td /tr /table /center /td /tr tr td width=70%nbsp;/td td width=30%nbsp;/td /tr HTMLSTUFF ; if ((params[0] !~ username=) || (params[1] !~ password=)) { #if the username or password isn't specified, ask for it print form action=\edit_teams.pl\ method=\get\ tr td width=70%Username:/td td width=30%input type=text size=12 maxlength=12 name=username/td /tr tr td width=70%Password/td td width=30%input type=password size=12 maxlength=12 name=password/td /tr tr td width=70%nbsp;/td td width=30%nbsp;/td /tr tr td colspan=2centerinput type=submit value=\Submit\
RE: need execute perms?
My domain is being hosted on an NT server, so I can't chmod it unfortunately. As for my hoster, they're called NEXTwebhosting. Thanks, Nick -Original Message- From: John Day [mailto:[EMAIL PROTECTED]] Sent: June 24, 2002 11:52 AM To: DBI-Users Subject: Re: need execute perms? 1.. Have you made the scripts executable? by using CHMOD 755 or something similar. You can often do this in your ftp client. 2.. Who is your provider, so we may all studiously avoid them in the future? John Day Words Images Toronto, Canada At 11:07 AM 6/24/2002 -0400, Nick Hoffman [UWO] wrote: Hi. The hosting company that I am with says that you only need execute for scripts permissions to run Perl scripts in my cgi-bin directory. However, I'm unable to run *any* of my scripts. Might anyone know why that may be? Whenever I try to, I get a 403.1 Forbidden: Execute Access Forbidden. The hosting company refuses to tell me how to get my scripts working, and cling to this motto We provide accessibility, not functionality. So, I have no idea how to get my scripts going. Below is one of my many scripts that simply won't run. Thanks for your help Nick Hoffman #!perl\perl.exe use DBI; use strict; use CGI::Carp qw(fatalsToBrowser); #data source name my ($dsn) = DBI:ODBC:ebahoops; #for holding the username and password that the user entered my (@username, @password); #for holding the usernameS and passwordS in the pwd file my (@unames, @pwds); #whether the username and password exist AND match my ($match) = false; #file that holds the different EBA divisions my ($DivisionsFile) = divisions.dat; my (@division_contents); #path to pwd file my ($pwd_file) = dont_delete.dat; #for converting query string my ($NameValue, $Name, $Value); #array for holding query data my (@data); #database and statement handles my ($dbh); my ($sth); #array for holding team names and numbers my (@COEDTeamNames, @COEDTeamNums, @COEDDivisions); my (@BoysTeamNames, @BoysTeamNums, @BoysDivisions); my (@GirlsTeamNames, @GirlsTeamNums, @GirlsDivisions); #temp vars my (@temp, @params, $counter, $temp); #put each param into the array @params = split(, $ENV {'QUERY_STRING'}); #convert ugly chars to regular chars $counter = 0; while (@params[$counter]) { ($Name, $Value) = split(=, @params[$counter]); $Value =~ tr/+/ /; $Value =~ s/%([\dA-Fa-f][\dA-Fa-f])/ pack (C, hex($1))/eg; @params[$counter] = $Name . = . $Value; $counter++; } print HTMLSTUFF; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta name=description content=The Official Etobicoke Basketball Association's Web Page meta name=keywords content=EBA, Etobicoke Basketball Association, Basketball, League, BBall, Ball, Sport, Sports, fun, games, activity, activities, net titleEtobicoke Basketball Association - Registration Form/title /head body bgcolor=#FF link=#FF vlink=#FF alink=#FF table border=0 cellpadding=0 cellspacing=0 width=600 tr td valign=top width=600 table border=0 cellpadding=0 cellspacing=0 width=100% tr td colspan=2 center table border=3 cellpadding=10 cellspacing=0 tr td center bETOBICOKE BASKETBALL ASSOCIATION/bbr bAdministration Page/b /center /td /tr /table /center /td /tr tr td width=70%nbsp;/td td width=30%nbsp;/td /tr HTMLSTUFF ; if ((@params[0] !~ username=) || (@params[1] !~ password=)) { #if the username or password isn't specified, ask for it print form action=\edit_teams.pl\ method=\get\ tr td width=70%Username:/td td width=30%input type=text size=12 maxlength=12 name=username/td /tr tr
Re: FW: HELP ME !! Can't locate object method connect via package DBI
Muchas gracias de todas maneras, si sabes algo por favor te le agradeceré... Muy atentamente, Germán Marambio Vargas PARLEY,JON (HP-MountainVi To: '[EMAIL PROTECTED]' [EMAIL PROTECTED], ew,ex1) '[EMAIL PROTECTED]' [EMAIL PROTECTED] jon_parley@hp cc: .comSubject: FW: HELP ME !! Can't locate object method connect via package DBI 24-06-2002 11:50 AM German, Estoy apesadumbrado. No tengo ninguna experiencia con el perlcc. --Thunder dbi-users, TRANSLATION: When I execute with Perl, I don't have any problems. When I do an executable with perlcc, at the moment I execute the archive, I get the message 'Can't locate object method connect via package DBI' -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 8:47 AM To: PARLEY,JON (HP-MountainView,ex1) Subject: RE: HELP ME !! Can't locate object method connect via package DBI Importance: High Cuando lo ejecuto con Perl no tengo problemas pero cuando hago un ejecutable con perlcc al momento de ejecutar el archivo me sale el mensaje Can't locate object method connect via package DBI El codigo es super simple: Agradezco desde ya su ayuda es de vital importancia. #!/usr/local/bin/perl -w use DBI; $dbh; $sth; { $v_dbname = $ENV{ORACLE_SID}; $v_userDB = 'fa'; $v_passDB = 'af1'; $v_dbd = 'Oracle'; #= Conexión a BD $dbh=DBI-connect($v_dbname,$v_userDB,$v_passDB,$v_dbd) || die Error de Conexión: $DBI::errstr. \n; $sth=$dbh-prepare( select to_char(sysdate, 'dd/mm/ hh24:mm:dd') from dual ); $sth-execute; @row=$sth-fetchrow_array; print La fecha del sistema es: $row[0]\n; } Muy atentamente, Germán Marambio Vargas -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 8:24 AM To: [EMAIL PROTECTED] Subject: HELP ME !! Can't locate object method connect via package DBI Hi dears Excuseme, my english is very poor. My Name is Germán i live in Chile(South America), i have the following problem: can't locate object method connect via package DBI. If your have the solution help me, please...!!! How can solution? Thanks a lot Muy atentamente, Germán Marambio Vargas
DBD::Pg::tables starts transaction (was: Postgres and mod_perl:vacuum getting stuck?)
On Mon, 2002-06-17 at 10:00, Jeff Boes wrote: We are experiencing a fairly predictable lock-up in the overnight VACUUM ANALYZE maintenance script. The VACUUM gets to the pg_class table and then stops, obviously waiting for something else to give up control of the table. The VACUUM script resumes precisely when the web server is bounced. The web server is using mod_perl, and mod_perl uses DBI code (in a locally developed module that does establish a connection at *compile* time in order to verify existence of tables used in the code). What puzzles me is that the start-up code does not do any UPDATEs or DELETEs, so although some of the connections do not have AutoCommit enabled, I don't understand why pg_class would seem to be locked in a transaction. Here's a follow-up to this, as it looks like we have solved it. First, thanks to Tom Lane (who I don't think is on this list, so I've copied him), who suggested setting debug_print_query to true for the PostgreSQL postmaster. This allowed us to see that the query select relname AS TABLE_NAME from pg_class where relkind = 'r' andrelname !~ '^pg_' andrelname !~ '^xin[vx][0-9]+' order by 1 was being executed in various places on start-up of our Apache web server. I identified this query as taking place in DBD::Pg::tables, which was being invoked in some initialization code for our local abstraction on top of DBI, and that led to adding a commit on that database connection handle, which appears to have solved the problem. So the moral is: in DBD::Pg, even methods that don't look like transactions (i.e., aren't named select*) can start transactions. -- Jeff Boes vox 616.226.9550 ext 24 Database Engineer fax 616.349.9076 Nexcerpt, Inc. http://www.nexcerpt.com ...Nexcerpt... Extend your Expertise
Re: FW: HELP ME !! Can't locate object method connect via package DBI
I did not know what 'perlcc' was and so had to read a bit about it. Given that your scenario is OK with 'perl', there is no need to question your installation of DBI and DBD-Oracle modules. Instead, the focus must be on perlcc and how it might have different requirements than perl. I searched www.google.com and found more than 1 hit suggesting that, because you are using perlcc, your code needs the following near the top of your logic: BEGIN { require DBI; require DBD::Oracle; } My guess is this will either completely fix your issues or will at least get you past your current ones. Consider searching google if/when the next error message appears. At 12:01 PM 6/24/2002 -0400, you wrote: Muchas gracias de todas maneras, si sabes algo por favor te le agradeceré... Muy atentamente, Germán Marambio Vargas PARLEY,JON (HP-MountainVi To: '[EMAIL PROTECTED]' [EMAIL PROTECTED], ew,ex1) '[EMAIL PROTECTED]' [EMAIL PROTECTED] jon_parley@hp cc: .comSubject: FW: HELP ME !! Can't locate object method connect via package DBI 24-06-2002 11:50 AM German, Estoy apesadumbrado. No tengo ninguna experiencia con el perlcc. --Thunder dbi-users, TRANSLATION: When I execute with Perl, I don't have any problems. When I do an executable with perlcc, at the moment I execute the archive, I get the message 'Can't locate object method connect via package DBI' -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 8:47 AM To: PARLEY,JON (HP-MountainView,ex1) Subject: RE: HELP ME !! Can't locate object method connect via package DBI Importance: High Cuando lo ejecuto con Perl no tengo problemas pero cuando hago un ejecutable con perlcc al momento de ejecutar el archivo me sale el mensaje Can't locate object method connect via package DBI El codigo es super simple: Agradezco desde ya su ayuda es de vital importancia. #!/usr/local/bin/perl -w use DBI; $dbh; $sth; { $v_dbname = $ENV{ORACLE_SID}; $v_userDB = 'fa'; $v_passDB = 'af1'; $v_dbd = 'Oracle'; #= Conexión a BD $dbh=DBI-connect($v_dbname,$v_userDB,$v_passDB,$v_dbd) || die Error de Conexión: $DBI::errstr. \n; $sth=$dbh-prepare( select to_char(sysdate, 'dd/mm/ hh24:mm:dd') from dual ); $sth-execute; @row=$sth-fetchrow_array; print La fecha del sistema es: $row[0]\n; } Muy atentamente, Germán Marambio Vargas -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 8:24 AM To: [EMAIL PROTECTED] Subject: HELP ME !! Can't locate object method connect via package DBI Hi dears Excuseme, my english is very poor. My Name is Germán i live in Chile(South America), i have the following problem: can't locate object method connect via package DBI. If your have the solution help me, please...!!! How can solution? Thanks a lot Muy atentamente, Germán Marambio Vargas
RE: compiling DBD::ODBC
unixODBC isn't usually installed in /usr/bin. It's usually in /usr/local. I'm guessing that the output of Makefile.PL will help, but it could be that you have remnants of udbc in there which could be causing the problem. Save the output of Makefile.PL and forward it to me (and please copy [EMAIL PROTECTED]) Thanks, Jeff -Original Message- From: Cornel Diaconu [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 9:37 AM To: [EMAIL PROTECTED] Subject: compiling... Sorry for this approach (I'm sure I'm not the first to ask you this, but for now I don't know where to find an answer to it, so...) I'm trying to compile your DBD::ODBC package on my RedHat 7.2, with perl 5.6.1 and unixODBC (I think some 2.xx) installed. When I instruct perl Makefile.PL where is my ODBC manager (namely in /usr/bin) (either by the parameter -o, or by means of ODBCHOME variable), it creates the dbdodbc.h file which tries to #include some libudbc.h file. Well, this last file is my problem, since I can't manage to find it anywhere, neither on my system, or in this whole world too !!! I've looked for it with any search engine I could imagine (Google, Excite, Lycos, Astavista, Askjeeves); my work was in vain; the only reasonable link to where I could find such a file was at OpenLink's SDK, but since this monstrozity is commercial, it's out of the question for me (and the odbc drivers for PostgreSQL or MySQL are at my side already from other sources, so their drivers are useless for me, anyhow...). So: where did you have in mind to take this file from, when you coded this package ? I've even tried to comment that include (in dbdodbc.h), but a lot of other errors popped-up afterwards (since there are some define's and function definitions in that file ...) Can you give me some clue (at least where to look from this point further) ? Thanx. Best regards, Cornel. P.S. Unfortunatelly, I'm just a beginner in Perl codding, thus I can't handle 100% the Makefile.PL script ;(( P.S. 2 : I can be reached at [EMAIL PROTECTED] too.
Re: need execute perms?
Are you certain that you have the correct path to the perl executable? Try changing your shebang line to: #!perl and see if they are then executable. On Mon, 2002-06-24 at 11:52, John Day wrote: 1.. Have you made the scripts executable? by using CHMOD 755 or something similar. You can often do this in your ftp client. 2.. Who is your provider, so we may all studiously avoid them in the future? John Day Words Images Toronto, Canada At 11:07 AM 6/24/2002 -0400, Nick Hoffman [UWO] wrote: Hi. The hosting company that I am with says that you only need execute for scripts permissions to run Perl scripts in my cgi-bin directory. However, I'm unable to run *any* of my scripts. Might anyone know why that may be? Whenever I try to, I get a 403.1 Forbidden: Execute Access Forbidden. The hosting company refuses to tell me how to get my scripts working, and cling to this motto We provide accessibility, not functionality. So, I have no idea how to get my scripts going. Below is one of my many scripts that simply won't run. Thanks for your help Nick Hoffman #!perl\perl.exe use DBI; use strict; use CGI::Carp qw(fatalsToBrowser); #data source name my ($dsn) = DBI:ODBC:ebahoops; #for holding the username and password that the user entered my (username, password); #for holding the usernameS and passwordS in the pwd file my (unames, pwds); #whether the username and password exist AND match my ($match) = false; #file that holds the different EBA divisions my ($DivisionsFile) = divisions.dat; my (division_contents); #path to pwd file my ($pwd_file) = dont_delete.dat; #for converting query string my ($NameValue, $Name, $Value); #array for holding query data my (data); #database and statement handles my ($dbh); my ($sth); #array for holding team names and numbers my (COEDTeamNames, COEDTeamNums, COEDDivisions); my (BoysTeamNames, BoysTeamNums, BoysDivisions); my (GirlsTeamNames, GirlsTeamNums, GirlsDivisions); #temp vars my (temp, params, $counter, $temp); #put each param into the array params = split(, $ENV {'QUERY_STRING'}); #convert ugly chars to regular chars $counter = 0; while (params[$counter]) { ($Name, $Value) = split(=, params[$counter]); $Value =~ tr/+/ /; $Value =~ s/%([\dA-Fa-f][\dA-Fa-f])/ pack (C, hex($1))/eg; params[$counter] = $Name . = . $Value; $counter++; } print HTMLSTUFF; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta name=description content=The Official Etobicoke Basketball Association's Web Page meta name=keywords content=EBA, Etobicoke Basketball Association, Basketball, League, BBall, Ball, Sport, Sports, fun, games, activity, activities, net titleEtobicoke Basketball Association - Registration Form/title /head body bgcolor=#FF link=#FF vlink=#FF alink=#FF table border=0 cellpadding=0 cellspacing=0 width=600 tr td valign=top width=600 table border=0 cellpadding=0 cellspacing=0 width=100% tr td colspan=2 center table border=3 cellpadding=10 cellspacing=0 tr td center bETOBICOKE BASKETBALL ASSOCIATION/bbr bAdministration Page/b /center /td /tr /table /center /td /tr tr td width=70%nbsp;/td td width=30%nbsp;/td /tr HTMLSTUFF ; if ((params[0] !~ username=) || (params[1] !~ password=)) { #if the username or password isn't specified, ask for it print form action=\edit_teams.pl\ method=\get\ tr td width=70%Username:/td td width=30%input type=text size=12 maxlength=12 name=username/td /tr tr td width=70%Password/td td width=30%input type=password size=12
Re: DBI Author?
It was written --- AUTHORS DBI by Tim Bunce. This pod text by Tim Bunce, J. Douglas Dunlop, Jonathan Leffler and others. Perl by Larry Wall and the perl5-porters. --- Thank you. BTW, I have no intent to bother the author directly with my questions; I know that is what this list is for. All I wanted to do was get the documentation (specifically a list of all the methods and arguments) in a printable format. Thanks again, Will __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
Re: need execute perms?
Jeff, I think there are two questions here, 1.. What version of PERL is installed 2.. What web server is being used? Apache? IIS? or something else? normally NT/W2K does not even read the shebang, but the file extension .pl is registered to the perl executable and so if the script is invoked correctly it will execute. The error message that was originally provided seemed to indicate that the script did not have the appropriate permissions, rather than the interpreter being unlocatable. John At 01:01 PM 6/24/2002 -0400, Jeff Seger wrote: Are you certain that you have the correct path to the perl executable? Try changing your shebang line to: #!perl and see if they are then executable. On Mon, 2002-06-24 at 11:52, John Day wrote: 1.. Have you made the scripts executable? by using CHMOD 755 or something similar. You can often do this in your ftp client. 2.. Who is your provider, so we may all studiously avoid them in the future? John Day Words Images Toronto, Canada At 11:07 AM 6/24/2002 -0400, Nick Hoffman [UWO] wrote: Hi. The hosting company that I am with says that you only need execute for scripts permissions to run Perl scripts in my cgi-bin directory. However, I'm unable to run *any* of my scripts. Might anyone know why that may be? Whenever I try to, I get a 403.1 Forbidden: Execute Access Forbidden. The hosting company refuses to tell me how to get my scripts working, and cling to this motto We provide accessibility, not functionality. So, I have no idea how to get my scripts going. Below is one of my many scripts that simply won't run. Thanks for your help Nick Hoffman #!perl\perl.exe use DBI; use strict; use CGI::Carp qw(fatalsToBrowser); #data source name my ($dsn) = DBI:ODBC:ebahoops; #for holding the username and password that the user entered my (username, password); #for holding the usernameS and passwordS in the pwd file my (unames, pwds); #whether the username and password exist AND match my ($match) = false; #file that holds the different EBA divisions my ($DivisionsFile) = divisions.dat; my (division_contents); #path to pwd file my ($pwd_file) = dont_delete.dat; #for converting query string my ($NameValue, $Name, $Value); #array for holding query data my (data); #database and statement handles my ($dbh); my ($sth); #array for holding team names and numbers my (COEDTeamNames, COEDTeamNums, COEDDivisions); my (BoysTeamNames, BoysTeamNums, BoysDivisions); my (GirlsTeamNames, GirlsTeamNums, GirlsDivisions); #temp vars my (temp, params, $counter, $temp); #put each param into the array params = split(, $ENV {'QUERY_STRING'}); #convert ugly chars to regular chars $counter = 0; while (params[$counter]) { ($Name, $Value) = split(=, params[$counter]); $Value =~ tr/+/ /; $Value =~ s/%([\dA-Fa-f][\dA-Fa-f])/ pack (C, hex($1))/eg; params[$counter] = $Name . = . $Value; $counter++; } print HTMLSTUFF; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta name=description content=The Official Etobicoke Basketball Association's Web Page meta name=keywords content=EBA, Etobicoke Basketball Association, Basketball, League, BBall, Ball, Sport, Sports, fun, games, activity, activities, net titleEtobicoke Basketball Association - Registration Form/title /head body bgcolor=#FF link=#FF vlink=#FF alink=#FF table border=0 cellpadding=0 cellspacing=0 width=600 tr td valign=top width=600 table border=0 cellpadding=0 cellspacing=0 width=100% tr td colspan=2 center table border=3 cellpadding=10 cellspacing=0 tr td center bETOBICOKE BASKETBALL ASSOCIATION/bbr bAdministration Page/b /center /td /tr /table /center /td /tr tr td width=70%nbsp;/td td width=30%nbsp;/td /tr HTMLSTUFF ; if ((params[0] !~ username=) || (params[1] !~
RE: Upgrade to 1.27 causes script failure
Looks like you forgot to add the { Columns={} } part ... -Original Message- From: Randall Perry [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 5:03 PM To: Tim Bunce Cc: [EMAIL PROTECTED] Subject: Re: Upgrade to 1.27 causes script failure Ok, here's text from DBI::Changes re: 1.20 change: To get previous selectall_hashref() behaviour (an array of hash refs) change $ary_ref = $dbh-selectall_hashref( $statement, undef, @bind); to $ary_ref = $dbh-selectall_arrayref($statement, { Columns={} }, @bind); When I do the above, and change my code from: $arrayref = $dbh-selectall_hashref($query); to: $arrayref = $dbh-selectall_arrayref($query); It returns an array of array refs; not an array of hash refs. Got this error when trying to access it as array of hash refs: Can't coerce array into hash at /perl/clean/confirm_warning_1.0.71c.pl line 60 So, is there a single method comparable to the old behaviour of selectall_hashref? I bet you've upgraded from a version 1.20. The interface to selectall_hashref changed in version 1.20. Read the Changes file (or perldoc DBI::Changes). Tim. On Fri, Jun 14, 2002 at 11:14:23AM -0400, Randall Perry wrote: Seems to be an error with selectall_hashref method. Anyone know what the problem is? Here are the errors: [Fri Jun 14 11:00:00 2002] confirm_warning_1.0.7c.pl: DBI selectall_hashref: invalid number of parameters: handle + 1 [Fri Jun 14 11:00:00 2002] confirm_warning_1.0.7c.pl: Usage: $h-selectall_hashref($statement, $keyfield [, \%attr [, @bind_params ] ]) at /perl/clean/confirm_warning_1.0.7c.pl line 124. [Fri Jun 14 11:00:00 2002] confirm_warning_1.0.7c.pl: Database handle destroyed without explicit disconnect at /perl/clean/confirm_warning_1.0.7c.pl line 124. And here's my code (marked offending line with #124): sub doQuery { my ($driver, $db, $user, $query) = @_; my($dbh, $arrayref); 124:$dbh = DBI-connect(dbi:$driver:$db, $user) or confess Can't connect to tasbill $DBI::errstr; $arrayref = $dbh-selectall_hashref($query); $dbh-disconnect; return $arrayref; } -- Randy Perry sysTame Mac Consulting/Sales phn 772.589.6449 mobile email[EMAIL PROTECTED] -- Randy Perry sysTame Mac Consulting/Sales phn 772.589.6449 mobile email[EMAIL PROTECTED]
first time user...
Hello i am new to the Unix and Perl both. I got a script to write which connects to the database. how should i proceed further to get started. I am aware of coding, database sql's all basic things, need to know how to do in Perl on Unix. Thanks Ajay = A man is not finished when he is defeated, he is finished when he quits. __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
RE: need execute perms?
Actually, on the hoster's website, it says that to run Perl scripts on their server, you don't need to include a shebang line. They do, though, give the path to Perl. I've tried both (their shebang line and no shebang line), and neither work. I gave your suggestion of #!perl a try and it also didn't work. I'm really at a loss now as to what to do. I'll find out what webserver they're using. As for what version of Perl, it's 5.60 Thanks, Nick -Original Message- From: Jeff Seger [mailto:[EMAIL PROTECTED]] Sent: June 24, 2002 1:02 PM To: John Day Cc: DBI-Users Subject: Re: need execute perms? Are you certain that you have the correct path to the perl executable? Try changing your shebang line to: #!perl and see if they are then executable. On Mon, 2002-06-24 at 11:52, John Day wrote: 1.. Have you made the scripts executable? by using CHMOD 755 or something similar. You can often do this in your ftp client. 2.. Who is your provider, so we may all studiously avoid them in the future? John Day Words Images Toronto, Canada At 11:07 AM 6/24/2002 -0400, Nick Hoffman [UWO] wrote: Hi. The hosting company that I am with says that you only need execute for scripts permissions to run Perl scripts in my cgi-bin directory. However, I'm unable to run *any* of my scripts. Might anyone know why that may be? Whenever I try to, I get a 403.1 Forbidden: Execute Access Forbidden. The hosting company refuses to tell me how to get my scripts working, and cling to this motto We provide accessibility, not functionality. So, I have no idea how to get my scripts going. Below is one of my many scripts that simply won't run. Thanks for your help Nick Hoffman #!perl\perl.exe use DBI; use strict; use CGI::Carp qw(fatalsToBrowser); #data source name my ($dsn) = DBI:ODBC:ebahoops; #for holding the username and password that the user entered my (@username, @password); #for holding the usernameS and passwordS in the pwd file my (@unames, @pwds); #whether the username and password exist AND match my ($match) = false; #file that holds the different EBA divisions my ($DivisionsFile) = divisions.dat; my (@division_contents); #path to pwd file my ($pwd_file) = dont_delete.dat; #for converting query string my ($NameValue, $Name, $Value); #array for holding query data my (@data); #database and statement handles my ($dbh); my ($sth); #array for holding team names and numbers my (@COEDTeamNames, @COEDTeamNums, @COEDDivisions); my (@BoysTeamNames, @BoysTeamNums, @BoysDivisions); my (@GirlsTeamNames, @GirlsTeamNums, @GirlsDivisions); #temp vars my (@temp, @params, $counter, $temp); #put each param into the array @params = split(, $ENV {'QUERY_STRING'}); #convert ugly chars to regular chars $counter = 0; while (@params[$counter]) { ($Name, $Value) = split(=, @params[$counter]); $Value =~ tr/+/ /; $Value =~ s/%([\dA-Fa-f][\dA-Fa-f])/ pack (C, hex($1))/eg; @params[$counter] = $Name . = . $Value; $counter++; } print HTMLSTUFF; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta name=description content=The Official Etobicoke Basketball Association's Web Page meta name=keywords content=EBA, Etobicoke Basketball Association, Basketball, League, BBall, Ball, Sport, Sports, fun, games, activity, activities, net titleEtobicoke Basketball Association - Registration Form/title /head body bgcolor=#FF link=#FF vlink=#FF alink=#FF table border=0 cellpadding=0 cellspacing=0 width=600 tr td valign=top width=600 table border=0 cellpadding=0 cellspacing=0 width=100% tr td colspan=2 center table border=3 cellpadding=10 cellspacing=0 tr td center bETOBICOKE BASKETBALL ASSOCIATION/bbr bAdministration Page/b /center /td /tr /table /center /td /tr tr td width=70%nbsp;/td
RE: need execute perms?
Doesn't there have to be an entry in the mime type to specify that .pl is executable. All my scripts are .cgi. -Original Message- From: Nick Hoffman [HWA-Inc] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 2:21 PM To: DBI-Users Subject: RE: need execute perms? Actually, on the hoster's website, it says that to run Perl scripts on their server, you don't need to include a shebang line. They do, though, give the path to Perl. I've tried both (their shebang line and no shebang line), and neither work. I gave your suggestion of #!perl a try and it also didn't work. I'm really at a loss now as to what to do. I'll find out what webserver they're using. As for what version of Perl, it's 5.60 Thanks, Nick -Original Message- From: Jeff Seger [mailto:[EMAIL PROTECTED]] Sent: June 24, 2002 1:02 PM To: John Day Cc: DBI-Users Subject: Re: need execute perms? Are you certain that you have the correct path to the perl executable? Try changing your shebang line to: #!perl and see if they are then executable. On Mon, 2002-06-24 at 11:52, John Day wrote: 1.. Have you made the scripts executable? by using CHMOD 755 or something similar. You can often do this in your ftp client. 2.. Who is your provider, so we may all studiously avoid them in the future? John Day Words Images Toronto, Canada At 11:07 AM 6/24/2002 -0400, Nick Hoffman [UWO] wrote: Hi. The hosting company that I am with says that you only need execute for scripts permissions to run Perl scripts in my cgi-bin directory. However, I'm unable to run *any* of my scripts. Might anyone know why that may be? Whenever I try to, I get a 403.1 Forbidden: Execute Access Forbidden. The hosting company refuses to tell me how to get my scripts working, and cling to this motto We provide accessibility, not functionality. So, I have no idea how to get my scripts going. Below is one of my many scripts that simply won't run. Thanks for your help Nick Hoffman #!perl\perl.exe use DBI; use strict; use CGI::Carp qw(fatalsToBrowser); #data source name my ($dsn) = DBI:ODBC:ebahoops; #for holding the username and password that the user entered my (@username, @password); #for holding the usernameS and passwordS in the pwd file my (@unames, @pwds); #whether the username and password exist AND match my ($match) = false; #file that holds the different EBA divisions my ($DivisionsFile) = divisions.dat; my (@division_contents); #path to pwd file my ($pwd_file) = dont_delete.dat; #for converting query string my ($NameValue, $Name, $Value); #array for holding query data my (@data); #database and statement handles my ($dbh); my ($sth); #array for holding team names and numbers my (@COEDTeamNames, @COEDTeamNums, @COEDDivisions); my (@BoysTeamNames, @BoysTeamNums, @BoysDivisions); my (@GirlsTeamNames, @GirlsTeamNums, @GirlsDivisions); #temp vars my (@temp, @params, $counter, $temp); #put each param into the array @params = split(, $ENV {'QUERY_STRING'}); #convert ugly chars to regular chars $counter = 0; while (@params[$counter]) { ($Name, $Value) = split(=, @params[$counter]); $Value =~ tr/+/ /; $Value =~ s/%([\dA-Fa-f][\dA-Fa-f])/ pack (C, hex($1))/eg; @params[$counter] = $Name . = . $Value; $counter++; } print HTMLSTUFF; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta name=description content=The Official Etobicoke Basketball Association's Web Page meta name=keywords content=EBA, Etobicoke Basketball Association, Basketball, League, BBall, Ball, Sport, Sports, fun, games, activity, activities, net titleEtobicoke Basketball Association - Registration Form/title /head body bgcolor=#FF link=#FF vlink=#FF alink=#FF table border=0 cellpadding=0 cellspacing=0 width=600 tr td valign=top width=600 table border=0 cellpadding=0 cellspacing=0 width=100% tr td colspan=2 center table border=3 cellpadding=10 cellspacing=0 tr td center bETOBICOKE BASKETBALL ASSOCIATION/bbr bAdministration Page/b /center /td /tr
RE: need execute perms?
Do they mention what extention your script must have? .cgi .pl and where it is supposed to be placed in order to be executable? Anton -Original Message- From: Nick Hoffman [HWA-Inc] [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 11:21 AM To: DBI-Users Subject: RE: need execute perms? Actually, on the hoster's website, it says that to run Perl scripts on their server, you don't need to include a shebang line. They do, though, give the path to Perl. I've tried both (their shebang line and no shebang line), and neither work. I gave your suggestion of #!perl a try and it also didn't work. I'm really at a loss now as to what to do. I'll find out what webserver they're using. As for what version of Perl, it's 5.60 Thanks, Nick -Original Message- From: Jeff Seger [mailto:[EMAIL PROTECTED]] Sent: June 24, 2002 1:02 PM To: John Day Cc: DBI-Users Subject: Re: need execute perms? Are you certain that you have the correct path to the perl executable? Try changing your shebang line to: #!perl and see if they are then executable. On Mon, 2002-06-24 at 11:52, John Day wrote: 1.. Have you made the scripts executable? by using CHMOD 755 or something similar. You can often do this in your ftp client. 2.. Who is your provider, so we may all studiously avoid them in the future? John Day Words Images Toronto, Canada At 11:07 AM 6/24/2002 -0400, Nick Hoffman [UWO] wrote: Hi. The hosting company that I am with says that you only need execute for scripts permissions to run Perl scripts in my cgi-bin directory. However, I'm unable to run *any* of my scripts. Might anyone know why that may be? Whenever I try to, I get a 403.1 Forbidden: Execute Access Forbidden. The hosting company refuses to tell me how to get my scripts working, and cling to this motto We provide accessibility, not functionality. So, I have no idea how to get my scripts going. Below is one of my many scripts that simply won't run. Thanks for your help Nick Hoffman #!perl\perl.exe use DBI; use strict; use CGI::Carp qw(fatalsToBrowser); #data source name my ($dsn) = DBI:ODBC:ebahoops; #for holding the username and password that the user entered my (@username, @password); #for holding the usernameS and passwordS in the pwd file my (@unames, @pwds); #whether the username and password exist AND match my ($match) = false; #file that holds the different EBA divisions my ($DivisionsFile) = divisions.dat; my (@division_contents); #path to pwd file my ($pwd_file) = dont_delete.dat; #for converting query string my ($NameValue, $Name, $Value); #array for holding query data my (@data); #database and statement handles my ($dbh); my ($sth); #array for holding team names and numbers my (@COEDTeamNames, @COEDTeamNums, @COEDDivisions); my (@BoysTeamNames, @BoysTeamNums, @BoysDivisions); my (@GirlsTeamNames, @GirlsTeamNums, @GirlsDivisions); #temp vars my (@temp, @params, $counter, $temp); #put each param into the array @params = split(, $ENV {'QUERY_STRING'}); #convert ugly chars to regular chars $counter = 0; while (@params[$counter]) { ($Name, $Value) = split(=, @params[$counter]); $Value =~ tr/+/ /; $Value =~ s/%([\dA-Fa-f][\dA-Fa-f])/ pack (C, hex($1))/eg; @params[$counter] = $Name . = . $Value; $counter++; } print HTMLSTUFF; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 meta name=description content=The Official Etobicoke Basketball Association's Web Page meta name=keywords content=EBA, Etobicoke Basketball Association, Basketball, League, BBall, Ball, Sport, Sports, fun, games, activity, activities, net titleEtobicoke Basketball Association - Registration Form/title /head body bgcolor=#FF link=#FF vlink=#FF alink=#FF table border=0 cellpadding=0 cellspacing=0 width=600 tr td valign=top width=600 table border=0 cellpadding=0 cellspacing=0 width=100% tr td colspan=2 center table border=3 cellpadding=10 cellspacing=0 tr td center bETOBICOKE BASKETBALL ASSOCIATION/bbr bAdministration Page/b /center /td
DBD::Oracle on an IRIX host core dumps on connection
Using: perl 5.6.1, DBI 1.2.7, DBD::Oracle 1.12 sgi_n32_oracle_client_toolkit demo_n32.mk -- http://misdev.fnal.gov/~dbox/n32/ I was able to finally build DBD::Oracle after installing the client toolkit and issuing this make command: perl Makefile.PL -p -m demo_n32.mk Generic tests pass, however, anything that actually attempts to connect to our Oracle server (on a solaris box) generates a segmentation fault and dumps core. I have asserted the fact that it successfully connects, but I can't seem to find out why exactly it's core dumping. Any information on getting this setup to work would be greatly appreciated. On a side note, sqlplus works just fine, and the same version of DBD::Oracle and Oracle 8.0.5 work just fine on our linux boxes. IRIX is once again the source of a problem. -- /* * Bob Phan [EMAIL PROTECTED],[EMAIL PROTECTED] * Computational Chemistry Informatics * Neurogen Corporation * (203)488-8201 x4645 * * To understand recursion, you must first understand recursion. */
DBI on a Zaurus
Has anyone been able to get the DBI architecture running on a Sharp Zaurus Linux PDA? I don't own one, and haven't tried... but it could be a very interesting and powerful platform if DBI were available for it. I'm in the wings contemplating purchases... -Rick +--+ | Rick Osterberg [EMAIL PROTECTED]| | Database Applications Specialist FAS Computer Services | +--+
Re: DBI on a Zaurus (or a pocketPC)
Rick Osterberg wrote: Has anyone been able to get the DBI architecture running on a Sharp Zaurus Linux PDA? I don't own one, and haven't tried... but it could be a very interesting and powerful platform if DBI were available for it. I'm in the wings contemplating purchases... And while we're at it -- has anyone gotten either DBI or DBI::PurePerl to work on a PocketPC with the perl that's been ported to that platform? It may complicate Rick's choice a bit and mine -- I'd prefer both options -- boot to PocketPC or boot to Linux on the PDA (e.g. IPAQ or the new Toshiba e740) and get DBI either way. -- Jeff
Re: first time user...
Ajay Kumar wrote: Hello i am new to the Unix and Perl both. I got a script to write which connects to the database. how should i proceed further to get started. I am aware of coding, database sql's all basic things, need to know how to do in Perl on Unix. First you'll have to learn the basics of Perl, then those of the DBI. While you can begin with the Perl and DBI documentation with `perldoc perl` and `perldoc DBI` I recommend using the great O'Reilly books Programming Perl (the famous Camel Book) and Programming the Perl DBI. They are great, I use them myself (in German translation, of course). Best regards, Martin Stricker -- Homepage: http://www.martin-stricker.de/ Webmaster-Forum: http://www.masterportal24.com/cgi-bin/YaBB.cgi Red Hat Linux 7.2 for low memory: http://www.rule-project.org/ Registered Linux user #210635: http://counter.li.org/
DBI:ODBC trying to select a Text field from SQL6.5
All, My Environment is... NT 4.0 MS SQL 6.5 ActivePerl v5.6.1 I am trying to run a select statement but one of the fields that I'm trying to get is a Text datatype. If I remove that field from my select statement everything works fine. the error message I get is... DBD::ODBC::db selectall_arrayref failed: [Microsoft][ODBC SQL Server Driver]String data, right truncation (SQL-01004)(DBD: st_fetch/SQLFetch (long truncated) err=1) at C:\TEMP\test-disdplay.pl line 27. Can anyone help me figure out how to get at that data or is there a different datatype that I can use that can hold more then 255 (I'm talking 1-3 pages of text) characters? Thanks, Brad ** Notice: The area code for the Wal-Mart Bentonville General Office in the US has changed from 501 to 479. Please make sure that you are dialing 479 when making calls to any General Office location. ** This email and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this email in error destroy it immediately. ** Wal-Mart Stores, Inc. Confidential **
RE: first time user...
There is a quick beginner's class at http://www.cgi101.com Click on Learn CGI at the top of the page and you can go through some tutorials. To learn MySQL, go to www.MySQL.org. Check out the Documentation section, this also contains tutorials and a background of MySQL. I found them both very helpful Emma - Just because the syntax is right, doesn't mean that it will work! Look a little harder, and you will find the answer. -Original Message- From: Ajay Kumar [mailto:[EMAIL PROTECTED]] Sent: Monday, June 24, 2002 11:03 AM To: [EMAIL PROTECTED] Subject: first time user... Hello i am new to the Unix and Perl both. I got a script to write which connects to the database. how should i proceed further to get started. I am aware of coding, database sql's all basic things, need to know how to do in Perl on Unix. Thanks Ajay = A man is not finished when he is defeated, he is finished when he quits. __ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com
Re: DBI on a Zaurus
On Mon, Jun 24, 2002 at 05:02:48PM -0400, Rick Osterberg wrote: Has anyone been able to get the DBI architecture running on a Sharp Zaurus Linux PDA? I don't own one, and haven't tried... but it could be a very interesting and powerful platform if DBI were available for it. I'm in the wings contemplating purchases... If perl works at all then DBI::PurePerl is likely to work. Combine that with DBD::Proxy and you can connect to anything anywhere. Tim.
strange error with using $db-do
I have cron script that runs fine on a bsd machine, but returns this output on the linux machine. i have version 1.21 on the linux machine. DBD::Oracle::db do failed: ORA-0: normal, successful completion (DBD SUCCESS_WITH_INFO: OCIStmtExecute) at /home/scripts/update/recompilestoredprocedures line 33. here is the code: while (my ($oname,$otype) = $select-fetchrow_array) { $sql = ALTER $otype $oname COMPILE; unless ( $db-do($sql)) { ## this db statement generates the eror $objectsnotcompiled = $objectsnotcompiled . $oname . ' '; } } Pleas email replies to me directly. thanks.
Re: DBI Author?
On Mon, Jun 24, 2002 at 10:10:52AM -0400, John Day wrote: And it wouldn't happen to be Tim Bunce would it? Aparrently. Oh, and some fellow by the name of Alligator Descartes?? That would be the Programming the Perl DBI book - which we co-authored. Alligator didn't write the DBI module - though he was involved in early driver development. You are too modest Tim! I have been using the DBI for at least 5 years now and it is the one module I totally rely upon to get my work done. Maybe it doesn't get said often enough, but thank you from a truly appreciative user! Thanks! Tim.
Re: DBD::Oracle on an IRIX host core dumps on connection
On Mon, Jun 24, 2002 at 04:21:16PM -0400, [EMAIL PROTECTED] wrote: Using: perl 5.6.1, DBI 1.2.7, DBD::Oracle 1.12 sgi_n32_oracle_client_toolkit demo_n32.mk -- http://misdev.fnal.gov/~dbox/n32/ I was able to finally build DBD::Oracle after installing the client toolkit and issuing this make command: perl Makefile.PL -p -m demo_n32.mk Generic tests pass, however, anything that actually attempts to connect to our Oracle server (on a solaris box) generates a segmentation fault and dumps core. I have asserted the fact that it successfully connects, but I can't seem to find out why exactly it's core dumping. Any information on getting this setup to work would be greatly appreciated. The README file says 5. If you get a core dump, rebuild DBD::Oracle with debugging enabled by executing: perl Makefile.PL -g (note the -g option) then rerun the code to get a new core dump file, finally use a debugger (gdb, sdb, dbx, adb etc) to get a stack trace from it. NOTE: I may not be able to help you much without a stack trace! It is worth fetching and building the GNU GDB debugger (4.15) if you don't have a good debugger on your system. If desparate try: make perl; ./perl script; echo '$c' | adb ./perl core (I should update that to mention the Devel::CoreStack module.) Tim.
MS Access
I've just spent the last 15 minutes looking at CPAN for a module to query a MS Access database. Which modules do I need to download? Can someone throw me a hint? :)
Re: MS Access
DBD::ODBC. John [EMAIL PROTECTED]
Re: MS Access
On Mon, 24 Jun 2002 16:22:38 -0700, Erick Nelson wrote: I've just spent the last 15 minutes looking at CPAN for a module to query a MS Access database. Which modules do I need to download? You need DBD::ODBC. Can someone throw me a hint? :) Well: first create a DSN for the database using the ODBC control panel (comes with Windows). You can simply use the name that you used for it there, to connect to the db in the connect string. Just look at these FAQ entries: I need to define a DSN for ODBC, how do I do it and which type should I use? http://xmlproj.dyndns.org/faqomatic/cache/6.html Example of DBD::ODBC and Access with Northwind database http://xmlproj.dyndns.org/faqomatic/cache/17.html The archives for this list surely contain some more detailed recipes for creating the DSN. -- Bart.
Re: Help!
jingyuan wang wrote: Yes, I have substitued -fPIC. but i have another error: gcc -c -xO3 -xdepend -DVERSION=\1.18\ -DXS_VERSION=\1.18\ -fPIC -I/usr/perl5/5.00503/sun4-solaris/CORE -DDBI_NO_THREADS Perl.c gcc: language depend not recognized gcc: Perl.c: linker input file unused since linking not done /bin/perl -I/usr/perl5/5.00503/sun4-solaris -I/usr/perl5/5.00503 /usr/perl5/5.00503/ExtUtils/xsubpp -typemap /usr/perl5/5.00503/ExtUtils/typemap DBI.xs xstmp.c mv xstmp.c DBI.c gcc -c -xO3 -xdepend -DVERSION=\1.18\ -DXS_VERSION=\1.18\ -fPIC -I/usr/perl5/5.00503/sun4-solaris/CORE -DDBI_NO_THREADS DBI.c gcc: language depend not recognized gcc: DBI.c: linker input file unused since linking not done Running Mkbootstrap for DBI () chmod 644 DBI.bs LD_RUN_PATH= cc -o blib/arch/auto/DBI/DBI.so -G DBI.o /usr/ucb/cc: language optional software package not installed *** Error code 1 make: Fatal error: Command failed for target `blib/arch/auto/DBI/DBI.so' Do you known about this error? Rebuild Perl with the GCC compiler. Anything else is too fraught with peril to be reliable. This is the standard FAQ advice for Solaris 8. Andrew Crum wrote: Yes. gcc does not understand -KPIC. For gcc, substitute -fPIC. Look for it in the Makefile.PL or possibly in the Makefile generated by 'make Makefile.PL'. At 03:55 PM 6/21/2002 +0200, you wrote: Hallo, I have tried to install the Mysql module. By the instruction of http://www.mysql.com/doc/P/e/Perl_installation.html I have a problem in the 3 step:make!!!(I have the sun solaris 8 system.) I have following errors:gcc -c -xO3 -xdepend -DVERSION=\2.101\ -DXS_VERSION=\2.101\ -KPIC -I/usr/perl5/5.00503/sun4-solaris/CORE Dumper.c gcc: unrecognized option `-KPIC' gcc: language depend not recognized gcc: Dumper.c: linker input file unused since linking not done -- Jonathan Leffler ([EMAIL PROTECTED], [EMAIL PROTECTED]) #include disclaimer.h Guardian of DBD::Informix 1.00.PC2 -- http://dbi.perl.org/