1 Reply Latest reply: Nov 18, 2014 9:15 AM by anbu cheliyan RSS

    record in SQL it is possible making use of mapping ?

    PAUL YEO

      Hi All

       

      Below is my SQL script with is working fine for record kode_reject :-

       

      CONNECT TO [Provider=SQLOLEDB.1;Persist Security Info=False;User ID=SA;Initial Catalog=andonDatabas;Data Source=Paul;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=PAUL;Use Encryption for Data=False;Tag with column collation when possible=False];

       

       

      LOAD *,

      day(date_time)      as [day],

      year(date_time)      as [Year],

      Date(Monthstart([date_time]), 'YY MMM') as YearMonth,

      Pick(Match(kode_reject, 5, 39), 'reject human error', 'reject machine error') AS DESC_REJECT;

      SQL select * from record_reject_detail_plc;

       

      In my actual application , i hv more then 100 error code , it is possible to create table like below :-

      SegmentTypeMap:

       

      MAPPING LOAD * INLINE [

      Original, New

      5,reject human error

      39,reject machine error.

      ];


      Instead of long list of script :-

      Pick(Match(kode_reject, 5, 39), 'reject human error', 'reject machine error') AS DESC_REJECT;


      Hope some one can advise how to achieve this ?


      Paul