Ayuda error Interbase6 delphi7
Publicado por pedro (6 intervenciones) el 16/07/2004 22:11:11
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
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
Valora esta pregunta


0