Thread: Key violation. ERROR: type "lo" does not exist.

Key violation. ERROR: type "lo" does not exist.

From
Fernando.Figueiredo@vivo.net.br
Date:
Hi ,
 
I need to insert in one database archives JPG.  I am using C++Builder.  How I could make this?
 
I created the following table:
 
CREATE TABLE tbimagens
(
  callid numeric(11) ,
  imagem bytea
)
 
E I try to insert given of the following form:
 
        TQuery *q;
        q = new TQuery(FDatabase1);
        try
        {
            q->DatabaseName = FDatabase1->DatabaseName;
            q->Close();
            q->SQL->Clear();
            q->SQL->Add("insert into tbimagens (callid,imagem) ");
            q->SQL->Add("values (:callid,:imagem) ");
            q->ParamByName("callid")->AsInteger = callid;
            q->ParamByName("imagem")->LoadFromFile(filename,ftBlob);
            q->Prepare();
            q->ExecSQL();
            q->Close();
        }__finally
        {
            delete q;
        }
I receive the mesagem from error: Key violation. ERROR: type "lo" does not exist.
 
Can You help me ? Thank You.
 
ASS: Fernando.
 
 
> --> 
> Hello everyone,

> I have created a table as follows:

> CREATE TABLE document (
> image_id int,
> image bytea
> );

> I want to insert a complete file, let's say an open office document
> into this table.  Anyone know how I would doe this?

You need to use the bytea functions allocated to your language API.
Which language are you using for this?

 
 

Re: Key violation. ERROR: type "lo" does not exist.

From
Douglas McNaught
Date:
Fernando.Figueiredo@vivo.net.br writes:

> I receive the mesagem from error: Key violation. ERROR: type "lo" does not
> exist.

Have you installed the 'contrib/lo' module that creates that type?

-Doug


Re: Key violation. ERROR: type "lo" does not exist.

From
Andrew - Supernews
Date:
On 2005-10-20, Douglas McNaught <doug@mcnaught.org> wrote:
> Fernando.Figueiredo@vivo.net.br writes:
>
>> I receive the mesagem from error: Key violation. ERROR: type "lo" does not
>> exist.
>
> Have you installed the 'contrib/lo' module that creates that type?

If he's using bytea columns, then he doesn't want that.

Most likely the interface he's using is assuming lo_* style blobs, rather
than bytea.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services