My requirement is -- Am trying to store the value entered by user into database (One of the Table in the database). But when am entering 0921 as department, then 0 (Zero) is getting ommitted and only 921 is getting stored in the database !! Which is giving wrong output and wrong results to me.
$ write SQL "set feedback on"
$ write SQL "spool Manager:[Aksh]akshay4.log"
$ write SQL "define IEMP_ID = '" + Ref + "';"
$ write SQL "define IYEAR = '" + File + "';"
$ write SQL "define IDEPT = '" + DEPT + "';"
$ write SQL "define IACC = '" + ACC + "';"
$ write SQL "Update EMPLOYEE set DEPT=&IDEPT where EMP_ID=&IEMP_ID and year=&IYEAR and ACC=&ACC;
$ write SQL "commit;"
$ write SQL "exit;"
$ close SQL
When I run the above code then I could see the below output:
old 1: Update employee set DEPT=&IDEPT where EMP_ID=&EMP_ID and year=&IYEAR and ACC=&ACC;
new 1: Update employee set DEPT=02150 where EMP_ID=14447 and year=2017 and ACC=1
But when I check the database after running the code..I could see only 2150 is getting saved in the database ... Any suggestions on this ??