I prefer to raiserrors and catch them using eval, like this:
$dbh-{RaiseError} = 1;
$sth = $dbh-prepare($insert_sql); ### prepare error will cause die
foreach $one (@many) {
eval {
$sth-execute($one); ### execute error caught in eval's $@
};
if ($@) {
warn Error on
Is there a way to back through a recordset after I've already gone through
it?
I want to go through the recordset, determining if certain groups of
records meet my criteria. Then I want to go through again and print the
groups that qualify. Since I have to deal with groups of records, I
I don't think so. Why don't you put the selected records in an auxiliary
structure (hash, array) and then go through that structure?
Saludos,
Marcelo.
I was considering this, but just thought it would be easier to just set
the flag in an aux structure and loop through my original recordset again,
checking the flag each time.
Anyone know if there is a definitive yes/no on this?
Thanks,
Don.
--
Don Seiler [EMAIL PROTECTED]
In Oracle database SQL
The from clause can contain another sql statement as temp table. In which
you can select the demanded records, then testify for the qualification in
the main SQL.
For example:
Select a.column1, a.column2
From (select column1, column2
From table_name
Actually the nature of the problem is what stopped me from doing this.
I won't know which records I want until I look at the group of them.
Example: I have a table of records. There is a groupnum column. Many
records have the same groupnum, i.e. they are in the same group. I'm
only
Hello,
I am trying to execute an update to an Access database. The statement
has two placeholders, and I put two variables between the parentheses in
the execute statement, and yet Access tells me it expects 3 parameters.
This is the prepare:
my $sth_del = $dbh-prepare(
UPDATE [DBI_TEST]
SET
Don Seiler writes:
I was considering this, but just thought it would be easier to just set
the flag in an aux structure and loop through my original recordset again,
checking the flag each time.
Anyone know if there is a definitive yes/no on this?
There are various issues to consider,
Basically, when I get to a new group number. The record set is ordered by
group number, so all records in a group are together. As I'm looping
through records in a group, I do some evaluation and add values to
variables. When I get to a new group number, I look at the values. If
they meet my
Perhaps I'm missing it, then.
basically my query is this:
select cust_no, acct_type, acct_status, group_num
from cust,acct
where cust.cust_no=acct.cust_no
order by group_num
the values of acct_type and acct_status for all of the records in
a group determine if I want that group or not. I
I'll second the suggestion made a few messages back about storing your
results in some other data structure (as opposed to re-traversing the data
structure that DBI gives you).
In your circumstances, I'd probably put the retrieved rows in a hash of
arrays (keyed by group number) before doing
That will probably be the solution.
Thanks to all involved!
Don.
On Thu, 1 Nov 2001, David Marshall wrote:
I'll second the suggestion made a few messages back about storing your
results in some other data structure (as opposed to re-traversing the data
structure that DBI gives you).
In
From: Don Seiler [mailto:[EMAIL PROTECTED]]
Basically, when I get to a new group number. The record set
is ordered by
group number, so all records in a group are together. As I'm looping
through records in a group, I do some evaluation and add values to
variables. When I get to a new
At 12:28 11/01/2001, Mahdi A. Sbeih wrote:
Hi Gary,
Thanks for these steps,
I have some questions for you:
- The shell script at the beginning of your email is to be used
after compiling Perl statically with all needed modules other
than DBD::Informix, right?
After everything BUT the
On Thu, 01 Nov 2001 11:03:56 -0800, Alan Hogue wrote:
I am trying to execute an update to an Access database. The statement
has two placeholders, and I put two variables between the parentheses in
the execute statement, and yet Access tells me it expects 3 parameters.
This behaviour has had me
May be a simple Q...
How do I get column names and order of column names
for a select * from ... query.
I dont want to use selecthash_ref just for column names.
Thanks in advance,
--MVRamana
_
Get your FREE download of MSN
I am developing an Intranet for my company. We have an oracle database version 8i
running on another Linux machine. which I want to use as a backborn.
I have tried to Install DBI on Windows NT Server using:
perl Makefile.pl
and I get an error: Can't locate loadable for modle DBI ...In
Use ActivePerl from www.activestate.com. Use it's ppm utility to install
modules (binaries).
See docs for ppm.
Ilya
-Original Message-
From: Ivan Kavuma [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 02, 2001 1:51 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject:
18 matches
Mail list logo