I see this is an older thread, however when searching online for any assistance with using the SQLTable library controls (or even the AlarmTable controls recently for that matter) the help was non-existent other than outlining the fields on the dialog.
I may have misinterpreted what your issue is, however I have successfully used the SQLTable control to display and update from a remote database - in this case a custom table created within the same database running the Citect Historian tables.
To load the data I used the LibSqlTable_ReloadData function. It seem that there was a limitation on the length of the SQL Select Query field which didn't allow for the query I wanted, so I used the database to create a stored procedure and then called the "EXEC" command within the cicode (which would be in the [Query_String] part below). This was achieved with a simple Cicode function called from the Initialize property. My function was:
INT FUNCTION SQLTableSetQuery([Any arguments required])
STRING sRecordSource;
STRING sConnection;
//Set the initial query of the table to execute the query
LibSqlTable_SetProperty([SQLTable_Name], "Select", [Query_String])
//Get the SELECT statement and the Connection STRING and Reload the table data
sRecordSource = LibSqlTable_GetProperty([SQLTable_Name], "Select");
sConnection = LibSqlTable_GetProperty([SQLTable_Name], "Connection");
LibSqlTable_ReloadData([SQLTable_Name], sRecordSource , sConnection);
RETURN 1;
END
The purpose of the table for me was to have an operator input a particular manual reading and then press a button on screen to write the manual value, and compared Citect variable tag value, to the custom table. The writing of the values the database was performed with some simple SQL Cicode functions abbreviated here:
hSQL = SQLConnect([Connection_String]);
IF hSQL <> -1 THEN
sQuery = [SQL_INSERT_Query];
SQLExec(hSQL, sQuery);
END
SQLDisconnect(hSQL);
Following this, to reload the table instantly, I used the same functions as in the previous Cicode function above:
//Get the SELECT statement and the Connection STRING and Reload the table data
sRecordSource = LibSqlTable_GetProperty([SQLTable_Name], "Select");
sConnection = LibSqlTable_GetProperty([SQLTable_Name], "Connection");
LibSqlTable_ReloadData([SQLTable_Name], sRecordSource , sConnection);
From the initial post, it seems that the cicode functions trying to be used (LibTable_GetCellValue/LibTable_SetCellValue) are not actually manipulating an SQL table as the intention of the library control would be.
Hope this helps someone!