"select 1 from cln00" always it is true. After that, it is "NOT EXIST", it means that 1 will be 0, so the where clause turns false. So, it should not select any row.
I have a doubt. can you please take a look if you can help me?
There is a program calling a stored procedure. Is there any way to find the calling program ame and operational -id ( the person who is calling Stored procedure)?
Please help me if you…
Sorry, mistyped completely :-);
The query "select cltnme from clt00 where not exists(select 1 from cln00)" will NOT send back data from clt00 iF there is at least 1 row in cln00 (that is the select 1 returns no row, so NOT EXISTS will be true).
Ch…
Hai,
I have a query like below
select cltname from clt00 where not exists(select 1 from cln00);
clt00 contains the below data
vijay
sankar
gopi
cln00 contains below data
vijay
sankar
vijji
can you please tell what is the output of the above quer…
connect to db name
select procschema,procname,body/text from syscat.procedures with ur|grep -ip 'SP Name'
At 11:14pm on February 16, 2009, RAVI GROVER said…
Hi Vijay,
Greetings!! There is a tool called devloper workbench which must have this kind of functionality of finding the code which is calling that Sp. But if you are sure that the calling program is a function or procedure that what you do is get the definition from the syscat.procedures / functions on column BODY/TEXT. then grep for the SP which is being called.You will get the occuirences and it is one way to find who is calling this sp and auth id you can get it from syscat itself. We can discuss this more on call.
The IDUG DB2-L ListServe is a great place to post questions such as these and receive responses from members of the IDUG DB2 Community. To learn more about the DB2-L Listserv and subscribe, visit http://www.idug.org/listserv.html.