Final Class Yiisoft\Db\Oracle\Builder\UuidValueBuilder
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Builds a {@see UuidValue} expression for Oracle.
Oracle stores a UUID as 16 raw bytes in a raw(16) column, and PDO_OCI cannot bind those bytes as a parameter:
bound as a large object it inserts NULL. So the value is emitted as a HEXTORAW() literal, the representation
this driver already uses for binary values.
Inlining is safe here because UuidValue normalizes the value to the canonical form, which leaves exactly 32
hexadecimal characters once the dashes are removed.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| build() | Yiisoft\ |
Method Details
| public string build ( \ | ||
| $expression | \ |
|
| $params | array | |
public function build(ExpressionInterface $expression, array &$params = []): string
{
/** @var UuidValue $expression */
return "HEXTORAW('" . str_replace('-', '', $expression->value) . "')";
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.