From: | Amila Jayasooriya <amilajayasooriya(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | cast type bytea to double precision |
Date: | 2012-02-17 07:19:15 |
Message-ID: | CACqosVRyNYtE3gCA23_6Fkf5vNcv594a_Q8HxVNDAVFmGx+18Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-sql |
HI All,
I have a database column which type is bytea. It contains floats converted
as byte array (4 bytes per one float) and encoding is Escape. I would be
able to get corresponding bytea string using substring function.
My question is how can I convert bytea string to float inside a SQL
function. Earlier I converted to float in C# side. I used
dataReader.getByte method to retrieve bytes and then Converted to float
using BitConverter.ToSingle (.Net build in class) method.
Now I can't use intermediate component as Npqsql driver. I want SQL to
directly convert bytea into floats and return the corresponding number when
execute a query from 3rd party application.
Thanks and Regards
Amila Jayasooriya
From | Date | Subject | |
---|---|---|---|
Next Message | Durumdara | 2012-02-17 08:13:29 | One transaction by connection - commit subdetails without release master transaction? |
Previous Message | Amila Jayasooriya | 2012-02-17 07:10:44 | cast type bytea to double precision |
From | Date | Subject | |
---|---|---|---|
Next Message | John Tuliao | 2012-02-17 07:52:13 | How can I use this subselect properly in an update? |
Previous Message | Amila Jayasooriya | 2012-02-17 07:10:44 | cast type bytea to double precision |