Problems? Is your data what you think it is? | |
PerlMonks |
Re: CGI MySQL script to ASP(perlscript) MSSQLby elwarren (Priest) |
on Oct 27, 2004 at 00:17 UTC ( [id://402858]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|