Showing posts with label script. Show all posts
Showing posts with label script. Show all posts

Friday, March 30, 2012

Please help me on Script

we are using a data loading tool that periodically changes a database option for several databases in several of the database instances. One of these options is the database Auto-Close option. When this option is enabled, the database will close and generate a very large error log. We already using stored procedure script to monitor all the activity happening. I need to track all the activity happens after this Auto-Close option enables, for this i will have to add some script in my script which monitors daily activity.I am new to Scripts. Please help me, what to write in script.

Regards,
SumitWhy you're using AUTO_CLOSE option on that database?
In order to monitor the activity you can schedule server side trace and refer to http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm link fyi.|||Why you're using AUTO_CLOSE option on that database?
In order to monitor the activity you can schedule server side trace and refer to http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm link fyi.

Hi,
Thanks for your responce, I donot have option to use Auto_close option or not, I just have to find out how can I add this option to our daily report email script. There are lots of changes occur when this option enable mainly it increase the log file size that i need to include my mail report, I am not very much aware of the scrips. pls find some way so that i can add it in scripts running.

Regards,
sumit

please help me i am retarded

ok, I admit this might be a stupid question, but I can't help it...I really don't know the answer to this:

I have a VBScript script that receives a floating point number from a form. I'm using a stored procedure to save this information to my SQL database.
My DB table field is set to "float" and my stored procedure variable is "float" but my vbscript variable is a double...and this combination doesn't work.

I need to know what variable types to use so this combination works and I can successfully store my decimal number in the database. Does anybody know this??

thanks!
~hJ~err,... I'm pretty sure vbscript does do types (as such) everything is a variant. What exactly is the problem you are having? You say "this combination doesn't work" but what do you mean by that?|||First off, the stored procedure fails...doesn't write anything. The other incompatibility I noticed is the decimal part is truncated...like when you go from float to int.

I guess I just need someone to tell me: " use this variable type in vbscript. use this variable type in the stored procedure and use this field type in the db and your decimal number will make it (including decimal) to the db"|||well the script should be treating it as a string so unless you are explicitly converting it into something inside your script you should have any truncation problems...

have you tried using a Decimal instead of a double?

Monday, March 26, 2012

please help -- 512 error when generating replication script

Hi,

I'm trying to script out my replication objects using
the 'Generate SQL Script...' option under Tools >
Replication in Enterprise Manager. Under 'Replication
components to script', I check 'Distributor properties'
and 'Publications in these databases:' and choose all
databases listed. I get a 512 error:

Error 512: Subquery returned more than 1 value. This is
not permitted when the subquery follows =, !=, <, <=, >,
>= or when the subquery is used as an expression.

The server is 2000 sp2, and the Ent Mgr client is 2000.
Using the same Ent Mgr client to script replication
objects in other 2000 sp2 servers, I don't receive any
errors.

I appreciate any help you can provide.

Thanks,
LB
.Try scripting individually.

Friday, March 23, 2012

Please help

