To validate the date in Unix using Oracle

sqlplus /nolog <<EOF > /dev/null
CONNECT $ORAUID/$ORAPWD
WHENEVER SQLERROR EXIT 1
SELECT TO_DATE('$DATE_INPUT', '$DATE_FORMAT') FROM DUAL;
EOF
if [ $? -eq 1 ]; then
echo "Error: Wrong Date Format - $DATE_INPUT"
exit
fi

You can get the date from the first internal table along with the posnr and calculate date calculations u an use RP_CALC_DATE_IN_INTERVAL    or  RE_ADD_MONTH_TO_DATE and again read the data with posnr and calculated date in the loop.
Reward points if helpful

Similar Messages

  • PL SQL Procedure to validate the data before inserting

    Hi All,
    I have a PLSQL procedure that validates the data and also inserts the data into the table. That procedure must be run to validate each row to be inserted. My doubt is how to reference that procedure within the interface of ODI.
    After reading some posts that mention the use of procedures, I think the best option is to call the procedure inside the knowledge module (inside a cursor that does a insert clause). Am I correct?
    As the KM's do a lot of verification and use temporary tables, I don't know what are the steps to be modified. Also, I would like to know if it's necessary to modified only the IKM or the LKM too.
    I'm using the IKM Oracle Incremental Update (PL SQL) and LKM Oracle to Oracle.
    Thanks.
    Luciene

    by validating data you mean looking up some table and see if it exists?
    If this is the case the you can implement this using a user function.
    If validation fails then you may put a -1 into the mapping.
    Then put a constraint on the target( say column is -1) and enable flow control.

  • Validate the path in unix

    Hello all,
    I wrote a programm that saves a file on the server (unix)
    I would like to know if there is a function to validate the path in unix.
    thanks in advance.
    Miguel.

    Hi Miguel,
    Of course there are several ways to do this, but here you have the ABAP code to scan an entire directory (using wildcards). This delivers a list with entries and you can then search it for your directory (or simply use your directory name as entry).
    <b><i>* Directory filescan subroutine
    *&      Form  collect_filenames
          Scan a directory for files
         -->PFILE_LIST   Table for file info
         -->PC_INDIR     Search directory
         -->PC_FSEARCHP  Search pattern
         <--PF_SUBRC     Resultcode
    ----</i>
    FORM collect_filenames TABLES   PFILE_LIST STRUCTURE FILE_LIST
                           USING    PC_INDIR
                                    PC_FSEARCHP
                           CHANGING PF_SUBRC.
    <i>* Local</i>
    data: errcnt(2) type p value 0.
    <i>* Check directory</i>
      if pc_indir is initial.
    <i>*   Error: directory is mandatory</i>
        clear: sy-subrc.
    <i>*   Set error</i>
        pf_subrc = 7.
    <i>*   Leave</i>
        exit.
      endif.
    <i>* Just to make sure: Close possibly pending processes</i>
    call 'C_DIR_READ_FINISH'
      ID 'ERRNO'  field pfile_list-errno
      ID 'ERRMSG' field pfile_list-errmsg.
    <i>* Start a new search process</i>
      CALL 'C_DIR_READ_START'
          ID 'DIR'    FIELD PC_INDIR
          ID 'FILE'   FIELD PC_FSEARCHP
          ID 'ERRNO'  FIELD PFILE_LIST-ERRNO
          ID 'ERRMSG' FIELD PFILE_LIST-ERRMSG.
    <i>* Result</i>
      IF SY-SUBRC <> 0.
    <i>*   Error: directory does not exist</i>
        CLEAR: SY-SUBRC.
    <i>*   Set error</i>
        PF_SUBRC = 6,
    <i>*   Leave</i>
        EXIT.
      ENDIF.
    <i>* Loop to get the filelist</i>
      DO.
    <i>*   Cleanup workarea</i>
        CLEAR: PFILE_LIST.
    <i>*   Call the next file entry in the directory</i>
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD PFILE_LIST-TYPE
          ID 'NAME'   FIELD PFILE_LIST-NAME
          ID 'LEN'    FIELD PFILE_LIST-LEN
          ID 'OWNER'  FIELD PFILE_LIST-OWNER
          ID 'MTIME'  FIELD PFILE_LIST-MTIME
          ID 'MODE'   FIELD PFILE_LIST-MODE
          ID 'ERRNO'  FIELD PFILE_LIST-ERRNO
          ID 'ERRMSG' FIELD PFILE_LIST-ERRMSG.
    <i>*   Set the related directory name</i>
        PFILE_LIST-DIRNAME = PC_INDIR.
    <i>*   Remember this result</i>
        MOVE SY-SUBRC TO PFILE_LIST-SUBRC.
    <i>*   Act on the result</i>
        CASE SY-SUBRC.
          WHEN 0.
    <i>*       Clear error messages</i>
            CLEAR: PFILE_LIST-ERRNO, PFILE_LIST-ERRMSG.
    <i>*       Can we use the file</i>
            CASE PFILE_LIST-TYPE(1).
              WHEN 'F' OR 'f'.
    <i>*           Normal file</i>
                PERFORM FILENAME_USEABLE(RSWATCH0) USING PFILE_LIST-NAME
                                                         PFILE_LIST-USEABLE.
              WHEN OTHERS.
    <i>*           Directory, device, fifo, socket, ...</i>
                CLEAR: PFILE_LIST-USEABLE.
            ENDCASE.
    <i>*       Filesize check</i>
            IF PFILE_LIST-LEN = 0.
    <i>*         No data in file</i>
              CLEAR: PFILE_LIST-USEABLE.
            ENDIF.
          WHEN 1.
    <i>*       Leave loop (no other entries found)</i>
            EXIT.
          WHEN OTHERS.
    <i>*       Count the other errors</i>
            ADD 1 TO ERRCNT.
    <i>*       Allow for maximum 10 errors (fail safe)</i>
            IF ERRCNT GT 10. EXIT. ENDIF.
    <i>*       Too many unknown entries</i>
            IF SY-SUBRC = 5.
    <i>*         Do not show these attributes (security)</i>
              MOVE: '???' TO PFILE_LIST-TYPE,
                    '???' TO PFILE_LIST-OWNER,
                    '???' TO PFILE_LIST-MODE.
            ENDIF.
    <i>*       File is unusable</i>
            CLEAR: PFILE_LIST-USEABLE.
        ENDCASE.
    <i>*   Convert number of seconds since 1970 to time and date</i>
        PERFORM P6_TO_DATE_TIME_TZ(RSTR0400) USING PFILE_LIST-MTIME
                                                   PFILE_LIST-MOD_TIME
                                                   PFILE_LIST-MOD_DATE.
    <i>*   Does the file contain the search pattern</i>
        IF PC_FSEARCHP = SPACE.
    <i>*     No pattern, so accept all</i>
          APPEND PFILE_LIST.
        ELSE.
          IF PFILE_LIST-NAME CP PC_FSEARCHP.
    <i>*       File contains search pattern</i>
            APPEND PFILE_LIST.
          ENDIF.
        ENDIF.
      ENDDO.
    <i>* Stop search</i>
      CALL 'C_DIR_READ_FINISH'
          ID 'ERRNO'  FIELD PFILE_LIST-ERRNO
          ID 'ERRMSG' FIELD PFILE_LIST-ERRMSG.
    <i>* Result</i>
      IF SY-SUBRC NE 0.
    <i>*   suppress error</i>
        CLEAR: SY-SUBRC.
      ENDIF.
    <i>* Sort the found filelist by date, time and name</i>
      SORT PFILE_LIST BY MTIME DESCENDING NAME ASCENDING.
    ENDFORM.                    " collect_filenames</b>
    Hope you can use this,
    Regards,
    Rob.

  • Problem with getting current date and time using oracle.jbo.domain.Date

    I`d like to get current date and time using oracle.jbo.domain.Date method getCurrentDate(), but it always return current date and 12:00:00. I also need to get the current time.

    I think you should use java.sql.Timestamp domain.
    (And set database type to TIME or DATETIME.)
    Jan

  • How to validate the date in my class

    Hi
    In my project with jsp and struts I need to validate the date field.
    So in the action class I want to validate the date that is the date is in dd/mm/year format?
    can anybody please give some idea to do this?
    Thank you so much.

    Here is a method that validates day/month/year using the Calendar class.
         public boolean validateDate(int day, int month, int year) {
              try {
                   Calendar cal = Calendar.getInstance();
                   cal.clear();
                   cal.setLenient(false);
                   cal.set(year, month-1, day);
                   // need to call getTime() to make the calendar compute/validate the date
                   cal.getTime();
                   return true;
              catch (IllegalArgumentException e) {               
                   return false;
         }

  • Validate the date

    I have to validate the date, using following rules. How I can validate.
    �     Valid date
    �     Not in the past
    �     Not more than 56 days in the future

    See DateFormat/SimpleDateFormat.parse()
    http://java.sun.com/j2se/1.5.0/docs/api/java/text/DateFormat.html#parse(java.lang.String)
    and Calendar.add()
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Calendar.html#add(int,%20int)
    There are also before(), after(), and compareTo() methods in Calendar.
    Message was edited by:
    jbish

  • When reading from the file validate the date  'DD/MM/YYYY'  format

    Hi,
    reading from the file ,validate the date format 'DD/MM/YYYY'.
    Thanks & regards
    venkata

    I suppose that you are writing a program in some programming language, probably PL/SQL. So, you can use TO_DATE function and handle the exception when it occurs.
    create or replace procedure tstdt
    as
      stdt varchar(10);
      dt date;
    begin
      stdt := '20/10/2006';
      dt := to_date(stdt);
       dbms_output.put_line('date is correct
    exception
    when others then
      dbms_output.put_line('Invalid Date');
    end;[],
    Miguel

  • Validate the data for SAP system

    How do you validate the data for SAP receiver system (RFC or IDOC adapter)?
    It is necessary to recognize does exists reference object or does field has the right value.
    Do you validate it in BPM or you handle  application/technical acnowlegment? Or Messaging monitoring is enough for your requirements.
    In case of ABAP Proxy will it enough to catch Fault Message in order to define what happens?

    Hi,
    there are two different kinds of validations:
    syntactical validation (length and data types of fields etc.) and semantical validations (correct customer in order, allowed number range etc.)
    From a theoretical point of view, only the first kind should be carried out in XI, all semantical validations should be part of the backend inbound processing. And indeed for IDocs and RFCs you will get according error messages in the backend. If you call proxies, you will need to code that yourself.
    In General i'd implement syntactical validations in XI, if more a necessary then XI already carries out (e.g. mandatory fields filled). For data validations i would rely on the backend, meaning for IDocs you should look into using ALEAUD IDoc, which will return any error messages during IDoc inbound processing. For RFCs you can have Exceptions defined which will translate to a negative application ACK.
    Regards
    Christine

  • How to validate the data in the table

    Hi Experts,
    My question is
    I am having a table control on my view. I need to validate the data entered by the user on the table
    and after validation i need to save the data into database table.
    Now my question is only related to Data Validation on table UI element.
    If the user enters 3 rows and if the 2nd and 3rd row are already existing,
    It should throw the message Entry already exists and the pointer should
    be at Row number 2 in this case.
    Similarly in the 2nd row i have a date field and if the user enters some character
    then it should throw an error message that Numeric values are only allowed and
    the pointer is placed in the 2nd row Date column so that it allows user to modify
    the wrong entry.
    Please advise.
    Regards,
    Chitrasen

    Hi,
    for validating user input in table , you have to get the entries inserted by user into an internal table using get_static_attribute_table and futher have your check using loop endloop.
    For date field, make the context attribute binded to date column as DATS. This would make sure the user inputs a valid date without your custom code.

  • Export the data of Essbase using ODI11

    Hi,
    I want to export the data of essbase using odi 11.g ,and store in the oracle database;
    But i got a issue that i haven't got the whole information,which just have the value of data column,and null instead of the Dimension Members ;
    The DataSet as the below:
    Account,Period,Year,Entity,Project,Data;
    Null,Null,Null,Null,Null,5231.212
    Null,Null,Null,Null,Null,6231.231
    Null,Null,Null,Null,Null,NULL
    I have check the below ways:
    *1.Essbase Report*
    http://ServerName:27130/easconsole/console.html
    Execute the report script:
    //ESS_LOCALE SimplifiedChinese_China.MS936@Binary
    <Sym {SUPALL}{TABDELIMIT} {NAMESON}{ROWREPEAT}{NOINDENTGEN}{SUPMISSINGROWS}{MISSINGTEXT "0"}
    <COLUMN(Scenario)
    {DECIMAL 8}
    "BUDGET"
    <ROW(Account,Period,Year,Entity,Project)
    <DimBottom "Account"
    <DimBottom "Period"
    <DimBottom "Year"
    <DimBottom "Entity"
    <DimBottom "Project"
    Result:
    Account,Period,Year,Entity,Project,Data;
    ACC1,1,FY13,ORG1,PRJ1,5231.212
    ACC2,2,FY13,ORG2,PRJ1,6231.231
    ACC3,3,FY13,ORG3,PRJ1,#Missing
    *2.odi Interface*
    LKM Hyperion Essbase DATA to SQL
    EXTRACTION_QUERY_TYPE:ReportScript
    EXTRACTION_QUERY_FILE:C:\odifile\budgetdata.txt
    EXT_COL_DELIMITER:\t
    *3.oracle table*
    The data type oracle 's table ,the data is NUMBER,other is NVARCHAR2(80);
    Anyone can help me ,thanks
    Kevin
    Edited by: kevin123 on 2013-4-17 下午11:03

    Who has experience in this field,thanks

  • How do u validate the data

    Hi
    I want to know Validate the data after extracting from R/3 to BW. Can any one of u please help me how should i go about this..
    If the annswers were given step by step briefly the full points wil be rewarded....
    waiting for the answrs

    Hi Kiran,
    Reconcilation:
    Reconcilation is the process of comparing the data after it is transferred to the BW system with the source system. The procedure to do reconcilation is either you can check the data from the SE16 if the data is coming from a particular table only or if the datasource is any std datasource then the data is coming from the many tables in that scenario what I used to do ask the R/3 consultant to report on that particular selections and used to get the data in the excel sheet and then used to reconcile with the data in BW . If you are familiar with the reports of R/3 then you are good to go meaning you need not be dependant on the R/3 consultant ( its better to know which reports to run to check the data ).
    I will give you a scenario to help you understand it better. Lets say BW extracts FI data from R/3. To make sure that all the records has been extracted from R/3 we can create a report in R/3 which will show the year-to-date balance of all the documents posted and we can create a BEx query on the BW cube which will also display the trial balnce. Any difference between the two balance will identify the records missing from R/3.
    Similary you can model other scenarios as per your requirement. If you are extracting from 2 or more different sources from R/3 then create a multicube on top of the individual cube and produce the report. You need to also create a similar report in R/3 as well.
    check this How to Doc:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7a5ee147-0501-0010-0a9d-f7abcba36b14
    Pls do check the link's below
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7a5ee147-0501-0010-0a9d-f7abcba36b14
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/biw/how%20to%20validate%20infocube%20data%20by%20comparing%20it%20with%20psa%20data
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8c92d590-0201-0010-5aa0-ee7a993f295c
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/968dab90-0201-0010-c093-9d2a326969f1
    Question regarding Tranports?
    ****Assign Points If Helpful****
    Regards,
    Ravikanth

  • How to validate the dates in the table control ?

    How to validate the dates in the table control ?
    Can I write like this ?
    LOOP AT it_tab .
    CHAIN.
    FIELD : it_tab-strtdat,it_tab-enddat.
    module date_validation.
    ENDCHAIN.
    ENDLOOP.
    Module Date_validation.
    ranges : vdat type sy-datum.
    vdat-sign = 'I'.
    VDAT-LOW = it_tab-STRTDAT.
    VDAT-HIGH = it_tab-ENDDAT.
    VDAT-OPTION = 'BT'.
    APPEND VDAT.
    WHAT CODE I have to write here to validate ?
    and If I write like this How can we know which is the current row being add ?
    It loops total internal table ..?
    Bye,
    Muttu.

    Hi,
    I think there is no need to put chain endchain.
    To do validation you have to write module in PAI which does required validations.
    Thanks
    DARSHAN PATEL

  • How to automate the data load process using data load file & task Scheduler

    Hi,
    I am doing Automated Process to load the data in Hyperion Planning application with the help of data_Load.bat file & Task Scheduler.
    I have created Data_Load.bat file but rest of the process i am unable complete.
    So could you help me , how to automate the data load process using Data_load.bat file & task Scheduler or what are the rest of the file is require to achieve this.
    Thanks

    To follow up on your question are you using the maxl scripts for the dataload?
    If so I have seen and issue within the batch (ex: load_data.bat) that if you do not have the full maxl script path with a batch when running it through event task scheduler the task will work but the log and/ or error file will not be created. Meaning the batch claims it ran from the task scheduler although it didn't do what you needed it to.
    If you are using maxl use this as the batch
    "essmsh C:\data\DataLoad.mxl" Or you can also use the full path for the maxl either way works. The only reason I would think that the maxl may then not work is if you do not have the batch updated to call on all the maxl PATH changes or if you need to update your environment variables to correct the essmsh command to work in a command prompt.

  • Validate the Date Time

    Does any java library class support to validate the date of the user input?

    Error index is concerned with the pattern not with the value.
    SimpleDateFormat test = new SimpleDateFormat("yyyy-MM-dd");
    ParsePosition p = new ParsePosition(0);
    p.setErrorIndex(-1);
    Date d=test.parse("2002-1130",p);  //does not match the pattern
    System.out.println(p.getErrorIndex()); // index other than -1 expected
    p.setErrorIndex(-1);  //  initialize
    d=test.parse("2002-11-31",p);// match the pattern but value invalid
    System.out.println(p.getErrorIndex()); //-1 expected

  • How to trace the data dictionary tables used in the standard transaction

    Dear all,
    Help me to trace the data dictionary tables used in the standard transaction "crm_dno_monitor". I need to find the tables where the data are stored.
    or
    Tell me generally how to find the tables used in the standard transaction.
    Regards,
    Prem

    Hi,
    Open the program of that standard transaction in object navigator or SE80..
    Then click on the dictionary structures tab..
    U can find the database tables used in this transaction..
    \[removed by moderator\]
    Regards,
    Rakesh
    Edited by: Jan Stallkamp on Jul 29, 2008 5:29 PM

Maybe you are looking for