ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanjeev40084 <sanjeev40...@hotmail.com>
Subject sql in sqlMap
Date Tue, 02 Jun 2009 19:27:29 GMT

I am having problem with the sql inside my sqlMap, could anyone help me fix

I have a class to map parameters:


  public class EmployeeParticipants

        public string EmployeeID { get; set; }
        public int Year              { get; set; }
        public string StartDate   { get; set; }
        public string EndDate     { get; set; }

        public ParticipantParameters(string employeeID, int Year)
            EmployeeID = employeeID;
            Year = Year;
            StartDate = "1/1/" + Year.ToString();
            EndDate = "1/1/" + (Year + 1).ToString();

My sqlMap.xml looks like this,

		<typeAlias alias="ParticipantParameters"

		<parameterMap id ="EmployeeParameters" class="EmployeeParticipants">
			<parameter property ="EmployeeID" column="employeeID"/>
			<parameter property="StartDate"  column="startDate"/>			

		<select id="GetEmployeeCount"
			SELECT count(PT.EMPLID) as CourseCount
			FROM db1..tb1
			INNER JOIN db1..tb2 ON tb1.ID = tb2.ID
			WHERE tb1.FN = 'S'
			AND tb1.LN     = 'N'
			AND tb1.DATE > #startDate#         <--i think the issue exists here 
                        AND tb1.ID     = #employeeID#       <--DATE and ID
are in string	datatype		
View this message in context: http://www.nabble.com/sql-in-sqlMap-tp23839118p23839118.html
Sent from the iBATIS - Dev mailing list archive at Nabble.com.

View raw message