Home: Perl Programming Help: DBI:
Update-Problem with flat-ASCII and mysql



afsmann
New User

Feb 6, 2012, 1:25 AM


Views: 25280
Update-Problem with flat-ASCII and mysql

Hi there,
I have a special type of flat-ascii file, where all data are written one after another. My perl-scills are very basic, but I tried my best to create a script.

with the "insert-part" everything work, but there is no check if the dataset is already in. I don't know how to manage this. If I load the script twice, I have dublettes in.

In the update-part I have 3 states of possiblities:
1) change of datafield
2) datafield is empty - new insert
3) datefield will be deleted to NULL
It seemes 1) and 2) work but 3) has an error in the SQL-String

UPDATE "adress" SET where Key_adr =5648
cause the value is missing after SET

Has anyone an idea?

I attach 2 scripts, one to create a db, and another for the update and a sample ascii-file.
I'm lucky about every hint

Thanx
Axel
Attachments: tabellen_anlg.zip (104 KB)