Леминги и #39

    Date: 03/11/08 (Code WTF)    Keywords: sql

    Автор кода утверждает, что апостроф в Delphi строке можно задать только таким образом:

      sql := 'select ... where ID = #'+inttostr(nomenID)+'#;'
      sql := MakeSymbols(sql);
    , где
      procedure MakeSymbols(var SQL: string);
      var
        Poss   : Integer;
        ResStr : string;
      begin
        ResStr := '';
        Poss   := Pos('#', SQL);
        while Poss <> 0 do
        begin
          ResStr := ResStr + Copy(SQL, 1, Poss - 1);
          ResStr := ResStr + #39;
          Delete(SQL, 1, Poss);
          Poss := Pos('#', SQL);
        end;
        ResStr := ResStr + SQL;
        SQL := ResStr;
      end;

    Source: http://community.livejournal.com/code_wtf/125530.html

« switch || Понравилось... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home