Q&A

  • View는 코딩으로 만들 수 없나요?
  with DM.qTmp do
  begin
    Close;
    Sql.Clear;
    Sql.Add(' Create View NonActing                     ');
    Sql.Add(' As                                        ');
    Sql.Add(' select *                                  ');
    Sql.Add(' from (select Member.MemberID, Name, EnterDt, Division_$dvsn, Sido, Gugun, Dong, Note, PostNo,    ');
    Sql.Add('              Position_$chrp, Chrp.CodeNm ChrpNm, MagazineCd_$magz, Magazine.Memo                        ');
    Sql.Add('       from Member                                                 ');
    Sql.Add('            inner join (select MemberID, MagazineCd_$magz, Memo from Magazine    ');
    Sql.Add('                                     where MagazineCd_$magz = :Magazine and Send_$send = :Send) Magazine    ');
    Sql.Add('            on Magazine.MemberID = Member.MemberID,            ');
    Sql.Add('            Person                                                   ');
    Sql.Add('            left outer join (select CommonCd, CodeNm from CommonCode where CommonID = '+''''+'$chrp'+''') chrp    ');
    Sql.Add('            on chrp.CommonCd = Person.Position_$chrp                                                        ');
    Sql.Add('       where Person.MemberID = Member.MemberID                                                     ');
    Sql.Add('           and EnterDt <= :EnterDt    ');
    Sql.Add('         and Division_$dvsn like :Division    ');
    Sql.Add('         and Position_$chrp <> :Position) Member    ');
    Sql.Add(' where Member.MemberID not in    ');
    Sql.Add('       (select MemberID from Member    ');
    Sql.Add('        where MemberID in (select Distinct MemberID from Donation    ');
    Sql.Add('                           where SlipDt >= :DonFrom and SlipDt <= :DonTo ))    ');
    Sql.Add('   and Member.MemberID not in    ');
    Sql.Add('       (select MemberID from Member    ');
    Sql.Add('        where MemberID in (select Distinct MemberID from Contact))    ');

    ParamByName('Magazine').AsString    := '102';
    ParamByName('Send').AsString        := '100';
    ParamByName('EnterDt').AsString     := mEditEnterDt.Text;
    ParamByName('Position').AsString    := vPosition;
    ParamByName('Division').AsString    := Division;
    ParamByName('DonFrom').AsString     := mEditDonFrom.Text;
    ParamByName('DonTo').AsString       := mEditDonTo.Text;

    ExecSql;
  end;



View Table을 만들려고 해요~
위에 있는 소스가 그 쿼리구요~~~
그런데~ ExecSql만~ 날리면~~ View를 알수 없다고~ Syntex 에러라고~ 나와요~~~
View는 코딩 안되나요???


0  COMMENTS