Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

store procedures, parameters

Status
Not open for further replies.

jambu

Programmer
Nov 20, 2002
185
0
0
GB
How do I pass parameters to a stored procedure? I have done this in the past with older versions of crystal but there doesnt seem to be anyway to pass parameters.

When I show Sql from the database menu I get the following

{call StoredProcedureName(?,?,?)}

That is the correct number of parameters but there is no way I can put in literals or crystal parameters in there.

I am using 8.5 and sql server 2000 and this is a sub report I am trying to get data into. BTW a version of the stored procedure that has no parameters works fine in crystal.

Thanks in advance.
 
This can get you started. It needs refinement, thought, as it will keep going until the first string is longer than the second string.
Code:
WhilePrintingRecords;
stringVar strTest := "The Really Huge Important Company";
stringVar LeftString := "";
stringVar RightString := strTest;
stringVar array arrTest := Split(strTest," ");

while Len(RightString) > Len(LeftString) AND 
      Instr(RightString," ") > 0 do
(
    LeftString := LeftString + Left(RightString,Instr(RightString," "));
    RightString := Right(RightString,Len(RightString) - Instr(RightString," "));
);

Len(LeftString);
Create a second formula to display the second string.
Code:
WhilePrintingRecords;
stringVar RightString;

Len(RightString);

~Brian
 
Sorry, I posted this to the wrong thread. My apologies.

~Brian
 
That's ok, had me very confused for a minute though.
 
You should be able to just add the parameter name in it but it doesn't work. However here are some links that explains how to do it.
Hope this helps as it doesn't for me. I'm trying to add a parameter field to an select statement with an access database, and it doesn't work I get a message that says COUNT FIELD ERROR
If you find more than this send me a email
 
The problem was that crystal adds the parameter to the record selection formula and I already had code in there. By replacing the code in there and relinking the sub report links it worked. There was no need to put the parameters in the sql statement.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top