Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Convert an SQL insert into a Perl data structure

by hippo (Bishop)
on Apr 05, 2023 at 11:46 UTC ( [id://11151481]=note: print w/replies, xml ) Need Help??


in reply to Convert an SQL insert into a Perl data structure

I tried SQL::Parser but it failed to read the whole SQL dump, complained about "---"

If that means the lines beginning with double-dashes then you can just strip those out - they are only notes from mysqldump and can be ignored. You can avoid them in the first place by using mysqldump --skip-comments instead.

This small issue is part of my efforts to upgrade a DB schema (by adding or removing table columns), processing the database data and inserting it back into the DB

There will be some reason you are not just doing this entirely inside the DB but I can't imagine what that reason might be.


🦛

Replies are listed 'Best First'.
Re^2: Convert an SQL insert into a Perl data structure
by bliako (Monsignor) on Apr 05, 2023 at 12:01 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11151481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-25 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found