tambde
asked on
How to update long field in oracle 7.3?
Hi,
I am writing a program which needs the program to update long field in the table.
I am using oracle 7.3 on solaris 2.6 and dbi module to connect to the oracle data base from the perl program.
when my input field is very small then i can update Long field properly but when my input variable grows to 4000 bytes or more it just aborts (doesn't update the long field).
I tried this on oracle 8 on windows NT 4.0 Then it works perfectly but does not work on the oracle 7.3 on solaris 2.6.
I am writing a program which needs the program to update long field in the table.
I am using oracle 7.3 on solaris 2.6 and dbi module to connect to the oracle data base from the perl program.
when my input field is very small then i can update Long field properly but when my input variable grows to 4000 bytes or more it just aborts (doesn't update the long field).
I tried this on oracle 8 on windows NT 4.0 Then it works perfectly but does not work on the oracle 7.3 on solaris 2.6.
I had the same problem, and I had to give up on perl and use a procedure using PL/SQL when I could guarantee that the long field was under 2 megs and I had to use the Pro C compiler when the long field could be over 2 Megs.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oops... typo.
change:
($sql, $file_ref) = @_;
to:
($sql, $long_string) = @_;
change:
($sql, $file_ref) = @_;
to:
($sql, $long_string) = @_;
ASKER
$sql="update publication set
due_date='2000-1-22|2000-1 -23|2000-1 -24|2000-1 -25|2000-1 -26|2000-1 -27|2000-1 -28|2000-1 -29|2000-1 -30|2000-1 -31|2000-2 -1|2000-2- 2|2000-2-3 |2000-2-4| 2000-2-5|2 000-2-6|20 00-2-7|200 0-2-8|2000 -2-9|2000- 2-10|2000- 2-11|2000- 2-12|2000- 2-13|2000- 2-14|2000- 2-15|2000- 2-16|2000- 2-17|2000- 2-18|2000- 2-19|2000- 2-20|2000- 2-21|2000- 2-22|2000- 2-23|2000- 2-24|2000- 2-25|2000- 2-26|2000- 2-27|2000- 2-28|2000- 2-29|2000- 3-1|2000-3 -2|2000-3- 3|2000-3-4 |2000-3-5| 2000-3-6|2 000-3-7|20 00-3-8|200 0-3-9|2000 -3-10|2000 -3-11|2000 -3-12|2000 -3-13|2000 -3-14|2000 -3-15|2000 -3-16|2000 -3-17|2000 -3-18|2000 -3-19|2000 -3-20|2000 -3-21|2000 -3-22|2000 -3-23|2000 -3-24|2000 -3-25|2000 -3-26|2000 -3-27|2000 -3-28|2000 -3-29|2000 -3-30|2000 -3-31|2000 -4-1|2000- 4-2|2000-4 -3|2000-4- 4|2000-4-5 |2000-4-6| 2000-4-7|2 000-4-8|20 00-4-9|200 0-4-10|200 0-4-11|200 0-4-12|200 0-4-13|200 0-4-14|200 0-4-15|200 0-4-16|200 0-4-17|200 0-4-18|200 0-4-19|200 0-4-20|200 0-4-21|200 0-4-22|200 0-4-23|200 0-4-24|200 0-4-25|200 0-4-26|200 0-4-27|200 0-4-28|200 0-4-29|200 0-4-30|200 0-5-1|2000 -5-2|2000- 5-3|2000-5 -4|2000-5- 5|2000-5-6 |2000-5-7| 2000-5-8|2 000-5-9|20 00-5-10|20 00-5-11|20 00-5-12|20 00-5-13|20 00-5-14|20 00-5-15|20 00-5-16|20 00-5-17|20 00-5-18|20 00-5-19|20 00-5-20|20 00-5-21|20 00-5-22|20 00-5-23|20 00-5-24|20 00-5-25|20 00-5-26|20 00-5-27|20 00-5-28|20 00-5-29|20 00-5-30|20 00-5-31|20 00-6-1|200 0-6-2|2000 -6-3|2000- 6-4|2000-6 -5|2000-6- 6|2000-6-7 |2000-6-8| 2000-6-9|2 000-6-10|2 000-6-11|2 000-6-12|2 000-6-13|2 000-6-14|2 000-6-15|2 000-6-16|2 000-6-17|2 000-6-18|2 000-6-19|2 000-6-20|2 000-6-21|2 000-6-22|2 000-6-23|2 000-6-24|2 000-6-25|2 000-6-26|2 000-6-27|2 000-6-28|2 000-6-29|2 000-6-30|2 000-7-1|20 00-7-2|200 0-7-3|2000 -7-4|2000- 7-5|2000-7 -6|2000-7- 7|2000-7-8 |2000-7-9| 2000-7-10| 2000-7-11| 2000-7-12| 2000-7-13| 2000-7-14| 2000-7-15| 2000-7-16| 2000-7-17| 2000-7-18| 2000-7-19| 2000-7-20| 2000-7-21| 2000-7-22| 2000-7-23| 2000-7-24| 2000-7-25| 2000-7-26| 2000-7-27| 2000-7-28| 2000-7-29| 2000-7-30| 2000-7-31| 2000-8-1|2 000-8-2|20 00-8-3|200 0-8-4|2000 -8-5|2000- 8-6|2000-8 -7|2000-8- 8|2000-8-9 |2000-8-10 |2000-8-11 |2000-8-12 |2000-8-13 |2000-8-14 |2000-8-15 |2000-8-16 |2000-8-17 |2000-8-18 |2000-8-19 |2000-8-20 |2000-8-21 |2000-8-22 |2000-8-23 |2000-8-24 |2000-8-25 |2000-8-26 |2000-8-27 |2000-8-28 |2000-8-29 |2000-8-30 |2000-8-31 |2000-9-1| 2000-9-2|2 000-9-3|20 00-9-4|200 0-9-5|2000 -9-6|2000- 9-7|2000-9 -8|2000-9- 9|2000-9-1 0|2000-9-1 1|2000-9-1 2|2000-9-1 3|2000-9-1 4|2000-9-1 5|2000-9-1 6|2000-9-1 7|2000-9-1 8|2000-9-1 9|2000-9-2 0|2000-9-2 1|2000-9-2 2|2000-9-2 3|2000-9-2 4|2000-9-2 5|2000-9-2 6|2000-9-2 7|2000-9-2 8|2000-9-2 9|2000-9-3 0|2000-10- 1|2000-10- 2|2000-10- 3|2000-10- 4|2000-10- 5|2000-10- 6|2000-10- 7|2000-10- 8|2000-10- 9|2000-10- 10|2000-10 -11|2000-1 0-12|2000- 10-13|2000 -10-14|200 0-10-15|20 00-10-16|2 000-10-17| 2000-10-18 |2000-10-1 9|2000-10- 20|2000-10 -21|2000-1 0-22|2000- 10-23|2000 -10-24|200 0-10-25|20 00-10-26|2 000-10-27| 2000-10-28 |2000-10-2 9|2000-10- 30|2000-10 -31|2000-1 1-1|2000-1 1-2|2000-1 1-3|2000-1 1-4|2000-1 1-5|2000-1 1-6|2000-1 1-7|2000-1 1-8|2000-1 1-9|2000-1 1-10|2000- 11-11|2000 -11-12|200 0-11-13|20 00-11-14|2 000-11-15| 2000-11-16 |2000-11-1 7|2000-11- 18|2000-11 -19|2000-1 1-20|2000- 11-21|2000 -11-22|200 0-11-23|20 00-11-24|2 000-11-25| 2000-11-26 |2000-11-2 7|2000-11- 28|2000-11 -29|2000-1 1-30|2000- 12-1|2000- 12-2|2000- 12-3|2000- 12-4|2000- 12-5|2000- 12-6|2000- 12-7|2000- 12-8|2000- 12-9|2000- 12-10|2000 -12-11|200 0-12-12|20 00-12-13|2 000-12-14| 2000-12-15 |2000-12-1 6|2000-12- 17|2000-12 -18|2000-1 2-19|2000- 12-20|2000 -12-21|200 0-12-22|20 00-12-23|2 000-12-24| 2000-12-25 |2000-12-2 6|2000-12- 27|2000-12 -28|2000-1 2-29|2000- 12-30|2000 -12-31|'
where pub_name='toi di1'";
$ab = $dbh->prepare($sql);
my $rc = $ab->bind_param(1, $temp_due_date, 24);
$rc = $ab->execute;
$rc = $dbh->commit;
I used above code but still it doesn't work.
due_date='2000-1-22|2000-1
where pub_name='toi di1'";
$ab = $dbh->prepare($sql);
my $rc = $ab->bind_param(1, $temp_due_date, 24);
$rc = $ab->execute;
$rc = $dbh->commit;
I used above code but still it doesn't work.
ASKER
$sql="update publication set
due_date='2000-1-22|2000-1 -23|2000-1 -24|2000-1 -25|2000-1 -26|2000-1 -27|2000-1 -28|2000-1 -29|2000-1 -30|2000-1 -31|2000-2 -1|2000-2- 2|2000-2-3 |2000-2-4| 2000-2-5|2 000-2-6|20 00-2-7|200 0-2-8|2000 -2-9|2000- 2-10|2000- 2-11|2000- 2-12|2000- 2-13|2000- 2-14|2000- 2-15|2000- 2-16|2000- 2-17|2000- 2-18|2000- 2-19|2000- 2-20|2000- 2-21|2000- 2-22|2000- 2-23|2000- 2-24|2000- 2-25|2000- 2-26|2000- 2-27|2000- 2-28|2000- 2-29|2000- 3-1|2000-3 -2|2000-3- 3|2000-3-4 |2000-3-5| 2000-3-6|2 000-3-7|20 00-3-8|200 0-3-9|2000 -3-10|2000 -3-11|2000 -3-12|2000 -3-13|2000 -3-14|2000 -3-15|2000 -3-16|2000 -3-17|2000 -3-18|2000 -3-19|2000 -3-20|2000 -3-21|2000 -3-22|2000 -3-23|2000 -3-24|2000 -3-25|2000 -3-26|2000 -3-27|2000 -3-28|2000 -3-29|2000 -3-30|2000 -3-31|2000 -4-1|2000- 4-2|2000-4 -3|2000-4- 4|2000-4-5 |2000-4-6| 2000-4-7|2 000-4-8|20 00-4-9|200 0-4-10|200 0-4-11|200 0-4-12|200 0-4-13|200 0-4-14|200 0-4-15|200 0-4-16|200 0-4-17|200 0-4-18|200 0-4-19|200 0-4-20|200 0-4-21|200 0-4-22|200 0-4-23|200 0-4-24|200 0-4-25|200 0-4-26|200 0-4-27|200 0-4-28|200 0-4-29|200 0-4-30|200 0-5-1|2000 -5-2|2000- 5-3|2000-5 -4|2000-5- 5|2000-5-6 |2000-5-7| 2000-5-8|2 000-5-9|20 00-5-10|20 00-5-11|20 00-5-12|20 00-5-13|20 00-5-14|20 00-5-15|20 00-5-16|20 00-5-17|20 00-5-18|20 00-5-19|20 00-5-20|20 00-5-21|20 00-5-22|20 00-5-23|20 00-5-24|20 00-5-25|20 00-5-26|20 00-5-27|20 00-5-28|20 00-5-29|20 00-5-30|20 00-5-31|20 00-6-1|200 0-6-2|2000 -6-3|2000- 6-4|2000-6 -5|2000-6- 6|2000-6-7 |2000-6-8| 2000-6-9|2 000-6-10|2 000-6-11|2 000-6-12|2 000-6-13|2 000-6-14|2 000-6-15|2 000-6-16|2 000-6-17|2 000-6-18|2 000-6-19|2 000-6-20|2 000-6-21|2 000-6-22|2 000-6-23|2 000-6-24|2 000-6-25|2 000-6-26|2 000-6-27|2 000-6-28|2 000-6-29|2 000-6-30|2 000-7-1|20 00-7-2|200 0-7-3|2000 -7-4|2000- 7-5|2000-7 -6|2000-7- 7|2000-7-8 |2000-7-9| 2000-7-10| 2000-7-11| 2000-7-12| 2000-7-13| 2000-7-14| 2000-7-15| 2000-7-16| 2000-7-17| 2000-7-18| 2000-7-19| 2000-7-20| 2000-7-21| 2000-7-22| 2000-7-23| 2000-7-24| 2000-7-25| 2000-7-26| 2000-7-27| 2000-7-28| 2000-7-29| 2000-7-30| 2000-7-31| 2000-8-1|2 000-8-2|20 00-8-3|200 0-8-4|2000 -8-5|2000- 8-6|2000-8 -7|2000-8- 8|2000-8-9 |2000-8-10 |2000-8-11 |2000-8-12 |2000-8-13 |2000-8-14 |2000-8-15 |2000-8-16 |2000-8-17 |2000-8-18 |2000-8-19 |2000-8-20 |2000-8-21 |2000-8-22 |2000-8-23 |2000-8-24 |2000-8-25 |2000-8-26 |2000-8-27 |2000-8-28 |2000-8-29 |2000-8-30 |2000-8-31 |2000-9-1| 2000-9-2|2 000-9-3|20 00-9-4|200 0-9-5|2000 -9-6|2000- 9-7|2000-9 -8|2000-9- 9|2000-9-1 0|2000-9-1 1|2000-9-1 2|2000-9-1 3|2000-9-1 4|2000-9-1 5|2000-9-1 6|2000-9-1 7|2000-9-1 8|2000-9-1 9|2000-9-2 0|2000-9-2 1|2000-9-2 2|2000-9-2 3|2000-9-2 4|2000-9-2 5|2000-9-2 6|2000-9-2 7|2000-9-2 8|2000-9-2 9|2000-9-3 0|2000-10- 1|2000-10- 2|2000-10- 3|2000-10- 4|2000-10- 5|2000-10- 6|2000-10- 7|2000-10- 8|2000-10- 9|2000-10- 10|2000-10 -11|2000-1 0-12|2000- 10-13|2000 -10-14|200 0-10-15|20 00-10-16|2 000-10-17| 2000-10-18 |2000-10-1 9|2000-10- 20|2000-10 -21|2000-1 0-22|2000- 10-23|2000 -10-24|200 0-10-25|20 00-10-26|2 000-10-27| 2000-10-28 |2000-10-2 9|2000-10- 30|2000-10 -31|2000-1 1-1|2000-1 1-2|2000-1 1-3|2000-1 1-4|2000-1 1-5|2000-1 1-6|2000-1 1-7|2000-1 1-8|2000-1 1-9|2000-1 1-10|2000- 11-11|2000 -11-12|200 0-11-13|20 00-11-14|2 000-11-15| 2000-11-16 |2000-11-1 7|2000-11- 18|2000-11 -19|2000-1 1-20|2000- 11-21|2000 -11-22|200 0-11-23|20 00-11-24|2 000-11-25| 2000-11-26 |2000-11-2 7|2000-11- 28|2000-11 -29|2000-1 1-30|2000- 12-1|2000- 12-2|2000- 12-3|2000- 12-4|2000- 12-5|2000- 12-6|2000- 12-7|2000- 12-8|2000- 12-9|2000- 12-10|2000 -12-11|200 0-12-12|20 00-12-13|2 000-12-14| 2000-12-15 |2000-12-1 6|2000-12- 17|2000-12 -18|2000-1 2-19|2000- 12-20|2000 -12-21|200 0-12-22|20 00-12-23|2 000-12-24| 2000-12-25 |2000-12-2 6|2000-12- 27|2000-12 -28|2000-1 2-29|2000- 12-30|2000 -12-31|'
where pub_name='toi di1'";
$ab = $dbh->prepare($sql);
my $rc = $ab->bind_param(1, $temp_due_date, 24);
$rc = $ab->execute;
$rc = $dbh->commit;
I used above code but still it doesn't work.
Please help.
due_date='2000-1-22|2000-1
where pub_name='toi di1'";
$ab = $dbh->prepare($sql);
my $rc = $ab->bind_param(1, $temp_due_date, 24);
$rc = $ab->execute;
$rc = $dbh->commit;
I used above code but still it doesn't work.
Please help.
# the code works.
$sql =qq!update production set due_date=:1 where pub_name='toi di1'!;
# put all those pipe delimited dates in $long_string
insert_long($sql,\$long_st ring);
__END__
looks like you need a better design for your data. you should have a seperate table for all of those dates. you shouldn't have to have pipe delimited data... this is the reason for a database.
$sql =qq!update production set due_date=:1 where pub_name='toi di1'!;
# put all those pipe delimited dates in $long_string
insert_long($sql,\$long_st
__END__
looks like you need a better design for your data. you should have a seperate table for all of those dates. you shouldn't have to have pipe delimited data... this is the reason for a database.