Showing posts with label variable. Show all posts
Showing posts with label variable. Show all posts

Thursday, March 29, 2012

Can we include a variable field value on the table header.

Can we include a variable field value on the table header.

I am doing a page break on every date change and also set the property of he table header to repeat on each page. By doing this ,I am able to get the table header on each page even on page break. I want the changed date to be displayed on the every page break and in the table header.

Please help.

You should be able to do this without issue. Assuming you have a field which you are pulling from that shows the date, you could do something like this as an expression in the table header.

="Report Header - " & Fields!Date.Value

Hope this helps.

Sunday, March 25, 2012

Can We assign DataSet object to Object Type

Hi Friends,

I am having a Package scope variable DS of type system.object .In the Script Component which accept this variable as ReadWrite type I am Making the following assignment.

Public Overrides Sub PostExecute()

Variables.DsReport = DsReport // DsReport is a Data Set Object Created and Populated inside the script Component

End Sub

I am getting error while doing this sort of assignment.

Please help me to solve this problem

Regards,

Mahe

Which error do you get?

-Tom

Thursday, March 22, 2012

Can variable be used in SQL UPDATE statement in VB.NET

Hy, i have this problem in vb.net:

I must use a variable in SQL UPDATE statement, after SET statement, and i'm getting error. This is that line of code:

Dim variable_name As String

Dim variable As Integer

Dim sqlStringAsString = ("UPDATE table_name SET " variable_name" = " & variable &" WHERE UserID = '" & UserID &"'")

Dim cmdSqlCommandAsNew SqlCommand(sqlString, conConnetion)

cmdSqlCommand.ExecuteNonQuery()

When I don't use a variable after SET statement, everything work fine. This code works fine:

Dim variable As Integer

Dim sqlStringAsString = ("UPDATE table_name SET column_name = " & variable &" WHERE UserID = '" & UserID &"'")

Dim cmdSqlCommandAsNew SqlCommand(sqlString, conConnetion)

cmdSqlCommand.ExecuteNonQuery()

Please, if someone can help me in this...thanks..

Hi,

Did you missing ampersand sign in ?

Dim sqlStringAsString = ("UPDATE table_name SET " variable_name" = " & variable &" WHERE UserID = '" & UserID &"'")

Try

Dim sqlStringAsString = ("UPDATE table_name SET " & variable_name &" = " & variable &" WHERE UserID = '" & UserID &"'")

|||

thanks on answering..i was getting numeric value, but need string value, that was a problem, variable_name has numeric value, and that was error in sql statement...thanks on help

Thursday, March 8, 2012

Can sql variable accept array?

Hi,
Can sql variable accept array?
regards,
florencehttp://www.algonet.se/~sommar/arrays-in-sql.html
"florence" <florencelee@.visualsolutions.com.my> wrote in message
news:110d01c3a21c$07657720$a301280a@.phx.gbl...
> Hi,
> Can sql variable accept array?
> regards,
> florence|||Florence,
SQL Server do not support array of values. You may have to pass comma seperated values to the code.
Refer to following url for more information.
Passing arrays to stored procedure
http://www.algonet.se/~sommar/arrays-in-sql.html
- Vishal|||http://www.algonet.se/~sommar/arrays-in-sql.html
--
Jacco Schalkwijk
SQL Server MVP
"florence" <florencelee@.visualsolutions.com.my> wrote in message
news:110d01c3a21c$07657720$a301280a@.phx.gbl...
> Hi,
> Can sql variable accept array?
> regards,
> florence|||http://www.aspfaq.com/2248
"florence" <florencelee@.visualsolutions.com.my> wrote in message
news:110d01c3a21c$07657720$a301280a@.phx.gbl...
> Hi,
> Can sql variable accept array?
> regards,
> florence

Friday, February 24, 2012

Can someone explain this strange value of @@ROWCOUNT?

I have noticed the following strange situation, but cannot find any explanation. The @.rows variable is 1 , even though the @.@.ROWCOUNT value just after the select statement is 0. (I have checked this by stepping through the SP).

update Products set ParentId = @.parent where ParentId = @.lastParentId
set @.err = @.@.ERROR
set @.rows = @.@.ROWCOUNT

However, if I set @.rows before @.err then the @.rows is correctly set to 0. (as in script below).

update Products set ParentId = @.parent where ParentId = @.lastParentId
set @.rows = @.@.ROWCOUNT
set @.err = @.@.ERROR

Can someone please explain why this is happenning?

