Table of Contents

Issue: Cannot use SQL keywords as database column names


If a database column for a PegaRULES table is named the same as a SQL keyword, then errors will occur.

For example, "Key" is a keyword for Microsoft SQL Server.  If a class is created with a property named "Key," and the class is mapped to a table with a column named "Key," then SQL syntax errors occur when accessing the class.

The errors that arise vary depending on the situation.  For example, the following error may occur in Tracer if an instance is written to a Microsoft SQL Server table that has an exposed column named Key, which is a reserved word in that database:

Problem writing an instance to the database: code: 156 SQLState: HY000 Message: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Incorrect syntax near the keyword 'Key'. 


Do not attempt to store Process Commander instances in a database table that has a column with the same name as a keyword.

Your application can use Rule-Connect-SQL rules and the RDB methods to access such a table, but be careful to create SQL that is free of syntax errors.  Often, this will mean adding double quote characters around any column names that are the same as keywords.

Pega Platform 7.1.1 - 8.3.1 System Architect System Administrator Data Integration
Suggest Edit
Did you find this content helpful?

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.