It is currently 21 Feb 2019 7:00


Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 19 Dec 2012 7:20 
Offline
Nouveau
Nouveau
User avatar

Joined: 04 Feb 2008 12:00
Posts: 61
Location: Cleveland, OH
I am trying to output to a global variable using a stored procedure using the CM for Databases. I would like to use that variable in a dependent job. The stored proc is completing successfully but does not output to the global variable. My simple stored proc is below and on the Databases tab there are two fields I can populate (Value & Auto-edit Variable). I have tried many combinations and none are successful. I check the value of the %%TEST variable using ctmvar -ACTION LIST. My proc is below. Any thoughts?

USE [wwrADWH]
GO
/****** Object: StoredProcedure [ediSend].[usp_GetJobParameters] Script Date: 12/17/2012 11:57:34 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [ediSend].[usp_GetJobParameters]
@result nvarchar(256) OUTPUT
AS BEGIN

SET NOCOUNT ON
BEGIN TRY

SELECT TOP 1 @result = Parameter1
FROM ediSend.JobParameters;


END TRY
BEGIN CATCH
DECLARE @errNbr INT
EXEC @errNbr = dbo.prcThrowError
RETURN @errNbr
END CATCH
END


Top
   
 Post subject:
PostPosted: 19 Dec 2012 9:43 
Offline
Nouveau
Nouveau
User avatar

Joined: 04 Feb 2008 12:00
Posts: 61
Location: Cleveland, OH
I found the solution to be that you must enter NULL for the Value field and %%\TEST for the Auto-Edit Variable.


Top
   
 Post subject:
PostPosted: 01 Jan 2013 4:21 
Offline
Nouveau
Nouveau
User avatar

Joined: 08 Jun 2007 12:00
Posts: 807
Location: Varese - Italy
To have a global variable list you can use the utility ctmvar in a job:
ctmvar -action LIST

I think that for your purpose can be more simple
Regards


Top
   
 Post subject:
PostPosted: 01 Jan 2013 4:36 
Offline
Nouveau
Nouveau
User avatar

Joined: 04 Feb 2008 12:00
Posts: 61
Location: Cleveland, OH
If you look at my post it states:

I check the value of the %%TEST variable using ctmvar -ACTION LIST.

I was using your suggestion to check if the variable is created and found that by only using %%TEST it only created the variable on the STEPS tab and I needed a Global variable to use in another job therefore I needed to use %%\TEST.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved