Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 25084
  • Last Modified:

not equal to symbol in db2

We all know that <> is the not equal to symbol used for DB2 queries. I have seen that some of the legacy queries are having != symbol for not equal to. Can anyone confirm the same that we can use both conventions..?
0
jimsweb
Asked:
jimsweb
1 Solution
 
woolmilkporcCommented:
Hi,

you can use "!=" instead of "<>" if the used code page has the exclamation point as X'5A'.

This is what IBM have to say regarding your question:

The following forms of the comparison operators are also supported in basic and quantified predicates in coded pages where the exclamation point is X'5A': !=, !<, and !> . In addition, in code pages 437, 819, and 850, the forms ¬=, ¬<, and ¬> are supported. All these product-specific forms of the comparison operators are intended only to support existing SQL statements that use these operators and are not recommended for use when writing new SQL statements.

The above quote is from this document:
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db29.doc.sqlref/db2z_basicpredicate.htm

HTH

wmp
0
 
jimswebAuthor Commented:
thanks!
0
 
theo kouwenhovenCommented:
or the "Not" prefix

FldA <> Fldb is the same as not FldA = Fldb
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now