Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Oracle SQL, what is a single pipe character ( '|' ) used for?

I was studying some dynamic SQL(or perhaps it was regular SQL ?) today in Oracle, when I saw the pipe char being used in a line like this:

someVar := 'someValue' | 'someOtherValue'

This puzzled me. Is it BITWISE-OR like in TSQL ? Or is it something else? I am aware of the concatenation operator ( || ) , but it wasn't that one.

like image 208
Caffeinated Avatar asked Mar 17 '26 18:03

Caffeinated


1 Answers

The documentation only shows it as a bitwise OR operator in TimesTen:

Bitwise OR of the two operands. Sets a bit to 1 if one or both of the corresponding bits in Expression1 and Expression2 are 1. Sets a bit to 0 if both of the corresponding bits are 0.

But you didn't mention TimesTen, and it isn't valid in 'normal' SQL or PL/SQL.

like image 83
Alex Poole Avatar answered Mar 19 '26 12:03

Alex Poole