cvsuser 02/03/19 14:14:51
Modified: P5EEx/Blue/P5EEx/Blue/Repository DBI.pm
Log:
allow Repository::DBI to use default method in Repository for store_row()
Revision Changes Path
1.9 +39 -39 p5ee/P5EEx/Blue/P5EEx/Blue/Repository/DBI.pm
Index: DBI.pm
===================================================================
RCS file: /cvs/public/p5ee/P5EEx/Blue/P5EEx/Blue/Repository/DBI.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -w -r1.8 -r1.9
--- DBI.pm 12 Mar 2002 17:02:11 -0000 1.8
+++ DBI.pm 19 Mar 2002 22:14:51 -0000 1.9
@@ -1,13 +1,13 @@
######################################################################
-## File: $Id: DBI.pm,v 1.8 2002/03/12 17:02:11 spadkins Exp $
+## File: $Id: DBI.pm,v 1.9 2002/03/19 22:14:51 spadkins Exp $
######################################################################
use P5EEx::Blue::P5EE;
use P5EEx::Blue::Repository;
package P5EEx::Blue::Repository::DBI;
-$VERSION = do { my @r=(q$Revision: 1.8 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
+$VERSION = do { my @r=(q$Revision: 1.9 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r};
@ISA = ( "P5EEx::Blue::Repository" );
@@ -1243,37 +1243,37 @@
}
# $ok = $rep->store_row ($table, \@cols, \@row, \@keycolidx, $update_first);
-sub store_row {
- my ($self, $table, $cols, $row, $keycolidx, $update_first) = @_;
- my ($update_sql, $insert_sql, $success);
-
- #print "store_row($table,\n [",
- # join(",",@$cols), "],\n [",
- # join(",",@$row), "],\n [",
- # join(",",@$keycolidx), "], $update_first);\n";
-
- $success = 0;
- if ($update_first) {
- $update_sql = $self->mk_update_row_sql($table,$cols,$row,$keycolidx);
- $success = $self->exec_sql($update_sql);
- $success = 0 if ($self->{numrows} == 0); # SQL succeeded but found no
rows to update
- if (!$success) {
- $insert_sql = $self->mk_insert_row_sql($table,$cols,$row);
- $success = $self->exec_sql($insert_sql);
- }
- }
- else {
- $insert_sql = $self->mk_insert_row_sql($table,$cols,$row);
- $success = $self->exec_sql($insert_sql);
- if (!$success) {
- $update_sql = $self->mk_update_row_sql($table,$cols,$row,$keycolidx);
- $success = $self->exec_sql($update_sql);
- $success = 0 if ($self->{numrows} == 0); # SQL succeeded but found
no rows to update
- }
- }
-
- $success;
-}
+#sub store_row {
+# my ($self, $table, $cols, $row, $keycolidx, $update_first) = @_;
+# my ($update_sql, $insert_sql, $success);
+#
+# #print "store_row($table,\n [",
+# # join(",",@$cols), "],\n [",
+# # join(",",@$row), "],\n [",
+# # join(",",@$keycolidx), "], $update_first);\n";
+#
+# $success = 0;
+# if ($update_first) {
+# $update_sql = $self->mk_update_row_sql($table,$cols,$row,$keycolidx);
+# $success = $self->exec_sql($update_sql);
+# $success = 0 if ($self->{numrows} == 0); # SQL succeeded but found no
rows to update
+# if (!$success) {
+# $insert_sql = $self->mk_insert_row_sql($table,$cols,$row);
+# $success = $self->exec_sql($insert_sql);
+# }
+# }
+# else {
+# $insert_sql = $self->mk_insert_row_sql($table,$cols,$row);
+# $success = $self->exec_sql($insert_sql);
+# if (!$success) {
+# $update_sql = $self->mk_update_row_sql($table,$cols,$row,$keycolidx);
+# $success = $self->exec_sql($update_sql);
+# $success = 0 if ($self->{numrows} == 0); # SQL succeeded but found
no rows to update
+# }
+# }
+#
+# $success;
+#}
# $ok = $rep->delete_row ($table, \@cols, \@row, \@keycolidx);
sub delete_row {
@@ -1609,12 +1609,12 @@
}
}
- if ($P5EEx::Blue::DEBUG >= 2 && $self->{context}->dbg(2)) {
- print "Table Metadata: $table\n";
- my $d = Data::Dumper->new([ $table_def ], [ "table_def" ]);
- $d->Indent(1);
- print $d->Dump();
- }
+ #if ($P5EEx::Blue::DEBUG >= 2 && $self->{context}->dbg(2)) {
+ # print "Table Metadata: $table\n";
+ # my $d = Data::Dumper->new([ $table_def ], [ "table_def" ]);
+ # $d->Indent(1);
+ # print $d->Dump();
+ #}
}
1;