[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] An example UPDATE



PureBytes Links

Trading Reference Links

Hi Tomasz:   Thank for taking time out from what must be a very busy schedule.  I just saw the work on Forex.  The
breadth of the product continues to impress me. 

I know this was simple but I couldn't get it and this removes one more hurdle.  It does read like the DML statements in the
tutorials  - as it should since Access is processing this. 
It's the syntax of the single quote, double quote and the + signs that was (and still is) throwing me off. 

Where could I learn more about this or is this specific to the way you wrote the function?    
 
Best personal regards
Joe 
  ----- Original Message ----- 
  From: Tomasz Janeczko 
  To: amibroker@xxxxxxxxxxxxxxx 
  Sent: Saturday, August 12, 2006 5:53 AM
  Subject: Re: [amibroker] An example UPDATE


  odbcExecuteSQL("UPDATE testtable SET fieldone = '" + somevalue + "' WHERE Symbol='MSFT'");

  Best regards,
  Tomasz Janeczko
  amibroker.com
    ----- Original Message ----- 
    From: Joe Landry 
    To: amibroker@xxxxxxxxxxxxxxx 
    Sent: Saturday, August 12, 2006 12:30 AM
    Subject: [amibroker] An example UPDATE


    Hi Tomasz - looks like the odbcSQLExecute statement will UPDATE and DELETE table records. 
    Would you take a couple of minutes and write an example of an UPDATE for us.  
    Say one where the key field <  symbol >    is a ticker like ticker = "XOM";       or "INTC".
    and not current ticker as provided by   Name()  ....

    Thanks
    JOE    
    odbcExecuteSQL( "sql statement" )

    - executes SQL statement

    This function returns 1 (True) on success, 0 (False) on failure.

    This function takes string parameter containing valid SQL statement such as INSERT, UPDATE, DELETE, etc, and as such allows write operations on the database. It is not intended to be used with SELECT statements or other statements (stored procedure calls) returning recordsets as it returns only true/false on success/failure.

    Example:

    odbcExecuteSQL("INSERT INTO testtable (fieldone,symbol) VALUES ( 'somevalue','"+Name()+"' )");