@# Quotes DB     useful, funny, interesting





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



Comments:

<0> outy
<1> rhelik, i have a set of those
<1> I can make dodecahedrons!
<1> aka buckyballs
<2> anyone know how to use an ado.net Command cl*** to execute multiple sql statements? like i have: create table blah ... ; create table blah2 ... ; ... but it errors on the 2nd create table
<1> I didn't even know you could do that
<3> I want something like a sproc or udf that will return rows based on arguments and be able to join against it etc
<3> would the only possible solution be to create a udf that returned a "table"?
<3> and would that even work?
<3> or am I trying to bend sql server over backwards =)
<1> a set of rows with the same columns is a table, so I think that would be possible
<1> drhyde would know for sure
<3> drhyde_ you around brotha?
<3> I guess I could probably go ahead and try it
<3> I have a hard time beleiving it would be efficient in anyway
<3> if it orked to begin with



<1> you can't create a view and join against that?
<1> that's what I would do
<3> no because we need to provide information to that view
<1> but then, I like views :-)
<1> ok
<3> we do use some views
<3> but this is a strange situation we're in =)
<4> i find myself in a strange situation about every 30 mins
<1> heh
<4> picking up a new boom tomorrow
<4> Professional SQL Server 2000
<4> you guys read that?
<4> heh boom, i mean book
<1> hmm, the module Quantum::Superpostions is quite cool
<1> woops, wrong channel
<2> woop got it
<2> FbScript / FbBatchExecution
<1> imagine doing: print "foo" if $word eq any(@words);
<1> or: pring "bar" if any(@a) < all(@b);
<1> this is awesome!
<2> what's that?
<1> quantum superpositions in perl, baby!
<1> and they mean exactly what they say
<1> if any of the elements of the array @a is less than all of the elements of @b then the expression is true
<2> purrl
<2> :D
<1> can't do this **** in any other langauge... bwhahaha
<1> ****ing hell, this module will even tell you the eigenvalues that led to the result!
<2> it's still purl :)
<3> holy ****
<3> it works
<3> I can inner join a god damn udf =)
<3> macca dont be a douche
<1> ah, but check this out... sub factors{ my $n = shift; eigenstates (int($n / any(2..$n-1)) == ($n / any(2..$n-1))); }
<1> that's all you need to find all the factors of $n
<1> astounding
<1> but mostly I just want this so I can do: if( $n == any(5, 6, 10, 11) ){ ... }
<3> select top 10 * from LISTING l
<3> INNER JOIN dbo.getUsers2(1) gu ON l.status = gu.id
<3> thats astounding =)
<1> heh
<1> sub prime { my $n = shift; return $n % all(2..sqrt($n)+1) != 0; } <== tells you if a number is prime!
<1> a..b is the operator in perl to create a list from a to b (inclusive)
<1> just FYI
<1> god I love perl
<5> i thought it was something like sub prime { /$.~@@~~}^%}^}%^}~ 2 ^^ = @@@ !@#@!$ }
<1> hardeharhar
<1> my quantum superposition prime number function is easy to understand
<1> my $n = shift <= makes $n the value of the argument
<1> return returns
<1> $n % all(2..sqrt($n)+1) != 0; $n is the arg, 2..sqrt($n)+1 creates an array from 2 to sqrt($n)+1
<1> any is the quantum part
<1> erm, I mean all
<1> so, a number is prime if the modulus of itself and ALL of the numbers from 2 to it's square root are not zero (i.e. it doesn't divide by them evenly)
<1> simple as pie
<1> or even pi
<2> hmm. how do i create a table with a dynamic name in a sproc using firebird?
<3> what macca?
<3> can you create a temp table
<2> nah it's not a temp table



<2> just a table with a variable name
<4> if i want to read info from another table in a SP, do i HAVE to use a CURSOR?
<2> MeshMan if you're reading more than 1 row then yes
<4> what can i do if its one row but multiple columns?
<6> just do select @var1 = field1, @var2 =
<2> what db?
<4> MSSQL
<2> mssql: select @var1 = field1, etc... from blah;
<2> firebird: select field1 from blah into :var1;
<6> you dont have to use a cursor for more than one row, you can try to se set based operations still
<4> i read that cursors are intesive and should be avoided
<4> intensive*
<6> yup
<6> avoided where possible
<4> cant wait to get my book tomorrow
<4> i am completely lost with Stored Procedure code
<4> so should progress quite quickly
<4> does MSSQL have a system table that records changes to a DB's table(s) ?
<6> no
<4> ah, ok
<2> i keep forgetting what's precision/scale do for a number?
<2> p = 5, s = 2: ppppp.ss ?
<2> or 000.00 ?
<2> or 00.000 ?
<4> http://www.ebaumsworld.com/videos/liquidlady.html
<4> like, wtf
<2> http://www.phpriot.com/2655 -- i get EXECUTE STATEMENT -- cannot convert to string
<7> use our paste site please
<8> which of these two queries is more efficient?
<8> http://pastebin.com/538000
<1> try them, the one that is faster is faster
<8> i would think B is better because the select in ( ) first returns just 1 row b/c .id=2 so the JOINs don't cycle thru rows without the specified id
<1> I suspect you won't see any difference at all
<8> or does SQL optimize it so that A checks the WHERE clause first in order to limit the number of comparisons in each JOIN? ...making them relatively equal
<1> of course, the result sets will be different
<8> how?
<1> the first query outputs 3 columns, the second query outputs 2 columns
<8> http://pastebin.com/538004
<8> that's what i meant
<1> heh
<1> my guess is that both will generate identical query plans
<8> i guess my question is whether the WHERE clause or JOINs take precedence in example A
<1> neither
<1> strictly speaking, both queries are identical
<8> if the JOINs are performed first it will get a lot of rows, then check the WHERE and eliminate all but 1
<1> joe4444: the order of your statements has NOTHING to do with the the order of execution
<1> joe4444: let me put it another way, a *good* DBMS would generate identical query plans for both your queries
<8> how about postgresql?
<1> if they were not identical, the query planner or optimizer has "issues"
<1> joe4444: use explain and see
<8> explain?
<1> EXPLAIN your-query-here
<1> it'll output the query plan
<8> cool
<8> looks identical
<1> postgresql is good :-)
<8> ...not that i fully understand what i'm reading
<1> heh
<8> are you familiar with ruby on rails?
<1> I prefer perl + catalyst
<9> <3 ruby
<1> ruby looks like chicken scratch to me
<1> and it's dog slow to boot
<9> its really easy to program
<1> and you can't do quantum superposition with ruby like you can with perl :-)
<9> 2 lines of code gets you an autocomplete box
<1> big woop
<1> you shouldn't be generating HTML in-code anyway, that's a function of the view
<9> yep
<8> in terms of MVC is there really such an advantage over making the DBMS perform all the "work" with stored functions, then using any script (e.g. php) to input the results in an HTML template?
<1> joe4444: well...
<1> there's a lot of debate as to where the business logic should go
<1> I prefer to divide the "model" part of the MVC into two layers
<1> 1) business logic layer and 2) object-database mapping interface


Name:

Comments:

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






Return to #sql
or
Go to some related logs:

bahhhoo
vehicle wallpapers 1440x900 widescreen
mirc phillipines
#mirc
#stocks
#windowsxp
freebasing xanax
cyberwaper OCR
#beginner
sperwear



Home  |  disclaimer  |  contact  |  submit quotes