说
说不清楚
Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是DBExpress,BCB6的数据库新驱动,oracle8.0.5
create table work_map
(
work_no varchar2 (20) not null,
map_data blob ,
remark varchar2 (512),
constraints pk_work_map primary key(work_no)
);
上面是表,代码如下
TOpenDialog *od=new TOpenDialog(Application);
od->Title = "选择word文档";
od->DefaultExt = "DOC";
od->FileName = "*.doc";
od->Filter = "Dat files (*.doc)|*.DOC";
if (od->Execute())
{
TMemoryStream *tmpStream = new TMemoryStream();
tmpStream->LoadFromFile(od->FileName);
BYTE* Data = (BYTE*)tmpStream->Memory;
Query1->Close();
Query1->SQL->Clear();
Query1->SQL->Add("INSERT INTO work_map valueswork_no,:map_data,:remark)");
Query1->ParamByName("work_no")->AsString = "2002-12-1";
Query1->ParamByName("map_data")->LoadFromStream(tmpStream,ftBlob);
Query1->ParamByName("remark")->AsString = "111";
if(!Query1->Prepared)
Query1->Prepared = true ;
Query1->ExecSQL() ;
delete tmpStream;
}
运行到Query1->ExecSQL()出错,信息
ORA-01461:仅可以为插入LONG列的LONG值赋值。
莫名其妙,
高人指点。。。。。。。。。。。。。。。。。。。。。。。。。。。。
create table work_map
(
work_no varchar2 (20) not null,
map_data blob ,
remark varchar2 (512),
constraints pk_work_map primary key(work_no)
);
上面是表,代码如下
TOpenDialog *od=new TOpenDialog(Application);
od->Title = "选择word文档";
od->DefaultExt = "DOC";
od->FileName = "*.doc";
od->Filter = "Dat files (*.doc)|*.DOC";
if (od->Execute())
{
TMemoryStream *tmpStream = new TMemoryStream();
tmpStream->LoadFromFile(od->FileName);
BYTE* Data = (BYTE*)tmpStream->Memory;
Query1->Close();
Query1->SQL->Clear();
Query1->SQL->Add("INSERT INTO work_map valueswork_no,:map_data,:remark)");
Query1->ParamByName("work_no")->AsString = "2002-12-1";
Query1->ParamByName("map_data")->LoadFromStream(tmpStream,ftBlob);
Query1->ParamByName("remark")->AsString = "111";
if(!Query1->Prepared)
Query1->Prepared = true ;
Query1->ExecSQL() ;
delete tmpStream;
}
运行到Query1->ExecSQL()出错,信息
ORA-01461:仅可以为插入LONG列的LONG值赋值。
莫名其妙,
高人指点。。。。。。。。。。。。。。。。。。。。。。。。。。。。