Good day for all,
I have used MySQL database for my previous projects but now I need to try some on oracle.
At the beginner to the Oracle, I decide to familiarize myself with oracle by testing my previous projects in Oracle instead of MySQL.
I have the select statement here in the 'try' block which I have used in the java bean.
Here's the code:
String strQry = "SELECT T_STAFF*, T_DEPARTMENT.CODE, T_ROLE.CODE, T_STATUS.CODE, ";
strQry += "T_DEPARTMENT.DESCRIPTION, T_ROLE.DESCRIPTION, T_STATUS.DESCRIPTION ";
strQry += "FROM T_DEPARTMENT, T_ROLE, T_STATUS, T_STAFF ";
strQry += "WHERE STAFF_NAME = '"+strUserName+"' ";
strQry += "AND T_STAFF.STAFF_DEPARTMENT_OBJECTID = T_DEPARTMENT.OBJECTID ";
strQry += "AND T_STAFF.STAFF_ROLE_OBJECTID = T_ROLE.OBJECTID ";
strQry += "AND T_STAFF.STAFF_STATUS_OBJECTID = T_STATUS.OBJECTID ";
rs = stmt.executeQuery(strQry);
I need to know, can I use the same string above for Oracle? If no, how should the string look like?
Thanks in advance.
except for this asterisk here --
SELECT T_STAFF<font color='"#FF0000"'>*</font>, ...
that's gonna barf in every database system, including mysql
also, you should really learn JOIN syntax, and stop using the deprecated comma list style joins
Sorry, my mistake. it should be SELECT T_STAFF.*
Thanks for the explanation.
This topic is now closed. New replies are no longer allowed.