Is it a good practice to set the MAXLEN value of %Library.String property type? Will it lead to wasted storage if its not really using it?

For example, I have to store a 5 characters long string into the below str field. Which of the statement is recommended?

Property str As %String;

vs

Property str As %String(MAXLEN="5");

0 2
0 1.2K

We use ExecureProcedure() to execute a stored procedure which returns a result set. But we see lot of "Invalid cursor state" errors when the result set is empty. The connection to SQL server database is made through ODBC.

ERROR #6022: Gateway failed: Fetch. + ERROR <Ens>ErrGeneral: SQLState: (24000) NativeError: [0] Message: [Microsoft][ODBC Driver 11 for SQL Server]Invalid cursor state

Here is the code snippet from the business operation class which uses EnsLib.SQL.OutboundAdapter

0 2
0 8.8K