View previous topic :: View next topic
|
Author |
Message |
nandu_d
New User
Joined: 18 Aug 2005 Posts: 2
|
|
|
|
Here I have a problem with an sql query involving a VARCHAR variable.
Eg: select count(*) from table_name where
cond1... and
cond2... and
sample_text <> : host-variable;
Here sample_text is a varchar variable of max lenght 500;
while executing this query I am getting -134 as SQL RETURN code.
Please help me out to over come this situation. I need to execute this query in a COBOL program using host-variable (COBOL host variables) in the condition against the sample_text (DB2 variable). Please give me the declaration for the COBOL host variable and how can I use this in my program. |
|
Back to top |
|
|
Para BB400
New User
Joined: 04 Aug 2005 Posts: 1
|
|
|
|
HAI NANDU,
PLEASE FIND THE BELOW HOST VARIABLE DECLARATION FORVARCHAR FIELDS
DECLARED DB2 TABLE FIELD
====================
INPUT_DATA VARCHAR(1000) NOT NULL
HOST VARIABLE DECLARATION
====================
01 HOST-INPUT-DATA.
49 HOST-INPUT-DATA-LEN PIC S9(04) COMP.
49 HOST-INPUT-DATA-TEXT PIC X(1000). |
|
Back to top |
|
|
nandu_d
New User
Joined: 18 Aug 2005 Posts: 2
|
|
|
|
Hi
Thanks for ur quick response. I tried the same but we are getting the
-134 error. Any alternative solution for this problem. |
|
Back to top |
|
|
mainframesguru
New User
Joined: 24 Jun 2005 Posts: 36 Location: Hyderabad
|
|
|
|
Hi Nandu,
Eg: select count(*) from table_name where
cond1... and
cond2... and
sample_text <> : host-variable;
01 HOST-INPUT-DATA.
49 HOST-INPUT-DATA-LEN PIC S9(04) COMP.
49 HOST-INPUT-DATA-TEXT PIC X(1000).
In the example, try to find out the HOST-INPUT-DATA-TEXT actual length
(the length of data it is holding) and move it to HOST-INPUT-DATA-LEN
and then use it.
Thanks And Regards
Vamshi
ICC-ISH
Chennai |
|
Back to top |
|
|
|