点击后从一个表中读纪录作为新表的列,这段代码为啥不行?
string thiscolumn,sqlstatement,thisgzb,temp
integer i,endnumber
thisgzb="CREATE TABLE GZB0311"&
+"(序号 NUMBER(3) NOT NULL)"
execute immediate :thisgzb;
//从工资项目表中选取纪录
sqlstatement="SELECT * FROM 工资项目表"
PREPARE SQLSA FROM :sqlstatement;
DESCRIBE SQLSA INTO SQLDA;
DECLARE my_cursor DYNAMIC CURSOR FOR SQLSA;
OPEN DYNAMIC my_cursor USING DESCRIPTOR SQLDA;
endnumber=SQLDA.NumOutputs
for i=1 to endnumber
FETCH my_cursor USING DESCRIPTOR SQLDA;
thiscolumn=GetDynamicString(SQLDA,1)
temp="ALTER TABLE GZB0311 ADD(" +thiscolumn+"CHAR(50))"
execute immediate :temp;
next
CLOSE my_cursor;