I am very much new to .NET/C# and using Oracle for DB operations
// not working - with paremeter
string sql = "select m.*, u.* FROM managers m, users u ";
sql += " WHERE u.userid = m.user_id ";
sql += " WHERE COMPANY_NAME LIKE = '%:COMPANY_NAME%'";
dbm.AddParameter("COMPANY_NAME", "ABC company");
//Error is: ORA-01036: illegal variable name/number
//it works - without parameter
string sql = "select m.*, u.* FROM managers m, users u ";
sql += " WHERE u.userid = m.user_id ";
sql += " WHERE COMPANY_NAME LIKE = 'ABC company'";
Tried lots of things and wasted my time.
Please can any find tell me the reason of this error?
its throwing error when I try to bind using parameters.
// not working - with paremeter
string sql = "select m.*, u.* FROM managers m, users u ";
sql += " WHERE u.userid = m.user_id ";
sql += " AND COMPANY_NAME LIKE = '%:COMPANY_NAME%'";
dbm.AddParameter("COMPANY_NAME", "ABC company");
Thank you for the reply. NOw I have corrected it. Please reply soon
the syntax must be like: " AND COMPANY_NAME LIKE = :COMPANY_NAME"
// not giving accurate results. like should not be case-sensitive.
// abc - no result
// ABC = result found
Well, I’m not familliar with the Oracle database, which is why I said “wild guess”. but with MySQL, what collation is used can effect the results. AFAIK it’s only for characters outside the first 128, but if you have characters like umlauts etc. (i,e. your ABC abc example was a simplification) then it might be something worth exploring. http://dev.mysql.com/doc/refman/5.1/en/charset-collation-effect.html
*Again, MySQL not Oracle, but I imagine Oracle has something similar.
the syntax must be like: " AND COMPANY_NAME LIKE :COMPANY_NAME"
// not giving accurate results. like should not be case-sensitive.
// abc - no result
// ABC = result found
yes its like that. like
“=” << was typo. sorry again.