/usr/bin/ls: 0403-027 The parameter list is too long
Hi all, Thanks for your help. I am facing a new problem. Here is the code part: foreach $name(`ls $opt_i/*.xml`){ chomp; push @f, $name; print pushing elements=$name\n; } [EMAIL PROTECTED]; Now in the directory $opt_i if there are some 10 , 20 or even 100 its working well. But now I have some 305 odd xmls and the code is EXITING WITH sh: /usr/bin/ls: 0403-027 The parameter list is too long. In unix prompt ls *.xml is working (giving out those 305 xmls) Could anybody help me out? Thanks and Regards 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: /usr/bin/ls: 0403-027 The parameter list is too long
Vamsi_Doddapaneni wrote on Montag, 9. Mai 2005 12:16 Here is the code part: foreach $name(`ls $opt_i/*.xml`){ chomp; push @f, $name; print pushing elements=$name\n; } [EMAIL PROTECTED]; Now in the directory $opt_i if there are some 10 , 20 or even 100 its working well. But now I have some 305 odd xmls and the code is EXITING WITH sh: /usr/bin/ls: 0403-027 The parameter list is too long. It's strange that your ls fails to handle 300+ files - is $opt_i being expanded correctly? And I don't ever recall seeing an ls display an error code upon failure. In any case, I would suggest using the Perl built-in to read the directory listing, instead of using the system ls command. Here's sample, albeit untested code: my $sample_dir = $opt_i; chdir $sample_dir || die \nFatal error : Cannot cd to $sample_dir\n; opendir SAMPLEDIR, $sample_dir || die \nFatal error : Cannot read directory $sample_dir.\n; my @ELEMENTS = grep /\.xml$/, readdir SAMPLEDIR; close SAMPLEDIR; The list @ELEMENTS will contain all *.xml files in $opt_i, if any. BTW, this is slightly OT for the DBI-users list. Cheers, Srikanth Madani Life is short. Be swift to love! Make haste to be kind! -Henri Frederic Amiel
OT - but help here anyway -- was Re: /usr/bin/ls: 0403-027 The parameter list is too long
On 5/9/05, Vamsi_Doddapaneni [EMAIL PROTECTED] wrote: I am facing a new problem. Here is the code part: foreach $name(`ls $opt_i/*.xml`){ chomp; push @f, $name; print pushing elements=$name\n; } [EMAIL PROTECTED]; Now in the directory $opt_i if there are some 10 , 20 or even 100 its working well. But now I have some 305 odd xmls and the code is EXITING WITH sh: /usr/bin/ls: 0403-027 The parameter list is too long. In unix prompt ls *.xml is working (giving out those 305 xmls) Could anybody help me out? Ever seen an Open Source program autoconfigure itself and test how big the argument list can be? There's a reason for doing so, and you're probably running into it. POSIX recognizes that some systems have limits on the number of characters that can be in the argument list, and the permitted lowest value on the upper bound is around 5KB - and includes the values in the environment. Many systems have very large limits - others do not, and yours appears to be one of the latter. What is the value of $opt_i? If it is /some/very/long/name/with/many/parts then the 'ls' command line is going to be 300 times (35 + average-length-of-file.xml) which could be 15 KB without problem. Which shell do you use personally? What happens when you type 'ls /some/very/...'? If the shell you use is not /bin/sh, could it be that Perl is using /bin/sh and running into a problem? Do you have a very large environment. Can you rewrite your Perl to do the reading, filtering and sorting of the directory contents, instead of invoking 'ls'? (Perl can do it; someone almost certainly already has done it and it's almost certainly available on CPAN; is it worth your while to do so? The answer to that depends on the tractability of the 'ls' problem.) -- Jonathan Leffler [EMAIL PROTECTED] #include disclaimer.h Guardian of DBD::Informix - v2005.01 - http://dbi.perl.org I don't suffer from insanity - I enjoy every minute of it.
RE: /usr/bin/ls: 0403-027 The parameter list is too long
$opt_i expands to some path, then perl calls the shell to run the command ls some_path/*.xml. The shell then does what shells do, it tries to expand the *.xml pattern into a list of files to construct a command line of the form ls some_path/file1 some_path/file2 some_path/file3 which it will then execute using the exec(2) operating system function. The exec(2) function has an upper limit on the command length it can handle, known as ARG_MAX. On my HP system ARG_MAX is 2048000 (in bytes). So if you have a great many files, and/or some_path is a very long path, and/or your ARG_MAX is small, you run into the problem you saw. A google for ARG_MAX found this nice explanation: http://www.in-ulm.de/~mascheck/various/argmax/ The key lesson: do not use shell wild-cards in production code unless 1) by design you have a known upper limit on the number of files you can have, and 2) you've tested your code at that upper limit. Ways around this include doing the ls function all in perl by reading the directory yourself, or using alternative shell command pipelines that do not suffer this limit (for example, use find). Conrad Kimball Associate Technical Fellow IT - CNO, Shared Services Group [EMAIL PROTECTED] P.O.Box 24346, MS 7M-HC Seattle, WA 98124-0346 Bellevue 33-12 bldg, office 32C1 Phone: (425) 865-6410 Pager: (206) 797-3112 Cell: (425) 591-7802 -Original Message- From: Madani, Srikanth, VF-DE [mailto:[EMAIL PROTECTED] Sent: Monday, May 09, 2005 5:53 AM To: Vamsi_Doddapaneni; dbi-users@perl.org; CAMPBELL, BRIAN D (BRIAN) Subject: RE: /usr/bin/ls: 0403-027 The parameter list is too long Vamsi_Doddapaneni wrote on Montag, 9. Mai 2005 12:16 Here is the code part: foreach $name(`ls $opt_i/*.xml`){ chomp; push @f, $name; print pushing elements=$name\n; } [EMAIL PROTECTED]; Now in the directory $opt_i if there are some 10 , 20 or even 100 its working well. But now I have some 305 odd xmls and the code is EXITING WITH sh: /usr/bin/ls: 0403-027 The parameter list is too long. It's strange that your ls fails to handle 300+ files - is $opt_i being expanded correctly? And I don't ever recall seeing an ls display an error code upon failure. In any case, I would suggest using the Perl built-in to read the directory listing, instead of using the system ls command. Here's sample, albeit untested code: my $sample_dir = $opt_i; chdir $sample_dir || die \nFatal error : Cannot cd to $sample_dir\n; opendir SAMPLEDIR, $sample_dir || die \nFatal error : Cannot read directory $sample_dir.\n; my @ELEMENTS = grep /\.xml$/, readdir SAMPLEDIR; close SAMPLEDIR; The list @ELEMENTS will contain all *.xml files in $opt_i, if any. BTW, this is slightly OT for the DBI-users list. Cheers, Srikanth Madani Life is short. Be swift to love! Make haste to be kind! -Henri Frederic Amiel
RE: Newbie problem connecting to MS SQL Server
All, I did not get any responses back to my previous message (see below). The other item I found interesting is that the port on the DB box is 4000, even though my freetds.conf says it should be 1433. Am I missing how this is supposed to work. I would appreciate any and all thoughts on this subject. Thanks, Mark Mark Vaughan Programmer III Direct: +1 303 802 2426 Cell: +1 303 601 4434 Fax: +1 303 802 1420 [EMAIL PROTECTED] Evolving Systems, Inc. 9777 Pyramid Court, Suite 100, Englewood, CO USA 80112 www.evolving.com -Original Message- From: Mark Vaughan Sent: Wednesday, May 04, 2005 1:29 PM To: 'Thomas A. Lowery'; DBI users Subject: RE: Newbie problem connecting to MS SQL Server I have proceeded further (Thanks Tom). I had a blank local file (~/.odbc.ini) and I removed it. Now I'm getting a Connection refused error, so at least it's trying to talk to the server. Any thoughts? Here is the output from CPAN's 'install DBD::ODBC' command: cpan install DBD::ODBC CPAN: Storable loaded ok Going to read /.cpan/Metadata Database was generated on Mon, 02 May 2005 07:56:55 GMT Running install for module DBD::ODBC Running make for J/JU/JURL/DBD-ODBC-1.13.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for /.cpan/sources/authors/id/J/JU/JURL/DBD-ODBC-1.13.tar.gz ok Scanning cache /.cpan/build for sizes x DBD-ODBC-1.13, 0 bytes, 0 tape blocks x DBD-ODBC-1.13/Changes, 32299 bytes, 64 tape blocks x DBD-ODBC-1.13/dbdimp.c, 127985 bytes, 250 tape blocks x DBD-ODBC-1.13/dbdimp.h, 7559 bytes, 15 tape blocks x DBD-ODBC-1.13/dbivport.h, 1253 bytes, 3 tape blocks x DBD-ODBC-1.13/fixup_c.h, 251 bytes, 1 tape blocks x DBD-ODBC-1.13/fixup_t.h, 243 bytes, 1 tape blocks x DBD-ODBC-1.13/Makefile.PL, 16670 bytes, 33 tape blocks x DBD-ODBC-1.13/MANIFEST, 1216 bytes, 3 tape blocks x DBD-ODBC-1.13/MANIFEST.SKIP, 126 bytes, 1 tape blocks x DBD-ODBC-1.13/META.yml, 343 bytes, 1 tape blocks x DBD-ODBC-1.13/mytest, 0 bytes, 0 tape blocks x DBD-ODBC-1.13/mytest/coltest.pl, 758 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/contest.pl, 669 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/joetest.pl, 2281 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/joetest2.pl, 808 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/joetest4.pl, 790 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/joetest5.pl, 1210 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/joetest6.pl, 259 bytes, 1 tape blocks x DBD-ODBC-1.13/mytest/joetest7.pl, 1692 bytes, 4 tape blocks x DBD-ODBC-1.13/mytest/leakcheck.pl, 2140 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/listtabs.pl, 899 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/longbin.pl, 2631 bytes, 6 tape blocks x DBD-ODBC-1.13/mytest/moreresults.pl, 810 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/proctest1.pl, 2125 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/proctest2.pl, 2442 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/proctest3.pl, 1052 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/randombind.pl, 2945 bytes, 6 tape blocks x DBD-ODBC-1.13/mytest/sqltmptabs.pl, 690 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testconn.pl, 2406 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/testconnspeed.pl, 916 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testdatasources.pl, 156 bytes, 1 tape blocks x DBD-ODBC-1.13/mytest/testdestruction.pl, 2319 bytes, 5 tape blocks x DBD-ODBC-1.13/mytest/testerrhandler.pl, 692 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testfunc.pl, 3286 bytes, 7 tape blocks x DBD-ODBC-1.13/mytest/testgetinfo.pl, 366 bytes, 1 tape blocks x DBD-ODBC-1.13/mytest/testigparams.pl, 1745 bytes, 4 tape blocks x DBD-ODBC-1.13/mytest/testinout.pl, 1742 bytes, 4 tape blocks x DBD-ODBC-1.13/mytest/testkeys.pl, 944 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testmulti.pl, 698 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testproc.pl, 916 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testproc2.pl, 1226 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/testproc3.pl, 1183 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/testspmulti.pl, 1063 bytes, 3 tape blocks x DBD-ODBC-1.13/mytest/testundef.pl, 682 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testundef2.pl, 986 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testundef3.pl, 707 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testver.pl, 627 bytes, 2 tape blocks x DBD-ODBC-1.13/mytest/testxml.pl, 1974 bytes, 4 tape blocks x DBD-ODBC-1.13/mytest/timetest.pl, 1264 bytes, 3 tape blocks x DBD-ODBC-1.13/ODBC.h, 1914 bytes, 4 tape blocks x DBD-ODBC-1.13/ODBC.pm, 30728 bytes, 61 tape blocks x DBD-ODBC-1.13/ODBC.xs, 6203 bytes, 13 tape blocks x DBD-ODBC-1.13/README, 5906 bytes, 12 tape blocks x DBD-ODBC-1.13/README.adabas, 1298 bytes, 3 tape blocks x DBD-ODBC-1.13/README.hpux, 965 bytes, 2 tape blocks x DBD-ODBC-1.13/README.informix, 1057 bytes, 3 tape blocks x DBD-ODBC-1.13/README.RH9, 498 bytes, 1 tape blocks x DBD-ODBC-1.13/t, 0 bytes, 0 tape blocks x DBD-ODBC-1.13/t/01base.t, 377 bytes, 1 tape blocks x DBD-ODBC-1.13/t/02simple.t, 7466 bytes, 15 tape blocks x DBD-ODBC-1.13/t/03dbatt.t, 5340
OT: Re: /usr/bin/ls: 0403-027 The parameter list is too long
On Mon, May 09, 2005 at 03:46:20PM +0530, Vamsi_Doddapaneni wrote: Here is the code part: foreach $name(`ls $opt_i/*.xml`){ Change this to: foreach $name (glob($opt_i/*.xml)) { You can learn more here: $ perldoc -f glob chomp; push @f, $name; print pushing elements=$name\n; } [EMAIL PROTECTED]; Now in the directory $opt_i if there are some 10 , 20 or even 100 its working well. But now I have some 305 odd xmls and the code is EXITING WITH sh: /usr/bin/ls: 0403-027 The parameter list is too long. As suggested previously, you should normally only get this when there are tens of thousands of files on the command line. What operating system and version are you running? For UNIX systems, the kernel is compiled to allow a set amount of information to be passed during an exec. The information that is passed includes the command line arguments, the environment, and some other little stuff. If your environment is large, e.g., you have a _lot_ (thousands) or environment variables or one environment variable that is really large (perhaps you are setting environment variables in your script?), then the total number of command line arguments you are allowed may be significantly reduced. http://www.linuxjournal.com/article/6060 In unix prompt ls *.xml is working (giving out those 305 xmls) This points to the fact that either your $opt_i is not set propertly or you are setting some environment variables in your script that are causing problems. 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. Duly noted. dd -- David Dooling
RE: /usr/bin/ls: 0403-027 The parameter list is too long
Try something like this instead. You should always use native perl calls to get the job done. Also, this isn't something to discuss in the dbi-user list. opendir(DIR, $dirname) or die can't opendir $dirname: $!; while (defined($file = readdir(DIR))) { if( -f $dirname/$file $dirname/$file =~ /\.xml$/ ){ # do something with $dirname/$file } } closedir(DIR); -Original Message- From: Vamsi_Doddapaneni [mailto:[EMAIL PROTECTED] Sent: Monday, May 09, 2005 4:16 AM To: CAMPBELL, BRIAN D (BRIAN); dbi-users@perl.org Subject: /usr/bin/ls: 0403-027 The parameter list is too long Importance: High Hi all, Thanks for your help. I am facing a new problem. Here is the code part: foreach $name(`ls $opt_i/*.xml`){ chomp; push @f, $name; print pushing elements=$name\n; } [EMAIL PROTECTED]; Now in the directory $opt_i if there are some 10 , 20 or even 100 its working well. But now I have some 305 odd xmls and the code is EXITING WITH sh: /usr/bin/ls: 0403-027 The parameter list is too long. In unix prompt ls *.xml is working (giving out those 305 xmls) Could anybody help me out? Thanks and Regards 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.
SEGV error
All, While executing CPAN's install DBD::ODBC command test #2 fails. Here is the output when run by hand: /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/local/lib/perl5/5.6.1/sun4-solaris -I/usr/local/lib/perl5/5.6.1 t/02simple.t 1..36 ok 1 - use DBI; ok 2 - use ODBCTEST; DBI 1.48-nothread default trace level set to 0x0/3 (pid 15136) - DBI-connect(, , ) - DBI-install_driver(ODBC) for solaris perl=5.006001 pid=15136 ruid=0 euid=0 install_driver: DBD::ODBC version 1.13 loaded from blib/lib/DBD/ODBC.pm New DBI::dr (for DBD::ODBC::dr, parent=, id=) dbih_setup_handle(DBI::dr=HASH(0x224600)=DBI::dr=HASH(0x285954), DBD::ODBC::dr, 0, Null!) dbih_make_com(Null!, 0, DBD::ODBC::dr, 92, 0) thr#0 - install_driver= DBI::dr=HASH(0x224600) - default_user in DBD::_::dr for DBD::ODBC::dr (DBI::dr=HASH(0x224600)~0x285954 undef undef HASH(0x1fa870)) - default_user= ( 'mallard' '[EMAIL PROTECTED]@R' ) [2 items] at DBI.pm line 580 via t/02simple.t line 21 - connect for DBD::ODBC::dr (DBI::dr=HASH(0x224600)~0x285954 'mallard' 'mallard' HASH(0x2714bc)) New DBI::db (for DBD::ODBC::db, parent=DBI::dr=HASH(0x285954), id=) dbih_setup_handle(DBI::db=HASH(0x285918)=DBI::db=HASH(0x2714ec), DBD::ODBC::db, 224340, Null!) dbih_make_com(DBI::dr=HASH(0x285954), 24a788, DBD::ODBC::db, 224, 0) thr#0 SQLConnect 'mallard', 'mallard' SQLGetFunctions - SQL_MoreResults supported: 1 - connect= DBI::db=HASH(0x285918) at DBI.pm line 598 - STORE for DBD::ODBC::db (DBI::db=HASH(0x2714ec)~INNER 'PrintError' 1) DBD::ODBC unsupported attribute passed (PrintError) STORE DBI::db=HASH(0x2714ec) 'PrintError' = 1 - STORE= 1 at DBI.pm line 645 - STORE for DBD::ODBC::db (DBI::db=HASH(0x2714ec)~INNER 'AutoCommit' 1) - STORE= 1 at DBI.pm line 645 - STORE for DBD::ODBC::db (DBI::db=HASH(0x2714ec)~INNER 'Username' 'mallard') DBD::ODBC unsupported attribute passed (Username) STORE DBI::db=HASH(0x2714ec) 'Username' = 'mallard' - STORE= 1 at DBI.pm line 648 via t/02simple.t line 21 FETCH= 'mallard' ('Username' from cache) at DBI.pm line 648 - connect= DBI::db=HASH(0x285918) - STORE for DBD::ODBC::db (DBI::db=HASH(0x2714ec)~INNER 'dbi_connect_closure' CODE(0x28587c)) DBD::ODBC unsupported attribute passed (dbi_connect_closure) STORE DBI::db=HASH(0x2714ec) 'dbi_connect_closure' = CODE(0x28587c) - STORE= 1 at DBI.pm line 668 via t/02simple.t line 21 - STORE for DBD::ODBC::db (DBI::db=HASH(0x2714ec)~INNER 'AutoCommit' 1) - STORE= 1 at 02simple.t line 27 ok 3 - Set Auto commit - FETCH for DBD::ODBC::db (DBI::db=HASH(0x2714ec)~INNER 'AutoCommit') dbd_error: err_rc=0 rc=0 s/d/e: 0/2541576/2629640 dbd_error: err_rc=0 rc=0 s/d/e: 0/0/2629640 - FETCH= 1 at Builder.pm line 472 via /usr/local/lib/perl5/site_perl/5.6.1/Test/More.pm line 362 ok 4 - Auto commit retrieved to what was set - STORE for DBD::ODBC::db (DBI::db=HASH(0x2714ec)~INNER 'PrintError' 0) DBD::ODBC unsupported attribute passed (PrintError) STORE DBI::db=HASH(0x2714ec) 'PrintError' = 0 - STORE= 1 at ODBCTEST.pm line 71 via t/02simple.t line 34 - do for DBD::ODBC::db (DBI::db=HASH(0x285918)~0x2714ec 'DROP TABLE PERL_DBD_TEST') Segmentation Fault(coredump) Environment: Solaris 2.8 Perl 5.6.1 DBI: 1.48 DBD::ODBC: 1.13 I have looked in the docs and found nothing to help with this problem so, as per usual, any and all help would be greatly appreciated. Thanks, Mark Mark Vaughan Programmer III Direct: +1 303 802 2426 Cell: +1 303 601 4434 Fax: +1 303 802 1420 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Evolving Systems, Inc. 9777 Pyramid Court, Suite 100, Englewood, CO USA 80112 www.evolving.com This e-mail and any attachments may be confidential and/or legally privileged. If you have received this e-mail and you are not a named addressee, please inform Evolving Systems TIS at [EMAIL PROTECTED] and then delete the e-mail from your system. If you are not a named addressee you must not use, disclose, distribute, copy, print or rely on this e-mail. To ensure regulatory compliance and for the protection of our clients and business, Evolving Systems may monitor and read e-mails sent to and from its servers. Although Evolving Systems routinely screens for viruses, addressees should scan this e-mail and any attachments for viruses. Evolving Systems makes no representation or warranty as to the absence of viruses in this e-mail or any attachments. Registered Office: 9777 Mt. Pyramid Ct Suite 100, Englewood, CO 80112
Re: /usr/bin/ls: 0403-027 The parameter list is too long
On Mon, May 09, 2005 at 02:52:53PM +0200, Madani, Srikanth, VF-DE wrote: BTW, this is slightly OT for the DBI-users list. Very. More than enough kinds folks have answered. Let's close it now. Tim.
Spreadsheet::WriteExcel question
My ignorance is showing. : ) I am pulling data out of Oracle and putting it into an Excel spreadsheet. Using this: while ( $row = $sth-fetchrow_arrayref ) { # this is a fast and simple way to deal with nulls: foreach (@$row) { $_ = '' unless defined } push (@results, @$row); } my $workbook = Spreadsheet::WriteExcel-new(report.xls); $worksheet = $workbook-add_worksheet(); $worksheet-write_row('A2', [EMAIL PROTECTED]); It give me columns of the data: sss 134 ABC Where I am looking for rows: s1A s3B s4C I know it has to do with my while statement...I am just not up to speed on what. Thanks for any help. Robert
Re: /usr/bin/ls: 0403-027 The parameter list is too long
On May 9, 2005, at 4:16 AM, Vamsi_Doddapaneni wrote: Hi all, Thanks for your help. I am facing a new problem. Here is the code part: Although I don't understand why it's doing that you might have better luck (not to mention better code) if used the Perl readdir command. foreach $name(`ls $opt_i/*.xml`){ chomp; push @f, $name; print pushing elements=$name\n; } [EMAIL PROTECTED]; Now in the directory $opt_i if there are some 10 , 20 or even 100 its working well. But now I have some 305 odd xmls and the code is EXITING WITH sh: /usr/bin/ls: 0403-027 The parameter list is too long. In unix prompt ls *.xml is working (giving out those 305 xmls) Could anybody help me out? Thanks and Regards 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. h short answer yes with an if, long answer no with a but Reverend Lovejoy
Installing DBI and DBD::TSM
I have two questions, first do I understand correctly to use DBD::TSM 1.48 I must have DBI installed? Second, I am having trouble installing DBI. Here's some info: I am very much a newbie at compiling code, any help will be so appreciated!! Thanks, Jackie AIX unix 5.2.0.0 chewbacca:/adsm2/perl/DBI-1.48 # which gcc /usr/bin/gcc chewbacca:/ # gcc -v Reading specs from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/specs Configured with: ../gcc-3.3.2/configure : (reconfigured) ../gcc-3.3.2/configure --disable-nls : (reconfigured) ../gcc-3.3.2/configure --disable-nls Thread model: aix gcc version 3.3.2 chewbacca:/adsm2/perl/DBI-1.48 # which cc /usr/local/bin/cc chewbacca:/ # cc -v Reading specs from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/specs Configured with: ../gcc-3.3.2/configure : (reconfigured) ../gcc-3.3.2/configure --disable-nls : (reconfigured) ../gcc-3.3.2/configure --disable-nls Thread model: aix gcc version 3.3.2 chewbacca:/ # perl -v This is perl, v5.8.0 built for aix-thread-multi Copyright 1987-2002, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. chewbacca:/adsm2/perl/DBI-1.48 # make realclean rm -f blib/script/dbiprof blib/script/dbiproxy rm -rf Perl.c DBI.c DBI-1.48 Perl.xsi t/zv*_*.t dbiproxy dbiprof dbitrac e.log dbi.prof ndtest.prt ./blib Makefile.aperl blib/arch/auto/DBI/extralibs.all perlmain.c tmon.out mon.out so_locations pm_to_blib *.o *.a perl.exe perl perl DBI.bs DBI.bso DBI.def libDBI.def DBI.exp DBI.x core core.*perl.*.? *perl.core mv Makefile Makefile.old /dev/null 21 rm -rf blib/lib/auto/DBI blib/arch/auto/DBI rm -rf DBI-1.48 rm -f blib/arch/auto/DBI/DBI.so blib/arch/auto/DBI/DBI.bs rm -f blib/arch/auto/DBI/DBI.a rm -f blib/arch/auto/DBI/Driver_xst.h blib/lib/DBD/Proxy.pm blib/lib/DB D/DBM.pm rm -f blib/arch/auto/DBI/DBIXS.h blib/lib/DBI/Const/GetInfoType.pm blib/ lib/Roadmap.pod rm -f blib/lib/DBI/DBD/Metadata.pm blib/lib/DBI/Const/GetInfo/ODBC.pm rm -f blib/lib/DBI/ProfileDumper/Apache.pm blib/arch/auto/DBI/Driver.xst rm -f blib/lib/DBD/File.pm blib/lib/DBD/NullP.pm blib/arch/auto/DBI/dbi_ sql.h rm -f blib/arch/auto/DBI/dbivport.h blib/arch/auto/DBI/dbd_xsh.h blib/li b/DBI/FAQ.pm rm -f blib/lib/DBI/SQL/Nano.pm blib/lib/DBI/Const/GetInfo/ANSI.pm blib/l ib/DBI.pm rm -f blib/lib/DBI/Const/GetInfoReturn.pm blib/lib/DBD/Sponge.pm rm -f blib/lib/DBI/W32ODBC.pm blib/lib/Bundle/DBI.pm blib/lib/DBI/Profil e.pm rm -f blib/lib/DBI/ProfileDumper.pm blib/lib/DBI/ProxyServer.pm rm -f blib/arch/auto/DBI/dbipport.h blib/lib/DBI/DBD.pm blib/lib/Win32/D BIODBC.pm rm -f blib/lib/DBI/PurePerl.pm blib/lib/DBD/ExampleP.pm blib/lib/DBI/Pro fileData.pm rm -rf Makefile Makefile.old chewbacca:/adsm2/perl/DBI-1.48 # perl Makefile.PL *** You are using a perl configured with threading enabled. *** You should be aware that using multiple threads is *** not recommended for production environments. *** Note: The optional PlRPC-modules (RPC::PlServer etc) are not installed. If you want to use the DBD::Proxy driver and DBI::ProxyServer modules, then you'll need to install the RPC::PlServer, RPC::PlClie Storable and Net::Daemon modules. The CPAN Bundle::DBI may help you You can install them any time after installing the DBI. You do *not* need these modules for typical DBI usage. Optional modules are available from any CPAN mirror, in particular http://search.cpan.org/ http://www.perl.com/CPAN/modules/by-module http://www.perl.org/CPAN/modules/by-module ftp://ftp.funet.fi/pub/languages/perl/CPAN/modules/by-module Creating DBI::PurePerltest variant: t/zvpp_01basics.t Creating DBI::PurePerltest variant: t/zvpp_02dbidrv.t Creating DBI::PurePerltest variant: t/zvpp_03handle.t Creating DBI::PurePerltest variant: t/zvpp_04mods.t Creating DBI::PurePerltest variant: t/zvpp_05thrclone.t (use thread Creating DBI::PurePerltest variant: t/zvpp_06attrs.t Creating DBI::PurePerltest variant: t/zvpp_07kids.t Creating DBI::PurePerltest variant: t/zvpp_08keeperr.t Creating DBI::PurePerltest variant: t/zvpp_09trace.t Creating DBI::PurePerltest variant: t/zvpp_10examp.t Creating DBI::PurePerltest variant: t/zvpp_11fetch.t Creating DBI::PurePerltest variant: t/zvpp_14utf8.t Creating DBI::PurePerltest variant: t/zvpp_15array.t Creating DBI::PurePerltest variant: t/zvpp_20meta.t Creating DBI::PurePerltest variant: t/zvpp_30subclass.t Creating DBI::PurePerltest variant: t/zvpp_40profile.t Creating
SQL -25507 error trying to build DBD::Informix on linux
Hi, I'm running into a problem trying to build DBD::Informix on a Redhat ES3 host, with a database on a Solaris 9 host. Client: RedHat ES3, 2.4.21-15.0.4.ELsmp, perl v5.8.0, Informix clientsdk.2.90.UC1.LINUX installed. Trying to install DBD-Informix-2005.01 Database server: Solaris 9, Informix 9.40.UC4 /etc/services and $INFORMIXDIR/etc/sqlhosts are fine. (olsoctcp specified in the sqlhosts file.) I've created a specific user for this, and that user has all the appropriate privs if I connect as it on the db server. On the linux host I've set all the environment variables correctly, but end up with this: .. Testing whether your Informix test environment will work... ESQLTEST Program Running: @(#)$Id: esqltest.ec,v 2004.1 2004/11/16 22:29:43 jleffler Exp $ $INFORMIXDIR is set to '/opt/informix'. $INFORMIXSERVER is set to 'flydev'. $DBI_DBNAME unset - defaulting to 'stores'. $DBD_INFORMIX_DATABASE unset - defaulting to 'stores'. $DBD_INFORMIX_DATABASE2 unset - defaulting to 'stores'. $DBD_INFORMIX_USERNAME is set to 'monfly'. $DBD_INFORMIX_USERNAME2 is set to 'monfly'. $DBD_INFORMIX_PASSWORD is set. $DBD_INFORMIX_PASSWORD2 is set. Testing connection to stores CONNECT TO 'stores' with user info SQL: -25507: Failed to locate SQL error message Testing concurrent connection to stores CONNECT TO 'stores' with user info SQL: -25507: Failed to locate SQL error message Does anyone have any ideas? Any help would be appreciated. (Oh, and apologies for the disclaimer at the end of this message. The company's email server tacks it on automatically.) -- Bruce Z. Lysik [EMAIL PROTECTED] Operations Engineer The information contained in this message (including any attachments) may be confidential. This message (including any attachments) is intended to be read only by the recipient(s) to whom it is addressed. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. If you have received this message in error, please immediately notify the sender and/or Shutterfly by telephone at (650) 610-5200 and delete or destroy any copy of this message (including any attachments).
RE: Spreadsheet::WriteExcel question
This is really off topic. -Original Message- From: Robert [mailto:[EMAIL PROTECTED] Sent: Mon 5/9/2005 1:45 PM To: dbi-users@perl.org Subject: Spreadsheet::WriteExcel question My ignorance is showing. : ) I am pulling data out of Oracle and putting it into an Excel spreadsheet. Using this: while ( $row = $sth-fetchrow_arrayref ) { # this is a fast and simple way to deal with nulls: foreach (@$row) { $_ = '' unless defined } push (@results, @$row); } my $workbook = Spreadsheet::WriteExcel-new(report.xls); $worksheet = $workbook-add_worksheet(); $worksheet-write_row('A2', [EMAIL PROTECTED]); It give me columns of the data: sss 134 ABC Where I am looking for rows: s1A s3B s4C I know it has to do with my while statement...I am just not up to speed on what. Thanks for any help. Robert
Re: Spreadsheet::WriteExcel question
On 05/09/2005 12:45 PM, Robert said: I am pulling data out of Oracle and putting it into an Excel spreadsheet. Using this: while ( $row = $sth-fetchrow_arrayref ) { # this is a fast and simple way to deal with nulls: foreach (@$row) { $_ = '' unless defined } push (@results, @$row); This puts all the columns fetched into one linear array. For database contents: row0: s, 1, A row1: s, 3, B row2: s, 4, C @results = ( s, 1, A, s, 3, B, s, 4, C ) If you want to keep straight which rows are which, you need something like this: # Use [] to make sure each row is a separate array reference. push @results, [ @$row ]; } my $workbook = Spreadsheet::WriteExcel-new(report.xls); $worksheet = $workbook-add_worksheet(); $worksheet-write_row('A2', [EMAIL PROTECTED]); I can't say what this does because this isn't the Spreadsheet list. -- 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.
Re: SQL -25507 error trying to build DBD::Informix on linux
On 5/9/05, Bruce Lysik [EMAIL PROTECTED] wrote: I'm running into a problem trying to build DBD::Informix on a Redhat ES3 host, with a database on a Solaris 9 host. Client: RedHat ES3, 2.4.21-15.0.4.ELsmp, perl v5.8.0, Informix clientsdk.2.90.UC1.LINUX installed. Trying to install DBD-Informix-2005.01 Database server: Solaris 9, Informix 9.40.UC4 Thanks for this much information. /etc/services and $INFORMIXDIR/etc/sqlhosts are fine. (olsoctcp specified in the sqlhosts file.) Well, the error message -25507is The specified service name or protocol is unknown. More significantly, the code failed to find the error message file. You assert that sqlhosts and services are fine, but don't show us the value of $INFORMIXSERVER, the entry in the sqlhosts file (though you're right - olsoctcp is correct on Linux, even though it is oltlitcp on Solaris 9), or the entry in services on the Linux or the Solaris host. However, I'm suspicious about the error message files - what NLS environment do you have set? LC_ALL? Or any of the LC_* variables? What is in your environment related to Informix? What is in the sqlhosts file, services, and the ONCONFIG file on the Solaris machine? The names need to match... But I'm most suspicious that $INFORMIXDIR/msg/en_us/0333 is incomplete, somehow. I found +25507 in netserv.iem and cnetserv.iem. Are those files present? Have you managed to get any ESQL/C program to connect to your database server from your Linux box? I suspect not. You should read the README file and look at the discussion of esqlbasic.ec and getting that to work before adding Perl into the mix. It's odd - you've clearly got quite a lot of the stuff you need around - the program doesn't run as much as you show if you don't. You could try running 'infxmsg -25507' and 'infxmsg +22507' and see what you get. Some of these questions would have been answered had you used the bug reporting mechanism documented in the README file. I've created a specific user for this, and that user has all the appropriate privs if I connect as it on the db server. On the linux host I've set all the environment variables correctly, but ...but you don't show the values to me so that I can verify them. end up with this: .. Testing whether your Informix test environment will work... ESQLTEST Program Running: @(#)$Id: esqltest.ec,v 2004.1 2004/11/16 22:29:43 jleffler Exp $ $INFORMIXDIR is set to '/opt/informix'. $INFORMIXSERVER is set to 'flydev'. $DBI_DBNAME unset - defaulting to 'stores'. $DBD_INFORMIX_DATABASE unset - defaulting to 'stores'. $DBD_INFORMIX_DATABASE2 unset - defaulting to 'stores'. $DBD_INFORMIX_USERNAME is set to 'monfly'. $DBD_INFORMIX_USERNAME2 is set to 'monfly'. $DBD_INFORMIX_PASSWORD is set. $DBD_INFORMIX_PASSWORD2 is set. Testing connection to stores CONNECT TO 'stores' with user info SQL: -25507: Failed to locate SQL error message Testing concurrent connection to stores CONNECT TO 'stores' with user info SQL: -25507: Failed to locate SQL error message Does anyone have any ideas? Any help would be appreciated. Can you connect to the server as monfly on your Solaris machine? Since you've got passwords set, I assume they are correct, case-sensitive and all. I'm still a little worried about me finding error +25507 and the code reporting error -25507. There are a couple of positive error numbers (grrr; don't ask me about it) and this may be one of them. Since the error is about service name or protocol name and you assert that 'flydev' is correctly set to olsoctcp, I'm left wondering about the service name - still. -- Jonathan Leffler [EMAIL PROTECTED] #include disclaimer.h Guardian of DBD::Informix - v2005.01 - http://dbi.perl.org I don't suffer from insanity - I enjoy every minute of it.
Executing Oracle stored procedures
All, I've got Apache v2.x, Oracle 9i, running on Red Hat linux 9, mod_perl, and DBI installed and working. I'd like to be able to execute Oracle stored procedures. Is anyone doing this without the mod_plsql plugin? If so, would you be wlling to share tips for making this work. I've already got stored procedures and am connecting to the database but am seeing the following errors. DBD::Oracle::db do failed ORA-06502.: PL/SQL: numeric or value error ORA-06502: at SYS.OWA_UTIL, line 323 I really need to know if there is something Apche needs to display pages generated fro stored procedures. Any help will be appreciated. thanks. Kevin
Re: Installing DBI and DBD::TSM
On 05/09/2005 03:47 PM, De Joe, Jackie said: I have two questions, first do I understand correctly to use DBD::TSM 1.48 I must have DBI installed? You understand correctly. Second, I am having trouble installing DBI. Here's some info: I am very much a newbie at compiling code, any help will be so appreciated!! AIX unix 5.2.0.0 chewbacca:/adsm2/perl/DBI-1.48 # which gcc /usr/bin/gcc chewbacca:/ # gcc -v Reading specs from /usr/local/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/specs Configured with: ../gcc-3.3.2/configure : (reconfigured) ../gcc-3.3.2/configure --disable-nls : (reconfigured) ../gcc-3.3.2/configure --disable-nls Thread model: aix gcc version 3.3.2 This is irrelevant. Your local perl was build with cc_r, so you need that to build any Perl modules that have XS components. chewbacca:/ # perl -v The output from `perl -V` would be more interesting. In particular, it would tell you what compiler was used to build perl. chewbacca:/adsm2/perl/DBI-1.48 # make ... cc_r -c-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlon glong -O-DVERSION=\1.48\ -DXS_VERSION=\1.48\ -I/usr/opt/perl5/lib/5.8 .0/aix-thread-multi/CORE Perl.c /bin/sh: cc_r: not found. This error means exactly what it says. The right compiler is either not installed or not in a directory in your $PATH. http://search.cpan.org/src/TIMB/DBI-1.48/README Read the section starting with IF YOU HAVE PROBLEMS. -- 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.