IBM Support

-551 error when enabling JSON environment

Question & Answer


Question

Getting -551 error when running 'enable(true)' on Db2 NOSQL command line interface.

Answer

This can be happened especially when you run the steps for JSON environment configuration for the first time.
In that case, the problem can be resolved by running 'disable(true)' and 'enable(true)' again.

Here are example scenario steps.
( Sample database name : 'myjsondb'. )

- DB creation for the test
$ db2 -tvf cr_json_db.db2
CREATE DATABASE myjsondb automatic storage yes using codeset utf-8 territory US collate using system pagesize 32 k
DB20000I  The CREATE DATABASE command completed successfully.
 
- create 32 K Bufferpool / temp tablespace creation
db2 "CREATE BUFFERPOOL NOSQLSYSTOOLSBP ALL DBPARTITIONNUMS SIZE AUTOMATIC PAGESIZE 32K"
db2 "CREATE TEMPORARY TABLESPACE NOSQLSYSTOOLSTEMP PAGESIZE 32K MANAGED BY AUTOMATIC STORAGE BUFFERPOOL NOSQLSYSTOOLSBP"
 
- Connect to Db2 NOSQL interface
$ ./db2nosql.sh -hostName localhost -port 50000 -db myjsondb -user db2inst1 -password db2inst1
 
- Getting -551 error when trying “enable(true)"

nosql>enable(true)

nosql>Executing SQL...

CREATE OR REPLACE FUNCTION SYSTOOLS.JSON_TABLE(INJSON BLOB(16M), INELEM VARCHAR(2048), RETTYPE VARCHAR(100)) RETURNS TABLE(TYPE INTEGER, VALUE VARCHAR(2048))
LANGUAGE C
PARAMETER STYLE SQL
PARAMETER CCSID UNICODE
NO SQL
NOT FENCED
DETERMINISTIC
NO EXTERNAL ACTION
DISALLOW PARALLEL
SCRATCHPAD 2048
EXTERNAL NAME 'db2json!jsonTable'
Error code: -551
DB2 SQL Error: SQLCODE=-551, SQLSTATE=42501, SQLERRMC=DB2INST1;REPLACE FUNCTION;SYSTOOLS.JSON_TABLE, DRIVER=3.72.30
CDJSN1156E Failed to execute function 'enable'

- To bypass this error, run 'disable(true)' and rerun 'enable(true)'.
nosql>disable(true)
Executing SQL...
CDJSN1159W Artifact does not exist for statement {0}
DROP TABLE SYSTOOLS.SYSJSON_INDEX
CDJSN1159W Artifact does not exist for statement {0}
 
DROP FUNCTION SYSTOOLS.JSON_VAL2
CDJSN1159W Artifact does not exist for statement {0}
 
DROP FUNCTION SYSTOOLS.JSON_BINARY
CDJSN1159W Artifact does not exist for statement {0}
 
DROP FUNCTION SYSTOOLS.JSON_BINARY2
CDJSN1159W Artifact does not exist for statement {0}
 
DROP FUNCTION SYSTOOLS.JSON_TABLE_BINARY
CDJSN1159W Artifact does not exist for statement {0}
 
DROP FUNCTION SYSTOOLS.JSON_UPDATE(BLOB(16M), VARCHAR(256), VARCHAR(32672), VARCHAR(32672) FOR BIT DATA, INTEGER)
CDJSN1159W Artifact does not exist for statement {0}
 
DROP FUNCTION SYSTOOLS.REG_MATCHES (VARCHAR(32000), VARCHAR(32000), VARCHAR(4))
CDJSN1159W Artifact does not exist for statement {0}
 
DROP FUNCTION SYSTOOLS.REG_MATCHES (VARCHAR(32000), VARCHAR(32000))
CDJSN1159W Artifact does not exist for statement {0}
 
DROP PROCEDURE SYSTOOLS.JSON_REGISTER RESTRICT
CDJSN1159W Artifact does not exist for statement {0}
 
DROP PROCEDURE SYSTOOLS.JSON_DEREGISTER RESTRICT
CDJSN1210I Database artifacts dropped successfully.
 
nosql>enable(true)
Executing SQL...
CDJSN1209I Database artifacts created successfully.

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"JSON","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"V11.1","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Product Synonym

db2

Document Information

Modified date:
11 December 2018

UID

ibm10787533