Q&A

  • Re: Parameter type error! 발생...문제가 어디인지??
델이랑파이랑 wrote:

> " Field 'el_' is of unknown type"라는 에러가 발생합니다....아마 임시테이블 bmt750t생성에서의 el필드타입과 파라미터로 지정한 :el_의 타입이 서로 일치하지 않는다는 메시지 같은데 잘모르겠군요... 좀 갈켜주세요!!

> 아래에는 소스내용입니다.

>

> procedure TForm1.querybitbtn1Click(Sender: TObject);

> var

> i:integer;

> begin

> with query1 do

> begin

> // close;

> // sql.clear;

> // sql.add('drop table bmt750t');

> // execsql;

>

> close;

> sql.clear;

> sql.add('create table bmt750T(');

> sql.add('prdcod char(13),');

> sql.add('up2 char(7),');

> sql.add('el numeric(10),');

> sql.add('sl numeric(10),');

> sql.add('bo numeric(10),');

> sql.add('hn numeric(10))');

> execsql;

> end;//with

>

> with query1 do

> begin

> close;

> sql.clear;

> sql.add(' select * ');

> sql.add(' from bmt750');

> sql.add(' where stkyr+stkmm+stkdd>=20001129');

> open;

> first;

>

> while not eof do

> begin

> with query2 do

> begin

> close;

> sql.add('insert into bmt750t (prdcod,up2,sl,bo,hn)');

> sql.add('values (:prdcod_,:a_,:el_,:sl_,:bo_,:hn_)');

>

> parambyname('prdcod_').asstring:=query1.fieldbyname('prdcod').asstring;

> parambyname('a_').asstring:='abc';

> if query1.fieldbyname('stkid').asstring='el' then

> parambyname('el_').asinteger:=query1.fieldbyname('trans').asinteger// + query1.fieldbyname('netinp').asinteger

> else

> if query1.fieldbyname('stkid').asstring='sl' then

> parambyname('sl_').asinteger:=query1.fieldbyname('trans').asinteger// + query1.fieldbyname('netinp').asinteger

> else

> if query1.fieldbyname('stkid').asstring='bo' then

> parambyname('bo_').asinteger:=query1.fieldbyname('trans').asinteger// + query1.fieldbyname('netinp').asinteger

> else

> if query1.fieldbyname('stkid').asstring='hn' then

> parambyname('hn_').asinteger:=query1.fieldbyname('trans').asinteger;// + query1.fieldbyname('netinp').asinteger;

>

>

> execsql;

> close;

> end;//with

> next;

> end;//while

> end;//with

>

> with query1 do

> begin

> i:=0;

> close;

> sql.clear;

> sql.add('select prdcod,up2,el,sl,bo,hn');

> sql.add('from bmt750t');

> open;

> first;

> i:=1;

> stringgrid1.rowcount:=recordcount+1;

> while not eof do

> begin

> stringgrid1.cells[0,i]:=fieldbyname('prdcod').asstring;

> stringgrid1.cells[1,i]:=fieldbyname('up2').asstring;

> stringgrid1.cells[2,i]:=fieldbyname('el').asstring;

> stringgrid1.cells[3,i]:=fieldbyname('sl').asstring;

> stringgrid1.cells[4,i]:=fieldbyname('bo').asstring;

> stringgrid1.cells[5,i]:=fieldbyname('hn').asstring;

> next;

> inc(i);

> end;//while

> close; //query1

>

> sql.clear;

> sql.add('drop table bmt750t');

> execsql;

> close;

> end; //with

>

> end; //처음 begin









>잘은 모르겠지만

sql.add('insert into bmt750t (prdcod,up2,sl,bo,hn)');

> sql.add('values (:prdcod_,:a_,:el_,:sl_,:bo_,:hn_)');

> 이부분에서 저장하는 테이블명은 5개데

파라미터는 6개네여

이부분이 잘못 된것 같습니다.

이만~~`

더움이 되길



0  COMMENTS