Q&A

  • parameter 문제 입니다.
안녕하세요 아래 구문을 실행을 하니 아래와 같은 error가 발생합니다.

이해가 되지 않아서 질문을 합니다.



델파이 4.0, MSSQL 7.0 입니다.



project AAb.exe raised exception Class EDatabaseError with

message 'Qcolorsave1: Parameter 'p1' not found'.



이런 에러가 발생합니다. 이상한것은 'p1'이 있는데도 에러가 발생합니다.

왜그런지 알고 싶습니다.(하루 꼭박 이렇게 원인 찾고 있습니다. 원인을 모르겠음)



많은 답을 부탁 드립니다.

감사합니다.





with Qcolorsave1 do

begin

Close;

Sql.Clear;

Sql.Add('Update Matr_color set');

Sql.Add(' COLOR_CODEA =:pCOLOR_CODEA, ');

Sql.Add(' MATR_COLORSIZE =isnull(:pMATR_COLORSIZE,'') , ');

Sql.Add(' COLOR_HAVENO =:pCOLOR_HAVENO ');

Sql.Add(' where Matr_Colorsize = :pMATR_COLORSIZE ');



ParamByNAme('pMatr_Colorsize' ).asstring :=Label7.Caption;



ParamByNAme('p1').Asstring :=FlatEdit1.text; 여기만 지나가면 위와 같은

Error가 발생합니다.



ParamByNAme('pCOLOR_CODEA' ).asstring :=str16;

ParamByNAme('pCOLOR_HAVENO' ).asstring :='2';

ExecSql;

Close;

end;

3  COMMENTS
  • Profile
    이성훈 2001.10.17 03:47
    아래 구문에는 P1이 없다는 메세지입니다.. 그럼 즐프하세요..

    { Sql.Clear;

    Sql.Add('Update Matr_color set');

    Sql.Add(' COLOR_CODEA =:pCOLOR_CODEA, ');

    Sql.Add(' MATR_COLORSIZE =isnull(:pMATR_COLORSIZE,'') , ');

    Sql.Add(' COLOR_HAVENO =:pCOLOR_HAVENO ');

    Sql.Add(' where Matr_Colorsize = :pMATR_COLORSIZE ');

    }







    dskang wrote:

    > 안녕하세요 아래 구문을 실행을 하니 아래와 같은 error가 발생합니다.

    > 이해가 되지 않아서 질문을 합니다.

    >

    > 델파이 4.0, MSSQL 7.0 입니다.

    >

    > project AAb.exe raised exception Class EDatabaseError with

    > message 'Qcolorsave1: Parameter 'p1' not found'.

    >

    > 이런 에러가 발생합니다. 이상한것은 'p1'이 있는데도 에러가 발생합니다.

    > 왜그런지 알고 싶습니다.(하루 꼭박 이렇게 원인 찾고 있습니다. 원인을 모르겠음)

    >

    > 많은 답을 부탁 드립니다.

    > 감사합니다.

    >

    >

    > with Qcolorsave1 do

    > begin

    > Close;

    > Sql.Clear;

    > Sql.Add('Update Matr_color set');

    > Sql.Add(' COLOR_CODEA =:pCOLOR_CODEA, ');

    > Sql.Add(' MATR_COLORSIZE =isnull(:pMATR_COLORSIZE,'') , ');

    > Sql.Add(' COLOR_HAVENO =:pCOLOR_HAVENO ');

    > Sql.Add(' where Matr_Colorsize = :pMATR_COLORSIZE ');

    >

    > ParamByNAme('pMatr_Colorsize' ).asstring :=Label7.Caption;

    >

    > ParamByNAme('p1').Asstring :=FlatEdit1.text; 여기만 지나가면 위와 같은

    > Error가 발생합니다.

    >

    > ParamByNAme('pCOLOR_CODEA' ).asstring :=str16;

    > ParamByNAme('pCOLOR_HAVENO' ).asstring :='2';

    > ExecSql;

    > Close;

    > end;

  • Profile
    dskang 2001.10.17 04:23
    이성훈님

    죄송합니다.

    다시 내용이 추가입니다.



    Sql.Add(' where Matr_Colorsize = :pMATR_COLORSIZE and Mtat_code =:p1 ');

    이렇게 P1이 추가 됩니다.



    답을 주셔서 감사합니다.

    한번더 부탁 드립니다.



    이성훈 wrote:

    > 아래 구문에는 P1이 없다는 메세지입니다.. 그럼 즐프하세요..

    > { Sql.Clear;

    > Sql.Add('Update Matr_color set');

    > Sql.Add(' COLOR_CODEA =:pCOLOR_CODEA, ');

    > Sql.Add(' MATR_COLORSIZE =isnull(:pMATR_COLORSIZE,'') , ');

    > Sql.Add(' COLOR_HAVENO =:pCOLOR_HAVENO ');

    > Sql.Add(' where Matr_Colorsize = :pMATR_COLORSIZE ');

    > }

    >

    >

    >

    > dskang wrote:

    > > 안녕하세요 아래 구문을 실행을 하니 아래와 같은 error가 발생합니다.

    > > 이해가 되지 않아서 질문을 합니다.

    > >

    > > 델파이 4.0, MSSQL 7.0 입니다.

    > >

    > > project AAb.exe raised exception Class EDatabaseError with

    > > message 'Qcolorsave1: Parameter 'p1' not found'.

    > >

    > > 이런 에러가 발생합니다. 이상한것은 'p1'이 있는데도 에러가 발생합니다.

    > > 왜그런지 알고 싶습니다.(하루 꼭박 이렇게 원인 찾고 있습니다. 원인을 모르겠음)

    > >

    > > 많은 답을 부탁 드립니다.

    > > 감사합니다.

    > >

    > >

    > > with Qcolorsave1 do

    > > begin

    > > Close;

    > > Sql.Clear;

    > > Sql.Add('Update Matr_color set');

    > > Sql.Add(' COLOR_CODEA =:pCOLOR_CODEA, ');

    > > Sql.Add(' MATR_COLORSIZE =isnull(:pMATR_COLORSIZE,'') , ');

    > > Sql.Add(' COLOR_HAVENO =:pCOLOR_HAVENO ');

    > > Sql.Add(' where Matr_Colorsize = :pMATR_COLORSIZE ');

    > >

    > > ParamByNAme('pMatr_Colorsize' ).asstring :=Label7.Caption;

    > >

    > > ParamByNAme('p1').Asstring :=FlatEdit1.text; 여기만 지나가면 위와 같은

    > > Error가 발생합니다.

    > >

    > > ParamByNAme('pCOLOR_CODEA' ).asstring :=str16;

    > > ParamByNAme('pCOLOR_HAVENO' ).asstring :='2';

    > > ExecSql;

    > > Close;

    > > end;

  • Profile
    2001.10.17 21:12
    p1이 string이 아닌 integer나 기타등등 다른것이 아닐까요....

    아님..... 죄송 ~~~~~~~