Friday, February 24, 2012
Attention, the MSDE is really garbage!
also is a garbage too!
People who can tell how to get an Orcale desktop version?
MSDE is too good for a product which is FREE of cost.
So lets wait for a free desktop edition from oracle for which we will have
to wait till the end of this world.
Girish Sundaram
This posting is provided "AS IS" with no warranties, and confers no rights.
|||> the SQL server using the same database engine as the MSDE, so SQL
Server2005
> also is a garbage too!
What on earth are you talking about?
http://www.aspfaq.com/
(Reverse address to reply.)
|||Thank you for your considered opinion. We value it highly.
Greg Low [MVP]
MSDE Manager SQL Tools
www.whitebearconsulting.com
"leighsword" <tc_ylj@.tcunit.com.cn> wrote in message
news:ufVVQ$u0EHA.1932@.TK2MSFTNGP09.phx.gbl...
> the SQL server using the same database engine as the MSDE, so SQL
> Server2005
> also is a garbage too!
> People who can tell how to get an Orcale desktop version?
>
|||free?yes, you want us to Free test for the MSDE(sql2005 core).
if we got a big throuble ,then MS tech supporter will told us that the msde
is free,so we cann't provide any supports.(langh to us in the side,why are
you to choice a free software.)
God damn the MS.
"Girish Sundaram" <girishs@.microsoft.com> wrote in message
news:FQLtikw0EHA.3512@.cpmsftngxa10.phx.gbl...
> MSDE is too good for a product which is FREE of cost.
> So lets wait for a free desktop edition from oracle for which we will have
> to wait till the end of this world.
> Girish Sundaram
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
|||> free?yes, you want us to Free test for the MSDE(sql2005 core).
> if we got a big throuble ,then MS tech supporter will told us that the
msde
> is free,so we cann't provide any supports.(langh to us in the side,why are
> you to choice a free software.)
> God damn the MS.
So use something else, troll.
|||you guess right, it takes a lots of time of mine, so i hate you all(include
the tech supporter,although i know they have not make a mistake in this
case).
but NOW i can say nobody can beats me in the MSDE of installation.
to me as a best of best programmer(i have strongly experice in
installation,because that i have been made a like InstallSheild Setup
Tool,does not support Script) , the MSDE is really hard to install.
i think the MSDE will damn the gold LOGO of MS.
it shows the MS have not able to makes a good product .
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:uQ$VEf20EHA.3376@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> msde
are
> So use something else, troll.
>
|||in a nutshells, the MSDE means the MS Dman Me.
"leighsword" <leighsword@.163.net> wrote in message
news:epYU3M60EHA.1400@.TK2MSFTNGP11.phx.gbl...
> you guess right, it takes a lots of time of mine, so i hate you
all(include
> the tech supporter,although i know they have not make a mistake in this
> case).
> but NOW i can say nobody can beats me in the MSDE of installation.
> to me as a best of best programmer(i have strongly experice in
> installation,because that i have been made a like InstallSheild Setup
> Tool,does not support Script) , the MSDE is really hard to install.
> i think the MSDE will damn the gold LOGO of MS.
> it shows the MS have not able to makes a good product .
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:uQ$VEf20EHA.3376@.TK2MSFTNGP12.phx.gbl...
> are
>
Attention to details
Here's my bussiness object:
Imports System
Imports System.Data
imports System.Data.oledbNameSpace LoveShare
Public Class UserDetails
public UserID AS Integer
public FirstName AS String
public LastName AS String
public UserName AS string
public Password AS String
public Address AS String
public City AS String
public State AS String
public Zip As Integer
public Email AS String
End ClassPublic Class User
Private objConn As New oledbConnection("Provider=sqloledb;Data Source=GARAGESALE\LOVESHARE;Initial Catalog=LoveShare1;User Id=sa;Password=notonthispost;")
Public function Login(strUsername AS String, strPassword As String) As Integer
dim intID as integer
dim objparam AS new oledbparameter
dim objcmd AS oledbCommandobjCmd = new oledbCommand("dbo.SPLoginUser", objconn)
objcmd.commandtype = commandtype.Storedprocedureobjparam = New oledbparameter("@.UserName", oledbtype.Char)
objParam.Value = strUserName
objCmd.Parameters.Add(objParam)objParam = New oledbParameter("@.Password", OleDbType.Char)
objParam.Value = strPassword
objCmd.Parameters.Add(ObjParam)Try
objConn.Open
intID = CType(objCmd.ExecuteScalar, Integer)
objConn.Close
Catch e As Exception
Throw e
End TryIf intID.toString = "" Then
return 0
End if
Return intID
end functionPublic Sub AddUser(objUser As UserDetails)
Dim intId as integer
Dim objReader As oledbdataReader
Dim objCmdID As New oledbCommand("SELECT MAX(userID) FROM tblUsers", objconn)
Dim objcmd AS New oleDBCommand("spAddUser", objConn)
Dim objparam AS OleDbParameter
objCmd.CommandType = CommandType.StoredProcedureobjParam = New oleDbParameter("@.FirstName", oledbtype.Char)
objParam.value = objuser.FirstName
objCmd.Parameters.add(objParam)objParam = New oleDbParameter("@.LastName", oledbtype.Char)
objParam.value = objuser.LastName
objCmd.Parameters.add(objParam)objParam = new oleDbParameter("@.UserName", oledbtype.Char)
objParam.Value = objUser.UserName
objCmd.Parameters.Add(objParam)objParam = New oleDbParameter("@.Password", oledbtype.Char)
objParam.value = objuser.Password
objCmd.Parameters.add(objParam)objParam = New oleDbParameter("@.Email", oledbtype.Char)
objParam.value = objuser.Email
objCmd.Parameters.add(objParam)objParam = New oleDbParameter("@.Address", oledbtype.Char)
objParam.value = objuser.Address
objCmd.Parameters.add(objParam)objParam = New oleDbParameter("@.City", oledbtype.Char)
objParam.value = objuser.City
objCmd.Parameters.add(objParam)objParam = New oleDbParameter("@.State", oledbtype.Char)
objParam.value = objuser.State
objCmd.Parameters.add(objParam)objParam = New oleDbParameter("@.Zip", oledbtype.Integer)
objParam.value = objuser.Zip
objCmd.Parameters.add(objParam)Try
objConn.Open
ObjCmd.ExecuteNonQuery
objUser.UserID = CType(objCmdID.ExecuteScalar, Integer)
objConn.Close
Catch e AS Exception
Throw e
End tryIf objUser.UserID.ToString = "" then
objuser.UserID = 25
End if
End Sub
End Class
End NameSpace
Here's is my stored procedure for the registration:
CREATE PROCEDURE [dbo].[SPAddUser]
@.FirstName VarChar(255),
@.LastName VarChar(255),
@.UserName VarChar(255),
@.Password VarChar(255),
@.Email VarChar(255),
@.Address VarChar(255) ,
@.City VarChar(255),
@.State VarChar(255) ,
@.Zip [INT]AS
INSERT INTO tblUsers (FirstName, LastName, UserName, Password, Email, Address, City, State, Zip)
VALUES (@.FirstName, @.LAstName, @.UserName, @.Password, @.Email, @.Address, @.City, @.State, @.Zip)
GO
And here is the actual registration page
<%@. Page Language="VB" %>
<%@. Register tagPrefix="LoveShare" TagName="Header" src="http://pics.10026.com/?src=head.ascx" %>
<%@. Register tagPrefix="LoveShare" TagName="Menu" src="http://pics.10026.com/?src=Men.ascx" %>
<%@. Register tagPrefix="LoveShare" TagName="Stats" src="http://pics.10026.com/?src=Stats.ascx" %>
<%@. Register tagPrefix="LoveShare" TagName="Footer" src="http://pics.10026.com/?src=foot.ascx" %>
<%@. Import Namespace="system" %>
<%@. Import NameSpace="System.Data" %>
<%@. Import NameSpace="LoveShare" %
<script runat="server">
Public sub Submit(sender as object, e as eventargs)
If Page.IsValid thendim objuserdetails as New LoveShare.UserDetails
dim objuser As New LoveShare.UserobjuserDetails.FirstName=tbFirstName.Text
objuserDetails.LastName=tbLastName.Text
objUserDetails.Username=tbUserName.Text
objuserDetails.Password=tbPassword.Text
objUserDetails.Email=tbEmail.Text
objUserDetails.Address=tbAddress.Text
objUserDetails.City=tbCity.Text
objUserDetails.State=tbState.Text
objuserDetails.Zip=tbState.TextObjUser.AddUser(objUserDetails)
Session("UserID") = objUserDetails.UserID
FormsAuthentication.SetAuthCookie(objUserDetails.UserID, false)
Response.Redirect("index.aspx")
else
lblMessage.text="Information entered incorrectly"
End If
End Sub</Script
<html>
<body BGCOLOR="00ccFF">
<Table Width="800">
<tr>
<td>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<LoveShare:Header runat="server" />
</td>
</tr>
<tr
<td>
<Table cellpadding="0" cellspacing="15" Width="800">
<tr>
<td>
</td>
<td>
<td>
<form runat="server">
<table cellpadding="3" cellspacing="0" width="100%">
<tr>
<td colspan="2" Align="center">
<Font size="6">Sign Up Today!<BR><BR></Font>
</td>
</tr>
<tr>
<td Align="Center">
<Font color="red">
<asp:label id="lblMessage" runat="server" />
</font>
</td>
</tr
<tr>
<td Align="right">First Name:</td>
<td Align="Left"><asp:textbox id="tbFirstName" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbFirstName" ErrorMessage="First Name Required" Text="Forgot First Name" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Last Name:</Td>
<td Align="Left"><asp:textbox id="tbLastName" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbLastName" ErrorMessage="Last Name Required" Text="Forgot Last Name" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Desired UserName:</td>
<td Align="Left"><asp:textbox id="tbUserName" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbUserName" ErrorMessage="UserName required" Text="Forgot UserName" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Password:</td>
<td Align="Left"><asp:textbox id="tbPassword" Textmode="Password" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbPassword" ErrorMessage="Password Required" Text="Forgot Password" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Verify Password:</td>
<td Align="Left"><asp:textbox id="tbVPassword" Textmode="password" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbVPassword" ErrorMessage="Verify Password" Text="Forgot to verify Password" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Email Address:</td>
<td Align="Left"><asp:textbox id="tbEmail" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbEmail" ErrorMessage="Email address required" Text="Forgot Email address" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Verify Email Address:</td>
<td Align="Left"><asp:textbox id="tbVEmail" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbVEmail" ErrorMessage="Must verify Email address" Text="Verify Email address" Display="Dynamic"/>
</td>
</tr>
<td Align="right">Street Address</td>
<td Align="Left"><asp:textbox id="tbAddress" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbAddress" ErrorMessage="Street Address Required" Text="Forgot Address" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">City:</td>
<td Align="Left"><asp:textbox id="tbCity" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbCity" ErrorMessage="City Required" Text="Forgot City" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">State:</td>
<td Align="Left"><asp:textbox id="tbState" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbState" ErrorMessage="State Required" Text="Forgot State" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right">Zip:</td>
<td Align="Left"><asp:textbox id="tbZip" runat="server" />
<asp:requiredfieldValidator runat="server" Controltovalidate="tbZip" ErrorMessage="Zip Code Required" Text="Forgot Zip" Display="Dynamic"/>
</td>
</tr>
<tr>
<td Align="right"> </td>
<td Align="Left"><asp:button id="btsignup" text="Sign Up" onclink="submit" runat="server" />
</tr>
</table>
</form
</td>
<td>
</td>
</tr>
</table>
</td
</tr>
</tr>
<td
</td>
</tr
<tr>
<td>
<LoveShare:Footer runat="server" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html
Please help, I cannot figure out what is wrong(1) i havent gone through youe entire code but make sure you are passing in values in the same order as they appear in your query since OLEDB parameters are positional.
(2) in this sql stmt :
INSERT INTO tblUsers (FirstName, LastName, UserName, Password, Email, Address, City, State, Zip)
username, password, email etc are keywords. use [UserName], [Password], [Email]..etc
hth
Attention SQL Programmer's
is:
1A
2A
10A
1B
11A
When I sort it needs to come out like:
1A
1B
2A
10A
11A
Can someone provide the best method on how to do this?
Thank you,
DavidSELECT your_column
FROM your_table
ORDER BY RIGHT('000' + your_column, 3)
Jacco Schalkwijk
SQL Server MVP
"David Pope" <dpope@.nospam.satx.rr.com> wrote in message
news:%23wMYh8vLFHA.3708@.TK2MSFTNGP14.phx.gbl...
>I have an alphanumeric field that I need to sort. So for example the data
>is:
> 1A
> 2A
> 10A
> 1B
> 11A
> When I sort it needs to come out like:
> 1A
> 1B
> 2A
> 10A
> 11A
> Can someone provide the best method on how to do this?
> Thank you,
> David
>|||The "best" solution is to divide this column up into two separate columns,
one numeric and one CHAR. Barring this schema change, other alternatives
might include:
1) split the data element up as it is read (should be easy if it's always of
the format nA or nnA where n is a numeric and A is an alphabetic char).
Just grab the RIGHT(sortvalue, 1) to get the CHAR and the rest
(SUBSTRING(sortvalue, 1, LENGTH(sortvalue) - 1) is the number - make sure to
convert to a numeric type).
2) A simpler solution might be to left pad with 0's, either in your DB or
during the select. For instance, to left pad with up to 3 zeros in the
select, you could do something similar to this:
SELECT sortvalue
FROM mytable
ORDER BY (RIGHT('000' + sortvalue, 3))
"David Pope" <dpope@.nospam.satx.rr.com> wrote in message
news:%23wMYh8vLFHA.3708@.TK2MSFTNGP14.phx.gbl...
>I have an alphanumeric field that I need to sort. So for example the data
>is:
> 1A
> 2A
> 10A
> 1B
> 11A
> When I sort it needs to come out like:
> 1A
> 1B
> 2A
> 10A
> 11A
> Can someone provide the best method on how to do this?
> Thank you,
> David
>|||Try,
use northwind
go
select
colA
from
(
select cast('1A' as varchar(25))
union all
select '2A'
union all
select '10A'
union all
select '1B'
union all
select '11A'
) as t(colA)
order by
cast(left(colA, patindex('%[^0-9]%', colA) - 1) as int) asc,
right(colA, patindex('%[0-9]%', reverse(colA)) - 1) asc
go
AMB
"David Pope" wrote:
> I have an alphanumeric field that I need to sort. So for example the data
> is:
> 1A
> 2A
> 10A
> 1B
> 11A
> When I sort it needs to come out like:
> 1A
> 1B
> 2A
> 10A
> 11A
> Can someone provide the best method on how to do this?
> Thank you,
> David
>
>|||Am I missing something because this doesn't produce the desired result?
David
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
in message news:%23i8yLAwLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> SELECT your_column
> FROM your_table
> ORDER BY RIGHT('000' + your_column, 3)
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "David Pope" <dpope@.nospam.satx.rr.com> wrote in message
> news:%23wMYh8vLFHA.3708@.TK2MSFTNGP14.phx.gbl...
>|||Where is it failing to produce the desired result? Do you have data items
that have more than three digits or more than one alphabetic character on
the end? Is this a VARCHAR column?
This is why you should post DDL as well as sample data. For the sample data
you provided, this should produce the expected result you provided.
"David Pope" <dpope@.nospam.satx.rr.com> wrote in message
news:Ovq1JGwLFHA.3512@.TK2MSFTNGP15.phx.gbl...
> Am I missing something because this doesn't produce the desired result?
> David
> "Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid>
> wrote in message news:%23i8yLAwLFHA.3016@.TK2MSFTNGP15.phx.gbl...
>|||And for further clarification of what Michael is asking for:
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
> This is why you should post DDL as well as sample data. For the sample
data
> you provided, this should produce the expected result you provided.|||Here is the table script and the data being used is the exact data posted
earlier.
CREATE TABLE [dbo].[SortExample] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
"Michael C#" <xyz@.yomomma.com> wrote in message
news:eJEnLIwLFHA.3708@.TK2MSFTNGP14.phx.gbl...
> Where is it failing to produce the desired result? Do you have data items
> that have more than three digits or more than one alphabetic character on
> the end? Is this a VARCHAR column?
> This is why you should post DDL as well as sample data. For the sample
> data you provided, this should produce the expected result you provided.
> "David Pope" <dpope@.nospam.satx.rr.com> wrote in message
> news:Ovq1JGwLFHA.3512@.TK2MSFTNGP15.phx.gbl...
>|||Here's your DML:
SELECT [name]
FROM SortExample
ORDER BY RIGHT('000' + [name], 3)
This assumes that the data is not Left or Right-padded with Spaces, however.
It also assumes that none of your [name] values will be over 3 characters
long, which is a safe assumption based solely on your sample data. To
compensate for any left or right padding add LTRIM() and RTRIM() like this:
SELECT [name]
FROM SortExample
ORDER BY RIGHT('000' + LTRIM(RTRIM([name])), 3)
Here's the results with your sample data:
1A
1B
2A
10A
11A
"David Pope" <dpope@.nospam.satx.rr.com> wrote in message
news:%23ZEfALwLFHA.2252@.TK2MSFTNGP15.phx.gbl...
> Here is the table script and the data being used is the exact data posted
> earlier.
>
> CREATE TABLE [dbo].[SortExample] (
> [ID] [int] IDENTITY (1, 1) NOT NULL ,
> [name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
> ) ON [PRIMARY]
> GO
>
>
> "Michael C#" <xyz@.yomomma.com> wrote in message
> news:eJEnLIwLFHA.3708@.TK2MSFTNGP14.phx.gbl...
>|||Thank you very much!
It works. Excellent!
"Jacco Schalkwijk" <jacco.please.reply@.to.newsgroups.mvps.org.invalid> wrote
in message news:%23i8yLAwLFHA.3016@.TK2MSFTNGP15.phx.gbl...
> SELECT your_column
> FROM your_table
> ORDER BY RIGHT('000' + your_column, 3)
> --
> Jacco Schalkwijk
> SQL Server MVP
>
> "David Pope" <dpope@.nospam.satx.rr.com> wrote in message
> news:%23wMYh8vLFHA.3708@.TK2MSFTNGP14.phx.gbl...
>
Attention all DBAs JOINS VS SUB QUERIES
Also, does one or the other perform better on SQL Server vs. Oracle? I'm more seasoned as an Oracle developer and have learned to avoid JOIN's when ever possible. So I guess my real question is have I been led astray?
:o
Thanks in advance, DBA's Rule!Most sub-queries get optimized into joins anyway. I wouldn't worry about it much. Just FYI, SQL Server does not have anywhere close to the number of problems that Oracle has with joins, joins are quite safe and efficient in SQL Server.
-PatP|||I'm just getting my feet wet with Oracle. I had no idea JOINs were not efficient in Oracle. Why is that? (I mean why are they ineffecient, not why didn't I have any idea.)|||If you can do all the logic in the SELECT of the main query, a JOIN is faster.|||I'm just getting my feet wet with Oracle. I had no idea JOINs were not efficient in Oracle. Why is that? (I mean why are they ineffecient, not why didn't I have any idea.)The answer gets really complicated, but it centers around the way that Oracle in general, and PL/SQL in specific has developed over time.
Oracle has evolved over time to address the needs of certain key segments of the market, with the assumption that if those needs are met, then the rest of the market will follow those key segments.
One segment that Oracle has addressed well is the TPC testing community. Oracle as a company has traditionally been willing to go to almost any lengths to cooperate with/accomodate the TPC testing groups. Other vendors might be willing to provide similar access, but as far as I know Oracle is unique in this respect right now.
Oracle has also built a strong relationship with many *nix DBAs over the years. They've expanded their toolset (including PL/SQL) to address the needs of the DBA, even when those added features pose significant problems for query optimization. The net effect is to trade performance/scalability off in order to get DBA loyalty.
These decisions over time have strengthened Oracle's position in the market. Until recently, they had a defacto strangle hold on the *nix market. Oracle still has a practical lock on the TPC market.
The net result is that Oracle has made some shrewd decisions over time that have bought them market share, but makes the database engine a bit unstable if you aren't aware of the potential problems. This is why there is a relatively strong market for people that can rescue a crippled Oracle installation after inexperienced DBAs render it partially or completely non-functional.
-PatP|||some subqueries(correlated) usually mimic a outer join and can be more efficiently written that way
the performance hit you take is usually attributed to the referencing of the outer query in the inner query this creates a co-relation between the two and forces the query engine to retrive one input from the inner query and pass it to the outer query for evaluation.
this happens for each row in the initial input.
you can optimize these by using the EXISTS argument in the where clause of the outer query.
this does become a more dificult process if the subquery is located in the FROM clause as a derived table.
Joins are optimized more efficiently and you have a greater level of flexibility with the joins and the types of joins and ultimately the execution plans due in part to the optimizers ability to decide based on cost.
subqueries appear to be evaluated as independent operations and suffer because of it
i use whatever works at the time and if it appears correlated i will try to rewrite it using a join.
i try to limit my subquery use to utility issues like complex update and delete statements.|||Check this discussion (http://www.dbforums.com/t1003932.html) in respect to SUBs vs. JOINs.
As per Horacle, - it's strength is in the muscles of the HW it runs on. And as Pat mentioned in regards to *nix admins that ironically became Horacle DBA's, - it made an extra effort throughout the releases to adapt to the *nix admin frame of reference, - this is why cursors in Horacle really fly, because they made sure they are faster than even ANSI joins. Why? Because *nix admins (not all, but a few!) have hard time grasping the concept of set-based approach ;)|||Dare I cross-post this to the Oracle forum? :rolleyes:|||Uh-oh, I think I need a body guard...|||No, I think you'd need a leash and a muzzle, and they'd need a shark-cage. ;)|||Looks like my little query got the reponse of two veteran DBA's. Thanks you for the very useful replies. In a some what related thread I found this example useful too:
http://asktom.oracle.com/pls/ask/f?p=4950:8:11521813539481172785::NO::F4950_P8_DISP LAYID,F4950_P8_B:953229842074,Y
I'm an Oracle guy at heart learning the SQL Server way.
Thanks again for the replies. :)|||I have NEVER heard so much drivel in my life...well except for last night when I was talking to a Yankee fan...
An example that FLYs (Now where did I put the complicated ones...)
Set Pagesize 0
Set Linesize 2000
Set Serveroutput on
Spool c:\Temp\DisabledChild.csv
Select '"Empl Id","Employee Name","Dpnd Id","Dependant Name",'
||'"Medical (10)",'
||'"Dental (11)",'
||'"Vision Care (14)",'
||'"Domestic Partner Medical (15)",'
||'"Domestic Partner Dental (16)",'
||'"Domestic Partner Vision Care (17)",'
||'"LegalCare (1Z)",'
||'"Basic Group Life (20)",'
||'"Basic AD'||Chr(38)||'D (22)",'
||'"Health Care Reimbursement (60)",'
||'"Dependent Care Reimbursement (61)"'
As Unload_String
From Dual
Union All
select '"'||x.emplid||'","'||Empl_Name||'","'||x.dependent_benef||'","'||x.name
||'","'||PT10_Ind||'","'||PT11_Ind||'","'||PT14_Ind
||'","'||PT15_Ind||'","'||PT16_Ind||'","'||PT17_Ind
||'","'||PT1Z_Ind||'","'||PT20_Ind||'","'||PT22_Ind
||'","'||PT60_Ind||'","'||PT61_Ind||'"'
from
(select a.emplid, a.dependent_benef, a.name
from enr_dpnd_benef a
where disabled = 'Y'
and lastupdveh = 'W'
and relationship in ('D','GC','OC','S','SC')
and exists
((select 1
from enr_dpnd_benef_h h
where (disabled = 'N'
or disabled is Null)
and h.lastupdveh = 'C'
and a.emplid = h.emplid
and a.dependent_benef = h.dependent_benef)
union all
(select 1
from enr_dpnd_benef i
where i.new_rcd = 'Y'
and a.emplid = i.emplid
and a.dependent_benef = i.dependent_benef))) x
,(select name as Empl_Name, emplid
from enr_employ_data) y
,(select 'Y' as PT10_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '10') pt10
,(select 'Y' as PT11_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '11') pt11
,(select 'Y' as PT14_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '14') pt14
,(select 'Y' as PT15_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '15') pt15
,(select 'Y' as PT16_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '16') pt16
,(select 'Y' as PT17_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '17') pt17
,(select 'Y' as PT1Z_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '1Z') pt1Z
,(select 'Y' as PT20_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '20') pt20
,(select 'Y' as PT22_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '22') pt22
,(select 'Y' as PT60_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '60') pt60
,(select 'Y' as PT61_Ind, emplid, dependent_benef
from enr_partic_dpnd b
where b.plan_type = '61') pt61
where x.emplid = y.emplid(+)
and x.emplid = pt10.emplid(+)
and x.dependent_benef = pt10.dependent_benef(+)
and x.emplid = pt11.emplid(+)
and x.dependent_benef = pt11.dependent_benef(+)
and x.emplid = pt14.emplid(+)
and x.dependent_benef = pt14.dependent_benef(+)
and x.emplid = pt15.emplid(+)
and x.dependent_benef = pt15.dependent_benef(+)
and x.emplid = pt16.emplid(+)
and x.dependent_benef = pt16.dependent_benef(+)
and x.emplid = pt17.emplid(+)
and x.dependent_benef = pt17.dependent_benef(+)
and x.emplid = pt1Z.emplid(+)
and x.dependent_benef = pt1Z.dependent_benef(+)
and x.emplid = pt20.emplid(+)
and x.dependent_benef = pt20.dependent_benef(+)
and x.emplid = pt22.emplid(+)
and x.dependent_benef = pt22.dependent_benef(+)
and x.emplid = pt60.emplid(+)
and x.dependent_benef = pt60.dependent_benef(+)
and x.emplid = pt61.emplid(+)
and x.dependent_benef = pt61.dependent_benef(+)
;
Spool Off;|||I DID quantify my statement, didn't it?!