In the first instance, @.@.ROWCOUNT is reporting on the statement immediately above it, which is the @.@.ERROR check. Please realize, however, that in your second instance, your @.@.ERROR check is now happening against your @.@.ROWCOUNT check.

To get around this issue, it's better practice to use a statement like this,making sure to reference @.@.ERROR and @.@.ROWCOUNT in this specific order:

SELECT @.err = @.@.ERROR, @.rows = @.@.ROWCOUNT
|||

Thanks for the explanation.

In your answer, why should the order of @.@.ERROR and @.@.ROWCOUNT matter, since both are now in 'one' statement, and therefore, both are reporting on what occurred in a previous statement? 'select @.err=@.@.ERROR, @.rows = @.@.ROWCOUNT' is after all a single statement.

|||

sun21170:

In your answer, why should the order of @.@.ERROR and @.@.ROWCOUNT matter, since both are now in 'one' statement, and therefore, both are reporting on what occurred in a previous statement? 'select @.err=@.@.ERROR, @.rows = @.@.ROWCOUNT' is after all a single statement.


Thank you, you are correct, the order does not matter!

Sunday, February 19, 2012

Can reports access session object and/or variables?

We are using SQL Reporting Services 2000.
We need the reports to be able to access a session variable or the request
object's server variables. How can we do this?Thank you for posting.
As for the SQL Server reporting service, the report components and controls
are well encapsulated to provide data centric processing. The underlying
ASP.NET application pipeline or components are hidden from the report
builder or developer, so we can not directly access session object in SQL
RS's report.
BTW, if you're programmtically request the SSRS report in ASP.NET web
application (through webservice), you can consider put the session state
manipulation code in ASP.NET application layer.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)|||Thanks for responding, Steven.
As an alternative to session, do you know if there is a way to do a global
variable for several reports to access? Our reports need to access a URL
that is different in the dev/test/production environments. One other person
suggested pulling this URL from a dataset, which is a decent workaround, but
it just seems like there should be a way to do a global variable in report
manager (we are using SRS2000).
"Steven Cheng[MSFT]" wrote:
> Thank you for posting.
> As for the SQL Server reporting service, the report components and controls
> are well encapsulated to provide data centric processing. The underlying
> ASP.NET application pipeline or components are hidden from the report
> builder or developer, so we can not directly access session object in SQL
> RS's report.
> BTW, if you're programmtically request the SSRS report in ASP.NET web
> application (through webservice), you can consider put the session state
> manipulation code in ASP.NET application layer.
> Regards,
> Steven Cheng
> Microsoft Online Community Support
>
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>|||Thanks for your response,
So far I haven't found any other particular storage like the Session state
in normal web application. I also think the suggesion on using database to
store such data is reasonable. And you can consider defining a shared
datasource for such database table so that make the shared data accessing
more reusable among your report projects.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Thursday, February 16, 2012

Can report services use Request.QueryString("varName") for record selection?

I know the parameters are available, but let's say if I've got a variable in a request.QueryString() function I want to use from a page which links to the report, is it possible for the record selection to be filtered by the Request.QueryString() variable?You need to pass the page parameters into as report parameter name / value pairs. We do not provide you the raw page querystring in the report (as the report execution isn't even guaranteed to come from a web page).

Can PL/SQL Acccept an inputted variable?

My "Query" refers to the ability to input variables in a PL/SQL Procedure.

Basically I am able to to input variables using the normal method
Exec procedure(variable1, variable2)

However I want to know if it is possible to code in such a way that the user inputs a variable when requested by the code:
For instance when the procedure is run, I want the DBMS to ask questions and accept the variables I put in to answer them
Sort of like the DBMS_OUTPUT but in reverse.
DMBS_INPUT perhaps??

Example:
SQL> Insert First Name?
SQL>

Thank you for any help with this...This is not possible...normally the database server running far away from the user and can't interact directly with him/her.
For such inputs you must implement a frontend...maybe an ms-access frontend can solve your problem.|||The project is an all Oracle affair, hopefully Oracle correct this problem because it would be handy to have this feature.
Thanks for your help and time Bart71|||If you are allowing your user to input directly through SQL Plus, I would suggest giving them a script to run rather than having them execute a package/procedure. Create a "test.sql" file as follows:

accept a prompt "Input First Name?"
execute my_procedure( '&&a' );

You can add whatever else you need; after that, from SQL Plus they would type:

SQL> @.test.sql

However, HIGHLY suggest having users go through a program interface rather than directly through SQL Plus...

JoeB