My question is similar to this one: link except that I don't want to serialize the QList. I want to store a QList as a double precision array in the DB table.
I am trying the following bindValue command for the variable val
:
query.bindValue( QStrFromSrcEnc( id ), QVariant::fromValue( val ) );
where val
is QList and id
is ":value"
I am executing the following postgres query:
"INSERT INTO valtable( type_id, asset_id, value, tag )\n"
"VALUES ( :typeId, :assetId, :value, :tag )\n"
The value
column of the table is of the type double precision[].
I get the following error, as you can see the 3rd field for value
is blank which means val
wasn't bound correctly.
ERROR: syntax error at or near ","
LINE 1: EXECUTE qpsqlpstmt_13e (60, 63, , '')
^
however, if val is simply a QVariant, then it works fine.