Reputation: 1081
Hi I'm new in Bluemix and I just tried some of sample code of SQLDB in Bluemix.
I tried example from this site.
I follow the step from readme.md file. But after I deployed my application, error happens.
Executing: CREATE SCHEMA SQLDBSAMPLE
Error creating schema: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-552, SQLSTATE=42502, SQLERRMC=USER12999;CREATE SCHEMA, DRIVER=3.66.46
Executing: CREATE TABLE SQLDBSAMPLE.PAYROLL1451703603548 (NAME VARCHAR(20), AGE INTEGER)
Error creating table: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-552, SQLSTATE=42502, SQLERRMC=USER12999;IMPLICIT CREATE SCHEMA, DRIVER=3.66.46
Executing: INSERT INTO SQLDBSAMPLE.PAYROLL1451703603548 VALUES ('John Smith', 52)
Error executing:INSERT INTO SQLDBSAMPLE.PAYROLL1451703603548 VALUES ('John Smith', 52)
SQL Exception: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SQLDBSAMPLE.PAYROLL1451703603548, DRIVER=3.66.46
Executing: DROP TABLE SQLDBSAMPLE.PAYROLL1451703603548
Error dropping table: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SQLDBSAMPLE.PAYROLL1451703603548, DRIVER=3.66.46
Executing: DROP SCHEMA SQLDBSAMPLE RESTRICT
Error Dropping schema: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=SQLDBSAMPLE, DRIVER=3.66.46
Finished
Upvotes: 1
Views: 321
Reputation: 3233
The first error you are getting depends on the fact that the user (USER12999) has not the privileges to create a schema. The second one is related to the same issue, since it is trying to create implicitly the schema. All the next errors are telling you that the table doesn't exist. I guess you're using the free BETA SQL DB Plan. It provides you the default schema (with the same name of your username): you could create the table in that default schema, just commenting out the CREATE SCHEMA
line and removing explicit schema SQLDBSAMPLE
from other statements in the sample code you posted.
Upvotes: 1