DB2-SQL Errors -300,-301,-302,-303,-304

As a routine, I am listening to mind music. Then I got an idea to write a post on DB2 SQL errors starts with 3**.

Recently, I found some errors, while writing SQL query.

The major part of your work is writing SQL query. So when you complete this work, you are good to go ahead.

Let me give an example:

Select Digits(Bill_TAX_1)
    into :WS-BILL-TAX
from A_Table A INNER JOIN B_Table B
ON A.Invoice_id = B.Invoice-id
Where A.Cust_Name = 'Test1'
  AND B.Bill_Number = '180000'

Here, :WS-BILL-TAX ===> Output host variable
      :WS-Bill-date ===> Input host variable

Data-types of these input/output host variables  must  match to the table column data types ( char to char, integer to numeric, comp to comp etc), else, you will get these kind of errors.

The errors -300,-301, -302, -303,-304 usually occur with host-variable related issues.


Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.