Skip to main content

[archive] ACUSQLdata type issue

  • June 30, 2010
  • 2 replies
  • 0 views

[Migrated content. Thread originally posted on 28 June 2010]

I am attempting to insert an HTML document into a MSSQL Server 2005 "text" data type field but I am getting the error message:

SQLCODE: 000000001 SQLSTATE: 00206
Operand type clash: image is incompatible with text

This is working Storage:
(ws-web-E-STATEMENT-DETAIL-LINES is the HTML doc)

01 ws-web-E-STATEMENT-ARC-REC.
02 ws-web-E-STATMENT-KEY.
03 ws-web-E-STATMENT-COMPANY PIC XX JUSTIFIED RIGHT.
03 ws-web-E-STATMENT-ACCOUNT-NUMBER
PIC X(6) JUSTIFIED RIGHT.
03 ws-web-E-STATEMENT-DATE-KEY.
05 ws-web-E-STATEMENT-YEAR PIC 99.
05 ws-web-E-STATEMENT-MONTH PIC 99.
05 ws-web-E-STATEMENT-DAY PIC 99.
02 ws-web-E-STATEMENT-DETAIL-LINES PIC X(31986).

Here is the ACUSQL insert:

EXEC SQL INSERT INTO bsmgr_new.dbo.estatarc_1
(E_STATMENT_COMPANY, E_STATMENT_ACCOUNT_NUMBER,
E_STATEMENT_YEAR, E_STATEMENT_MONTH,
E_STATEMENT_DAY, E_STATEMENT_DETAIL_LINES)
VALUES (:ws-web-E-STATMENT-COMPANY,
:ws-web-E-STATMENT-ACCOUNT-NUMBER,
:ws-web-E-STATEMENT-YEAR,
:ws-web-E-STATEMENT-MONTH,
:ws-web-E-STATEMENT-DAY,
:ws-web-E-STATEMENT-DETAIL-LINES)
END-EXEC.

Any help would be much appreciated.

2 replies

[Migrated content. Thread originally posted on 28 June 2010]

I am attempting to insert an HTML document into a MSSQL Server 2005 "text" data type field but I am getting the error message:

SQLCODE: 000000001 SQLSTATE: 00206
Operand type clash: image is incompatible with text

This is working Storage:
(ws-web-E-STATEMENT-DETAIL-LINES is the HTML doc)

01 ws-web-E-STATEMENT-ARC-REC.
02 ws-web-E-STATMENT-KEY.
03 ws-web-E-STATMENT-COMPANY PIC XX JUSTIFIED RIGHT.
03 ws-web-E-STATMENT-ACCOUNT-NUMBER
PIC X(6) JUSTIFIED RIGHT.
03 ws-web-E-STATEMENT-DATE-KEY.
05 ws-web-E-STATEMENT-YEAR PIC 99.
05 ws-web-E-STATEMENT-MONTH PIC 99.
05 ws-web-E-STATEMENT-DAY PIC 99.
02 ws-web-E-STATEMENT-DETAIL-LINES PIC X(31986).

Here is the ACUSQL insert:

EXEC SQL INSERT INTO bsmgr_new.dbo.estatarc_1
(E_STATMENT_COMPANY, E_STATMENT_ACCOUNT_NUMBER,
E_STATEMENT_YEAR, E_STATEMENT_MONTH,
E_STATEMENT_DAY, E_STATEMENT_DETAIL_LINES)
VALUES (:ws-web-E-STATMENT-COMPANY,
:ws-web-E-STATMENT-ACCOUNT-NUMBER,
:ws-web-E-STATEMENT-YEAR,
:ws-web-E-STATEMENT-MONTH,
:ws-web-E-STATEMENT-DAY,
:ws-web-E-STATEMENT-DETAIL-LINES)
END-EXEC.

Any help would be much appreciated.
I discovered that getting rid of the trailing nulls takes care of the problem.

inspect ws-web-E-STATEMENT-DETAIL-LINES replacing trailing
null by space.

However the insert puts a large amount of white space in the field following the HTML.
I need to be able to make ws-web-E-STATEMENT-DETAIL-LINES variable length but I don't think there is any way to do it, is there?

[Migrated content. Thread originally posted on 28 June 2010]

I am attempting to insert an HTML document into a MSSQL Server 2005 "text" data type field but I am getting the error message:

SQLCODE: 000000001 SQLSTATE: 00206
Operand type clash: image is incompatible with text

This is working Storage:
(ws-web-E-STATEMENT-DETAIL-LINES is the HTML doc)

01 ws-web-E-STATEMENT-ARC-REC.
02 ws-web-E-STATMENT-KEY.
03 ws-web-E-STATMENT-COMPANY PIC XX JUSTIFIED RIGHT.
03 ws-web-E-STATMENT-ACCOUNT-NUMBER
PIC X(6) JUSTIFIED RIGHT.
03 ws-web-E-STATEMENT-DATE-KEY.
05 ws-web-E-STATEMENT-YEAR PIC 99.
05 ws-web-E-STATEMENT-MONTH PIC 99.
05 ws-web-E-STATEMENT-DAY PIC 99.
02 ws-web-E-STATEMENT-DETAIL-LINES PIC X(31986).

Here is the ACUSQL insert:

EXEC SQL INSERT INTO bsmgr_new.dbo.estatarc_1
(E_STATMENT_COMPANY, E_STATMENT_ACCOUNT_NUMBER,
E_STATEMENT_YEAR, E_STATEMENT_MONTH,
E_STATEMENT_DAY, E_STATEMENT_DETAIL_LINES)
VALUES (:ws-web-E-STATMENT-COMPANY,
:ws-web-E-STATMENT-ACCOUNT-NUMBER,
:ws-web-E-STATEMENT-YEAR,
:ws-web-E-STATEMENT-MONTH,
:ws-web-E-STATEMENT-DAY,
:ws-web-E-STATEMENT-DETAIL-LINES)
END-EXEC.

Any help would be much appreciated.
You could find the last character in the html, and then change your code to:

VALUES (:ws-web-E-STATMENT-COMPANY,
:ws-web-E-STATMENT-ACCOUNT-NUMBER,
:ws-web-E-STATEMENT-YEAR,
:ws-web-E-STATEMENT-MONTH,
:ws-web-E-STATEMENT-DAY,
:ws-web-E-STATEMENT-DETAIL-LINES(1:LAST-CHAR-POSITION))