Home
How It Works
Daily Challenge
Contact

Companies
Register
Login
Recruiter Tools
Post SqlAds
Resume Razor
Candidates
Register
Login
My Info
Employment
Submit Question
Training
Intro to
Informatica
Ask Mark
Recent Topics
Resume Courier
Top 10
grabowski
vlg
anjugarg
billw
jjahns
drj
nisha
nishardhini
grifman
kalaabhyas
 

Pete Russitano Design >


Yesterdays Results
86% Correct
14% Incorrect
Sponsored Jobs
Database Programming Specialist
Atlanta, GA
Advanced SQL query experience; - Five years of experience in software development; - Experience in building web-based programming applications with relational databases in a multi-tier environment   more...
Contact Us
Data Modeler
Shelton, CT
UML, Rational, RequisitePro   more...
Contact Us
DB2 DBA
New Haven Area, CT
DB2, DBA, Logical & Physical Modeling   more...
Contact Us
Project Manager (Multiple)
Windsor, CT
Junior to Senior Level Project Managers with Insurance Background   more...
Contact Us
Business Analyst
Windsor, CT
Insurance B/A   more...
Contact Us
Data Analyst
Shelton, CT
MSAccess, SQL Sever, SQL, DBase, Clipper, Foxpro   more...
Contact Us
DataStage Developer
Iowa, IA
DataStage, Informatica, Oracle, Team Leader   more...
Contact Us
Saiko Consulting's SqlChallenge
Saiko Consulting's SqlChallenge
CareerFactor
Saiko Consulting

Read A Topic

Return To Topics Originally Posted:  6/6/2006 8:10:24 PM
  Last Updated:  6/6/2006 8:10:24 PM

Subject:
Help Trying To Write Portable SQL

You Asked....
I am creating a table called 'Company' and want to use a column called 'Active' that is basically set to 0 when the entity is 'Active' and 1 when the entity is 'Inactive'.

In trying to make my DDL as portable as possible which data type should be used for the 'Active column?

and we responded....
There are two schools of thought on this one.

Some would say define the column using CHAR because it is more widely supported across RDMS's. Some also believe that using CHAR allows for a less ambiguous meaning.

There other school of thought is to use INT because making your DDL portable across RDMS's is virtually impossible because each has a slight variation.

Hope that helps.


others said.... Post Your Own Review

Review By:  joblock

>>>>>Begin Original Message<<<<<

I am creating a table called 'Company' and want to use a column called 'Active' that is basically set to 0 when the entity is 'Active' and 1 when the entity is 'Inactive'.

In trying to make my DDL as portable as possible which data type should be used for the 'Active column?

>>>>>End Original Message<<<<<


If your using 1's and 0's those are integers. However, if you want to make sure 0 is false and 1 is true, us -1 as true and 0 as false. That way you can cast it to bolean, and use very efficient functions in oracle as sql server. It should depend on how you use the data. What logic do you have to perform to present the data to the UI. Minimize that logic.

Review On:  7/10/2006 4:21:33 PM