Have you seen this error before?
I am getting the error: ARRAY(0x1024df4) ARRAY(0x1024df4) ARRAY(0x1024df4) ARRAY(0x1024df4) ARRAY(0x1024df4) ARRAY(0x1024df4) ARRAY(0x1024df4) ARRAY(0x1024df4) ARRAY(0x1024df4) ARRAY(0x1024df4) when I run the script below: #!/usr/bin/perl -w use strict; use DBI; my $dbh = DBI-connect($database, $username, $passwd) or die Can't connect to Oracle database: \n $DBI::errstr\n; $dbh-{RaiseError} = 1; #Set up your sql statement that you want to run in Oracle my $sql=qq( select ctn from ctn_inv where rownum 11 ); #Prepare the SQL statement for running and it'll be stored in Oracle buffer my $sth=$dbh-prepare($sql); #Execute the SQL statememt $sth-execute; while( my $record= $sth-fetch()) { print $record\n; } - Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger
Re: Have you seen this error before?
On Jun 10, 2004, at 12:36 PM, jason corbett wrote: I am getting the error: ARRAY(0x1024df4) It's not an error. It's what you see when you try to print an array reference. This line is where it's coming from: print $record\n; If you wanted to see what's in the array referenced by $record, try: print @$record\n; Hope that helps. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Have you seen this error before?
On Jun 10, 2004, at 12:56 PM, jason corbett wrote: Thanks for the advice. No problem. What is best for selecting records from a database: Hash or Array? Array if you want to walk it be index, hash if you want to walk it by name. There is no best. ;) James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: Have you seen this error before?
Let's keep our discussions on the list, so we can all help and learn. On Jun 10, 2004, at 1:15 PM, jason corbett wrote: This statement ( print %record}.\n; print %record}.\n; ) from my script below keeps giving the error use of uninitialized value in list argument at filename line ##, STDLIN line 3. How about this? What does this one mean? You did not put a script below for me to examine. Generally, printing a hash should look something like: print $_ = $hash{$_}\n foreach keys %hash; If you instead have a reference to a hash, you need a minor change: print $_ = $hash-{$_}\n foreach keys %$hash; Hope that helps. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response