I have a table in a database which contains a date field. Being
technically inept this filed was specified as of type Char. I would now
like correct my error. My idea was to read in the date for each line of
the table, then insert this value back into a new field.
My code...
#! d:/perl/bin/perl.exe
use Win32::ODBC;
$db = new Win32::ODBC("MyDSN");
$db->Sql("SELECT DATE1 FROM MyTABLE");
while ($db->FetchRow())
{
$temp = $db->Data;
print "$temp\n" # So I can see what happens
$db->Sql("INSERT INTO MyTABLE (DATE2) VALUES ('$temp')");
}
$db->Close();
exit 0;
### End ###
When I run this it prints the Date from the first line and then stops.
Nothing has been entered into the table.
I realise now that I was being very naive. Can anybody suggest how I
should do this?
TIA,
&rw
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]