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

[amibroker] An example UPDATE



PureBytes Links

Trading Reference Links

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()+"' )");