Why use "= +" and "= *" in a "WHERE" clause?

I have a connected database connection in the java class, I do not know why to use this "= +" and "= *" in the WHERE clause.

Here is an example:

String where = null; if (isOracleConnectionCache()) { where = "ValidInfo.InfoCode = FolderInfo.InfoCode AND ValidInfoGroup.InfoGroup =+ ValidInfo.InfoGroup AND FolderInfo.FolderRSN = ?"; } else { where = "ValidInfo.InfoCode = FolderInfo.InfoCode AND ValidInfoGroup.InfoGroup =* ValidInfo.InfoGroup AND FolderInfo.FolderRSN = ?"; } 

Can anyone tell me?

I have three questions:

(1) What do the signs "*" and "+" mean?

(2) how do these =+ and =* work in the WHERE clause?

(3) how does it compare with two tables?

+7
java sql database oracle mysql
source share
3 answers

So, as others have already explained, the =* operator in SQL Server points to an external connection.

However, in Oracle =+ there is no operator at all. It looks like ValidInfoGroup.InfoGroup =+ ValidInfo.InfoGroup actually parsed as ValidInfoGroup.InfoGroup = (+ ValidInfo.InfoGroup) , where + is a unary identity operator.

Since this code is an attempt to write an external connection depending on the database used, it is incorrect when used in Oracle - in fact, it performs a normal connection. The correct way to write this condition to Oracle custom syntax would be ValidInfoGroup.InfoGroup = ValidInfo.InfoGroup (+) .

It might be better to use the ANSI SQL join syntax to specify an outer join, which in my opinion would eliminate the need to check which database is being used.

Thanks to Martin and Nikolai for helpful comments on other answers.

+6
source share

=* makes OUTER JOIN in SQL Server

UPDATE

(+) = makes OUTER JOIN in Oracle

I do not know that = + regrets the confusion

+2
source share

This is nothing but Outer Join in Oracle and MS-SQL. Suppose that one table entry is deleted and the corresponding NULL value, so when you compare with == , I will understand that this will create a problem, so we can use Outer Join, as you mentioned in your question.

0
source share

All Articles