Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Friday, March 30, 2012

parameter problem in sql2005 sp

in sql2005 store procedure is accepting the varchar value which is more than the parameter's varchar value size it is not giving any exception error but removes the remaining character from right side

Example :

Table

-

create table employee

(Empname Varchar(5), EmpNo Int)

Procedure

create procedure test (@.para1 Varchar(5))

as

SELECT * FROM employee WHRE empNAME=@.PARA1

Execution

--

exec test 'ABCDEFGH'

it consider only 'ABCDE' and ignores remaining character without giving any exception error.

Thanks,

It is the specification. Not only in 2005 earlier versions also use the same specification.

But in sql server 2005 you can overcome this issue using Varchar(max) it never truncate the value.

Declare @.A varchar(1), @.B varchar(Max);

Set @.A = '1234' --Truncated value

Set @.B = '1234' --Never Truncate the value

Select @.A, @.B

Note:

The character length is only validated on Insert & Update statement.

|||thanks fo reply

parameter problem in sql2005 sp

in sql2005 store procedure is accepting the varchar value which is more than the parameter's varchar value size it is not giving any exception error but removes the remaining character from right side

Example :

Table

-

create table employee

(Empname Varchar(5), EmpNo Int)

Procedure

create procedure test (@.para1 Varchar(5))

as

SELECT * FROM employee WHRE empNAME=@.PARA1

Execution

--

exec test 'ABCDEFGH'

it consider only 'ABCDE' and ignores remaining character without giving any exception error.

Thanks,

It is the specification. Not only in 2005 earlier versions also use the same specification.

But in sql server 2005 you can overcome this issue using Varchar(max) it never truncate the value.

Declare @.A varchar(1), @.B varchar(Max);

Set @.A = '1234' --Truncated value

Set @.B = '1234' --Never Truncate the value

Select @.A, @.B

Note:

The character length is only validated on Insert & Update statement.

|||thanks fo replysql

parameter passing problem


why this wont work?
error:
Exception Details: System.Data.SqlClient.SqlException: Procedure or Function 'test1' expects parameter '@.cid', which was not supplied.
.................................................................................
ASPX CODE:
string cid12;
cid12 = "user5";
// Connection
ConnectionStringSettings mysettings;
mysettings = System.Configuration.ConfigurationManager.ConnectionStrings["dbase1_connection"];
string myConnectionString = mysettings.ConnectionString;
SqlConnection conn1 = new SqlConnection(myConnectionString);
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn1;
cmd.CommandText = "test1";
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter param = cmd.Parameters.Add("@.cid", SqlDbType.NChar, 20);
param.Direction = ParameterDirection.Input;
param.Value = cid12;

conn1.Open();
cmd.ExecuteNonQuery();
conn1.Close();
.................................................................................
STORED PROCEDURE:
ALTER PROCEDURE dbo.test1
(
@.cid nvarchar(20)
)
AS
/* SET NOCOUNT ON */
select tech_id, customer_id, issue_main from [case] where customer_id = @.cid
--GO
RETURN
.................................................................................
im using asp.net, C#, and sql express
forgive me. im new to this .net
PLS HELP

forgive me. i found out that the codes above are just ok. i found out that one of my grid table is the one causing the problem - it is not passing a parameter. hehehe. my fault. im just human.

thanks to you all.

Wednesday, March 28, 2012

parameter is missing a value.

Hi Friends,

I have created a child report with hidden parameter. When I call this report from the Master report using a link, I am getting error 'the xxxx parameter is missing a value'.

From, master report, if I click a value, it should take that value to child report where it filters for that value and should display the child report.

How to overcome this?

Thanks & Regards,

Naveen J V

Have you set any default value for the parameter in your subreport?

|||

Hi,

No default value has been set.

Regards,

Naveen J V

|||Ok, then try giving a default value for your hidden parameter. Give the same expression that you have used in the value field for the parameter. This might work. Not sure.|||

Hi,

I already tried this option, but I'm still getting the same error.

Thanks & Regards,

Naveen

|||

All the parameters created in sub-report should get some value, so if you have more than one parameter in the sub-report and from the master report you are passing value of only one parameter then obviously the value of other parameters will be missing. I suggest you to set the default value for the parameters in the sub report, so that the report get displayed even if you are passing wrong values from the master report.

By the way what is the expression that you are passing? And how many parameters you have?

|||

Hi Rohit,

My sub report has only one parameter. In my master report, If I click a particular column, it should take me to the sub report, where I should be able to see the filtered report based on the passed value.

It is working for one of my report which uses a different cube.

Thanks & Regards,

Naveen

|||

Can you give the expression that you are passing?

|||

Rohit,

While creating a report, in Query builder I selected a parameter (which referes to a member of a dimension). Same parameter I'm using in my report. I am not using any expressions.

Thanks & Regards,

Naveen

|||

what is the expression you are writting in the navigation properties for the parameter of your sub report?

|||

Hi,

Jump to Report ->Sub_rpt (sub report name)

Parameter name -> DLVLTM

