Q&A

  • select count(*) 를 변수에 입력시키는 방법?
저는 아래처럼 테이블에 값(한줄이겠죠)을 입력시켜서

테이블에서 읽습니다...

테이블을 안쓰고 바로 변수에 넣는 방법이 없을까요?



=== 아래 ===



Query1.SQL.clear;

Query1.SQL.Add(' select count(part_id) as temp ');

Query1.SQL.Add(' from aaa where dwg_no = ');

Query1.SQL.Add('"' + ls + '"' );

Query1.active := true;

li_row_count := strtoint(dbgrid2.Fields[0].text);



2  COMMENTS
  • Profile
    2001.11.20 19:37
    눈부신나 wrote:

    > 저는 아래처럼 테이블에 값(한줄이겠죠)을 입력시켜서

    > 테이블에서 읽습니다...

    > 테이블을 안쓰고 바로 변수에 넣는 방법이 없을까요?

    >

    > === 아래 ===

    >

    > Query1.SQL.clear;

    > Query1.SQL.Add(' select count(part_id) as temp ');

    > Query1.SQL.Add(' from aaa where dwg_no = ');

    > Query1.SQL.Add('"' + ls + '"' );

    > Query1.active := true;



    Query1.Open;

    li_row_count := Query1.Fields[0].AsString;



    혹은,



    li_row_count := Query1.FieldByName('temp').AsString;



    즐코하세요...^^



    > li_row_count := strtoint(dbgrid2.Fields[0].text);

    >

  • Profile
    지나가다 2001.11.20 19:36
    검색에서 'Query 변수' 이렇게 검색 해보세요

    해당 첫 페이지 중간쯤에 보면 관련 답글이 있어요



    시간이 없더러도 찾아 보는 습관을 드리세요 그럼 지나가다 보고 배우는게 많아요

    그럼...



    눈부신나 wrote:

    > 저는 아래처럼 테이블에 값(한줄이겠죠)을 입력시켜서

    > 테이블에서 읽습니다...

    > 테이블을 안쓰고 바로 변수에 넣는 방법이 없을까요?

    >

    > === 아래 ===

    >

    > Query1.SQL.clear;

    > Query1.SQL.Add(' select count(part_id) as temp ');

    > Query1.SQL.Add(' from aaa where dwg_no = ');

    > Query1.SQL.Add('"' + ls + '"' );

    > Query1.active := true;

    > li_row_count := strtoint(dbgrid2.Fields[0].text);

    >