MS SQL: DUPLICATE does not work correctly unless GET(File,0) comes first

Applies to: Clarion 6.1 Legacy with MS SQL 2008 R2, as reported in 2011.

Problem

The Help says GET(File,FilePointer) is not supported by MS SQL. Yet DUPLICATE without a preceding GET(File,0) did not work correctly, and with the GET the trace showed the record buffer being populated. The poster asked whether the documentation was wrong or DUPLICATE was broken for MS SQL.

Solution

  1. Call GET(File,0) before DUPLICATE.
  2. A poster replied that the documentation is slightly wrong: GET(File,FilePointer) is unsupported, except for GET(File,0) when used with DUPLICATE.
  3. DUPLICATE(FileName) then checks all the keys at once.

Caveats

  • Another poster suggested priming the key fields, calling GET(File,PrimaryKey) and checking ERRORCODE() instead. The original poster preferred DUPLICATE because it checks every key in one call.
  • The statement about the documentation is a poster's reading; no vendor confirmation is in the thread.
  • The original poster proposed passing it on to the documentation people; no reply is in the thread.

Today (2026)

Not re-tested on current Clarion or current SQL Server. Check the current Help text for GET and DUPLICATE on your driver.

Sources: Graham D. (Apr 2011, the question), Edmond S. (Apr 2011), Scott F. (Apr 2011) in softvelocity.clarion.databasedrivers.