Parameter value -> =Fields!TM.Uniquename

Regards,

Naveen J V

|||

Actually everything seems to be fine. It may be a data issue though.

anyways again give it a try:

Go to Sub report and in the report parameter window try by making available values non-queried.

|||

Hi Rohit,

If I dont hide the parameter, the report works fine. If I hide, only then I get this error. In the present context, it should be hidden. Based on the selection made from the master report, it should disply the child report.

I dont understand wht could be the problem?

Regards,

Naveen

|||

Hi Rohit,

I'm getting the same error. Please refer to my rprevious mail.

Regards,

Naveen J V

parameter is missing a value.

Hi Friends,

I have created a child report with hidden parameter. When I call this report from the Master report using a link, I am getting error 'the xxxx parameter is missing a value'.

From, master report, if I click a value, it should take that value to child report where it filters for that value and should display the child report.

How to overcome this?

Thanks & Regards,

Naveen J V

Have you set any default value for the parameter in your subreport?

|||

Hi,

No default value has been set.

Regards,

Naveen J V

|||Ok, then try giving a default value for your hidden parameter. Give the same expression that you have used in the value field for the parameter. This might work. Not sure.|||

Hi,

I already tried this option, but I'm still getting the same error.

Thanks & Regards,

Naveen

|||

All the parameters created in sub-report should get some value, so if you have more than one parameter in the sub-report and from the master report you are passing value of only one parameter then obviously the value of other parameters will be missing. I suggest you to set the default value for the parameters in the sub report, so that the report get displayed even if you are passing wrong values from the master report.

By the way what is the expression that you are passing? And how many parameters you have?

|||

Hi Rohit,

My sub report has only one parameter. In my master report, If I click a particular column, it should take me to the sub report, where I should be able to see the filtered report based on the passed value.

It is working for one of my report which uses a different cube.

Thanks & Regards,

Naveen

|||

Can you give the expression that you are passing?

|||

Rohit,

While creating a report, in Query builder I selected a parameter (which referes to a member of a dimension). Same parameter I'm using in my report. I am not using any expressions.

Thanks & Regards,

Naveen

|||

what is the expression you are writting in the navigation properties for the parameter of your sub report?

|||

Hi,

Jump to Report ->Sub_rpt (sub report name)

Parameter name -> DLVLTM

Parameter value -> =Fields!TM.Uniquename

Regards,

Naveen J V

|||

Actually everything seems to be fine. It may be a data issue though.

anyways again give it a try:

Go to Sub report and in the report parameter window try by making available values non-queried.

|||

Hi Rohit,

If I dont hide the parameter, the report works fine. If I hide, only then I get this error. In the present context, it should be hidden. Based on the selection made from the master report, it should disply the child report.

I dont understand wht could be the problem?

Regards,

Naveen

|||

Hi Rohit,

I'm getting the same error. Please refer to my rprevious mail.

Regards,

Naveen J V

Monday, March 26, 2012

parameter is missing a value.

Hi Friends,

I have created a child report with hidden parameter. When I call this report from the Master report using a link, I am getting error 'the xxxx parameter is missing a value'.

From, master report, if I click a value, it should take that value to child report where it filters for that value and should display the child report.

How to overcome this?

Thanks & Regards,

Naveen J V

Have you set any default value for the parameter in your subreport?

|||

Hi,

No default value has been set.

Regards,

Naveen J V

|||Ok, then try giving a default value for your hidden parameter. Give the same expression that you have used in the value field for the parameter. This might work. Not sure.|||

Hi,

I already tried this option, but I'm still getting the same error.

Thanks & Regards,

Naveen

|||

All the parameters created in sub-report should get some value, so if you have more than one parameter in the sub-report and from the master report you are passing value of only one parameter then obviously the value of other parameters will be missing. I suggest you to set the default value for the parameters in the sub report, so that the report get displayed even if you are passing wrong values from the master report.

By the way what is the expression that you are passing? And how many parameters you have?

|||

Hi Rohit,

My sub report has only one parameter. In my master report, If I click a particular column, it should take me to the sub report, where I should be able to see the filtered report based on the passed value.

It is working for one of my report which uses a different cube.

Thanks & Regards,

Naveen

|||

Can you give the expression that you are passing?

|||

Rohit,

While creating a report, in Query builder I selected a parameter (which referes to a member of a dimension). Same parameter I'm using in my report. I am not using any expressions.

Thanks & Regards,

Naveen

|||

what is the expression you are writting in the navigation properties for the parameter of your sub report?

|||

Hi,

Jump to Report ->Sub_rpt (sub report name)

Parameter name -> DLVLTM

Parameter value -> =Fields!TM.Uniquename

Regards,

Naveen J V

|||

Actually everything seems to be fine. It may be a data issue though.

anyways again give it a try:

Go to Sub report and in the report parameter window try by making available values non-queried.

|||

Hi Rohit,

If I dont hide the parameter, the report works fine. If I hide, only then I get this error. In the present context, it should be hidden. Based on the selection made from the master report, it should disply the child report.

