@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3



Comments:

<0> seems to me the only difference between the three embedded SELECT statements is the columns returned
<1> how do I ignore the results of the first SELECT in a stored proc if I want to do a second select for different results. I only want to return the second query, but ONLY if the first query comes back empty. right now it returns both datasets
<2> That is the only difference Gamble.
<0> then the structure is unnecessary; just return all the columns and let the caller decide what to do based on @GT
<2> Basically the problem is we're having to revamp this m***ive web based application converting to stored procedures, and the flow of data through the original makes for complicated stored procedures
<3> What's wrong w/this inner join? http://rafb.net/paste/results/qO5CNe87.html
<2> The way the architecture in the application is designed, that approach is impossible
<0> why? Does it use ordinal position instead of column names when using the resulting set?
<2> Atleast at the present time for the present delivery date
<2> It's 3 tier architecture
<2> And we only have 10 hours to change around 200 queries
<0> rofl
<2> lol
<2> thanks for feeling my pain
<0> what is the 'change' being made to this one?
<3> Can anybody help me figure out what's wrong with this SQL statement? It's got two inner joins in it, but keeps returning an error. (http://rafb.net/paste/results/qO5CNe87.html)



<0> not that i want to bite into your generous '10 hours', lol
<2> lol
<2> well
<2> basically, the way it's setup now... the queries are generated in the business layer and p***ed to the database layer of our architecture
<2> conditional logic is generated in the business logic layer
<0> Aragorn16, you have extraneous parentheses
<0> Aragorn16, try: http://rafb.net/paste/results/fxxBFb19.html
<2> so basically, we have ~200 queries/data that are being generated/p***ed through at minimal 4 functions then returned
<4> okay, using MS-SQL, I am having a repeating error trying to say "ThisValue IS Null" in a SQL statement. Is that not how you put a null in for a double?
<5> avoid stored procedures
<0> I suppose my question was "why will extra columns break your application?"
<3> k, thx
<2> and the only way to convert to stored procedure is basically convert all those conditional checks into the stored procedures
<2> we can't avoid stored proecdures atm
<0> that was not my point, setdh
<2> sql injection problems are all over the place
<2> as well as anytime a user enters a ' the query dosent get executed
<0> I meant just rewrite the proc to remove all those unnecessary "IF" blocks, since the only difference is in the columns returned, simply return them all with one SELECT
<0> I was *not* saying to eliminate the proc
<2> oh yeah, its the way the data is being displayed
<0> ROFL
<2> in the ui layer
<0> poor soul
<2> :(
<0> beest of luck
<2> were going to need it
<0> JudgeXRTI, what does your syntax look like? Is it an ***ignment statement?
<4> it's an update statement
<0> UPDATE myTable SET myColumn = NULL
<0> of course, you'll likely want a WHERE clause :)
<6> but fist try it out without WHERE
<6> just to be sure it works
<0> heh
<0> EyePulp, if the first set is empty, it will populate @@ROWCOUNT with 0, you might leverage that
<0> but the impact to the front-end is the same regardless
<7> what commands can i look at for detecting the length of a string and removing the leftmost 4 to 7 characters of it (in this case, in an update)
<0> it would receive two sets in the TDS stream, and have to deal with both (even if just skipping it)
<7> in sql server 2000
<4> funny where clause trick
<4> there went 103,000 rows of data.
<7> :<
<0> are you serious man?
<4> just kidding. I'm not that dumb.
<4> ;)
<4> Would have been hilarious though, huh?
<0> no
<7> to a sadist
<2> Well I basically just found out I can collapse about 30 of these queries into one stored proc so the night is looking a bit brighter :)
<0> good :)
<4> I coulda rolled back anyway lol
<1> any way to wipe the results of a SELECT inside a stored proc after I run the SELECT in order to p*** out different values?
<2> One question, on INSERT and UPDATE queries within a stored proc, in situations in which you are going to store data to only certain columns within the table depending on a variable within the proc, how do you handle a situation in which for "blank" fields the system is p***ing an empty string throughout the application and ultimately as an object to the DB
<2> Wouldnt you have to convert to NULL before p***ing the object to DB
<7> EyePulp from my rookish perspective i might suggest perhaps do the first select into a temp table
<7> then do whatever you're doing with it before the second select from that, then drop the table
<4> thanks guys :)
<1> moo: thanks, but I think there's a better way.
<8> sethd: at least in oracle empty string is considered to be null
<7> i'd imagine there is
<2> this is SQL server
<1> a little cleaner, that is.



