I can´t compile this code:
Code: Select all
LOCAL cTabla := company("ITEMS")
aSql := SQL INSERT INTO &cTabla ( CODIGO, DESCRIPCIO, IMPORTE ) VALUES ( 'C01', 'CONCEPTO PARA PRUEBAS', 12.12 )
SQLEXEC( aSQL )
Code: Select all
LOCAL cTabla := company("ITEMS")
aSql := SQL INSERT INTO &cTabla ( CODIGO, DESCRIPCIO, IMPORTE ) VALUES ( 'C01', 'CONCEPTO PARA PRUEBAS', 12.12 )
SQLEXEC( aSQL )
Code: Select all
LOCAL cTabla := company("ITEMS")
Code: Select all
PRIVATE cTabla := company("ITEMS")
Code: Select all
#xtranslate ADO_SQL UPDATE [TABLE <tbl> ] SET [ <col1> = <val1> [,<colN> = <valN> ] ] [ WHERE <*cwhere*> ] => ;
"UPDATE " + <tbl> + " SET " + ;
FW_ArrayAsList( \{ FW_QuotedColSQL( <"col1"> ) + " = " + FW_ValToSQL( <val1> ) ;
[, FW_QuotedColSQL( <"colN"> ) + " = " + FW_ValToSQL( <valN> ) ] \} ) [ + " WHERE " + CharRepl( '"', <"cwhere">, "'", .t. ) ]
MOISES wrote:Sorry, not working.
Code: Select all
local cSql
local cName := "John"
local cCity := "New York"
local dHireDate:= Date() - 1200
local nSalary := 123023.75
PRIVATE cTable := "customer"
cSql := SQL INSERT INTO &cTable ( FIRST, CITY, HIREDATE, SALARY ) VALUES ( cName, cCity, dHireDate, nSalary )
? cSql
Code: Select all
local cSql
local aData := ;
{ { "John", "New York", Date() - 1200, 23465.55 } ;
, { "Jimmy", "Sydney", Date() - 2000, 32000.00 } ;
, { "David", "Manila", Date() - 4000, 54234.76 } ;
}
PRIVATE cTable := "customer"
cSql := SQL INSERT INTO &cTable ( FIRST, CITY, HIREDATE, SALARY ) ARRAY aData
? cSql