Skip to Content
0
Former Member
May 08, 2010 at 03:03 PM

Passing Params & Formulas to SQL Command & Strd Proc in CR 11.5 & 2008 - 1

23 Views

I am working with CR 11.5 and heavily use SQL Command rewrites and Stored Procedures (SPs)with the usual limitation that only single parameter values can be passed into SPs, and Parameters must be created within the SQL Command editor (and cannot be referenced to those generated in Field Explorer, or can they?)

I understand from BE/CR's sales material for CR 2008 that multiple values can now be used under these conditions. As I recall, Multivalue Parameters are actually arrays that can be made into comma delimited strings.

Local StringVar StringExpression;
Local NumberVar ArrayCount := Count({?Code});
Local NumberVar i;

if ArrayCount = 0
   then StringExpression := ""
else 
   StringExpression := {?Code}[1];
   i := 2;  
While i <= ArrayCount Do
(
    StringExpression := StringExpression + ", " + {?Code}<i>; 
    i := i + 1;
);

See part 2 for continuation....