I dont understand wht could be the problem?

Regards,

Naveen

|||

Hi Rohit,

I'm getting the same error. Please refer to my rprevious mail.

Regards,

Naveen J V

parameter is missing a value error

I am trying to populate a report "rdlc" file within a reportviewer control in a webpage. It works fine when is ran as a RDL file as a report services solution. Now that I created my datasource that will populate my report, I get an error "The 'beg_date' parameter is missing a value", which is a field that is specified back from the result of the procedure. Anyone know how to approach this?

Private connAs String Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.Load conn = System.Configuration.ConfigurationManager.ConnectionStrings("ESQLConn").ConnectionString()End Sub Protected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Button1.Click AddReportDataset()End Sub Private Sub AddReportDataset()Dim ds1As ReportDataSource =New ReportDataSource("DataSource1", sd1())Dim ds2As ReportDataSource =New ReportDataSource("DataSource2", sd2())Dim ds3As ReportDataSource =New ReportDataSource("DataSource3", sd3())Me.rptViewer.LocalReport.DataSources.Add(ds1)Me.rptViewer.LocalReport.DataSources.Add(ds2)Me.rptViewer.LocalReport.DataSources.Add(ds3)End Sub Private Function sd1()As SqlDataSourceDim compnameAs ControlParameter =New ControlParameter compname.DefaultValue =Me.txtCompany.Text.ToStringDim begdateAs ControlParameter =New ControlParameter begdate.DefaultValue =Me.txtBegDate.Text.ToStringDim enddateAs ControlParameter =New ControlParameter enddate.DefaultValue =Me.txtEndDate.Text.ToStringDim sqldsAs New SqlDataSource sqlds.ConnectionString = conn sqlds.SelectCommand ="csp_rpt_ef0115_db" sqlds.SelectCommandType = SqlDataSourceCommandType.StoredProcedure sqlds.SelectParameters.Add(compname) sqlds.SelectParameters.Add(begdate) sqlds.SelectParameters.Add(enddate)Return sqldsEnd Function Private Function sd2()As SqlDataSourceDim sqldsAs New SqlDataSource sqlds.ConnectionString = conn sqlds.SelectCommand ="SELECT DISTINCT RTRIM(Act_Type) + ISNULL(Act_Sub_Type,'') AS Type FROM AR_Act" sqlds.SelectCommandType = SqlDataSourceCommandType.Text Return sqlds End Function Private Function sd3() As SqlDataSource Dim sqlds As New SqlDataSource sqlds.ConnectionString = conn sqlds.SelectCommand = "select Item from dbo.Pick_Items with (nolock)
where fPick_Name='asxdbLocations" sqlds.SelectCommandType = SqlDataSourceCommandType.TextReturn sqldsEnd Function

hello,

you seem to be commenting some of you code out by using ' instead of "

See your original post and look at the text in green which is commented out. Could this be the problem?

Regards

Marco

|||

use those link it might help you http://www.c-sharpcorner.com/UploadFile/asif.blog/DynamicDataGrouping08042006115320AM/DynamicDataGrouping.aspx

Parameter is missing a value

Hi Folks,

I'm receiving the "Parameter is missing a value" error message while testing my report.

I have five parameters, two of which are hidden that gets prefilled from the query below. The hidden parameters are DatatechClient and DatatechProduct.

SELECT ClientNameProduct, DatatechClient, DatatechProduct
FROM V_TranslationTable
WHERE (CMRNum = @.Cmr) AND (AcctNum = @.ClientNum)

Three parameters are shown and the report works fine as long as the CMRNum and AcctNum is found in the V_TranslationTable however, the error generates when they are not found. I looked through the other threads in this forum that deals with "Parameter is missing a value" but it didn't appear to be a solution shown.

Thanks in advance for any assistance you give.

I take it that when either CMRNum or AcctNum don't exist, you don't want the report to error out. Use this in your query - the report should run and return nothing, but won't error out:

Where IsNull(CMRNum,'') = @.Cmr AND IsNull(AcctNum,'') = @.ClientNum

|||

Hi Jamvir,

Thanks for responding.

I need to give more clearity. My report consists of six datasets and I'm working with RS2005. @.Cmr and @.ClientNum gets populated by a query in my first two datasets. My two hidden parameters @.DatatechClient and @.DatatechProduct are a part of my third dataset and they are the columns that are coming back blank from the query below.

SELECT ClientNameProduct, DatatechClient, DatatechProduct
FROM V_TranslationTable
WHERE (CMRNum = @.Cmr) AND (AcctNum = @.ClientNum)

Blank parameters for @.DatatechClient and or @.DatatechProduct are being passed to my fifth dataset query below.

SELECT EntityID, PrimaryDirInd, IsOnContract, [5DigitCode], EntityName, Addr1, City, State, Zip, Attn, Phone, ClientID, ProductID
FROM V_EntityDirectories
WHERE ((DirID = @.DirNum) AND (ClientID = @.DatatechClient) AND (ProductID = @.DatatechProduct))
ORDER BY EntityID

