sql - Inserting data into table returns error code 195 -
this question results advice received in this one, namely changing of error code definition , going there.
my problem: when trying insert data table, receive sqlcode 00195
, sqlstate s0001
. if understand error codes correctly, positive non-zero number means query succeeded warnings. when @ database, no data has been inserted. i've found two resources describe error code
is not recognized built-in function name
as you'll see, 2 functions used in expression trim
, sha1
. if omit both of them, same error persists.
using pic -(4)9
definition of sqlcode field, suggested in other post, returns -195
result, error code can't seem find about.
i use sql server 2012 , percobol, utilizes opencobol compiler.
declaration of fields:
01 sqlcode pic 9(5). 01 sqlstate pic x(5). 01 ws-input. 05 achternaam pic x(25) value spaces. 05 voornaam pic x(15) value spaces. 05 email pic x(50) value spaces. 05 login pic x(15) value spaces. 05 wachtwoord pic x(11) value spaces. 05 gebr_type pic x(20) value spaces.
sql query:
exec sql insert dbo.gebruikers values ( trim( :login ), trim( :achternaam ), trim( :email ), trim( :projectcode ), trim( :gebr_type ), trim( :voornaam ), sha1( trim( :wachtwoord ) ) ) end-exec
database:
connection string:
jdbc:sqlserver://localhost\sqlexpress;databasename=groep31;user=groep31;password=somepw
solution: trim
isn't supported in sql server. using rtrim
fixed it.
solution: sha1
isn't supported either in sql server. using hashbytes('sha1', rtrim(:wachtwoord))
fixed (although there encoding issues right now).
Comments
Post a Comment