KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Passing pointers inside SQL queries
PRODUCT: 4D Developer | VERSION: 11.1 | PLATFORM: Mac & Win
Published On: August 13, 2008

In 4D v11 SQL it is possible to pass a pointer variable inside an SQL Query. The pointer variable should be passed without a dereference.

For Example:

C_TEXT($vName;$vresult)
C_POINTER($name_p)
$vName:="John"
$name_p:=->$vName
Begin SQL
  SELECT names
  FROM test
  WHERE names=:$name_p
  INTO :$vresult
End SQL



In this example, at the end the value of $vresult will be John. The SQL engine will not allow you to use a pointer-to-pointer reference in SQL queries.