Also blank parameters for @.DatatechClient and or @.DatatechProduct are being passed to my sixth dataset query below.

SELECT PkgHdngs.ClientID, PkgHdngs.ProductID, PkgHdngs.DirID, PkgHdngs.HdngSeqNum, PkgHdngs.HdngText, PkgHdngs.HdngCode, PkgHdngs.DirVer, HdngAds.AdUnitID, HdngAds.AdRate
FROM PkgHdngs INNER JOIN
HdngAds ON PkgHdngs.ClientID = HdngAds.ClientID AND PkgHdngs.ProductID = HdngAds.ProductID AND PkgHdngs.DirID = HdngAds.DirID AND PkgHdngs.DirVer = HdngAds.DirVer AND PkgHdngs.HdngSeqNum = HdngAds.HdngSeqNum
WHERE ((PkgHdngs.DirID = @.DirID) AND (PkgHdgns.ClientID = @.DatatechClient) AND (PkgHdgns.ProductID = @.DatatechProduct))
ORDER BY PkgHdngs.ClientID, PkgHdngs.ProductID, PkgHdngs.DirID

Best regards

|||

Have Non queried default values for DatatechClient and DatatechProduct parameters and use the follwing expression for it:

=IIf(Count(Fields!DatatechClient.Value, "DataSet3") > 0, First(Fields!DatatechClient.Value, "DataSet3"), "SomeDefaultValueOrBlank")

and similarly for DatatechProduct

Parameter Error on Deployment

New to report services and trying out my first report. I have a report with a simple parameter lookup. When I preview it in Visual Studio it works fine. I can select the parameter value and it returns back the correct information.

When trying to preview the deployed version of the report I get the following error after selecting the parameter value and clicking preview. I am not sure where I need to declare the variable @.owners.

Thanks

Reporting Services Error

An error has occurred during report processing. (rsProcessingAborted) Get Online Help Query execution failed for data set 'ANDON'. (rsErrorExecutingCommand) Get Online Help ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@.Owners'.

Microsoft Reporting Services

I guess you are using @.Owner in your sql query and not defined it as a parameter for that dataset.

So in Data tab, select the dataset Edit the dataset by clicking on "..." button. and go to Paramaters tab. Type @.Owner under Name column and type "=Parameters!Owner.Value".

I'm asssuimg that Owner is already defined as one of the report parameters (Report -> Report Parameters). If not, create this parameter and then do the above.

Shyam

|||

Thanks for the response.

I have my SQL query defined as

SELECT idfld, andon, createdate, issuetype, origname, owner, notes, outcome, responded, resolution
FROM dbo.issue
WHERE (owner = @.Owner)

I went into the Data Tab/Parameters Tab and @.Owner = Parameters!Owner.value was already set

In my report parameters I have Owner defined and it is pulling information from a Select Distinct owner query.

Still works in the view mode and I still get the error when I look at the deployed report.

|||

I guess you have set Available values for your parameter from a query. Try setting a default value for your parameter.

Shyam

|||

Yes, I am getting the values for my parameter from a query. I tried setting a default value and I still get the same error.

|||

Is your parameter multi-valued?

Also check the following link:

http://msdn2.microsoft.com/en-us/library/aa337223.aspx

What is the provider type you are using on your report server and on your local machine (from visual studio)? Based on that check how you should handle as described in the link above.

Shyam

|||

"What is the provider type you are using on your report server and on your local machine (from visual studio)? "

That was the key. I had to modify the data source on the Reports Server to match what I was using on my report. Thanks!

|||make sure that the parameter is consistent throughout your code. Parameters are case sensitive - In your post, the error message referred to @.Owners - with an "s". In your posts it was referred to as @.Owner and @.owner. Reporting services sends the error when there is any difference between the report parameter in the parameter drop down and its references in the underlying code.

Parameter Error on Deployment

New to report services and trying out my first report. I have a report with a simple parameter lookup. When I preview it in Visual Studio it works fine. I can select the parameter value and it returns back the correct information.

When trying to preview the deployed version of the report I get the following error after selecting the parameter value and clicking preview. I am not sure where I need to declare the variable @.owners.

Thanks

Reporting Services Error


An error has occurred during report processing. (rsProcessingAborted) Get Online Help

Query execution failed for data set 'ANDON'. (rsErrorExecutingCommand) Get Online Help

ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Must declare the variable '@.Owners'.


Microsoft Reporting Services

I guess you are using @.Owner in your sql query and not defined it as a parameter for that dataset.

So in Data tab, select the dataset Edit the dataset by clicking on "..." button. and go to Paramaters tab. Type @.Owner under Name column and type "=Parameters!Owner.Value".

I'm asssuimg that Owner is already defined as one of the report parameters (Report -> Report Parameters). If not, create this parameter and then do the above.

Shyam

|||

Thanks for the response.

I have my SQL query defined as

SELECT idfld, andon, createdate, issuetype, origname, owner, notes, outcome, responded, resolution
FROM dbo.issue
WHERE (owner = @.Owner)

