<?xml version="1.0" encoding="UTF-8"?>
               
<load>   

  <!-- Login to this database.  -->
  <dbType>Oracle</dbType>
  <dbUrl>jdbc:oracle:thin:@localhost:1521:jddb</dbUrl>
  <dbUserName>scott</dbUserName>
  <dbPassword>tiger</dbPassword>
  <table>person</table>
  <sequence name="person_seq" pkColumn="person_id" />
  <sqlToRunBeforeLoad>delete from person</sqlToRunBeforeLoad>   <!-- to append to table leave this blank -->
  <sqlToRunBeforeLoad>delete from person</sqlToRunBeforeLoad> <!-- to append to table leave this blank -->

  <file pathAndName="testing/excel/Test-excel.xls" type="Excel" sheetNumberInWorkBook="0" />  
  <skipLines top="5" />              

	<column fieldNumber="1" dbColumn="name" type="String" >
    <validation errorWhen="notMatch" >     <!-- must be all letters, otherwise show the error message -->
      <regExp>^[A-Za-z]{1,100}$</regExp>
      <message>Invalid name. Name can't be blank and can't contain blanks, numbers, or special characters.</message>
    </validation>
    <validation errorWhen="match" >      <!-- Must not be blank  -->
      <message>Name can't be blank</message>
      <regExp>^ *$</regExp>
    </validation>
	</column>

  <!-- Note we skip field 2 "Shoe Size", it isn't needed on our database -->

	<column fieldNumber="3" dbColumn="nick_name" type="String" >
	</column>

	<column fieldNumber="4" dbColumn="age" type="Integer" >
    <validation errorWhen="notMatch" >
      <regExp>^\d{1,3}$</regExp>
      <message>Invalid age must be a number, maximum 3 digits.</message>
    </validation>
    <validation errorWhen="match" >
      <message>Age can't be blank</message>
      <regExp>^ *$</regExp>
    </validation>
	</column>

  <!-- Date format checking not supported for Excel files -->
	<column fieldNumber="5" dbColumn="birthday" type="Date" />

	<column fieldNumber="6" dbColumn="score" type="Float" />

	<column fieldNumber="7" dbColumn="favorite_food" type="String" />

	<column constantValue="Pin Pals" dbColumn="team_name" type="String" />

	<column sqlToGetValue="(sysdate)" dbColumn="created" />

</load>   
   

  
