Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: CGI MySQL script to ASP(perlscript) MSSQL

by elwarren (Curate)
on Oct 27, 2004 at 00:17 UTC ( #402858=note: print w/replies, xml ) Need Help??

in reply to CGI MySQL script to ASP(perlscript) MSSQL

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.

  • Comment on Re: CGI MySQL script to ASP(perlscript) MSSQL

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://402858]
[arc444]: hi. Anyone know how to filter the list of methods returned when querying an object in the perl debugger ?
[arc444]: for example : m $obj | grep 'blah'

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2018-01-24 10:33 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (257 votes). Check out past polls.