SELECT LOWER(pla_lan_code) as locale,
pla_auto_translate_opt_out_flag^1 as autoTranslationEnabled,
pte_manual_edit_flag^1 as autoTranslated,
ftr_created_date as queuedDate,
ftr_translation_date as translationDate,
ftr_engine as translationEngine,
ftr_id as translationId,
pla_auto_translate_opt_out_flag as translationOptOut
SELECT * FROM property_languages (nolock)
LEFT OUTER JOIN properties_text_live (nolock)
This query is embedded in Java code. I am trying to convert it into a stored proc. I want to know what ^1 equates to in SQL.
This isn't standard SQL. In Transact-SQL (used in MS SQL Server and Sybase) ^ is the bitwise exclusive-OR operator.
1 ^ 1 is 0, and 0 ^ 1 is 1.
If the original int stores 0 for false and 1 for true, XORing by 1 would reverse the sense of the original flags.
Guessing that pla_auto_translate_opt_out_flag is an int with 1 for opting out and 0 for enabling autotranslation, using the operator returns 1 for enabling and 0 for opting out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With