DB21012E -147 on SQL INSERT in DBXMMPR COBOL preprocessor
search cancel

DB21012E -147 on SQL INSERT in DBXMMPR COBOL preprocessor

book

Article ID: 234902

calendar_today

Updated On:

Products

Datacom Datacom/DB

Issue/Introduction

A COBOL program with a Datacom SQL INSERT statement fails with a -147 error in DBXMMPR the COBOL preprocessor:   
   
 DB21012E ---- PREPARE STATEMENT FAILED (QHOST)
                 OP. NOT ALLOWED AT ISOL. LEVEL U
                 SQLCA-SQLCODE  = -147
                 SQLCA-SQLSTATE = 25S01

Environment

Release : 15.1

Component : DATACOM SQL

Cause

See the explanation and action for SQLCODE -147

Reason:
The current logical unit of work reflects a transaction isolation level of U (user). As such, no insert, update, or delete operations are allowed.
The SQLSTATE that equates to this SQL return code is 25S01.
Action:
Verify that the transaction isolation level is the desired one, or eliminate the offending operation.

The default value for ISOLEVEL is U when SQLMODE=DATACOM.

This is documented in the Datacom/DB SQL Preprocessor Options under ISOLEVEL

 

Resolution

Specify ISOLVEVEL=C in your COBOL source in the $DBSQLOPT statement:

*$DBSQLOPT SQLMODE=DATACOM AUTHID=SYSADM ISOLEVEL=C