[plt-scheme] SrPersist and bind-parameter
Many thanks to Jon Kre Hellan and Francisco Solsona for help on this.
For those that are interested the solution follows:
When I changed to:
(prepare hstmt table-select)
(define tname-buffer (make-buffer '(sql-c-char 18)))
(define tname-indicator (make-indicator))
(set-indicator! tname-indicator 'sql-nts) ;; <-- this was the key change
(bind-parameter hstmt 1 'sql-param-input 'sql-varchar 18 tname-buffer tname-indicator)
(write-buffer! tname-buffer "INVENTORY")
(read-buffer tname-buffer)
(read-indicator tname-indicator)
(sql-execute hstmt)
it all worked.
Alex