voodoochicken Posted March 7, 2008 Share Posted March 7, 2008 hi, as the title suggests, there are two different questions:1- how do you compare a null value in a condition, say, something like select whatever etc where some_field=null2- when you use 'insert into', do you have to declare previously the table where you want to insert, or the insert into does create the table3- ok, three questions: is there any command to check existence of a table or a procedure or an index? something like if table_name exists do whatever or if procedure_name exists do whatever else whatever_else?tnx Link to comment Share on other sites More sharing options...
justsomeguy Posted March 7, 2008 Share Posted March 7, 2008 What database are you using? Link to comment Share on other sites More sharing options...
voodoochicken Posted March 8, 2008 Author Share Posted March 8, 2008 What database are you using?umm.. mysql.. somehow i assumed this was a 'defacto' mysql forum.. (ashamed) Link to comment Share on other sites More sharing options...
Synook Posted March 8, 2008 Share Posted March 8, 2008 1- how do you compare a null value in a condition, say, something like select whatever etc where some_field=nullThat's right2- when you use 'insert into', do you have to declare previously the table where you want to insert, or the insert into does create the tableYou have to do INSERT INTO table VALUES (...). If there is no table the query will fail, you have to create one first.3- ok, three questions: is there any command to check existence of a table or a procedure or an index? something like if table_name exists do whatever or if procedure_name exists do whatever else whatever_else?To check the existence of a table, you can do CHECK TABLE table_name, if there is no table the column Msg_type will be "error" and the Msg_text will be "Table 'database.table_name' doesn't exist". Not sure about the others... Link to comment Share on other sites More sharing options...
voodoochicken Posted March 8, 2008 Author Share Posted March 8, 2008 wow! tnx Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.