Board index » delphi » CLOB in Oracle

CLOB in Oracle

Hi:

  I want to insert a long text in a oracle CLOB field. I have the error
ORA-01461.
  The code is this:

Query1.ParamByName('id').AsInteger := StrToInt(Edit1.Text);
Query1.ParamByName('test').AsMemo := Memo1.Text;
Query1.ExecSQL;

  The query is:

INSERT INTO
TABLE_TEST (ID, TEST)
  VALUES
(:id, :test)

The text is larger than 4000 Bytes.
There is a solution for this shit error ?

 

Re:CLOB in Oracle


ORA-01461 tells you that you can't use a LONG value (your Memo) with a CLOB
datatype (your column).

You need to use an API that supports CLOB columns.  The BDE doesn't do it.

Eric

Quote
"Marcelino Varas" <v...@mediatechnic.de> wrote in message

news:3d61078f$3@dnews...
Quote
> Hi:

>   I want to insert a long text in a oracle CLOB field. I have the error
> ORA-01461.
>   The code is this:

> Query1.ParamByName('id').AsInteger := StrToInt(Edit1.Text);
> Query1.ParamByName('test').AsMemo := Memo1.Text;
> Query1.ExecSQL;

>   The query is:

> INSERT INTO
> TABLE_TEST (ID, TEST)
>   VALUES
> (:id, :test)

> The text is larger than 4000 Bytes.
> There is a solution for this shit error ?

Re:CLOB in Oracle


Quote
>The text is larger than 4000 Bytes.
>There is a solution for this shit error ?

Use a query with parameters like this:

insert into TABLE_TEST (ID, TEST) values (:PID, empty_blob())
returning TEST into  :PTEST

set the params like this

  FSQLDataSet.ParamByName('PID').AsInteger := AValue;
  FSQLDataSet.ParamByName('PTEST').DataType := ftOraBlob;
  FSQLDataSet.ParamByName('PTEST').Value := AValue;

cu Christian

Other Threads