MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question on Dynamic SQL in a program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
suggala
Beginner


Joined: 07 Oct 2003
Posts: 3
Topics: 2

PostPosted: Tue Oct 14, 2003 3:20 pm    Post subject: Question on Dynamic SQL in a program Reply with quote

Hi,

I am able to create a working storage variable as follows

select count(*) into :ws-count
from table.name
where var1 = 'x'
and var2 = 2

all this is stored in varchar working storage variable totcnt
I am moving length too.

When I issue a prepare statement I am getting error -312.
I am guessing it may be due to existance of host variable
ws-count.

Any help in this regard to overcome this. thanx

Raghu
_________________
Raghu
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Oct 14, 2003 5:02 pm    Post subject: Reply with quote

suggala,

How is ws-count defined? Is it defined as comp field? If it is indeed defined as comp field , then make sure that it is 01 level or 05 level item.

Any way check this link for a detailed explanation of seql error code -312

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNMCH11/2.1.6.107?SHELF=&DT=20010718150520

Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group