<2> unfortunantly
<7> [sql server 2000] what commands can i look at for detecting the length of a string and removing the leftmost 4 to 7 characters of it (in this case, in an update)
<1> but I appreciate the suggestion.
<1> LEN()
<8> i know, but I was hoping the definition would be the same :)
<1> LEFT()
<1> RIGHT()
<7> k
<7> i figured it was probably that but couldn't find anywhere that listed the syntax
<7> thanks
<2> Japi, unfortunantly I believe it isn't :(
<0> EyePulp, you could perhaps use EXISTS() to see if rows satisfy the first condition before proceeding
<8> sethd: probably not, but you can try that out by writing a short procedure to ***ign a empty string to variable and then check if it is null or not
<1> THAT is what I was looking for many minutes ago. Time to roll back the query. =)
<0> sethd, can you rephrase your question?
<0> moofluffy, what are you trying to achieve? I need a little more info
<7> TheGamble i was just looking for the syntax, i can achieve it fine now that i have it ;)
<7> thanks though
<0> kk
<0> sethd, were you looking for a way to trim your query down to only the 'essential' columns, as determined by contents of parameters, thereby avoiding updating some/all columns?
<9> moofluffy, DATALENGTH, LEN, LEFT, RIGHT and SUBSTRING are what your looking for ... depending on your needs, and your data
<10> moz
<10> msg
<9> datalength and len are the same, but datalength works on chars and returns string length, not char length
<0> CHARINDEX and PATINDEX might play in, too, depending on those requirements also
<11> and, of course, RTFM() might help too
<0> lol
<9> haha
<9> CoJoNEsX: why do I see logs for 12/31 of every year from 2001 to present?
<9> and wtf is with the gay "Session Time" lines ...
<12> what port does sql run on for tcp/ip ?
<2> Gamble: sorry for not answering you earlier, was deep in code
<2> Basically yeah... Right now i'm just planning on using IsNull(Column, '')
<0> so if '' comes in, you have to leave the column alone, by rule?
<2> yes
<0> brutal
<2> agreed
<2> this application was developed ground up by a team of trained dolphins
<0> I was thinking lemurs, but ok
<0> However, I don't think ISNULL(Column, '') will have the desired effect if the inbound data is non-null and the column contains ''
<0> if you plan on using ISNULL(Column, @param), then in cases where Column contains '' from a prior update, it will ignore @param
<2> hmm
<0> UPDATE myTable SET Column = CASE WHEN @param <> '' THEN @param ELSE Column END
<13> Is it possible to add a row to a binary data (i stored a datatable in binary format) in sql 2005?
<0> sethd, the interesting this is that it seems there's no way to 'empty' a column out, if it comes in '' or null, it just gets ignored? seems odd. anyhow, have a nice weekend
<14> sup
<15> stuff
<16> porn rox
<16> how about that?
<17> how do i go about learning sql
<18> get a sql server, get some data, write some sql
<17> but how do i write sql
<17> thats what i need to learn
<18> select * from yourtable
<17> do what?
<18> you write that
<17> but i need to understand what i'm doing and why i'm doing it
<18> that answer lies hidden in the mists
<19> sql wont give you those answers
<20> go buy a good book dude
<20> oreily has a deal now that let's you check books out and read them online
<17> what book?
<17> what is a good book
<20> hell, I dunno, I hacked my way through when I was learning
<19> business for dummies
<20> sql for dummies?
<20> heh
<20> I figured **** out using enterprise manager, and access to build the queries
<20> eventually, I didn't need to use the IDE's for making queries
<20> ****, that was a long time ago...
<20> I'm sure there's metric ****loads of sites out there that'll get you started too
<20> http://safari.oreilly.com/
<20> start there...
<17> ok


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #sql
or
Go to some related logs:

#networking
aljazeera.ent
I only fuck black men
what is local host
#beginner
#italy
r00t exploit fc2
#microsoft
#politics
#politics



Home  |  disclaimer  |  contact  |  submit quotes