Skip to main content

Christoph Schmitz

Member since Dec 11, 2008

Recent Blog Comments By Christoph Schmitz

  • Getting Contact, Photos, And Social Media Information Using And An Email Address

    Posted on Oct 18, 2011 at 9:28 AM

    It always amazes me how little people care about when or where they reveal their data. FullContact seems to be able to relate your Youtube account to your Twitter account to your bio to your demographics. That is more that just a little scary to me... @Ben, in your dump your usernames for the diffe... read more »

  • Performance Of LEFT OUTER JOIN Insert vs. INNER JOIN Delete Statement

    Posted on Aug 20, 2011 at 5:47 AM

    @Ben, @David, NOT IN has always been known to be a performance killer. One of the slowest operations in SQL. NOT EXISTS on the other hand can take full advantage of the indices that exist and usually is much faster than NOT IN or LEFT OUTER JOIN. If we are talking about many records, this ... read more »

  • Getting @@RowCount After SQL INSERT INTO Statement

    Posted on Jul 27, 2009 at 7:34 AM

    @Scott that can not work. The SQL statement is not processed by CF, but, by the database. CF can only reference what the database sends back. Local variables are only sent back if you use a corresponding return statement. Classic case for a stored proc with IN and OUT variables. ;-) Cheers Chris... read more »

  • Why NULL Values Should Not Be Used in a Database Unless Required

    Posted on Jul 1, 2009 at 3:25 AM

    @Jody I respectfully disagree. While it may be more convenient to have '000-000-0000' instead of a NULL, it's neither good nor correct. NULL marks the absence of a value, so, if a user doen't provide a value, NULL is what to store in the database. '000-000-0000' on the other hand is a value, it ge... read more »

  • Project HUGE: The Imaginary Fear Of Scheduling Mundane Tasks Such As Nutritional Intake

    Posted on Dec 29, 2008 at 10:03 AM

    Ben, I would be interested in what supplements you are or will be taking and what falls in the category of "nutrients". ;-) Chris... read more »

  • Ben Nadel's Easy Tips For Writing Better, More Optimized SQL

    Posted on Mar 28, 2008 at 6:19 AM

    Never use SELECT * should actually read 'Never use SELECT * unless in an EXISTS Clause'. It is OK to write SELECT ID, name FROM tblA a WHERE EXISTS ( SELECT * FROM tblB WHERE fkField=a.field ) According to Joe Celko, this makes the query optimizer choose the best index and will result in b... read more »

  • Incoming Tabular Data Stream Remote Procedure Call Is Incorrect

    Posted on Jan 4, 2008 at 5:17 AM

    @Ben, IN and especially NOT IN come with pretty big performance penalties... the longer the list the bigger the performance loss. Unless there is a reason why you MUST use it, I'd recommend changing your query to e.g. NOT EXISTS. That can speed up query execution time considerably. I've seen impr... read more »

  • Getting @@RowCount After SQL INSERT INTO Statement

    Posted on Nov 28, 2007 at 4:45 PM

    Hey Ben, great post! You are talking about MS SQL Server, correct? For MSSQL, I have two additions... you can select @@rowcount with physical tables as well, if you use cfquery's result attribute: <!--- use the result attribute for cfquery ---> <cfquery name="qry" datasource="#myDSN" resu... read more »

  • SQL Optimization Case Study - JOIN Clause vs. IN Clause

    Posted on Sep 5, 2007 at 8:39 AM

    @Ben, yes, EXISTS can reference values from the outer select. Look at the condition of the subquery from my example: WHERE userID=r.userID Here r is an alias for the table from the outer select. The subquery only selects those records that have a corresponding userID in the outer select. Thos... read more »

  • SQL Optimization Case Study - JOIN Clause vs. IN Clause

    Posted on Sep 5, 2007 at 4:50 AM

    Hi Ben, you might want to check the EXISTS clause, too. E.g. SELECT requestID, request_title FROM Request r WHERE EXISTS ( SELECT * FROM User WHERE userID=r.userID ) Given proper indexes, EXISTS is much faster than IN. And, considering that NOT IN is even slower than IN, NOT EXISTS ca... read more »

  • Why NULL Values Should Not Be Used in a Database Unless Required

    Posted on Aug 17, 2007 at 3:25 AM

    Hi AJ, that problem arises from putting blank values where a NULL should have been... you must check against both options: <CFQUERY Name="GetCompanyName" datasource="DS123"> SELECT CompanyName, date_approved FROM CompanyProfile WHERE CompanyID = #VAL(CompanyID)# and date_approved is not null... read more »

  • Need Help Making A Viable ExpandServerPath() ColdFusion UDF

    Posted on Jul 4, 2007 at 3:32 AM

    Ben, I'm not sure I understand your desired function completely... you want the full path to any file where you give the relative path to the calling template? Well, that's exactly what ExpandPath() does... ExpandPath( "./data/2007_07_02.dat" ) will give you the full path, so what's the difference... read more »

  • Did You Know That "000" Equals "00A" In ColdFusion?

    Posted on Apr 10, 2007 at 2:27 PM

    @Justin, CFML supports the CONTAINS operator: <cfif variable CONTAINS 'AE'> Just keep in mind that this operator is case insensitive, like all basic decision operators in CFML. For more information, take a look at the docs: read more »

  • Ask Ben: Limiting The Amount Of Time A Block Of Code Can Run

    Posted on Apr 2, 2007 at 9:37 AM

    Ben, no offense man, but, you got cflock wrong somehow... The timeout attribute of cflock specifies the time a request will wait until it aquires a lock, it does NOT specify the time a request within the lock may run. You can have a cflock-timeout of 1 second and still have the request run 100s of... read more »

  • Strange Numericly Named CFInvokeArgument Behavior

    Posted on Mar 30, 2007 at 7:54 AM

    @Ben, Ahhh... I see. Couldn't you simply use an array, conditionally append element, and then pass that array to the function? Or, if you need single arguments within your function, could you use a struct with numeric keys and pass that struct in as argumentcollection? Chris... read more »

  • Strange Numericly Named CFInvokeArgument Behavior

    Posted on Mar 30, 2007 at 4:10 AM

    Hi, actually you can pass argument names that are not syntactically valid variable names. <cfinvokeargument name="another girl" value="Kim" /> will work as expected. And it should, too, because all strings can be keys of a struct. myVar['some invalid var name'] is a syntactically correct wa... read more »

  • A Better CFParam Tag With A Catch Attribute (Proof Of Concept)

    Posted on Mar 23, 2007 at 8:16 AM

    Ben, I don't know if one could say "using it wrong". Come to think of it, I use <cfparam> on form pages only, when I want to prefill a form control: <cfparam name="" default=""/> <form> <input type="text" name="foo" value=""/> </form> My apps are... read more »

  • A Better CFParam Tag With A Catch Attribute (Proof Of Concept)

    Posted on Mar 23, 2007 at 7:05 AM

    Fred, I wasn't aware that IsDefined() behaved like that, thanks for pointing that out! I got curious and just for the fun of it wrote a small test to compare the two functions. I found that when searching the variables scope, IsDefined() is usually faster, when searching other scopes, StructKeyExi... read more »

  • A Better CFParam Tag With A Catch Attribute (Proof Of Concept)

    Posted on Mar 23, 2007 at 6:02 AM

    @Fred, of course, searching scopes takes time, but, nothing stops you from specifying a scope with isDefined(), too. ;-) <cfif NOT IsDefined("")> Actually, with the exception of the variables scope I personally scope all variables. (I'm just too lazy for scoping local variables. ;-P)... read more »

  • A Better CFParam Tag With A Catch Attribute (Proof Of Concept)

    Posted on Mar 23, 2007 at 4:20 AM

    Ben, I personally hardly ever use <cfparam>... not so much, because it is lacking a feature, but, because I got used to IsDefined(). Plus, isDefined() executes much faster than <cfparam>. I did some tests a couple of years ago and on my machines IsDefined() would be about 100 times fas... read more »

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel