Re: Broken SQL

From: John Kebert (johnrkebert_at_AThotmailDOT.com)
Date: 12/20/04

  • Next message: Ullrich: "Re: Newbie Question"
    Date: Mon, 20 Dec 2004 00:13:14 -0600
    
    

    <nowhere@bollocksFilter.com> wrote in message
    news:3C++QflGZ7fvsYC=0EXPKWZU6QTO@4ax.com...
    >
    > I'm not too hot on databases and SQL, and I'm having a bit of grief.
    >
    > I'm using some TQuery objects to read/write data in some simple
    > Paradox tables.
    >
    > I have one table which consists of these fields:
    > Name Type
    > ---- ----
    > ChangeDate @ (Timestamp)
    > UserName A 20
    > AuditTrail A 240
    >
    > I have a procedure that adds an entry to this audit log table, which
    > looks something like this:
    >
    > procedure logEntry(username: string; description : string);
    > var
    > timeStampStr : string;
    > begin
    > timeStampStr := DateTimeToStr(Now());
    > with DMUdata.auditLogQuery do
    > begin
    > Close;
    > SQL.Clear;
    > SQL.Add('INSERT INTO "Audit_log" ');
    > SQL.Add(' VALUES ("' + TimeStampStr + '", "' +
    > username + '", "' + description +'") ');
    > RequestLive := true;
    > ExecSQL;

    All the talk of datetime formats is great; however, I believe the problem
    lies in the following statement. You should not call open on an insert
    statement. I suspect if you just delete the "Open" it should work just
    fine.

         Open; <---- returns a cursor to an insert, you need a select to return
    a cursor!
    > end;
    > end;

    My 2 cents..

    John


  • Next message: Ullrich: "Re: Newbie Question"

    Relevant Pages

    • Re: BizTalk eating up SQL Server (Virii Behaviour)
      ... Yes, one gig is the least to run sql & bts in the same box, ... uninstall procedure, i manually deleted all databases, and run the ... and it was leaving like 20 mbs free memory, ... BizTalk Solution Developer ...
      (microsoft.public.biztalk.general)
    • Re: Dont understand what version of SQL to install
      ... I'm talking about developing and testing databases for my client and ... To my XP, I can add SQL Developer 2008 to develop (I guess I should say, ... So I can use SQL Developer 2008 to create a database in standard 2005, ... installed on Client OSs such as Windows Vista. ...
      (microsoft.public.sqlserver.setup)
    • Re: Relational-to-OOP Tax
      ... Many SQL vendors has text mining features. ... Tutorial D isn't availible in production databases. ... The Third Manifesto,2 object functionality and the relational model are ...
      (comp.object)
    • Re: [PHP] is there a problem with php script pulling HTML out of database as it writes the page??
      ... I even had one tell me "SQL injection? ... about databases, server management, mail, or anything. ... I have a ghostwriter who keeps me active on the mailing lists. ...
      (php.general)
    • DataArchitect Version 3.5 Now On HP-UX
      ... DataArchitect is a powerful tool that provides ERD capability like PowerDesigner as well as the ability to graphically reverse engineer, create and modify a database through ODBC and perform advanced SQL functions. ... Data Architect is an emerging enterprise tool for designing databases at all levels of an organization using the same concepts found in tools costing thousands of dollars! ... Minimize/Maximize feature on diagram objects ...
      (comp.sys.hp.mpe)