[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 959
  • Last Modified:

locked query in AS400

Hello,

I've been asked to find out why we get an error message when trying to acces a query in AS400.
The error message is this one : "Query &1 in &2 in use, cannot be shared"

I don't have much experience with AS400 so I don't even know what is the first step to take to verify the locks on the query or on the job or anything like that.

Thanks
0
vanroybel
Asked:
vanroybel
2 Solutions
 
_b_hCommented:
To check the locks, use the Work with Object Locks (WRKOBJLCK) command:
WRKOBJLCK OBJ(MYLIB/MYQUERY) OBJTYPE(*QRYDFN)

Post back any questions
Barry
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
This just means that another use has the query open in WRKQRY and is in the process of modifying it.  Barry's instructions will help you find the job that is holding the lock so you can contact the user and ask them to exit the query.  IF you just end the job, their changes will be lost.

- Gary Patterson
0
 
tliottaCommented:
Gary is correct.

The rest of the message says:

Cause . . . . . :   The definition for this query is currently being created,
  changed, copied, or used in some way so that it cannot be shared at this
  time.

Gary's wording is a real-life phrasing.

It's odd, though, that you used the raw message text in your question. Do your users actually see the "&1" and "&2" in the message when it appears? Or did you locate the QQRYMSG message file and look at the message definition?

If your users are seeing the 'raw' message, then there's something else somewhere that should be considered.

Tom
0
 
vanroybelAuthor Commented:
Thanks for the help. The query worked a bit later it was because of a network problem.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now