| |
| |
| |
|
Page: 1 2 3 4
Comments:
<0> What is the way to handle lame local numberformatting, like in Sweden we use , as decimalseparator. So a float is stores as "0,83". This causes trouble in querys <0> shall I just simply treat it as a string and replace the , with a . ? <0> well it worked.. but it feels like wrong way <1> Why would it matter? If you p*** the values as parameters the formatting should not affect the SQL. <0> INSERT INTO table SET a_float = 0,7 <0> not good <0> mmm i see what you mean <0> but i build the query from asp <2> what is the best way to store an ipaddress? varchar or is there a formula to convert to an integer, or something else... <3> its all numeric <3> you can just format it when you pull it out <4> well yeah, what's most important is the data and not how its formatted <1> ASP uses ADO which is fully capable of parameters. <2> so i guess 1.1.1.1 would be stored as 1001001001 right? <0> but the query is just a string <1> Don't dynamically construct SQL.
<1> Use parameters. <0> could you give a simplified example of how to insert w/ parameters? <0> or do you mean these rs.addnew etc <2> asp or .net ? <0> asp <2> ew <0> (dont hehe) <2> !googlemother****er <2> :) <0> sure but i dont know what to google for, thus the simple example... but it it those .addnew methods you talk about? <0> someone told me those were slow and lame to use and that it was better to use .execute() <2> no its not addnew <2> try a search for asp sql parameter <0> hmm <2> to be honest i havent used or looked at asp in so long i really dont remember <0> i check w/ #asp <0> thanx anyway! <2> this article is wroth a look http://www.asp101.com/articles/wrox/asp30/26100903.asp <0> hmm thats with stored procedures <2> keep reading <0> :) <0> ah <2> :) <0> neat. then i guess its not nessesary to know the datatype either since you dont have to surround the value with '' <4> whuah, i like that link... <4> kind of like how i write my vb6 proggies <1> You write perogies? <5> side note: if you don't manually add the parameters to the collection (i.e. you simply refer to them and they are "automatigically <5> there, then your program will **** <4> no, i usually eat'em <4> :) <0> hehe <6> say what? <0> this was not so obvious <2> what is Cardinality? <0> its when you make a mistake that is a cardinal error, thus cardinality is the very essense of this error <7> People who inline SQL instead of using paramters make me sad in the pants. <0> still havent found any useful examples of how to do it :( <8> Drk`Angel what do you mean? how is inline sql a replacement for using parameters? <7> tenfour: execute("update blah set morp = " + someVariable + " where bork = " + foo); <7> = bad. Yuck. Evil. <0> dkr: and how would that be with parameters? <7> And yet, is done all over the freaking place. <0> plz <9> even without "parameters" <8> oh i see what you mean <9> you only need to filter your input <7> The specifics vary quite a bit from language to language. I'd suggest trying in #whateverlang <7> Darken: Parameters use precompipled queries, which speeds things up lots. I see code liek that in tight loops all the time. <0> mmmm... <7> Which means you haave to let the db recompile the freaking query 10k times. <7> Which is just ... stupid. <9> yes <8> i still use inline sql a lot of the time. i try to use strongly typed datasets which means i already have client code that "wraps" the call anyway <7> Wow, my typing ****s right now. :) <8> so to write a corresponding sproc seems more redundant (although not completely - really it's just a matter of laziness) <7> Don't need sprocs to use parameters. <7> And even if you are scrubbing your input, how confident are you that your scrubbing gets everything all the time? Parameters are one more level of defence, and aren't a major performance hit. <7> Probably not a performance hit at all compared to serious scrubbing and escaping. <9> Drk`Angel i am 100% confident <9> 100% of the time
<9> because i design things right the first time ;) <8> bah <7> uh huh. :) <9> yes uh huh <9> <= the developer's developer <8> aka the poor developer <7> I'd rather just use the db the way its meant to be used rather than bending over backwars to to escape strings. :) <7> Just me, though. <0> parameters seem to be highly ***ociated with stored procedures.. hmm <1> Sure, but they work just as well with batches. <0> hmm <6> hehe <0> hmm back to basic <0> if I want to insert a ' with an inline insert, how can i escape this character? <10> i was in here last night with a question about how to get the "nine highest" rows, and i got it working, but i'm wondering if anyone has any ideas on how to improve it <10> http://pastebin.com/567682 <0> insert into table set field = 'annie\'s' will not work <10> this does the major work of it, i created a view based on this query (mssql) <10> and now i can just say select * from where rank < 9 for the 9 best, and be able to do aggregates on it <10> it's just the speed of it concerns me <8> ioNix_ 'annie''s' <0> cool <0> are there other crash-characters to watsh out for <0> ? <1> Parameters :P <0> halo: i just cant figure it out. Ive googled on everything <0> it always about Sp's <1> Set cm = CreateObject("ADODB.Command") : Set cm.ActiveConnection = cn : cm.CommandText = "INSERT INTO Table1 (name) VALUES (?);" : cm.Parameters.Append cm.CreateParameter("@name", adVarChar, , 15, strName) : cm.Execute <1> Something to that effect <0> whoa! thank you! an example :) <11> can anyone reccomend a more optimal way to write this (SQL Server 2000) http://www.rafb.net/paste/results/CtKe3356.html ? <0> interesting <11> this can get called up to a couple thousand times in one of my queries <11> if it breaks through the first and second if clauses it can get a bit slow <6> hard to recommend without getting a headache <6> i'd rather recommend if you told me about the problem at hand and design of your db :) <6> seems like a project management app? <12> maybe you need to reevaluate why its getting called a couple thousand times in a query, or redesign if its that much of a problem <11> for a very specific field <11> this part of it is for scheduling the building of Homes <11> I think I figured it out <11> I put some of that tmpTable stuff into a view <6> seems like something you could do with a very simple query <6> ody: it probably cached that's why it's fast now :) <11> well I haven't verified that its cached <6> i am pretty sure <11> er that its faster <11> but I'm thinking it will be because its cached <6> you are not ordering by the temp table <6> and yet you are checking the first row of that table <6> how the hell does that work? <11> well the first query should only return one row <6> you are doing a bunch of gymnastics <6> just to determine whether Edit 0 or 1 <6> without looking at it much seems like it could be written in one select statement :/ <11> http://www.rafb.net/paste/results/TG3Cha92.html thats the function <11> http://www.rafb.net/paste/results/NzWG5R45.html theres the view <11> now it works great :) <11> minimal impact on load <6> meh <6> DBCC FREEPROCCACHE <0> hmm that Generate SQL Script does not include default-values in tables. Is it just a matter of settings? <13> ok who wnats to do my homework for $100? :) <8> hehe i will! <14> SicWork:: wtheck? h0mework? <13> ya <13> i gotta get an A though... otherwise no $100 <13> :) <11> whats the homework? <14> shooot it. <13> http://www.psl.cs.columbia.edu/cl***es/cvn-4156/mia.htm <11> you're an ivy leauger.. heh <13> some crap about extreme programming
Return to
#sql or Go to some related
logs:
#beginner #nhl abolitionisn
#beginner #politics #politics Linalove escort #csharp #directx DECRYPTING PASSFILES
|
|