# Database drivers: PROP:SQL and performance

**URL:** <https://forums.softvelocity.com/t/database-drivers-prop-sql-and-performance/1639>\
**Category:** Knowledge Base\
**Tags:** database-drivers\
**Created:** [November 9, 2026, 11:38am UTC](https://forums.softvelocity.com/t/database-drivers-prop-sql-and-performance/1639 "2026-11-09T11:38:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rzaunere](https://avatars.discourse-cdn.com/v4/letter/r/f14d63/32.png) [@rzaunere](https://forums.softvelocity.com/u/rzaunere)\
**Post date:** [November 9, 2026, 11:38am UTC](https://forums.softvelocity.com/t/database-drivers-prop-sql-and-performance/1639/1 "2026-11-09T11:38:25Z")

</div>

Part of [Database drivers: the hub](https://forums.softvelocity.com/t/database-drivers-the-hub/1652). 121 entries under this heading; every entry opens as its own topic.

- [A PROP:SQL query on a dummy table takes 95 seconds; the same statement takes 6 in Management Studio (Reported, not reproduced)](https://forums.softvelocity.com/t/a-prop-sql-query-on-a-dummy-table-takes-95-seconds-the-same-statement-takes-6-in-management-studio-reported-not-reproduced/1102) - ORDER BY was most of it; compare execution plans from Profiler.
- [Intermittent Errorcode 90 opening a /turbosql dummy table used for PROP:SQL (Reported, not reproduced)](https://forums.softvelocity.com/t/intermittent-errorcode-90-opening-a-turbosql-dummy-table-used-for-prop-sql-reported-not-reproduced/1103) - read FILEERROR(), not ERROR().
- [PostgreSQL: how do I see the server's SQL error message after a file error?](https://forums.softvelocity.com/t/postgresql-how-do-i-see-the-servers-sql-error-message-after-a-file-error/1104) - FILEERRORCODE() and FILEERROR(); the ABC Try methods.
- [PROP:SQL with only a WHERE clause works on MySQL but returns different rows on Firebird](https://forums.softvelocity.com/t/prop-sql-with-only-a-where-clause-works-on-mysql-but-returns-different-rows-on-firebird/1105) - PROP:SQL is a full statement; PROP:WHERE carries a fragment.
- [MySQL from Clarion: can I keep using SET/NEXT/ADD/PUT, or must I learn SQL first?](https://forums.softvelocity.com/t/mysql-from-clarion-can-i-keep-using-set-next-add-put-or-must-i-learn-sql-first/1106) - the driver generates the SQL; PROP:SQL for set-based work.
- [Reading a browse's generated SELECT in the trace: question marks, a duplicated WHERE and DESC on every ORDER BY column](https://forums.softvelocity.com/t/reading-a-browses-generated-select-in-the-trace-question-marks-a-duplicated-where-and-desc-on-every-order-by-column/1107) - parameter markers, range + filter, a backwards page read.
- [MSSQL: what BUFFER page size speeds up an ABC browse?](https://forums.softvelocity.com/t/mssql-what-buffer-page-size-speeds-up-an-abc-browse-file-loaded-or-page-loaded/1108) - index first, then raise the page size from 20 into the low hundreds.
- [MSSQL: PUT() inside a SET/NEXT loop makes the loop read the same rows twice (Reported, not reproduced)](https://forums.softvelocity.com/t/mssql-put-inside-a-set-next-loop-makes-the-loop-read-the-same-rows-twice-reported-not-reproduced/1109) - set-based UPDATE through PROP:SQL instead.
- [Firebird: a stored procedure on a second database answers in milliseconds, but every NEXT() on the dummy table takes a second (Reported, not reproduced)](https://forums.softvelocity.com/t/firebird-a-stored-procedure-on-a-second-database-answers-in-milliseconds-but-every-next-on-the-dummy-table-takes-a-second-reported-not-reproduced/1110) - a VIEW with a large BUFFER over an imported table of the second database.
- [Firebird: adding "ROWS 1000" to a browse through SQL() in the filter gives "Token unknown" (Reported, not reproduced)](https://forums.softvelocity.com/t/firebird-adding-rows-1000-to-a-browse-through-sql-in-the-filter-gives-dynamic-sql-error-token-unknown-reported-not-reproduced/1111) - the filter lands inside the WHERE.
- [PostgreSQL: an invoice-history query with GROUP BY over a million-row table takes 20 seconds](https://forums.softvelocity.com/t/postgresql-an-invoice-history-query-with-group-by-over-a-million-row-table-takes-20-seconds/1112) - a partial covering index, or the customer id on the invoice.
- [PostgreSQL: a year-by-month summary, and crosstab() saying relation "..." does not exist on a CTE](https://forums.softvelocity.com/t/postgresql-a-year-by-month-summary-and-crosstab-saying-relation-does-not-exist-on-a-cte/1113) - GROUP BY on the server; the CTE goes inside the crosstab string.
- [Keeping lookup tables in TPS while the main data moves to SQL](https://forums.softvelocity.com/t/keeping-lookup-tables-in-tps-while-the-main-data-moves-to-sql-what-it-costs-and-how-to-do-it/1114) - a mixed-driver VIEW joins on the client; In-Memory or QUEUE lookups.
- [Calling SQLSetEnvAttr from Clarion always returns -1 (SQL\_ERROR)](https://forums.softvelocity.com/t/calling-sqlsetenvattr-from-clarion-always-returns-1-sql-error/1115) - pass the value, not ADDRESS(); SQLRETURN is a SHORT.
- [Clarion 6.3 build 9058: GPF inside the SQL driver on Close() when a form is opened a second time (Reported, not reproduced)](https://forums.softvelocity.com/t/clarion-6-3-build-9058-gpf-inside-the-sql-driver-on-close-when-a-form-is-opened-a-second-time-reported-not-reproduced/1116) - BLOB tables down the relation chain; 2008 beta builds.
- [New to SQL: what changes when a Clarion program uses Microsoft SQL Server, and where to learn](https://forums.softvelocity.com/t/new-to-sql-what-changes-when-a-clarion-program-uses-microsoft-sql-server-and-where-to-learn/1117) - sets instead of records; the file commands still work, PROP:SQL for the rest.
- [Getting the rows of a SELECT: PROP:SQL, NEXT, and when to use a Clarion VIEW instead](https://forums.softvelocity.com/t/getting-the-rows-of-a-select-prop-sql-next-and-when-to-use-a-clarion-view-instead/1118) - declare the first columns to match the SELECT, then NEXT in a loop.
- [SQL Server: a CHOOSE-style test inside a SUM (use the discounted amount when it is not NULL)](https://forums.softvelocity.com/t/sql-server-a-choose-style-test-inside-a-sum-use-the-discounted-amount-when-it-is-not-null/1119) - a CASE expression inside the aggregate.
- [PROP:SQL with a subquery column takes minutes and the column comes back as zeros (Reported, not reproduced)](https://forums.softvelocity.com/t/prop-sql-with-a-subquery-column-takes-minutes-and-the-column-comes-back-as-zeros-reported-not-reproduced/1120) - read the trace to see what is sent; the thread did not settle it.
- [SQL browse: filtering a parent browse on child fields shows each parent once per child](https://forums.softvelocity.com/t/sql-browse-filtering-a-parent-browse-on-child-fields-shows-each-parent-once-per-child/1121) - a server-side view with one row per parent is the first choice.
- [MS SQL: running several statements, or a script, through PROP:SQL](https://forums.softvelocity.com/t/ms-sql-running-several-statements-or-a-script-through-prop-sql/1122) - osql against a script file, or a stored procedure.
- [Turning on the SQL driver trace from code, without the Trace utility or win.ini](https://forums.softvelocity.com/t/turning-on-the-sql-driver-trace-from-code-without-the-trace-utility-or-win-ini/1123) - SEND with /LOGFILE=, PROP:Profile, PROP:Details and PROP:LogSQL.
- [SQL Server view with a LEFT OUTER JOIN: error 10113 when indexing it, and is it slow without an index?](https://forums.softvelocity.com/t/sql-server-view-with-a-left-outer-join-error-10113-when-indexing-it-and-is-it-slow-without-an-index/1124) - index the underlying tables; the view uses what the same SELECT would use; read the execution plan.
- [MSSQL driver: error 78 when a browse opens the update form, on one customer's machine only (Reported, not reproduced)](https://forums.softvelocity.com/t/mssql-driver-error-78-when-a-browse-opens-the-update-form-on-one-customers-machine-only-reported-not-reproduced/1125) - run Trace.exe on that machine before it recurs; one poster saw every error 78 come from the ABC browse code (page load, totalling).
- [PROP:SQL result set comes back empty after upgrading to build 9055: a SET() on the file after the statement](https://forums.softvelocity.com/t/prop-sql-result-set-comes-back-empty-after-upgrading-to-build-9055-a-set-on-the-file-after-the-statement/1126) - remove the SET(); it clears the PROP:SQL statement, and build 9055 honours that.
- [How to see the SQL that Clarion generates for PostgreSQL (PROP:LogSQL output looks like gibberish)](https://forums.softvelocity.com/t/how-to-see-the-sql-that-clarion-generates-for-postgresql-prop-logsql-output-looks-like-gibberish/1127) - it is the trace output; Trace.exe with the Clarion-statement options is easier to read.
- [A browse's SELECT in the trace lists all the table's fields, not only the browse columns](https://forums.softvelocity.com/t/a-browses-select-in-the-trace-lists-all-the-tables-fields-not-only-the-browse-columns/1128) - the first lines may be the schema check; the VIEW's PROJECT list defines what comes back; the log and the server view disagreed.
- [ABC FileManager passed to a procedure: the program GPFs on fm.UseFile (Reported, not reproduced)](https://forums.softvelocity.com/t/abc-filemanager-passed-to-a-procedure-the-program-gpfs-on-fm-usefile-reported-not-reproduced/1129) - the thread showed a similar procedure that opens the file through the manager and tests with a dummy PROP:SQL; no cause was found.
- [MSSQL: Relate:File.DELETE or DELETE(File) for speed, and what actually made the app faster](https://forums.softvelocity.com/t/mssql-relate-file-delete-or-delete-file-for-speed-and-what-actually-made-the-app-faster/1130) - both calls work; do the referential integrity in the database with a trigger; no speed difference was measured.
- [Update form with tabs: showing the number of child records on each tab before the user opens it](https://forums.softvelocity.com/t/update-form-with-tabs-showing-the-number-of-child-records-on-each-tab-before-the-user-opens-it/1131) - ActiveInvisible = True on the child browses, file-load them, then RECORDS() of each browse queue.
- [PostgreSQL: an UPDATE with a WITH ... AS clause fails with ERROR: column "v1" does not exist](https://forums.softvelocity.com/t/postgresql-an-update-with-a-with-as-clause-fails-with-error-column-v1-does-not-exist/1132) - a WITH name is a result set, not a scalar; write the SELECT first and split the work into simpler UPDATEs.
- [MSSQL: connection busy S1000 on an update form although BUSYHANDLING = 2 is set (the poster's cause was his own PROP:SQL updates)](https://forums.softvelocity.com/t/mssql-connection-busy-s1000-on-an-update-form-although-busyhandling-2-is-set-the-posters-cause-was-his-own-prop-sql-updates/1133) - the poster's cause was his own PROP:SQL updates; set BUSYHANDLING on the first table opened on the connection.
- [PostgreSQL: a browse over three related tables takes up to two minutes to refresh (Reported, not reproduced)](https://forums.softvelocity.com/t/postgresql-a-browse-over-three-related-tables-takes-up-to-two-minutes-to-refresh-reported-not-reproduced/1134) - `/NESTING = TRUE` (join on the server) and hot key fields were suggested; no result was posted.
- [PostgreSQL: the child browse shows wrong and duplicate records after opening the update form](https://forums.softvelocity.com/t/postgresql-the-child-browse-shows-wrong-and-duplicate-records-after-opening-the-update-form/1135) - filter the child browse and reset it on a parent field instead of relying on the relation controls.
- [PostgreSQL: making an Excel or CSV file directly from the server](https://forums.softvelocity.com/t/postgresql-making-an-excel-or-csv-file-directly-from-the-server/1136) - the server's COPY command, or `\copy` from psql, writes a CSV file.
- [A "starts with" browse filter built from \>= 'Taz' and \< 'Ta{' returns no record on SQL Server but works on Oracle](https://forums.softvelocity.com/t/a-starts-with-browse-filter-built-from-taz-and-ta-returns-no-record-on-sql-server-but-works-on-oracle/1137) - filter with `LIKE 'Taz%'` wrapped in `SQL(...)` instead of building an upper bound; the cause of the missing row was not settled.
- [After converting from TPS to MSSQL, one procedure takes 7 seconds per scan instead of 1](https://forums.softvelocity.com/t/after-converting-from-tps-to-mssql-one-procedure-takes-7-seconds-per-scan-instead-of-1/1138) - run SQL Profiler, feed the trace to the Database Engine Tuning Advisor and apply its index changes; 7 seconds fell to under one.
- [MSSQL: a SELECT returns 87 rows but the UPDATE with the same WHERE says 267 rows affected](https://forums.softvelocity.com/t/mssql-a-select-returns-87-rows-but-the-update-with-the-same-where-says-267-rows-affected/1139) - a trigger on the table touched more rows; disabling it explained the count.
- [MSSQL: BUFFER(file, 2) or more gives a file system error on NEXT when a /TURBOSQL field is shorter than the column](https://forums.softvelocity.com/t/mssql-buffer-file-2-or-more-gives-a-file-system-error-on-next-when-a-turbosql-field-is-shorter-than-the-column/1140) - make the declared field at least as long as the server column, or cut the value in the SELECT; the bulk fetch needs the exact record size.
- [After code changes the data behind a browse, ODBC does not redisplay it (it did with TPS)](https://forums.softvelocity.com/t/after-code-changes-the-data-behind-a-browse-odbc-does-not-redisplay-it-it-did-with-tps/1141) - call `BRW2.ResetQueue(RESET:Done)` after the code changes the data.
- [Parameterized queries: SQLBindParameter before PROP:SQL is ignored; PROP:SQLRowSet took parameters](https://forums.softvelocity.com/t/parameterized-queries-sqlbindparameter-before-prop-sql-is-ignored-prop-sqlrowset-took-parameters/1142) - use PROP:SQLRowSet, which took parameters and several statements; PROP:SQL ignored SQLBindParameter.
- [PostgreSQL: one row per invoice that lists the count of items per price (string\_agg is slow as a subquery)](https://forums.softvelocity.com/t/postgresql-one-row-per-invoice-that-lists-the-count-of-items-per-price-string-agg-is-slow-as-a-subquery/1143) - the cost was a subquery run once per invoice; count by price first in a CTE, then aggregate with string\_agg in one pass (55 seconds to under one).
- [Process procedure on a PostgreSQL table: error 33 "record not available" on Access:Items.Update (Reported, not reproduced)](https://forums.softvelocity.com/t/process-procedure-on-a-postgresql-table-error-33-record-not-available-on-access-items-update-reported-not-reproduced/1144) - a Process expects PUT(View); REGET(View,POSITION(View)) at the start lets Access:File.Update work; no result was posted.
- [PostgreSQL: a view with two or more LEFT OUTER JOINs is very slow (UseDeclareFetch)](https://forums.softvelocity.com/t/postgresql-a-view-with-two-or-more-left-outer-joins-is-very-slow-usedeclarefetch/1145) - add `useDeclareFetch = 1` to the connection string; `/Nesting=True` was the other suggestion.
- [File drop combo on MSSQL: the More Field Assignments do nothing](https://forums.softvelocity.com/t/file-drop-combo-on-mssql-the-more-field-assignments-do-nothing/1146) - the VIEW must project the assigned fields; add them to the list box with width 0 (it worked for the poster), or use hot fields with "Not In View" unchecked.
- [IP driver in front of a remote MySQL server: will it be faster than the ODBC driver?](https://forums.softvelocity.com/t/ip-driver-in-front-of-a-remote-mysql-server-will-it-be-faster-than-the-odbc-driver/1147) - expect no gain: the IP driver sits in front of the same ODBC driver and only adds a layer; it helps only if the slow leg is the long one.
- [MySQL through ODBC: a browse over more than two related files sends many queries instead of one join](https://forums.softvelocity.com/t/mysql-through-odbc-a-browse-over-more-than-two-related-files-sends-many-queries-instead-of-one-join/1148) - two one-to-many children multiply the rows, so Clarion builds the view on the client; use a browse per child, a server view, or set PROP:Alias.
- [A SQL error box appears when a table is filtered (SQL Server Express 2005): finding the SELECT that failed (Reported, not reproduced)](https://forums.softvelocity.com/t/a-sql-error-box-appears-when-a-table-is-filtered-sql-server-express-2005-finding-the-select-that-failed-reported-not-reproduced/1149) - turn the trace on or set `file{PROP:Details}=1` and `file{PROP:Profile}` to a log file to see the generated SELECT; a small SQLError procedure can copy the query to the clipboard.
- [SQL: making room between sort-order numbers with one UPDATE (Reported, not reproduced)](https://forums.softvelocity.com/t/sql-making-room-between-sort-order-numbers-with-one-update-reported-not-reproduced/1150) - one UPDATE such as `mysortorder = mysortorder * 5` changes all rows as a set, so a unique constraint is not hit row by row as in a SET/NEXT/PUT loop; no outcome was posted.
- [MSSQL: PROP:SQLFilter gives "The multipart identifier could not be bound" or "Ambiguous column name"](https://forums.softvelocity.com/t/mssql-prop-sqlfilter-gives-the-multipart-identifier-could-not-be-bound-or-ambiguous-column-name/1151) - the generated SELECT uses aliases A, B and so on; set `Buchungen{prop:alias} = 'A'` before the view is used and name that alias in PROP:SQLFilter.
- [PostgreSQL: a failing PROP:SQL statement on a dummy file never gives errorcode 90 - ERRORCODE() is always 33](https://forums.softvelocity.com/t/postgresql-a-failing-prop-sql-statement-on-a-dummy-file-never-gives-errorcode-90-errorcode-is-always-33/1152) - remove the NEXT: after a statement that returns no rows it returns 33 and masks the 90; test ERRORCODE() right after the PROP:SQL assignment.
- [MSSQL: a LIKE condition in a view's PROP:Filter is ignored; use SQL() or PROP:SQLFilter](https://forums.softvelocity.com/t/mssql-a-like-condition-in-a-views-prop-filter-is-ignored-use-sql-or-prop-sqlfilter/1153) - wrap the text in SQL() so the driver sends it as written; the poster confirmed it works.
- [MySQL: several ; separated statements in one PROP:SQL do not run (a stored procedure was the way the thread leaned)](https://forums.softvelocity.com/t/mysql-several-separated-statements-in-one-prop-sql-do-not-run-a-stored-procedure-was-the-way-the-thread-leaned/1154) - a plain query call does not switch on multiple statements; put them in a stored procedure and call it.
- [MS SQL: an occasional "Invalid object name" error on one table that exists](https://forums.softvelocity.com/t/ms-sql-an-occasional-invalid-object-name-error-on-one-table-that-exists/1155) - run trace.exe and check whether the statement went to another database; check the quoting; fully qualify the table name.
- [A NEXT loop with PROP:WHERE on a SQL file returns nothing, ERRORCODE 33 "record unavailable"](https://forums.softvelocity.com/t/a-next-loop-with-prop-where-on-a-sql-file-returns-nothing-errorcode-33-record-unavailable/1156) - use SET(key) alone with the WHERE, check NULL against 0 and quote the values; if nothing returns, remove one filter at a time and use trace.exe.
- [PostgreSQL: PROP:SQL with a WITH (common table expression) query returns error 33 "no records found"](https://forums.softvelocity.com/t/postgresql-prop-sql-with-a-with-common-table-expression-query-returns-error-33-no-records-found/1157) - move the query into a stored function and call it; one post says C9 and later accept CTEs through PROP:SQLRowSet.
- [PostgreSQL: a browse on a 295,000-record table waits 7 to 10 seconds before it shows anything](https://forums.softvelocity.com/t/postgresql-a-browse-on-a-295-000-record-table-waits-7-to-10-seconds-before-it-shows-anything/1158) - add `UseDeclareFetch=1` to the ODBC connection string so the server starts sending before the set is complete; it worked for the poster in the data source configuration.
- [MSSQL: browse boxes became sluggish after the database grew from 10 GB to 20 GB](https://forums.softvelocity.com/t/mssql-browse-boxes-became-sluggish-after-the-database-grew-from-10-gb-to-20-gb/1159) - add server indexes that match the slow browse's key, filter and order, found with SQL Profiler and added one at a time; not every dictionary key needs a server index.
- [MSSQL: LIKE has no "repeat 0-n times" - matching name, any non-alphanumeric characters, surname](https://forums.softvelocity.com/t/mssql-like-has-no-repeat-0-n-times-matching-name-any-number-of-non-alphanumeric-characters-surname/1160) - combine `LIKE 'john[^A-Z0-9]%smith'` with a `NOT LIKE` that rejects letters or digits in between; the poster tested it on sample rows.
- [ODBC (Firebird): INLIST or INSTRING in a filter is ignored and the generated SELECT has no WHERE clause](https://forums.softvelocity.com/t/odbc-firebird-inlist-or-instring-in-a-filter-is-ignored-and-the-generated-select-has-no-where-clause/1161) - the driver cannot translate those statements, so the client evaluates them; write the condition in SQL inside `SQL(...)`.
- [ODBC, SQL Server: PROP:SQL "select count(...)" returns garbage characters in a STRING field (use a CSTRING)](https://forums.softvelocity.com/t/odbc-sql-server-prop-sql-select-count-returns-garbage-characters-in-a-string-field-use-a-cstring/1162) - declare the receiving fields as CSTRING (256 worked) and drop the CAST; a STRING takes the raw bytes the backend sends.
- [Reading a code and description from a SQL table in another database when its structure may change](https://forums.softvelocity.com/t/reading-a-code-and-description-from-a-sql-table-in-another-database-when-its-structure-may-change/1163) - three answers: a server VIEW, a dynamic query through PROP:SQL into a generic two-field table, or a VIEW with a BUFFER.
- [PostgreSQL: a read, add and update loop stops at record 201 with 284 records, fixed by a later ODBC driver release](https://forums.softvelocity.com/t/postgresql-a-read-add-and-update-loop-stops-at-record-201-with-284-records-fixed-by-a-later-odbc-driver-release/1164) - two other posters ran the test without trouble; the poster confirmed the fault belonged to one ODBC driver release and a later one cured it.
- [MSSQL: FILEERROR() shows a generic error instead of the server's RAISERROR text when SQL Native Client is installed](https://forums.softvelocity.com/t/mssql-fileerror-shows-a-generic-error-instead-of-the-servers-raiserror-text-when-sql-native-client-is-installed/1165) - an earlier thread said the blind messages came only where SQL Native Client was installed; run on a machine without it, or uninstall it temporarily, and the real message appears.
- [MSSQL: emptying a whole table from the program with PROP:SQL (DELETE FROM or TRUNCATE TABLE)](https://forums.softvelocity.com/t/mssql-emptying-a-whole-table-from-the-program-with-prop-sql-delete-from-or-truncate-table/1166) - `Adreport{prop:SQL}='Delete from Adreport'` worked for the poster; TRUNCATE TABLE is faster because the deletions are not logged.
- [Tuning an ABC application ported from TPS to SQL over ODBC: ranges to filters, and date range limits on a browse](https://forums.softvelocity.com/t/tuning-an-abc-application-ported-from-tps-to-sql-over-odbc-ranges-to-filters-and-date-range-limits-on-a-browse/1167) - change range checks to filters so the WHERE clause does the work; HandyTools page-loaded related browses made the display instant for one poster.
- [ODBC /TURBOSQL dummy table for PROP:SQL returns nothing unless the table exists on the backend (Firebird)](https://forums.softvelocity.com/t/odbc-turbosql-dummy-table-for-prop-sql-returns-nothing-unless-the-table-exists-on-the-backend-firebird/1168) - the poster's cause was a leading space in the driver string (`' /TURBOSQL=True'`); with the flag right the dummy table need not exist on the backend.
- [SQL browse over several tables: where to put a PROP:SQL lookup for each row, and which locator to use](https://forums.softvelocity.com/t/sql-browse-over-several-tables-where-to-put-a-prop-sql-lookup-for-each-row-and-which-locator-to-use/1169) - import a server view like a file, or put the PROP:SQL call in the browse's SetQueueRecord method; add related tables to the file schematic instead if you can; ENTRY or FILTERED locators suit SQL.
- [SQL app: how to show the user that a browse or form is still loading (busy cursor or splash window)](https://forums.softvelocity.com/t/sql-app-how-to-show-the-user-that-a-browse-or-form-is-still-loading-busy-cursor-or-splash-window/1170) - a busy cursor with a status bar message, or a splash procedure that gets EVENT:Close when the connection is up; the poster chose the cursor.
- [Filling an ABC browse from a stored SQL procedure: use a queue](https://forums.softvelocity.com/t/filling-an-abc-browse-from-a-stored-sql-procedure-use-a-queue/1171) - a template browse cannot read a stored procedure; load the result set into a queue and show the queue, keeping it small with filters.
- [Emptying a VIEW before reuse: CLOSE and OPEN it, and PROJECT every field you use (PostgreSQL)](https://forums.softvelocity.com/t/emptying-a-view-before-reuse-close-and-open-it-and-project-every-field-you-use-postgresql/1172) - CLOSE and OPEN the VIEW, or clear each file's record as the ViewManager does; only PROJECTed fields come back in SQL.
- [Moving from TPS to a SQL backend: when to open tables, where PROP:BusyHandling goes, multi-paragraph memo export truncated (Reported, not reproduced)](https://forums.softvelocity.com/t/moving-from-tps-to-a-sql-backend-when-to-open-tables-where-prop-busyhandling-goes-multi-paragraph-memo-export-truncated-reported-not-reproduced/1173) - set BusyHandling before any connection is made; LazyOpen was one view on opening tables; the memo export truncation got no answer.
- [MySQL through ODBC: updating a table from a TPS file; "record not available" on PUT in a process](https://forums.softvelocity.com/t/mysql-through-odbc-updating-a-table-from-a-tps-file-record-not-available-on-put-in-a-process/1174) - declare the primary key, make the key fields hot fields in the Process, find the record with GET and test ERRORCODE() before PUT.
- [MSSQL: error 80 (unsupported driver function) on a PUT; how to find the cause (Reported, not reproduced)](https://forums.softvelocity.com/t/mssql-error-80-unsupported-driver-function-on-a-put-how-to-find-the-cause-reported-not-reproduced/1175) - read FileError() right after the PUT or use a trace; GET the record before the PUT; no cause was found.
- [Firebird: a Process that takes 2 minutes on TPS takes 3 hours after the move, and what the posters advised](https://forums.softvelocity.com/t/firebird-a-process-that-takes-2-minutes-on-tps-takes-3-hours-after-the-move-and-what-the-posters-advised/1176) - time the Process without your code, add BUFFER, replace per-record calls with PROP:SQL or a stored procedure; the ODBC NoWait button raised the speed for the poster.
- [MS SQL: the application GPFs after writing to a table that has a trigger (Reported, not reproduced)](https://forums.softvelocity.com/t/ms-sql-the-application-gpfs-after-writing-to-a-table-that-has-a-trigger-reported-not-reproduced/1177) - an ODBC driver bug was suspected without proof and a GPF reporter tool was suggested; the LOGOUT question went unanswered.
- [PostgreSQL: WHERE on a column alias fails with "alias\_name does not exist" (use a subselect, WITH or a join)](https://forums.softvelocity.com/t/postgresql-where-on-a-column-alias-fails-with-alias-name-does-not-exist-use-a-subselect-with-or-a-join/1178) - an alias cannot be used in the WHERE of the same select; filter on the real expression, wrap a subselect, use a WITH query (the poster's choice) or a LEFT JOIN on a grouped subselect.
- [PostgreSQL: dynamic column titles from a function that returns a table (Reported, not reproduced)](https://forums.softvelocity.com/t/postgresql-dynamic-column-titles-from-a-function-that-returns-a-table-reported-not-reproduced/1179) - read as a pivot problem with the crosstab function as the starting point; a guess borrowed from another SQL dialect did not apply; no answer was settled.
- [MySQL: an ABC browse with two joined files loses its records under SetFilter (use a MySQL view)](https://forums.softvelocity.com/t/mysql-an-abc-browse-with-two-joined-files-loses-its-records-under-setfilter-use-a-mysql-view/1180) - create a view on the server for each complex browse, import it as a table and base the browse on it; the browse was fast and SetFilter worked.
- [Firebird: PROP:SQLOrder on a sortheader browse gives duplicate rows (Reported, not reproduced)](https://forums.softvelocity.com/t/firebird-prop-sqlorder-on-a-sortheader-browse-gives-duplicate-rows-reported-not-reproduced/1181) - a file-loaded browse and putting the sort in ApplyOrder helped other posters; the original poster still got duplicates though the SQL ran correctly in IBExpert.
- [MSSQL: an UPDATE with a join sets PAID on every row of the table - remove the CROSS JOIN](https://forums.softvelocity.com/t/mssql-an-update-with-a-join-sets-paid-on-every-row-of-the-table-remove-the-cross-join/1182) - the CROSS JOIN made a Cartesian product so every row qualified; keep the INNER JOIN and WHERE, or test with a count subquery in the WHERE.
- [MSSQL: error 78 "Invalid number of parameters" with "Size not equal for key" in the trace log (Reported, not reproduced)](https://forums.softvelocity.com/t/mssql-error-78-invalid-number-of-parameters-with-size-not-equal-for-key-in-the-trace-log-reported-not-reproduced/1183) - the error vanished for the poster when the browse Totaling was removed or the key dropped; one poster pointed at the driver with more than one key; no cause was settled.
- [MSSQL: "Record Retrieval Error" when the update form returns and the browse refreshes (Reported, not reproduced)](https://forums.softvelocity.com/t/mssql-record-retrieval-error-when-the-update-form-returns-and-the-browse-refreshes-reported-not-reproduced/1184) - the POSITION() return string in the ABC classes, a bad connection and a ResetFromFile() after ResetFromView() were the leads; the poster did not say what cured it.
- [MSSQL: a PROP:SQL query returns nothing in the app but works in Query Analyzer (double quotes around a string value)](https://forums.softvelocity.com/t/mssql-a-prop-sql-query-returns-nothing-in-the-app-but-works-in-query-analyzer-double-quotes-around-a-string-value/1185) - put string values in single quotes (`<39>` inside a Clarion literal); test ERRORCODE() after the PROP:SQL assignment and each NEXT.
- [MSSQL: concatenating TEXT columns in an UPDATE stops at 8000 characters (use UPDATETEXT to append)](https://forums.softvelocity.com/t/mssql-concatenating-text-columns-in-an-update-stops-at-8000-characters-use-updatetext-to-append/1186) - one UPDATETEXT statement per source column: offset 0 and delete length NULL in the first, both NULL in the rest to append.
- [A stored procedure through PROP:SQL returns in milliseconds but the same script in the admin tool takes much longer](https://forums.softvelocity.com/t/a-stored-procedure-through-prop-sql-returns-in-milliseconds-but-the-same-script-in-the-admin-tool-takes-much-longer/1187) - MS SQL may hand back the first part of the result set and load the rest on another thread; compare the same result set on both sides before looking for a fault.
- [MySQL: copying a whole table to a remote server with PROP:SQL "INSERT INTO ... SELECT" does not run when the tables are on different servers](https://forums.softvelocity.com/t/mysql-copying-a-whole-table-to-a-remote-server-with-prop-sql-insert-into-select-does-not-run-when-the-tables-are-on-different-servers/1188) - an INSERT ... SELECT runs on one server only; export with INTO OUTFILE and load with LOAD DATA LOCAL INFILE, both through PROP:SQL.
- [MySQL through ODBC: ABC browses on a 200,000-record table are slow, PREVIOUS and PrimeRecord take seconds (Reported, not reproduced)](https://forums.softvelocity.com/t/mysql-through-odbc-abc-browses-on-a-200-000-record-table-are-slow-previous-and-primerecord-take-seconds-reported-not-reproduced/1189) - view filters, case-sensitive keys, a trace and an older ODBC driver release were suggested; MS SQL browses were fast for two posters; no cause was found.
- [Firebird: "BIND has not been called for (1101)" when a browse uses an alias file (check the filter for a reserved word)](https://forums.softvelocity.com/t/firebird-bind-has-not-been-called-for-1101-when-a-browse-uses-an-alias-file-check-the-filter-for-a-reserved-word/1190) - Trace.exe named the field with no BIND; it was a Firebird reserved word still used in the filter; renaming it cured the error.
- [Firebird: a LIKE filter on a process or browse without PROP:SQLFilter, and making it case-insensitive](https://forums.softvelocity.com/t/firebird-a-like-filter-on-a-process-or-browse-without-prop-sqlfilter-and-making-it-case-insensitive/1191) - wrap the SQL in SQL() inside the normal filter; for case-insensitive matching use CONTAINING (the poster's choice) or upper() on both sides.
- [PostgreSQL: converting a TPS file with large blobs to PostgreSQL through ODBC is painfully slow (Reported, not reproduced)](https://forums.softvelocity.com/t/postgresql-converting-a-tps-file-with-large-blobs-to-postgresql-through-odbc-is-painfully-slow-reported-not-reproduced/1192) - posters offered a hand-coded SET/NEXT loop with no indexes until after the load, UseDeclareFetch=1, loading a CSV with COPY, or keeping files in a folder; nothing was measured.
- [SQL browse over a parent and a child table returns the parent row once per matching child: how to get distinct rows](https://forums.softvelocity.com/t/sql-browse-over-a-parent-and-a-child-table-returns-the-parent-row-once-per-matching-child-how-to-get-distinct-rows/1193) - an EXISTS subquery on the child table inside the filter worked for the poster; DISTINCT on the first view field of the SQL Advanced tab was the alternative.
- [MSSQL: the application is very slow at one client; check the log file and recovery model, keys, user count and the free edition](https://forums.softvelocity.com/t/mssql-the-application-is-very-slow-at-one-client-check-the-log-file-and-recovery-model-keys-user-count-and-the-free-edition/1194) - check SIMPLE or FULL recovery and the log size, table sizes, missing keys, the user count and the free edition's governor, and watch the queries in SQL Profiler.
- [Getting the value of a SQL scalar function into Clarion: the CALL form fails on MS SQL; SELECT it with a CAST through PROP:SQL](https://forums.softvelocity.com/t/getting-the-value-of-a-sql-scalar-function-into-clarion-the-call-form-fails-on-ms-sql-select-it-with-a-cast-through-prop-sql/1195) - drop CALL for a function on MS SQL, select it through PROP:SQL into a dummy table and CAST the result, which made the value arrive.
- [MSSQL: copying records from one table to a table in another database on another server](https://forums.softvelocity.com/t/mssql-copying-records-from-one-table-to-a-table-in-another-database-on-another-server/1196) - Use a second connection variable and PROP:SQL or Clarion adds in a process, a queue copy, a stored procedure or a trigger; one table cannot switch servers.
- [MS SQL: PROP:SQL SELECT returns only "Record Not Available" - a USE statement in the same string breaks it](https://forums.softvelocity.com/t/ms-sql-prop-sql-select-returns-only-record-not-available-a-use-statement-in-the-same-string-breaks-it/1197) - PROP:SQL takes one statement at a time; remove the USE statement or send it as its own call, and check ERRORCODE after OPEN and PROP:SQL.
- [Firebird: searching and locating without case sensitivity needs a case-insensitive collation](https://forums.softvelocity.com/t/firebird-searching-and-locating-without-case-sensitivity-needs-a-case-insensitive-collation/1198) - Firebird has no case-insensitive switch; build or install a case-insensitive collation (one poster used the IBCollate drivers on Firebird 1.0) and read the collation page he linked.
- [Firebird: an Access-style crosstab (pivot) query from a Clarion program (Reported, not reproduced)](https://forums.softvelocity.com/t/firebird-an-access-style-crosstab-pivot-query-from-a-clarion-program-reported-not-reproduced/1199) - A commercial crosstab wizard and an Oracle pivot page were suggested; nobody gave a Firebird statement and the asker reported no outcome.
- [MS SQL Server: duplicating a record without specifying each field and value (Reported, not reproduced)](https://forums.softvelocity.com/t/ms-sql-server-duplicating-a-record-without-specifying-each-field-and-value-reported-not-reproduced/1200) - A Fetch of the record then an Insert with the key cleared avoids listing fields; no plain SQL statement for copying a row was offered, and a unique key is needed.
- [MSSQL 2005: a Missing Indexes report lists an index again after the service restarts, although the index exists (Reported, not reproduced)](https://forums.softvelocity.com/t/mssql-2005-a-missing-indexes-report-lists-an-index-again-after-the-service-restarts-although-the-index-exists-reported-not-reproduced/1201) - The thread did not explain why the suggestion returned; it covers covering indexes, taking the database offline instead of stopping the service, and comparing the include lists.
- [MSSQL and an ABC Browse: using fields in the browse queue that are not shown in the list box](https://forums.softvelocity.com/t/mssql-and-an-abc-browse-using-fields-in-the-browse-queue-that-are-not-shown-in-the-list-box/1202) - Add the fields to the browse's Hot Fields list, or add a browse join; reading other tables per row in SetQueueRecord costs a query per row.
- [PROP:SQL with SELECT COUNT(\*): where does the result end up?](https://forums.softvelocity.com/t/prop-sql-with-select-count-where-does-the-result-end-up/1203) - The result row fills the buffer of the file named in PROP:SQL from its first field, so a LONG or CSTRING there receives the count; no server table is needed.
- [MS SQL after leaving TPS: can BUFFER be set once for all files, and what else speeds up a legacy app?](https://forums.softvelocity.com/t/ms-sql-after-leaving-tps-can-buffer-be-set-once-for-all-files-and-what-else-speeds-up-a-legacy-app/1204) - No global BUFFER setting is known; set the buffer in a helper procedure that sends PROP:SQL, and prefer set operations or stored procedures to row loops.
- [SQL Server: the equivalent of the Clarion FORMAT function to pad a number with leading zeros in an UPDATE](https://forums.softvelocity.com/t/sql-server-the-equivalent-of-the-clarion-format-function-to-pad-a-number-with-leading-zeros-in-an-update/1205) - No direct FORMAT in SQL Server; STR, LTRIM, SPACE and REPLACE of spaces by zeros padded the number inside one UPDATE for the poster.
- [PROP:SqlJoinExpression set in code has no effect on the browse; which embed works](https://forums.softvelocity.com/t/prop-sqljoinexpression-set-in-code-has-no-effect-on-the-browse-which-embed-works/1206) - A runtime join expression set on the browse view had no effect in several embeds; putting it in the browse Reset method right after the parent call worked for the poster.
- [PROP:SQLFilter gives errors on a local variable: concatenate the value and prefix the table alias](https://forums.softvelocity.com/t/prop-sqlfilter-gives-errors-on-a-local-variable-concatenate-the-value-and-prefix-the-table-alias/1207) - PROP:SQLFilter goes to the server as the WHERE clause, so concatenate the variable's value into the string and prefix the column with the table alias a. or b.
- [MS SQL: DUPLICATE does not work correctly unless GET(File,0) comes first](https://forums.softvelocity.com/t/ms-sql-duplicate-does-not-work-correctly-unless-get-file-0-comes-first/1208) - On MS SQL, call GET(File,0) before DUPLICATE; the Help text saying GET with a file pointer is unsupported is slightly wrong for that case.
- [MSSQL list box: hot fields do not update unless added to the list with length 0 (clear "Not in View")](https://forums.softvelocity.com/t/mssql-list-box-hot-fields-do-not-update-unless-added-to-the-list-with-length-0-clear-not-in-view/1209) - Clear the Not in View checkbox on the hot fields; a field outside the view is not selected from the database, so it cannot refresh.
- [MSSQL: "Function sequence error" on .Update() and .Fetch() a few times a month (Reported, not reproduced)](https://forums.softvelocity.com/t/mssql-function-sequence-error-on-update-and-fetch-a-few-times-a-month-reported-not-reproduced/1210) - Function sequence error on Update and Fetch; leads were a PROP:SQL NEXT that left rows unread, and BINDCOLORDER, BINDCONSTANTS or ODBC tracing; no outcome posted.
- [MySQL ODBC: a PROP:SQL insert fails with 07001 "SQLBindParameter not used for all parameters" when a value holds a question mark (Reported, not reproduced)](https://forums.softvelocity.com/t/mysql-odbc-a-prop-sql-insert-fails-with-07001-sqlbindparameter-not-used-for-all-parameters-when-a-value-holds-a-question-mark-reported-not-reproduced/1211) - A PROP:SQL insert into MySQL failed with 07001 when a value held a question mark; BINDCOLORDER and the ODBC API were suggested, with no outcome posted.
- [MySQL over a fibre internet line is much slower than on the LAN: look for SET/NEXT calls in frequently run code](https://forums.softvelocity.com/t/mysql-over-a-fibre-internet-line-is-much-slower-than-on-the-lan-look-for-set-next-calls-in-frequently-run-code/1212) - MySQL over a fibre line was slow because a routine in the event code did a SET and NEXT on four configuration files; the poster found that cause himself.
- [Running a complex procedure on each record when moving to SQL: keep it client-side or move it into a stored procedure](https://forums.softvelocity.com/t/running-a-complex-procedure-on-each-record-when-moving-to-sql-keep-it-client-side-or-move-it-into-a-stored-procedure/1213) - Keep a complex per-record procedure client-side, or move the whole select-and-update into a stored procedure; queues and cursors were other options.
- [MSSQL: PROP:SQL with a SELECT, then changes in a loop - what is updated, and why SET() after PROP:SQL clears the query](https://forums.softvelocity.com/t/mssql-prop-sql-with-a-select-then-changes-in-a-loop-what-is-updated-and-why-set-after-prop-sql-clears-the-query/1214) - Do not SET() after PROP:SQL, it clears the query; use one PROP:SQL UPDATE, or a VIEW with a filter and update through the view.
- [PostgreSQL: a table with 300,000 rows and 7 indexes gets slower to open and update as it grows (Reported, not reproduced)](https://forums.softvelocity.com/t/postgresql-a-table-with-300-000-rows-and-7-indexes-gets-slower-to-open-and-update-as-it-grows-reported-not-reproduced/1215) - Partitioning, a full vacuum and analyse, and UseDeclareFetch=1 were suggested for a slowing 300,000-row table; the poster still saw the problem and no cause was found.
- [ODBC: changing the table alias Clarion generates in its SELECT statements (PROP:Alias)](https://forums.softvelocity.com/t/odbc-changing-the-table-alias-clarion-generates-in-its-select-statements-prop-alias/1216) - Set PROP:Alias on each file after it opens and on each thread; a global extension or File Manager Init embed can apply the prefix to all tables.
- [MSSQL: updating a row with fields from the previous record of the same table (T-SQL)](https://forums.softvelocity.com/t/mssql-updating-a-row-with-fields-from-the-previous-record-of-the-same-table-t-sql/1217) - A lookup function on the table being updated shares its buffer, so use an ALIAS or a dummy table; the T-SQL LAG function was not in SQL Server then.
- [Converting a TPS loop that calculates fields from other fields of the same record into a SQL UPDATE](https://forums.softvelocity.com/t/converting-a-tps-loop-that-calculates-fields-from-other-fields-of-the-same-record-into-a-sql-update/1218) - Replace the Clarion loop with an UPDATE referring to the row's other columns, or use computed columns, or move the array into a child table.
- [Remote MS SQL (2005 Express) too slow over an IP address: how to find out why, starting with a simple keyed browse](https://forums.softvelocity.com/t/remote-ms-sql-2005-express-too-slow-over-an-ip-address-how-to-find-out-why-starting-with-a-simple-keyed-browse/1219) - No fix was posted for a slow remote SQL Express link: the line speed caps it, keyed access runs on the server, and a plain page-loaded unique-key browse is the test.
- [PostgreSQL through ODBC: 400-500% slower than MS SQL, memory grows, and "Record changed by another station" (UseDeclareFetch, LFConversion)](https://forums.softvelocity.com/t/postgresql-through-odbc-400-500-slower-than-ms-sql-memory-grows-and-record-changed-by-another-station-usedeclarefetch-lfconversion/1220) - For slow PostgreSQL over ODBC add UseDeclareFetch=1 to the connection string; LFConversion=0 stopped the Record changed by another station message.
- [ABC browse with a parent and child file: parent columns empty after the first child row (JoinType=MSSQL helped the poster)](https://forums.softvelocity.com/t/abc-browse-with-a-parent-and-child-file-parent-columns-empty-after-the-first-child-row-jointype-mssql-helped-the-poster/1221) - A Clarion view joins as a left outer join by default; if parent columns come back empty, re-create the browse, or the poster set the driver option /JoinType=MSSQL, losing nested joins.
- [SQL browse fetches far more data than one page needs after moving from TPS: SQL filter and order, and hot fields](https://forums.softvelocity.com/t/sql-browse-fetches-far-more-data-than-one-page-needs-after-moving-from-tps-sql-filter-and-order-and-hot-fields/1222) - Move browse filters and orders to the server with PROP:SQLFilter and PROP:SQLOrder in ApplyFilter and ApplyOrder, and use hot fields to choose fetched columns.
