Sioln has asked for the wisdom of the Perl Monks concerning the following question:

Has someone allready wrote the code parser Embeded SQL -> Perl::MySQL ?

I need to transfer code like this:

EXEC SQL SET DATABASE DB1 = "example:localhost:user:passw"; EXEC SQL CONNECT DB1; EXEC SQL BEGIN DECLARE SECTION; BASED ON table1.id my_id; EXEC SQL END DECLARE SECTION; MYSQL_RES *result; EXEC SQL SELECT id INTO :my_id FROM name_db; result = mysql_store_result(&mysql); if(result != NULL) { numofrows = mysql_num_rows (result); printf ("--\n", numofrows); } else {printf ("--\n"); break;} mysql_free_result (result); mysql_close (&mysql); return 0; }

2006-01-17 Retitled by g0n, as per Monastery guidelines
Original title: 'Code convertion from embedded sql to Perl::MySQL'

Replies are listed 'Best First'.
Re: Code conversion from embedded sql to Perl::MySQL
by renodino (Curate) on Jan 17, 2006 at 15:55 UTC
    While I'm not certain I understand your question (and I'm definitely *not* a MySQL expert), maybe you're looking for something like SQL::Preproc ? Tho it would use DBD::mysql, not Perl::MySQL (whatever that is?).
      Thank you.