Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Conexión con bases de datos (https://www.clubdelphi.com/foros/forumdisplay.php?f=2)
-   -   error, Interbase y delphi, edicion campos Blob (https://www.clubdelphi.com/foros/showthread.php?t=12473)

athos 16-07-2004 21:51:09

error, Interbase y delphi, edicion campos Blob
 
hace dias estoy tratando de editar un campo tipo Blob sub_type 1 de interbase, desde delphi he descubierto algunas cosas pero ahora me detine este error, a continuacion describo todo lo que he hecho.

si alguien conoce otra forma de hacer, por favor ayudenme.

delphi

library funcion;

uses
ShareMem,
SysUtils;

type
TGetSegmentProc = function (Handle: Pointer;
var Buffer; Size: Integer; var Read: Integer): Integer cdecl;
TPutSegmentProc = function (Handle: Pointer;
var Buffer; Size: Integer): Integer cdecl;
PBlob = ^TBlob;
TBlob = record
GetSegment: TGetSegmentProc;
Handle: Pointer;
Segments: Integer;
MaxLength: Integer;
TotalSize: Integer;
PutSegment: TPutSegmentProc;
end;

procedure Str2Text(AText: PChar; Blob: Pointer); cdecl; export;
begin
if AText <> nil then
PBlob(Blob).PutSegment(
PBlob(Blob).Handle, AText^, StrLen(AText));
end;

exports
Str2Text;
begin
end.

esto funciona, al menos compilo la dll, la puse en c:\funcion.dll

en interbase hice esto:

CREATE TABLE "test" ("TEXTO" BLOB SUB_TYPE TEXT SEGMENT SIZE 80);

DECLARE EXTERNAL FUNCTION STR2TEXT CSTRING(255) HARACTER SET NONE RETURNS BLOB ENTRY_POINT 'Str2Text' MODULE_NAME 'c:\funcion.dll';

INSERT INTO test (texto) VALUES (str2text('estoy probando'));

y me de el siguiente error.

Dynamic SQL Error
SQL error code = -206
Column unknown
TEXTO
Statement: insert into test (texto) values (str2text('estoy probando'))

y nada de nada, no se que ocurre.

gracias



La franja horaria es GMT +2. Ahora son las 23:20:47.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi