我是用PB连接oralce数据库.语句如下:/******************************************************************************** 描述: 保存修改的数据,并提交到数据库。 创建人: 创建时间: 备注: *********************************************************************************/ date curdate string ll_1,ll_2,ll_3,ll_4,ll_5,ll_6 long ll_7,ll_8,ll_9 long NbrRows,i,rows //增加记录 dw_display.AcceptText() NbrRows = dw_display.RowCount() rows=0 FOR i=1 TO nbrrows ll_1=dw_display.getitemstring(i,'CPID') ll_2=dw_display.getitemstring(i,'CPNAME') ll_7=dw_display.getitemnumber(i,'CPSCALE') ll_7=dw_display.getitemnumber(i,'FLSCALE') ll_3=dw_display.getitemstring(i,'BILLINGCYCLID')
insert into TM_d_SPSCALE_CPJS select :ll_1,:ll_2,:ll_7,:ll_8,:ll_3 from dual; IF SQLCA.SQLCODE <> 0 THEN ROLLBACK; MESSAGEBOX('操作提示','插入表出错!请重试!') CONTINUE END IF commit; rows++ NEXT IF rows>0 THEN messagebox('操作提示','已成功增加'+string(rows)+'条记录') END IF dw_display.Reset()
我是刚刚接触oracle,很多地方不明白,希望大家帮帮忙啊..
insert into TM_d_SPSCALE_CPJS select :ll_1,:ll_2,:ll_7,:ll_8,:ll_3 from dual; ---------------------------------------------------------- 这样写可以吗? insert into TM_d_SPSCALE_CPJS(...................) value(:ll_1,:ll_2,:ll_7,:ll_8,:ll_3);
描述: 保存修改的数据,并提交到数据库。
创建人:
创建时间:
备注:
*********************************************************************************/
date curdate
string ll_1,ll_2,ll_3,ll_4,ll_5,ll_6
long ll_7,ll_8,ll_9
long NbrRows,i,rows
//增加记录
dw_display.AcceptText()
NbrRows = dw_display.RowCount()
rows=0 FOR i=1 TO nbrrows
ll_1=dw_display.getitemstring(i,'CPID')
ll_2=dw_display.getitemstring(i,'CPNAME')
ll_7=dw_display.getitemnumber(i,'CPSCALE')
ll_7=dw_display.getitemnumber(i,'FLSCALE')
ll_3=dw_display.getitemstring(i,'BILLINGCYCLID')
insert into TM_d_SPSCALE_CPJS
select :ll_1,:ll_2,:ll_7,:ll_8,:ll_3 from dual;
IF SQLCA.SQLCODE <> 0 THEN
ROLLBACK;
MESSAGEBOX('操作提示','插入表出错!请重试!')
CONTINUE
END IF
commit;
rows++
NEXT
IF rows>0 THEN
messagebox('操作提示','已成功增加'+string(rows)+'条记录')
END IF
dw_display.Reset()
select :ll_1,:ll_2,:ll_7,:ll_8,:ll_3 from dual;
----------------------------------------------------------
这样写可以吗?
insert into TM_d_SPSCALE_CPJS(...................)
value(:ll_1,:ll_2,:ll_7,:ll_8,:ll_3);
messageBox('Error',SQLCA.sqlErrText)