So I have created a Stored Procedure and I'am linking it to crystal report.
My stored procedure has 2 Parameter StartDate AS DATIME and EndDate AS DATEIIME.
Everything is good, when I run the Crystal report it ask me the parameters and it's working pretty fine.
The change I want to bring :
So my question is that, is it possible to change the Paramter format. What do I mean by that ?
In Crystal, if you create a parameter DataType Date you can set the property
Allow Range Values to TRUE ...
But the paramters that come from the Stored Procedure wont allow me to set those properties
Is there a way I can allow my parameter that I receive from the Stored Procedure to have a Range value when I run the CR ?
Many Thanks
Related
I am working on a stored procedure activity to load data into one of my table. The procedure expects an int parameter to be passed and the value for this comes from the lookup output firstrow field. But when I pass the lookup output value for the parameter the pipeline is not getting executed. I have tried to convert the values as well and even used a variable to store. Any option to process the same?
Regards,
Sandeep
Can you send the detailed error when you try to execute the pipeline?
Thanks,
Pratik
How do I save procedure out parameter value to variable for later reuse in sqlworkbench/j script?
It is possible to run a stored procedure with out parameters using WbCall
However, the result of that can not be used to be stored into a Workbench variable.
That is only possible with "regular" queries (SELECT) that return a result set.
Is it possible to replicate this code from a stored procedure in a SSRS dataset?
exec #dtEffective = dbo.selUpdEnv 'PrevBusDt','=',#cdUser,'N'
What I'm trying to do is save the effective date in a variable and display the date in a textbox.
I tried creating a parameter called dtEffective and use it in the dataset. But it didn't save the value.
Create a new data set with the [dbo.sqlUpdEnv] as the record source. Note that #cdUser will need to be populated first since you're passing it in, so make sure that's above #dtEffective in the parameter list. In your #dtEffective parameter, set the Default Value to the result of the data set.
I am getting capability error whenever I am trying to set active property tue. I want to bind the grid with the stored procedure that takes one parameter.
If I do it through TQuery How do I specify the fields. I am using wwDBGrid.
MessageMembershipSelectQuery.Params[0].AsString :=
custQuery.FieldByName('cust_code').AsString;
MessageMembershipSelectQuery.Active := True;
Please guide
Replace you Query component by a StoredProc component. Also, check your parameter data type. If it is indeed a string parameter, then it´s Ok to use AsString, but if the parameter has a different data type, like Integer, for instance, then you should assign it´s value by using, for instance, AsInteger.
I want to use a dbExpress TSQLQuery component. But i do not know how to write the SQL to add a parameter. I will give an example maybe it will be more clear what my problem is.
In a TADOQuery the following works:
SELECT*
FROM sometable
WHERE sometable.id = :value;
Now in the above example you pass the parameter to the query using the colon (:) before the parameter name. But when I try and do that with the TSQLQuery, I get the following error:
dbExpress driver does not support the TDBXTypes.UNKNOWN data type. Vendor Error Message.
Now if this is not the way that you pass a parameter in a TSQLQuery component, can someone please assist me. This is new territory for me.
Im using a Firebird database, and Im using Delphi XE2
To set the properties of a parameter you must use the Params property. From here you can access each paramer using a index or the name, to set the value of the parameter use one of the properties AsString, AsInteger an so on, depeding of the type of the field.
Check this sample
var
LSQLQuery : TSQLQuery;
begin
LSQLQuery:=TSQLQuery.Create(nil);
try
LSQLQuery.SQLConnection:=SQLConnection1;
LSQLQuery.CommandText:='Select FIRST_NAME from EMPLOYEE Where EMP_NO=:Param1';
LSQLQuery.Params.ParamByName('Param1').AsInteger:=2;//or using the index of the parameter LSQLQuery.Params[0].AsInteger:=2;
LSQLQuery.Open;//Execute the query
ShowMessage(LSQLQuery.FieldByName('FIRST_NAME').AsString); //get the data
LSQLQuery.Close;
finally
LSQLQuery.Free;
end;
end;