IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we use COBOL local arrays in DB2 queries


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Fri Dec 07, 2007 8:46 pm
Reply with quote

Hi,
Can we use COBOL local arrays in DB2 queries in the application program?


EXEC SQL
SELECT * FROM TABLE
WHERE FIELD = :WS-EMPLOYEE (WS-INDEX)
END-EXEC.

The above query is giving me errors....
Can't we not use arrays inside embedded SQL?


Thannks.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Dec 07, 2007 9:19 pm
Reply with quote

lanand_hps wrote:
Hi,
Can we use COBOL local arrays in DB2 queries in the application program?


EXEC SQL
SELECT * FROM TABLE
WHERE FIELD = :WS-EMPLOYEE (WS-INDEX)
END-EXEC.

The above query is giving me errors....
Can't we not use arrays inside embedded SQL?


Thannks.


This straight from the Application Programming & SQL Guide
"You cannot define host variables, other than indicator variables, as arrays. You can specify OCCURS only when defining an indicator structure. You cannot specify OCCURS for any other type of host variable.".
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Sat Dec 08, 2007 1:48 am
Reply with quote

thanks..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top