5

I have the following SQL statement. Please tell me if my translation of it is accurate. I'm using MS SQL Server 2008. Thanks

(bld_sqft > 0 OR bld_area > 0)

My translation

bld_sqft > 0 OR bld_area > 0
3
  • I believe the above translation is correct. > is just representation for the '>' symbol (more: ascii.cl/htmlcodes.htm)
    – CodeTalk
    Nov 2, 2012 at 15:36
  • Is this an expression in a BI package stored as XML? Nov 2, 2012 at 15:40
  • Yes this is in an XML file that is converted to a JSP, which displays the user interface
    – dido
    Nov 2, 2012 at 15:44

2 Answers 2

7

&gt; is an HTML entity (typically used because HTML uses <> for markup), that is not valid SQL and it should not run unless it is being translated to > before being sent to SQL Server.

See http://dev.w3.org/html5/html-author/charref for information about HTML entities.

1
  • @Siva OK, it doesn't error out for my user id, that's kind of odd, but I've expanded the data type. I didn't even realize I had a top 5 favorited query on SEDE!
    – Cade Roux
    Nov 4, 2012 at 20:18
3

Where are you getting this SQL statement? You are right that > translates to the greater than symbol, but it was encoded to the entity character reference. It is almost as if the encoded value was being treated literally when displayed on a web page.

[EDIT] As you can see, when I typed that symbol, it actually rendered as a > symbol in my post...

A good hint is if you see the ampersand (&) followed by two to four characters then a semi-colon, it was supposed to render differently:

http://www.htmlhelp.com/reference/html40/entities/special.html [/EDIT]

1
  • I think he got that syntax from .xml file Aug 20, 2021 at 2:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.