PL/SQL: Strings in PL/SQL

Strings can be literals or variables. A
string literal begins and ends with a single
quotation mark:
'This is a string literal'

If you need to embed a single quote inside
a string literal, you can type in two single
quotes right next to one another, as in:
'This isn''t a date'

You can also use the “q” character to
indicate an alternative terminating character
for the literal:
q'[This isn't a date]'

A string variable is an identifier declared
with a string datatype and then assigned
a value (which could be a literal or an
expression).

Quelle: OraMag 09/10 2011 Seite 65 (Steve Feuerstein)

Für schwierigere Strings ist die q-Notation von Vorteil, da hier das Maskieren der enthaltenen Hochkomma entfällt.

Kommentare

Beliebte Posts aus diesem Blog

PGA unter Oracle 11g

trunc(sysdate) - nette Spiele mit dem Datum

Datapump - Verzeichnis erstellen