IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New how's it guaranteed?
is the relationship being enforced by the database? I've been bit a couple times where data that was "guaranteed to be there" wasn't.

While I don't always use it, if there's a chance of data missing I'll use (+) and test for null on the key field using ISNULL() in the program. NULLS are hard to see when running the query interactively, so I'd then use the NVL function:
NVL(p1,p2) = if p1 is null then return p2 else return p1

select t.*,\n       nvl(u1.FIRSTNAME, 'data missing') AT_FIRSTNAME,\n       nvl(u2.FIRSTNAME, 'data missing') OB_FIRSTNAME,\n       nvl(u3.FIRSTNAME, 'data missing') RB_FIRSTNAME\n  from tickets t,\n       users u1,\n       users u2,\n       users u3\n where t.ASSIGNEDTO  = u1.USERID (+)\n   and t.OPENEDBY    = u2.USERID (+)\n   and t.REQUESTEDBY = u3.USERID (+)


I found that using (+) is a quick(performance) way to get a list of what's not in the other file. To see all tickets with an invalid ASSIGNEDTO value, I'd use this:
select t.*,\n  from tickets t,\n       users u1\n where t.ASSIGNEDTO  = u1.USERID (+)\n   and u1.USERID is null\n

Darrell Spice, Jr.

[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore

New Enforced by DB.
     Trying to build a query (n00b) - (inthane-chan) - (20)
         Off the top of my head - (JayMehaffey) - (8)
             Blew my SQL engine... - (inthane-chan)
             What is this INNER JOIN nonsense? - (ben_tilly) - (6)
                 Why do you say that? - (JayMehaffey) - (5)
                     /me relearns the value of double-checking references... - (ben_tilly) - (4)
                         It works in MS SQL Server as well. - (orion)
                         Actually, Oracle also uses the JOIN syntax, as of version... - (CRConrad) - (1)
                             And that may be where my bias is from - (ben_tilly)
                         I must be an exception. - (static)
         Is this what you want? - (ChrisR) - (1)
             That looks good... -NT - (inthane-chan)
         Here I come to save the day - (orion)
         Fixed. - (inthane-chan) - (1)
             We posted around the same time - (orion)
         this is how I'd do it - (SpiceWare) - (5)
             Do you do that... - (inthane-chan) - (3)
                 As to whether you *should* do that - (drewk)
                 how's it guaranteed? - (SpiceWare) - (1)
                     Enforced by DB. -NT - (inthane-chan)
             This is how I'd do it - (drewk)

is there more coffee... can I have another cup... you wanna cup I can make some more... I have alot... I mean I have this pot here... but its almost gone and its been sitting there for 10 minutes anyway... I should make more... did I ask if you needed coffee??? do you??? need coffee I mean...
352 ms