× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 05/24/2018
01:16:53 PM:
The process is still pulling over too many records so we want to
push all the work onto the iSeries side. Our smartest DB2 sql
programmer helped me create this Stored Procedure:

P1 : BEGIN
DECLARE EDITBORROWERSSN_C1 CURSOR WITH RETURN FOR

SELECT CASE
WHEN ( SELECT DISTINCT 1
FROM SLSFILESMT . SLBRREV1
WHERE BORROWER_SSN = @BORROWER_SSN
) IS NULL THEN RESULT
ELSE 'Valid'
END
FROM TABLE
( VALUES ( 'Invalid' ) )
AS TVALUES ( RESULT ) ;

OPEN EDITBORROWERSSN_C1 ;

END

This runs instantly when called from Run SQL scripts - CALL
SLBRRES01 ('123456789'). I cannot, however, come up with the
correct syntax to call the DB2 SP (SLBRRES01) from MS SQL. This
"runs" without returning anything as I can't setup the parameters
without syntax errors:

EXEC('@Result = [CFITESTLOANS].[IASPCFI].[SLSFILESMT].[SLBRRES01]')

I'm trying different scenarios I've read on Google so I might be way
off. It doesn't have to be an SP. Could be a UDF or whatever on
the iSeries side. If this can be set up to run quickly we can use
the same method in many places.

Can anyone offer some help with this?


One of our MS SQL engineers sent me the following for one of our
stored procedure calls against the IBM i. They use an ODBC DSN name as
the linked server name.

DECLARE @sql VARCHAR(max);
SET @sql = 'CALL LibraryName.ProcecureName ('''+@param1''','''+@param2+
''','''+@param3+''')'
EXEC (@sql) AT LinkedServerName;


Sincerely,

Dave Clark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.