It is very possible to run the same SQL against several different databases. The two biggest problems you'll run into will be making the initial connection to the database, and then datatypes in your schema.
There are several methods of connecting to an MSSQL database via ADO, ODBC, or the Sybase driver. In all fairness, you also have three methods to connect to MySQL as well. You should set a config variable on startup to choose what database you'll be connecting to, then an if/then switch can choose to execute the proper connect strings and setup your environment.
Once you're connected, you'll have some differing datatypes on these databases. Perl scalars will hide most of this from you, so you'll really deal with this problem more when you're porting your schema. For example, in Oracle we use VARCHAR2 datatype, but MySQL only has VARCHAR datatype. Oracle doesn't use the VARCHAR for some reason that is long forgotten. A forward compatability that was never introduced. The DBI driver hides all this from you as long as you're not doing something fancy. Judging by your request, I don't think you are. No offense intended.
HTH
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.