...'zyxwvuts' ,'20140428' ,40 ,500
union all
select 'zyxwvuts' ,'20140328' ,30 ,500
union all
select 'zyxwvuts' ,'20140228' ,20 ,500
select * from #dummytable
Need to add 6 months of the last day of the month from the last date for each server
Need to calculate the additional Disk Used...
Hi I have the following data which i have scripted for your convenience:
if object_id('tempdb..#people') is not null drop table #people
create table #people
(
DOB datetime
)
insert into #people values('19630901')
insert into #people values('19640901')
insert into #people...
Hi Larry
This might help:
if object_id('tempdb..#test') is not null drop table #test
create table #test
(
companyID int
,[$_Paid] decimal(10,2)
,[$_Billed] decimal(10,2)
)
insert into #test values(22,181.38,67.88)
insert into #test values(22,5986.34,2279.03)
insert into #test...
Hi Jose
Sorry I did not read your original emal properly. Try the reverse
WHERE
(
ProjectedSubmissionDate is not null and ActualSubmittedDate > to_date('1-Dec-10','dd-MON-yy')
)
or
(
ActualApprovedDate > to_date('1-Dec-10','dd-MON-yy')
)...
Try something like this in the WHERE part of your sql statement
WHERE
(
ProjectedSubmissionDate is null and ActualSubmittedDate < to_date('1-Dec-10','dd-MON-yy')
)
or
(
ActualApprovedDate < to_date('1-Dec-10','dd-MON-yy')
);
regards
Mark
I found a website that answered my question. Compared to sql server it's surprisingly difficult to do a simple thing like select * from a table in a stored procedure. This website has a good explanation for SQL Server Programmers
http://www.akadia.com/services/ora_return_result_set.html...
...table. Something like this.
create or replace "ShowMonthlyReport"
as
begin
execute LoadMonthlyReport -- load the data into a table
select * from MonthlyReport -- display the data
end;
Can you please show how this is done?
Shown below is the stored procedure that loads the data into...
...on how to create a stored procedure that selects the columns from a table.
Like this:
create or replace procedure "P1"
is
begin
select * from T;
end;
/
The code to create Table T is shown:
whenever sqlerror continue
drop table T;
create table T
(
x number(2)
,y varchar2(1)...
I found this on the internet courtesy Wayne S at
http://www.sqlservercentral.com/Forums/Topic845680-338-1.aspx
-- if temp table already exists (failed previous run), drop it
if OBJECT_ID('tempdb..#test') IS NOT NULL DROP TABLE #test
-- simulate the table with the data in it.
-- NOTE how your...
Hi Borislav
Thank you for replying. The split function puts the data in rows, not columns.
E.g Split function puts
Apple,Pear,Kiwifruit,Orange
as
Fruit1
Apple
Pear
Kiwifruit
Orange
I want the data as:
Fruit1 Fruit2 Fruit3 Fruit4
Apple Pear Kiwifruit Orange
i.e the...
...null then drop table #Fruit
create table #Fruit
(
TheFruit varchar(100)
)
insert into #Fruit values ('Apple,Pear,Kiwifruit,Orange')
select * from #Fruit
In my real life data there is 10 items in the TheFruit column, so parsename can't be used, and it would be a nightmare using lots...
Hi
I created the following code to show the code in my stored procedures:
set serveroutput ON
set feedback off
set linesize 200
set ver off
col name format A100 Heading 'List of Stored Procedures'
PROMPT
-- Show the list of stored procedures for the user name
SELECT distinct name
FROM...
Hi Dave
Thank you for replying.
I have a stored procedure that takes a parameter of a fruit name say Kiwifruit. A select statement will filter the records so only kiwifruit will appear.
I would like to change the stored procedure so it can take multi-values of say kiwifruit,pear,orange. These...
Hi
I have a stored procedure that has a multi-value parameter. The parameter called GetFruitNames will have a value such as
'kiwifruit,pear,orange'
In the select statement I have the folowing
select
fruitnames
from fruit
where
fruitnames in (GetFruitNames)
The GetFruitNames...
Hi
I worked out how to do this. Here is my code for future reference
Sub InsertDataTooOracle(Sql As String)
' The following code inserts data into the oracle database
' Can only run 1 sql statement. Don't use commit. Don't use semi-colon at the end of the sql statement
On Error GoTo...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.