Liquid Fire Posted March 13, 2008 Share Posted March 13, 2008 after some googling i could only find standard sql for select/insert/update, does anyone know any good website that talk about standard sql statements and which sql databases allow for them for stuff like creating, editing, deleting fields/indexes/relationships? Quote Link to comment Share on other sites More sharing options...
jcombs_31 Posted March 13, 2008 Share Posted March 13, 2008 You're not making much sense, SQL is SQL, the syntax varies slightly from one system to another, but in general it is the same. Quote Link to comment Share on other sites More sharing options...
Liquid Fire Posted March 13, 2008 Author Share Posted March 13, 2008 well i am build a data with pdo and want to make sure my sql statements are correct not matter the sql database the person is using. for instance in mysql is i do: SHOW TABLES LIKE 'statuses' that will return statuses if the table exists and nothing if not, will that work in DB2, postgre, mssql, etc??? is there a way to test sql statement without having to install the software, something like a emulation program? Quote Link to comment Share on other sites More sharing options...
neylitalo Posted March 13, 2008 Share Posted March 13, 2008 Most popular databases don't conform to ANSI/ISO SQL by default, so it can be tricky, if not impossible, to write SQL that will work in multiple DBMSs. However, a database abstraction library like ADOdb might help you write code for database-independent systems. Quote Link to comment Share on other sites More sharing options...
trq Posted March 13, 2008 Share Posted March 13, 2008 I don't think using ADOdb is that different to using PDO, they both abstract your database layer from implimentation. I think its more the queries themselves the op is concerend with. Quote Link to comment Share on other sites More sharing options...
ober Posted March 13, 2008 Share Posted March 13, 2008 I don't think using ADOdb is that different to using PDO, they both abstract your database layer from implimentation. I think its more the queries themselves the op is concerend with. Agreed. I really don't think you can write standard SQL statements that will span all DBMSs. It's unfortunate but true. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 13, 2008 Share Posted March 13, 2008 You can definitely stick to "standard" column names, syntaxes, etc., but there always will be DMBS-specific extensions, so be wary. Quote Link to comment Share on other sites More sharing options...
Liquid Fire Posted March 13, 2008 Author Share Posted March 13, 2008 yea, i mean as far is i know all of the follow should work in all databases supported by PDO: SELECT [field(s)] FROM [table][tr][td] [join_type] JOIN [table(s)] ON [field(s)] = [value(s)] WHERE [field(s)] = [value(s)] GROUP BY [feild(s)] ORDER BY [field(s)] HAVING [feild(s)] INSERT INTO [table][tr][td]([fields]) (VALUE[values]) UPDATE [table][tr][td] SET [feild] = [value] WHERE [field] = [value] DELETE FROM [table][tr][td] WHERE [fields] = [value] I am just not sure about the other ones like creating/editing/deleting table and fields or adding indexs, etc... I just want to try to find a site that lets me know how to do this kind of stuff for all major sql databases. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.