Hi,
How can i use a java script function in sql reporting services.
I have a textbox - which i want to make as a hyperlink and when the user
clicks on it - it has to open another report or say url in another browser.
i am usin
<hyperlink>="javascript:window.open('http://www.google.com',_blank)"</hyperlink>
but it doesnt work . Can you please help me how to do this ?
Thanks
RPDon't be doing this by hand. Use RS capabilities. For the textbox do a right
mouse click, properties, advanced, navigation, jump to URL.
Then put in this for a report with parameters:
Here is an example of a Jump to URL link I use. This causes Excel to come up
with the data in a separate window:
="javascript:void(window.open('" & Globals!ReportServerUrl &
"?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
"&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
For a website put in this:
="javascript:void(window.open('http://www.google.com','_blank'))"
Note that you have to have SP1 or SP2 installed. This functionality was
added in SP1.
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"RP" <RP@.discussions.microsoft.com> wrote in message
news:CD453D6F-085D-4EFB-94B1-D43A6D6D677A@.microsoft.com...
> Hi,
> How can i use a java script function in sql reporting services.
> I have a textbox - which i want to make as a hyperlink and when the user
> clicks on it - it has to open another report or say url in another
> browser.
> i am using
> <hyperlink>="javascript:window.open('http://www.google.com',_blank)"</hyperlink>
> but it doesnt work . Can you please help me how to do this ?
> Thanks
> RP|||Bruce,
I didnt do this by hand. I rt clicked on the textbox, properties - advanced
- navigation
jump to url.
The funny thing is :
if i give the
="javascript:void(window.open('http://www.google.com','_blank'))"
and click on the link, i get 'page cannont be displayed' with
"javascript:void(window.open('http://www.google.com','_blank'))"
in the url.
click on that - will open a new window.
2. if i access the report from localhost\reports\reportname - this is the
situation
but if i access the report from localhost\reportserver\reportname - it works
absolutely fine.
what is the diff. between reports and reportserver ?
Thanks
"Bruce L-C [MVP]" wrote:
> Don't be doing this by hand. Use RS capabilities. For the textbox do a right
> mouse click, properties, advanced, navigation, jump to URL.
> Then put in this for a report with parameters:
> Here is an example of a Jump to URL link I use. This causes Excel to come up
> with the data in a separate window:
> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
> For a website put in this:
> ="javascript:void(window.open('http://www.google.com','_blank'))"
> Note that you have to have SP1 or SP2 installed. This functionality was
> added in SP1.
>
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
>
> "RP" <RP@.discussions.microsoft.com> wrote in message
> news:CD453D6F-085D-4EFB-94B1-D43A6D6D677A@.microsoft.com...
> > Hi,
> > How can i use a java script function in sql reporting services.
> > I have a textbox - which i want to make as a hyperlink and when the user
> > clicks on it - it has to open another report or say url in another
> > browser.
> > i am using
> > <hyperlink>="javascript:window.open('http://www.google.com',_blank)"</hyperlink>
> > but it doesnt work . Can you please help me how to do this ?
> > Thanks
> > RP
>
>|||I have a little test report that has what looks exactly the same to me.
= "javascript:void(window.open('http://www.google.com','_blank'))"
It works regardless of how the report is pulled up (I did it both ways:
reports and reportserver).
Don't know what to tell you, it works for me (I am on SP2).
Bruce Loehle-Conger
MVP SQL Server Reporting Services
"RP" <RP@.discussions.microsoft.com> wrote in message
news:893EB9DB-C59F-4FBD-9E0F-DDB2B17E3FB7@.microsoft.com...
> Bruce,
> I didnt do this by hand. I rt clicked on the textbox, properties -
> advanced
> - navigation
> jump to url.
> The funny thing is :
> if i give the
> ="javascript:void(window.open('http://www.google.com','_blank'))"
> and click on the link, i get 'page cannont be displayed' with
> "javascript:void(window.open('http://www.google.com','_blank'))"
> in the url.
> click on that - will open a new window.
> 2. if i access the report from localhost\reports\reportname - this is the
> situation
> but if i access the report from localhost\reportserver\reportname - it
> works
> absolutely fine.
> what is the diff. between reports and reportserver ?
> Thanks
> "Bruce L-C [MVP]" wrote:
>> Don't be doing this by hand. Use RS capabilities. For the textbox do a
>> right
>> mouse click, properties, advanced, navigation, jump to URL.
>> Then put in this for a report with parameters:
>> Here is an example of a Jump to URL link I use. This causes Excel to come
>> up
>> with the data in a separate window:
>> ="javascript:void(window.open('" & Globals!ReportServerUrl &
>> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
>> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
>> For a website put in this:
>> ="javascript:void(window.open('http://www.google.com','_blank'))"
>> Note that you have to have SP1 or SP2 installed. This functionality was
>> added in SP1.
>>
>>
>> --
>> Bruce Loehle-Conger
>> MVP SQL Server Reporting Services
>>
>> "RP" <RP@.discussions.microsoft.com> wrote in message
>> news:CD453D6F-085D-4EFB-94B1-D43A6D6D677A@.microsoft.com...
>> > Hi,
>> > How can i use a java script function in sql reporting services.
>> > I have a textbox - which i want to make as a hyperlink and when the
>> > user
>> > clicks on it - it has to open another report or say url in another
>> > browser.
>> > i am using
>> > <hyperlink>="javascript:window.open('http://www.google.com',_blank)"</hyperlink>
>> > but it doesnt work . Can you please help me how to do this ?
>> > Thanks
>> > RP
>>|||Bruce,
Can you pls post the code of your sample report once. my javascript looks
exactly the same. unfortunately it works if i say reportserver instead of
report. is there anyother way to check?
Thanks
RP
"Bruce L-C [MVP]" wrote:
> I have a little test report that has what looks exactly the same to me.
> = "javascript:void(window.open('http://www.google.com','_blank'))"
> It works regardless of how the report is pulled up (I did it both ways:
> reports and reportserver).
> Don't know what to tell you, it works for me (I am on SP2).
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "RP" <RP@.discussions.microsoft.com> wrote in message
> news:893EB9DB-C59F-4FBD-9E0F-DDB2B17E3FB7@.microsoft.com...
> > Bruce,
> > I didnt do this by hand. I rt clicked on the textbox, properties -
> > advanced
> > - navigation
> > jump to url.
> > The funny thing is :
> > if i give the
> > ="javascript:void(window.open('http://www.google.com','_blank'))"
> > and click on the link, i get 'page cannont be displayed' with
> > "javascript:void(window.open('http://www.google.com','_blank'))"
> > in the url.
> > click on that - will open a new window.
> >
> > 2. if i access the report from localhost\reports\reportname - this is the
> > situation
> > but if i access the report from localhost\reportserver\reportname - it
> > works
> > absolutely fine.
> >
> > what is the diff. between reports and reportserver ?
> > Thanks
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> Don't be doing this by hand. Use RS capabilities. For the textbox do a
> >> right
> >> mouse click, properties, advanced, navigation, jump to URL.
> >>
> >> Then put in this for a report with parameters:
> >> Here is an example of a Jump to URL link I use. This causes Excel to come
> >> up
> >> with the data in a separate window:
> >>
> >> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> >> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> >> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
> >>
> >> For a website put in this:
> >>
> >> ="javascript:void(window.open('http://www.google.com','_blank'))"
> >>
> >> Note that you have to have SP1 or SP2 installed. This functionality was
> >> added in SP1.
> >>
> >>
> >>
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >>
> >>
> >> "RP" <RP@.discussions.microsoft.com> wrote in message
> >> news:CD453D6F-085D-4EFB-94B1-D43A6D6D677A@.microsoft.com...
> >> > Hi,
> >> > How can i use a java script function in sql reporting services.
> >> > I have a textbox - which i want to make as a hyperlink and when the
> >> > user
> >> > clicks on it - it has to open another report or say url in another
> >> > browser.
> >> > i am using
> >> > <hyperlink>="javascript:window.open('http://www.google.com',_blank)"</hyperlink>
> >> > but it doesnt work . Can you please help me how to do this ?
> >> > Thanks
> >> > RP
> >>
> >>
> >>
>
>|||oh b.t.w,
even i have SP2
"Bruce L-C [MVP]" wrote:
> I have a little test report that has what looks exactly the same to me.
> = "javascript:void(window.open('http://www.google.com','_blank'))"
> It works regardless of how the report is pulled up (I did it both ways:
> reports and reportserver).
> Don't know what to tell you, it works for me (I am on SP2).
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "RP" <RP@.discussions.microsoft.com> wrote in message
> news:893EB9DB-C59F-4FBD-9E0F-DDB2B17E3FB7@.microsoft.com...
> > Bruce,
> > I didnt do this by hand. I rt clicked on the textbox, properties -
> > advanced
> > - navigation
> > jump to url.
> > The funny thing is :
> > if i give the
> > ="javascript:void(window.open('http://www.google.com','_blank'))"
> > and click on the link, i get 'page cannont be displayed' with
> > "javascript:void(window.open('http://www.google.com','_blank'))"
> > in the url.
> > click on that - will open a new window.
> >
> > 2. if i access the report from localhost\reports\reportname - this is the
> > situation
> > but if i access the report from localhost\reportserver\reportname - it
> > works
> > absolutely fine.
> >
> > what is the diff. between reports and reportserver ?
> > Thanks
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> Don't be doing this by hand. Use RS capabilities. For the textbox do a
> >> right
> >> mouse click, properties, advanced, navigation, jump to URL.
> >>
> >> Then put in this for a report with parameters:
> >> Here is an example of a Jump to URL link I use. This causes Excel to come
> >> up
> >> with the data in a separate window:
> >>
> >> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> >> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> >> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
> >>
> >> For a website put in this:
> >>
> >> ="javascript:void(window.open('http://www.google.com','_blank'))"
> >>
> >> Note that you have to have SP1 or SP2 installed. This functionality was
> >> added in SP1.
> >>
> >>
> >>
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >>
> >>
> >> "RP" <RP@.discussions.microsoft.com> wrote in message
> >> news:CD453D6F-085D-4EFB-94B1-D43A6D6D677A@.microsoft.com...
> >> > Hi,
> >> > How can i use a java script function in sql reporting services.
> >> > I have a textbox - which i want to make as a hyperlink and when the
> >> > user
> >> > clicks on it - it has to open another report or say url in another
> >> > browser.
> >> > i am using
> >> > <hyperlink>="javascript:window.open('http://www.google.com',_blank)"</hyperlink>
> >> > but it doesnt work . Can you please help me how to do this ?
> >> > Thanks
> >> > RP
> >>
> >>
> >>
>
>|||bruce -
got it - figured it myself.
"Bruce L-C [MVP]" wrote:
> I have a little test report that has what looks exactly the same to me.
> = "javascript:void(window.open('http://www.google.com','_blank'))"
> It works regardless of how the report is pulled up (I did it both ways:
> reports and reportserver).
> Don't know what to tell you, it works for me (I am on SP2).
>
> --
> Bruce Loehle-Conger
> MVP SQL Server Reporting Services
> "RP" <RP@.discussions.microsoft.com> wrote in message
> news:893EB9DB-C59F-4FBD-9E0F-DDB2B17E3FB7@.microsoft.com...
> > Bruce,
> > I didnt do this by hand. I rt clicked on the textbox, properties -
> > advanced
> > - navigation
> > jump to url.
> > The funny thing is :
> > if i give the
> > ="javascript:void(window.open('http://www.google.com','_blank'))"
> > and click on the link, i get 'page cannont be displayed' with
> > "javascript:void(window.open('http://www.google.com','_blank'))"
> > in the url.
> > click on that - will open a new window.
> >
> > 2. if i access the report from localhost\reports\reportname - this is the
> > situation
> > but if i access the report from localhost\reportserver\reportname - it
> > works
> > absolutely fine.
> >
> > what is the diff. between reports and reportserver ?
> > Thanks
> >
> > "Bruce L-C [MVP]" wrote:
> >
> >> Don't be doing this by hand. Use RS capabilities. For the textbox do a
> >> right
> >> mouse click, properties, advanced, navigation, jump to URL.
> >>
> >> Then put in this for a report with parameters:
> >> Here is an example of a Jump to URL link I use. This causes Excel to come
> >> up
> >> with the data in a separate window:
> >>
> >> ="javascript:void(window.open('" & Globals!ReportServerUrl &
> >> "?/SomeFolder/SomeReport&ParamName=" & Parameters!ParamName.Value &
> >> "&rs:Format=CSV&rc:Encoding=ASCII','_blank'))"
> >>
> >> For a website put in this:
> >>
> >> ="javascript:void(window.open('http://www.google.com','_blank'))"
> >>
> >> Note that you have to have SP1 or SP2 installed. This functionality was
> >> added in SP1.
> >>
> >>
> >>
> >>
> >> --
> >> Bruce Loehle-Conger
> >> MVP SQL Server Reporting Services
> >>
> >>
> >>
> >> "RP" <RP@.discussions.microsoft.com> wrote in message
> >> news:CD453D6F-085D-4EFB-94B1-D43A6D6D677A@.microsoft.com...
> >> > Hi,
> >> > How can i use a java script function in sql reporting services.
> >> > I have a textbox - which i want to make as a hyperlink and when the
> >> > user
> >> > clicks on it - it has to open another report or say url in another
> >> > browser.
> >> > i am using
> >> > <hyperlink>="javascript:window.open('http://www.google.com',_blank)"</hyperlink>
> >> > but it doesnt work . Can you please help me how to do this ?
> >> > Thanks
> >> > RP
> >>
> >>
> >>
>
>

Friday, March 9, 2012

PL/SQL cursors and index tables

I'm trying to write a script that stores values in an index table using a cursor. My syntax looks write but i'm getting the following message:

Please enter the number of rows to be selected: 5
last_name_tbl last_name_tbl_type;
*
ERROR at line 9:
ORA-06550: line 43, column 27:
PL/SQL: ORA-00923: FROM keyword not found where expected
ORA-06550: line 43, column 4:
PL/SQL: SQL Statement ignoredOriginally posted by bbk
I'm trying to write a script that stores values in an index table using a cursor. My syntax looks write but i'm getting the following message:

Please enter the number of rows to be selected: 5
last_name_tbl last_name_tbl_type;
*
ERROR at line 9:
ORA-06550: line 43, column 27:
PL/SQL: ORA-00923: FROM keyword not found where expected
ORA-06550: line 43, column 4:
PL/SQL: SQL Statement ignored
Show your code

pl/sql

I am doing pl/sql first time. I dont know that when i have script to run , i wrote that in simple note pad and now i am not able to run that procedure. please help me that where to write script and how to run it sucessfully.Originally posted by sam70
I am doing pl/sql first time. I dont know that when i have script to run , i wrote that in simple note pad and now i am not able to run that procedure. please help me that where to write script and how to run it sucessfully.

Either write it in SQL*PLUS, or open SQL*PLUS and do @.filename to run it.

Saturday, February 25, 2012

Pivot Tables using SQL

Hi,

I need some help in writing an SQL script that would convert the results into a pivot table in Toad. I am extracting data from an Oracle database.

I need to have each post date as a column header from the SQL below:

select ca.ACCOUNT_ID, cd.CLIENT_NAME, od.post_date, sum(oi.PRICE)
from order_details od, client_details cd, client_account ca, order_items oi
where od.DELETED = 0
and od.SERVICE_ID = 300009
and cd.CLIENT_ID = od.CLIENT_ID
and cd.CLIENT_ID = ca.CLIENT_ID
and od.ORDER_ID = oi.ORDER_ID
and od.INVOICE_DATE = oi.IDATE
group by ca.ACCOUNT_ID, cd.CLIENT_NAME, od.post_date

Thanks for any helpCheck here:

http://asktom.oracle.com/pls/ask/f?p=4950:8:16663421538065257584::NO::F4950_P8_DISP LAYID,F4950_P8_CRITERIA:7086279412131,
http://asktom.oracle.com/pls/ask/f?p=4950:8:16663421538065257584::NO::F4950_P8_DISP LAYID,F4950_P8_CRITERIA:419593546543,
http://asktom.oracle.com/pls/ask/f?p=4950:8:16663421538065257584::NO::F4950_P8_DISP LAYID,F4950_P8_CRITERIA:766825833740,
http://asktom.oracle.com/pls/ask/f?p=4950:8:16663421538065257584::NO::F4950_P8_DISP LAYID,F4950_P8_CRITERIA:925229353765,
:eek:|||Thanks...will have a look|||Also, this question has been asked and answered many times on many forums, just search for 'PIVOT TABLE' or 'CROSS TAB QUERY'. :D