You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings, dear. I, like you, adore Gawk. The task is to work with the database (sqlite3). Found you) Compiled without errors, the library appeared. But when importing to Gawk, here is such an error. Can you recommend something? Thanks. gawk: character search error: /usr/local/lib/gawk/odbc.so: undefined character: SQLAllocHandle
OS Devuan, kernel 6.0.6
GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
The text was updated successfully, but these errors were encountered:
Hi Evgeniy,
Sorry for the long delay.
Is this still an issue ?
It looks here that odbc.so is complaining about some character. Indeed, your statement "INSERT INTO db values(1, 'data_sensor','temp: 67С')" has an invisible character before the C.
I copied/pasted that value in a test table in sqllite3 and it did not cause any error:
stmt = "INSERT INTO countries values(100, 'Evgeniy','temp: 67С') # displayed as 67� if the C is deleted;
ret = ODBC_execute(cursor, stmt)
Result:
| 1|100 |Evgeniy |temp: 67С|
I guess the temperature to insert is 67℃. I tried this too:
stmt = "INSERT INTO countries values(101, 'Evgeniy','temp: 67�DC')" # i.e. 67 degrees Celsius i.e. Unicode Character �DC (U+2103)
ret = ODBC_execute(cursor, stmt)
Result:
| 1|101 |Evgeniy |temp: 67℃|
No error here either, and the UTF-8 character was stored, retrieved and displayed correctly in the console.
I'm using the vi editor to introduce the temperature and it is OK as long as one does not try to move the cursor past the 67C sequence... The console displays UTF-8 as expected.
If you work in a console, you can try redirecting the screen to some X-Windows server (e.g. on another linux with a running desktop GUI) and using a graphical, UTF-8 enabled editor such as mousepad so those characters get displayed correctly.
One thing you can try is removing the 67C string altogether and see if the insertion works.
Cheers.
Cesare
I just thought of something that could be related: maybe the column you are inserting into is not wide enough because of the extra-bytes used by that special character's encoding. This is why Oracle RDBMS allows to specify the character semantics when defining a table's column (cf. NLS_LENGTH_SEMANTICS: either char or byte).
Greetings, dear. I, like you, adore Gawk. The task is to work with the database (sqlite3). Found you) Compiled without errors, the library appeared. But when importing to Gawk, here is such an error. Can you recommend something? Thanks.
gawk: character search error: /usr/local/lib/gawk/odbc.so: undefined character: SQLAllocHandle
OS Devuan, kernel 6.0.6
GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
The text was updated successfully, but these errors were encountered: