'cpu'라는 인자를 대입해서 오라클 테이블에 update하고자 합니다.
실행 error는 EdatabaseError with message Parameter 'cpu' not found.
변수StrCPUS는 테이블에서 읽어온 값입니다.
궁금증을 풀어주세요.
var
cpu : string ;
begin
with query1 do begin
close;
paramByName('cpu').Asstring :=StrCPUS ;
sql.clear;
sql.add('update tpslog.host_cpu');
sql.add('set tran_sum = :cpu');
sql.add('where time=''12''');
ExecSQL;
end;
<주의>두개짜리 따옴표가 아니고 한개짜리를 써야합니다.
ss := ' update XXX.XXXX9999 ' + // as temp ');
' set C_A_DATE = ' +
'''' + ls_DATE + '''' +
' where ( ' +
' p_no = ' + '''' + ls_cell1 + '''' +
' and b_no = ' + '''' + ls_cell2 + '''' +
' and d_grp = ' + '''' + ls_cell3 + '''' +
' and d_no = ' + '''' + ls_cell4 + '''' +
' ) ' ;
query3.SQL.clear ;
query3.SQL.Add(''+ ss + '' );
query3.ExecSQL;
=======================================
정방현 wrote:
> 'cpu'라는 인자를 대입해서 오라클 테이블에 update하고자 합니다.
> 실행 error는 EdatabaseError with message Parameter 'cpu' not found.
> 변수StrCPUS는 테이블에서 읽어온 값입니다.
> 궁금증을 풀어주세요.
>
> var
> cpu : string ;
> begin
> with query1 do begin
> close;
> paramByName('cpu').Asstring :=StrCPUS ;
> sql.clear;
> sql.add('update tpslog.host_cpu');
> sql.add('set tran_sum = :cpu');
> sql.add('where time=''12''');
> ExecSQL;
> end;