Resync string too long as string

mmitchell

Registered User.
Local time
Today, 16:24
Joined
Jan 7, 2003
Messages
80
I need to use a resync command on a form, but the SQL is too long to use.

Is there a way to use a stored procedure instead?

When I tried making a stored procedure using the needed "?" in plce of the parameters I get this error:
ADO error: No value given for one or more required parmameters.
In part my SQL looks like:
Code:
CREATE PROCEDURE "test67"
/* this part remed
(@Rev int,
@ECN int,
@QuoteID int,
@WOID int,
@WOIDSub smallint)
*/
AS 
SELECT <stuff removed>
FROM <stuff removed>
WHERE  (dbo.T_SetupSheetHistoryMaterialDetail.Revision = ?) 
AND (dbo.T_SetupSheetHistoryMaterialDetail.ECN = ?) 
AND  (dbo.T_SetupSheetHistoryMaterialDetail.QuoteID = ?) 
AND (dbo.T_SetupSheetHistoryMaterialDetail.WOIDSub = ?) 
AND  (dbo.T_SetupSheetHistoryMaterialDetail.WOID = ?)
1. How do I hnadle the need for a long resync string
and or
2. How do I fix the above error
 
WHERE (dbo.T_SetupSheetHistoryMaterialDetail.Revision = @Rev)
AND (dbo.T_SetupSheetHistoryMaterialDetail.ECN = @ECN)
AND (dbo.T_SetupSheetHistoryMaterialDetail.QuoteID = @QuoteID)

ETC.

Use the parameters and reference them
 
Not sure what you mean by "reference them", but here is what I had to do to get it to work:

I had to make a new parameter and then pass it a question mark in my code:

resynccommand="EXEC test67 ?"

Code:
CREATE PROCEDURE "test67"
(
@QuestionMark nvarchar
)
*/
AS 
SELECT <stuff removed>
FROM <stuff removed>
WHERE  (dbo.T_SetupSheetHistoryMaterialDetail.Revision = @QuestionMark ) 
AND (dbo.T_SetupSheetHistoryMaterialDetail.ECN = @QuestionMark ) 
AND  (dbo.T_SetupSheetHistoryMaterialDetail.QuoteID = @QuestionMark ) 
AND (dbo.T_SetupSheetHistoryMaterialDetail.WOIDSub = @QuestionMark ) 
AND  (dbo.T_SetupSheetHistoryMaterialDetail.WOID = @QuestionMark )
 

Users who are viewing this thread

Back
Top Bottom