[Lazarus] Missing (compatible) underlying dataset, can not open

"Leonardo M. Ramé" l.rame at griensu.com
Thu Nov 27 16:54:19 CET 2014


El 27/11/14 a las 12:26, Michael Van Canneyt escibió:
>
>
> On Thu, 27 Nov 2014, "Leonardo M. Ramé" wrote:
>
>> Hi, I'm trying to execute this query, but I'm getting "Missing
>> (compatible) underlying dataset, can not open".
>>
>> lQuery.DataBase := PQConnection1;
>> lQuery.ParseSQL:= false;
>> lQuery.SQL.Text:= 'select json_agg(resultset) as json from(select 1)
>> as resultset';
>> lQuery.Open;
>>
>> The query runs without problems in PostgreSql 9.3 both from pgAdmin
>> and psql.
>>
>> Any hint?.
>
> Yes: You are creating a result set with fields that are not recognized
> by SQLDB (json type).
> PQLib (on which pqconnection is based) also does not "understand" json
> result fields, it converts them to text.
>
> So, you must somehow typecast the result to string:
>
> Probably
>
> select json_agg(resultset)::text as myjson from(select 1) as resultset
>
> should work.
>
> Michael.
>
>

Great Michael!, that worked.

-- 
Leonardo M. Ramé
Medical IT - Griensu S.A.
Av. Colón 636 - Piso 8 Of. A
X5000EPT -- Córdoba
Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19
Cel.: +54 9 (011) 40871877





More information about the Lazarus mailing list