Set @employeenumb:=WTF;




  • CREATE PROCEDURE  database.table()

        DETERMINISTIC

    BEGIN

     

    SET @rptdate:='2001-01-01';

    SELECT DATE_FORMAT((@rptdate:=CURDATE() -1),'%Y-%m-%d');

    SELECT @rptdate:=DATE_SUB(CURDATE(), INTERVAL 1 DAY);

     

    set @employeenumb:=1;

     

    Call DoAnalysis ();

     

    set @employeenumb:=2;

     

    Call DoAnalysis ();

     

    set @employeenumb:=3;

     

    Call DoAnalysis ();

     

    set @employeenumb:=4;

     

    Call DoAnalysis ();

     

    ...

     

    set @employeenumb:=50;

     

    Call DoAnalysis ();

     

     


     

    ED: huge space after the lines!

     
    ...


     

     

    END



  • Real programmers don't use loops or parameters!



  • If this were my workplace, the code would be in ColdFusion and go like so:

    <CFSET EmployeeNumber=0>
    

    <CFLOOP INDEX="Index" FROM="1" TO="50" STEP="1">
    <CFIF Index EQ "1">
    <CFSET EmployeeNumber = 1>
    </CFIF>
    <CFIF Index EQ "2">
    <CFSET EmployeeNumber = 2>
    </CFIF>
    <CFIF Index EQ "3">
    <CFSET EmployeeNumber = 3>
    </CFIF>

    ...
    
    &lt;CFIF Index EQ &quot;50&quot;&gt;
    	&lt;CFSET EmployeeNumber = 50&gt;
    &lt;/CFIF&gt;
    
    &lt;CFQUERY NAME=&quot;DoAnalysis1&quot;&gt;
    	EXECUTE DoAnalysis &apos;#EmployeeNumber#&apos;
    &lt;/CFQUERY&gt;
    

    </CFLOOP>


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.