I went into the Data Tab/Parameters Tab and @.Owner = Parameters!Owner.value was already set

In my report parameters I have Owner defined and it is pulling information from a Select Distinct owner query.

Still works in the view mode and I still get the error when I look at the deployed report.

|||

I guess you have set Available values for your parameter from a query. Try setting a default value for your parameter.

Shyam

|||

Yes, I am getting the values for my parameter from a query. I tried setting a default value and I still get the same error.

|||

Is your parameter multi-valued?

Also check the following link:

http://msdn2.microsoft.com/en-us/library/aa337223.aspx

What is the provider type you are using on your report server and on your local machine (from visual studio)? Based on that check how you should handle as described in the link above.

Shyam

|||

"What is the provider type you are using on your report server and on your local machine (from visual studio)? "

That was the key. I had to modify the data source on the Reports Server to match what I was using on my report. Thanks!

|||make sure that the parameter is consistent throughout your code. Parameters are case sensitive - In your post, the error message referred to @.Owners - with an "s". In your posts it was referred to as @.Owner and @.owner. Reporting services sends the error when there is any difference between the report parameter in the parameter drop down and its references in the underlying code.sql

Parameter error

Why do I keep getting this error:

"A number is required here"

I am trying to prompt the user of the report for the a Billing ID, which will refresh the contents of the report.

I am using exactly the same technique and method which is illustrated in the manual:

{VW_BillingItemsConsolidated.BillingAddressID}={?billingID}

Where {VW_BillingItemsConsolidated.BillingAddressID} is the table field and {?billingID} is the forumla I have created.

RegardsNow I have changed the "Parameter Field" "Value Type" to take numerical data the error is no longer showing. Still though, when I enter a number the information on the report doesn't change to reflect that customer. Where am I going wrong?|||I just keeo getting "False" in the field which is inserted onto the report.|||What is the datatype of VW_BillingItemsConsolidated.BillingAddressID?
It should work correctly

Parameter Conversions Question from SQL Server

I have a question regarding a casting error I recieve when I explictly assign a value to a value in a stored procedure......
The value pstrLoginName is a public string defined in a code module
The stored procedure is NVARCHAR Datatypes....

Here is the Stored Procedure

CREATE procedure dbo.Appt_GetPermissions_NET
(
@.LoginName nvarchar(15),
@.Password NvarChar(15),
@.DeleteScan bit Output

)
as
select

@.DeleteScan=UserP_DeleteScan
from
Clinic_Users
where
UserName = @.LoginName
and
UserPassword = @.Password

GO

Here is my error

Specified cast is not valid
Line 194: cmdsql.CommandType = CommandType.StoredProcedure
Line 195:
Line 196: parmLogin = cmdsql.Parameters.Add("@.LoginName", SqlDbType.NVarChar, 15).Value = pstrLoginName
Line 197: parmPassword = cmdsql.Parameters.Add("@.LoginPassword", SqlDbType.NVarChar, 15).Value = pstrLoginPassword
Line 198: parmDelete = cmdsql.Parameters.Add("@.DeleteScan", SqlDbType.Bit)

my vb .net code to execute this

Public Sub ObtainPermission()

'get the needed data
Dim consql As New SqlConnection("Server=myserver;database=APPOINTMENTS;uid=webtest;pwd=webtest")
Dim cmdsql As New SqlCommand
Dim parmLogin As SqlParameter
Dim parmPassword As SqlParameter
Dim parmDelete As SqlParameter

cmdsql = New SqlCommand("Appt_GetPermissions_NET", consql)
cmdsql.CommandType = CommandType.StoredProcedure

parmLogin = cmdsql.Parameters.Add("@.LoginName", SqlDbType.NVarChar, 15).Value = pstrLoginName <--error occurs here

parmPassword = cmdsql.Parameters.Add("@.LoginPassword", SqlDbType.NVarChar, 15).Value = pstrLoginPassword <--I'm sure it will happen here then
parmDelete = cmdsql.Parameters.Add("@.DeleteScan", SqlDbType.Bit)
parmDelete.Direction = ParameterDirection.Output

consql.Open()
cmdsql.ExecuteNonQuery()

'obtain rights

pstrPermissions = cmdsql.Parameters("@.DeleteScan").Value
consql.Close()

End SubDude, your doing too much on one line!
If you are going to do all this on one line you'll have to add some paranthesis:
(parmLogin = cmdsql.Parameters.Add("@.LoginName", SqlDbType.NVarChar, 15)).Value = pstrLoginName

I'd recommend splitting the row in two lines for better readability.|||You have both this line:


Dim cmdsql As New SqlCommand

and this line:

cmdsql = New SqlCommand("Appt_GetPermissions_NET", consql)

Note that you have used "New" twice. Remove the "New" from the first line and you should have better luck.
Terri|||Ofcourse it's wrong to allocate an object twice,
but it shouldn't raise an error, since he hasn't used the variable
before allocating it the second time.
Won't it just 'leak' an object instance?sql

