01-22-2026 03:51 PM - edited 01-22-2026 03:52 PM
All,
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Eric Brenner
-- Create date: Janualy 22, 2026
-- Description: Checks to see if the PC Name
-- is a valid data analysis computer.
-- =============================================
ALTER PROCEDURE [dbo].[uspGetPlantProductList_Select]
@PC_NAME NVARCHAR(50),
@Exists BIT OUTPUT,
@PLANT_CODE NVARCHAR(50) OUTPUT
AS
BEGIN
SET NOCOUNT ON;
SELECT @PLANT_CODE = plant
FROM OC_CONFIG_SYSTEM
WHERE system_name = @PC_NAME;
SET @Exists = CASE WHEN @PLANT_CODE IS NULL THEN 0 ELSE 1 END;
END
GO
Solved! Go to Solution.
01-23-2026 07:48 AM
I have some new information. I was finally able to get data returned! On the DB Tools Execute Query, I had to add another question mark to the call, so now it's:
{call uspGetPlantProductList_Select (?,?,?)}
Which retrieves the vales that I want other than the Plant Code which only comes back as one character instead of four like I am expecting. I am still investigating that part.
01-23-2026 09:35 AM
You have 3 @-declarations, so you needing 3 @s in the call is logical.
Without seeing anything about the table it's hard to guess why Plant is 1 character. Is it an ID-number (int) converted to a unicode char?
01-23-2026 09:51 AM - edited 01-23-2026 09:52 AM
I figured it out. Apparently, when you assign parameters to the DB Tools Create Parameterized Query VI, you are supposed to set how many characters you wish to return in the 'value' portion of the Array Cluster. The documentation does not specify that - at least for strings.
I found this out by looking at this Knowledge Base article: Set and Get Input and Output Parameters from a SQL Stored Procedure - NI
See #4, the second bullet point.
Reserve memory space for the output parameter before the query is executed.
Once I did that, wa-la! The appropriate value appeared.