Board index » delphi » BLOB: conversion error from string "BLOB"

BLOB: conversion error from string "BLOB"

Hello.

When I try to insert/update a blob field interbase raises "conversion error
from string "BLOB""

The sql is:
UPDATE OS
SET nome = :nome, descricao = :descricao
WHERE id = :id

The parameters are:
sql.ParamByName['ID'].Value := '001'; (char (03))
sql.ParamByName['NOME'].Value := 'NOME'; (varchar (30))
sql.ParamByName['DESCRICAO].Value := Memo1.Text; (BLOB SUB_TYPE TEXT)

What is anything wrong?

Thanks.

--
Eduardo Xavier

 

Re:BLOB: conversion error from string "BLOB"


Quote
Eduardo Xavier wrote:

> Hello.

> When I try to insert/update a blob field interbase raises "conversion error
> from string "BLOB""

> The sql is:
> UPDATE OS
> SET nome = :nome, descricao = :descricao
> WHERE id = :id

> The parameters are:
> sql.ParamByName['ID'].Value := '001'; (char (03))
> sql.ParamByName['NOME'].Value := 'NOME'; (varchar (30))
> sql.ParamByName['DESCRICAO].Value := Memo1.Text; (BLOB SUB_TYPE TEXT)

> What is anything wrong?

> Thanks.

> --
> Eduardo Xavier

Don't go through Variants, use AsXxxx instead.  I make this recommendation for
all TDataset descendants including the BDE.  So in this case use AsString.

--
Jeff Overcash (TeamB)   On waves of silver I dreamed of gold
(Please do not email    'Till I lost the peace that dreaming gives
 me directly unless     I dreamed of the moment of my own death
 asked.  Thank You)     That no one ever dreams and lives (Marillion)

Re:BLOB: conversion error from string "BLOB"


Quote
> Don't go through Variants, use AsXxxx instead.  I make this recommendation
for
> all TDataset descendants including the BDE.  So in this case use AsString.

Jeff,

thanks for the answer.

I was using a WHERE with a blob field in a previous query. Now its ok.

Why the AsXxxx are better than variants? Conversions, processing?

Thanks,

Eduardo Xavier

Re:BLOB: conversion error from string "BLOB"


Quote
Eduardo Xavier wrote:

> Why the AsXxxx are better than variants? Conversions, processing?

When you know the data type it is faster and more reliable to not go through the
Type -> Variant -> Type conversion to do the assignment IMO.

Quote

> Thanks,

> Eduardo Xavier

--
Jeff Overcash (TeamB)   On waves of silver I dreamed of gold
(Please do not email    'Till I lost the peace that dreaming gives
 me directly unless     I dreamed of the moment of my own death
 asked.  Thank You)     That no one ever dreams and lives (Marillion)

Other Threads