parameter cannot set the command text for dataset

Hello

I get the following error in a very quick test system i created:

An error occurred during local report processing.

An error has occurred during report processing.

Cannot set the command text for data set 'test'.

Error during processing of the CommandText expression of dataset 'test'.

My sql is:

= "select T.testid, T.test from test T " & Iif(Parameters!test1.Value = 1, "", "Where T.testid = " & Parameters!test1.Value)

There is nothing obviously wrong in the code as far as i can see

The parameter 'test1' is of type 'string'

The database 'test' has 2 columns of type 'smallint' and 'Name:nvarchar(50)'

I am at a loss, as this query is really simple, and is similar to the example query set up my microsoft which works fine

Thanks

t.test from test?

You tried running this in sql?

|||

Yes, it works fine in sql if you strip out the bits that obviously wont work in query analyser

this works:

= "select T.testid, T.test from test T " & Iif(1 = 1, "", "Where T.testid = 1" )

this does not:

= "select T.testid, T.test from test T " & Iif(1 = 1, "", "Where T.testid = " & Parameters!test1.Value)

why?

there is a parameter called test1

|||

Found the answer!

You have to have another table with a different name into which the parameter links (in the section 'available values' / 'from query')

I created another table called test2, et voila! it works

Friday, March 23, 2012

parameter and Oracle DB

I have a dataset that queries an Oracle DB. I am getting an error when I try
to set a parameter in the query. Basically I have the following:
WHERE x.system_num = s.system_num
and na.service_id = x.service_id
and na.location_num = sl.location_num
and sd.device_mux_id = dm2.device_mux_id
and (x.auth_date >= @.param_start)
ORDER BY m.mso_name, sl.system_name, system_type, d.device_address
The error I get is the following:
ORA-00936: missing expression
(System.Data.OracleClient)
When I remove the "and (x.auth_date >= @.param_start)" the error goes away.
The missing expression sounds like I have a comma at the end of the SELECT or
FROM line; but when the param line is removed the error goes away. So I
don't think that is it.
Could it be in how the parameter is set up? Just throwing out ideas here.
Thank you for any help offered.
Rob CuscadenFYI
After several HOURS of silly errors someone found the solution to this
problem. I wanted to post it here so that others can gain from my hours of
frustration. I will not say that it will work in ALL cases; but that it
works in mine and it is something for others to try if they are stuck.
Problem, using Reporting Services 2005 and accessing an Oracle database with
parameters.
In Reporting Services queries of a SQL DB, I have seen the @.param_startdate
used in the query and then the parameter is defined in the "Report
Parameters" option on the "Reports" top menu option.
So, for example
Select *
From sometable
Where sometable.datefield >= @.param_startdate
Then you go modify the Report Parameters option for the project.
If you try this with an ORACLE DB you will get several errors (ORA-00936:
missing expression is one of them).
SOLUTION: To solve this for an ORACLE DB, use the following:
SELECT *
FROM sometable
WHERE sometable.datefield = :param_startdate
-----
Now I am sure that this little ( : ) is documented somewhere in a document
out there somewhere. BUT for crying out loud... such a simple solution that
took 6 hours to find.
Please feel my frustration and I hope I prevent this from happening elsewhere.
Rob Cuscaden
"Rob" wrote:
> I have a dataset that queries an Oracle DB. I am getting an error when I try
> to set a parameter in the query. Basically I have the following:
> WHERE x.system_num = s.system_num
> and na.service_id = x.service_id
> and na.location_num = sl.location_num
> and sd.device_mux_id = dm2.device_mux_id
> and (x.auth_date >= @.param_start)
> ORDER BY m.mso_name, sl.system_name, system_type, d.device_address
> The error I get is the following:
> ORA-00936: missing expression
> (System.Data.OracleClient)
> When I remove the "and (x.auth_date >= @.param_start)" the error goes away.
> The missing expression sounds like I have a comma at the end of the SELECT or
> FROM line; but when the param line is removed the error goes away. So I
> don't think that is it.
> Could it be in how the parameter is set up? Just throwing out ideas here.
> Thank you for any help offered.
> Rob Cuscaden
>|||Rob,
I have been having the same problem and my queries look up an Oracle DB
also. I ended up getting so frustrated at mine, that our Oracle DB
Administrator told me to use a program called Toad for Oracle. Used that
which the SQL module in that program works very similar as the Microsoft
Query tool (Data, Import External Data,
New Database Query).
Anyway, I looked at the SQL Statement after building the Query (joining
tables, adding fields, adding criteria filters, etc). And I saw the same
Where table.field LIKE :whatever
Well, I tried using that in the Microsoft Query (SQL Statement) and I end up
getting some other error which I can't duplicate right now. I tried it again
and now it just completely bails me out of excel with the ever famous Debug,
Send Error Report, etc.
Anyway, wasn't sure if you ran into anything more you could share that might
help in my situation.
I also posted this issue somewhere else on here explaining more in detail
about how originally I created the query with one line of criteria where 3 of
my criteria having 5 "or" conditions. When I refresh or return data to Excel
it works fine.
Problem starts occurring if I ever have to go back in to the query to edit
and then try and refresh or return the data again. That's where I get the
ORA-00936 Missing expression error message.
I'm so stuck on this and really need to resolve somehow, because the data
that's returned from this query is used for charts, graphs, pivot tables,
that are all part of a giant VBA I wrote to automate dashboards for a bunch
of engineers.
Anwyay, any suggestions you or anyone might have on this would be greatly
appreciated.
"Rob" wrote:
> FYI
> After several HOURS of silly errors someone found the solution to this
> problem. I wanted to post it here so that others can gain from my hours of
> frustration. I will not say that it will work in ALL cases; but that it
> works in mine and it is something for others to try if they are stuck.
> Problem, using Reporting Services 2005 and accessing an Oracle database with
> parameters.
> In Reporting Services queries of a SQL DB, I have seen the @.param_startdate
> used in the query and then the parameter is defined in the "Report
> Parameters" option on the "Reports" top menu option.
> So, for example
> Select *
> From sometable
> Where sometable.datefield >= @.param_startdate
> Then you go modify the Report Parameters option for the project.
> If you try this with an ORACLE DB you will get several errors (ORA-00936:
> missing expression is one of them).
> SOLUTION: To solve this for an ORACLE DB, use the following:
> SELECT *
> FROM sometable
> WHERE sometable.datefield = :param_startdate
> -----
> Now I am sure that this little ( : ) is documented somewhere in a document
> out there somewhere. BUT for crying out loud... such a simple solution that
> took 6 hours to find.
> Please feel my frustration and I hope I prevent this from happening elsewhere.
> Rob Cuscaden
> "Rob" wrote:
> > I have a dataset that queries an Oracle DB. I am getting an error when I try
> > to set a parameter in the query. Basically I have the following:
> >
> > WHERE x.system_num = s.system_num
> > and na.service_id = x.service_id
> > and na.location_num = sl.location_num
> > and sd.device_mux_id = dm2.device_mux_id
> > and (x.auth_date >= @.param_start)
> >
> > ORDER BY m.mso_name, sl.system_name, system_type, d.device_address
> >
> > The error I get is the following:
> >
> > ORA-00936: missing expression
> > (System.Data.OracleClient)
> >
> > When I remove the "and (x.auth_date >= @.param_start)" the error goes away.
> > The missing expression sounds like I have a comma at the end of the SELECT or
> > FROM line; but when the param line is removed the error goes away. So I
> > don't think that is it.
> >
> > Could it be in how the parameter is set up? Just throwing out ideas here.
> >
> > Thank you for any help offered.
> > Rob Cuscaden
> >sql

