I need to insert and then update an entry in a table using 2 stored procs
that I am not authorized to alter.  The first stored proc checks to see if
I can insert a row and if so it returns the row:

$cmd = 'exec sp_1 .......';
$sth->prepare($cmd);
$sth->execute();
while (@row = $sth->fetchrow_array())
 {
     .....
     $date = $row[2];
 }

Later, I call another stored proc and pass date to it.

$cmd = "exec sp_2 ..., $date ...";
$sth->prepare($cmd);
$sth->execute();

In sp_2, the date is used in the 'where' clause of the update
statement.  However, it will never find a row to update because in this
case:

'Apr 27 2001 11:56AM' != 'Apr 27 2001 11:56AM'

The date returned by sp_1 loses its resolution beyond the minutes.  So,
while the db may return a date format in the 'C' locale, that's apparently
not what the db uses in the comparison.  Is there anything I can do in my
code to force the stored proc to return the full date down to the 300th of
a sec?  The date is generated in sp_1 using the getdate() function.

Thank you,
Curt Crandall

Reply via email to