Mohan
Mohan

Reputation: 3903

Reading bytes as a string from Db

I have one table that has 2 fields one(container_id) for numeric type and another for byte type(coDearntainer_objects) . I would like to read the byte field(container_objects) as a string for corresponding (container_id) field.

How could I do this? I am using Postgresql Db Table Structure:

CREATE TABLE container
(
  ct_id numeric,
  container_object bytea
)

Upvotes: 0

Views: 15823

Answers (1)

Frank Heikens
Frank Heikens

Reputation: 127086

Take a look at encode() to transform a bytea to a string.

Upvotes: 4

Related Questions