Wednesday, March 21, 2012

ParallelPeriod Error

I keep getting an error "The ParallelPeriod function expects a member expression for the argument. A tuple set expression was used." Is there something that I can use instead of LastPeriods to get this to work?

Here is the trend expression for a KPI that I get the error for:

(KPIVALUE('ABI Aggregate Test')-(CoalesceEmpty(

Aggregate({[Entities].[SITE].&[1]}

* {[Entities].[EntityType].[Site]}

* {[TDVs].[Parameter - Material].&[Bitum_Coal_Usage_Site -]}

* {ParallelPeriod([Date].[Year - Quarter - Month - Date].[Date], 1,

LastPeriods(3, StrToMember('[TDV Result Date].[Year - Quarter - Month - Date].[Year].[Calendar ' + EssMdx.Ess.Epm.AnalysisServices.MdxFunctions.Timeframe.GetLastFullYear() + ']')))}

, [Measures].[Result]),0)))

Could you describe what you are trying to do? It looks like you are trying to go back 1 day from a set consisting of the last 3 years. If you are trying to compare the KPI value to the same day 3 years ago you could use the Lag() function instead of LastPeriods(), but I don't really think that is what you are trying to do.|||

Sorry, the above line {ParallelPeriod([Date].[Year - Quarter - Month - Date].[Date], 1, should be {ParallelPeriod([Date].[Year - Quarter - Month - Date].[Year], 1,

I am trying to get a trend expression based on 1 year back (or 2 or 3...). ParallelPeriod has been working fine except with date ranges. The KPI value expression will give me a value for the last 3 full years (2006, 2005, and 2004) and is the same expression without the ParallelPeriod function. If the trend is 1 year back then it should be 2005, 2004, and 2003 (or it may be 2003, 2002, 2001).

Thanks

|||

That makes a bit more sense. In this case you simply have the LastPeriods and ParallelPeriod function nested the wrong way around, changing it to the following should work. Basically you need to pass the result of your GetLastFullYear Function to ParallelPeriod() and then pass the member from that to LastPeriods.

eg

(KPIVALUE('ABI Aggregate Test')-(CoalesceEmpty(

Aggregate({[Entities].[SITE].&[1]}

* {[Entities].[EntityType].[Site]}

* {[TDVs].[Parameter - Material].&[Bitum_Coal_Usage_Site -]}

* {LastPeriods(3,
ParallelPeriod([Date].[Year - Quarter - Month - Date].[Date], 1,StrToMember('[TDV Result Date].[Year - Quarter - Month - Date].[Year].[Calendar ' + EssMdx.Ess.Epm.AnalysisServices.MdxFunctions.Timeframe.GetLastFullYear() + ']')))}

, [Measures].[Result]),0)))

|||Thanks.

Parallel SQL Destination Load Pre-Process error

I cannot find any information on this error. It occurs on packages that are writing to the same table using a sql server destination. I suppose it would be a good exercise in error handling, but I'd rather avoid it.

Error: Unable to prepare the SSIS bulk insert for data insertion.
Error: component "FACT_BillingLineItem Destination" (22652) failed the pre-execute phase and returned error code 0xC0202071.
The cause of these errors, I eventually determined, was that SQL Server/SSIS by default uses up system memory until it goes loopy, unless you tell it not to by configuring the SQL Server "Maximum Server Memory" property.

Parallel SQL Destination Load Pre-Process error

I cannot find any information on this error. It occurs on packages that are writing to the same table using a sql server destination. I suppose it would be a good exercise in error handling, but I'd rather avoid it.

Error: Unable to prepare the SSIS bulk insert for data insertion.
Error: component "FACT_BillingLineItem Destination" (22652) failed the pre-execute phase and returned error code 0xC0202071.The cause of these errors, I eventually determined, was that SQL Server/SSIS by default uses up system memory until it goes loopy, unless you tell it not to by configuring the SQL Server "Maximum Server Memory" property.

Parallel Index Operations

Got the following error messages when rebuilding indexes on SQL Server 2000 + SP3 server.
WARNING: EC 5c166098, 2 waited 300 sec. on latch 5c1694bc. Not a BUF latch.
Waiting for type 0x2, current count 0xa, current owning EC 0x5C16A098.
Refer to KB-810195, but it should be corrected in SP3. My server has already service pack 3 installed.
Johnny
We have seen this in relation to IO problems, have you checked the windows
system event log?
"Johnny" <Johnny@.discussions.microsoft.com> wrote in message
news:087B2B6A-32A4-4C14-841D-4FE2993B8E75@.microsoft.com...
> Got the following error messages when rebuilding indexes on SQL Server
2000 + SP3 server.
> WARNING: EC 5c166098, 2 waited 300 sec. on latch 5c1694bc. Not a BUF
latch.
> Waiting for type 0x2, current count 0xa, current owning EC 0x5C16A098.
> Refer to KB-810195, but it should be corrected in SP3. My server has
already service pack 3 installed.
> Johnny
>
|||There is no errors in the system & application event log around the time of running index rebuild.

Parallel Index Operations

Got the following error messages when rebuilding indexes on SQL Server 2000
+ SP3 server.
WARNING: EC 5c166098, 2 waited 300 sec. on latch 5c1694bc. Not a BUF latch.
Waiting for type 0x2, current count 0xa, current owning EC 0x5C16A098.
Refer to KB-810195, but it should be corrected in SP3. My server has alread
y service pack 3 installed.
JohnnyWe have seen this in relation to IO problems, have you checked the windows
system event log?
"Johnny" <Johnny@.discussions.microsoft.com> wrote in message
news:087B2B6A-32A4-4C14-841D-4FE2993B8E75@.microsoft.com...
> Got the following error messages when rebuilding indexes on SQL Server
2000 + SP3 server.
> WARNING: EC 5c166098, 2 waited 300 sec. on latch 5c1694bc. Not a BUF
latch.
> Waiting for type 0x2, current count 0xa, current owning EC 0x5C16A098.
> Refer to KB-810195, but it should be corrected in SP3. My server has
already service pack 3 installed.
> Johnny
>|||There is no errors in the system & application event log around the time of
running index rebuild.

Parallel Index Operations

Got the following error messages when rebuilding indexes on SQL Server 2000 + SP3 server.
WARNING: EC 5c166098, 2 waited 300 sec. on latch 5c1694bc. Not a BUF latch.
Waiting for type 0x2, current count 0xa, current owning EC 0x5C16A098.
Refer to KB-810195, but it should be corrected in SP3. My server has already service pack 3 installed.
JohnnyWe have seen this in relation to IO problems, have you checked the windows
system event log?
"Johnny" <Johnny@.discussions.microsoft.com> wrote in message
news:087B2B6A-32A4-4C14-841D-4FE2993B8E75@.microsoft.com...
> Got the following error messages when rebuilding indexes on SQL Server
2000 + SP3 server.
> WARNING: EC 5c166098, 2 waited 300 sec. on latch 5c1694bc. Not a BUF
latch.
> Waiting for type 0x2, current count 0xa, current owning EC 0x5C16A098.
> Refer to KB-810195, but it should be corrected in SP3. My server has
already service pack 3 installed.
> Johnny
>|||There is no errors in the system & application event log around the time of running index rebuild.