How do I validate a regex before running it?

I wish to make sure that my regex is valid before running it. Is there boolean method to validate it?

How aboutboolean valid = true;
try {
  Pattern p = Pattern.compile(theRegexYouWantToValidate);
} catch(PatternSyntaxException pse) {
  valid = false;
}?

Similar Messages

  • About close the PR before running PR- PO

    Hello experts:
    I got a requirement from customer as following
    how to close a PR automatically before running PR->PO
    after several manager approved the PR, the requestor wanna close the PR.  i am trying to use the ME52N to do that, but the indicator 'CLOSED' in tab quantitied/date" is gray.  because i did the configuration as following
    MM>Purch.>Req>Rel.Proc.>with class. -->Set up procedure with classification
    Push "Release indicator" = 1 (can not changed).  
    i can't set the indicator as '4', because customer don't wanna approver to change the quantity or amout within the workflow. so i have to set the release indicator as '1'.
    base on the customizing option, once system is running the PR->PO, in fact requestor wanna cancel or close some PR instead generating the PO. So in this case how could i close the PR under no change in customizing.  one more thing i work in the 4.6C system, if the system version is over ECC5.0, the system already provide the fuctionality that system will trigger the workflow once quantity /date is changed. 
    i searched some thread in this forum, i got some idea about this requiremnt. i have to write the LSMW or BDC program to close the PR request wanna cancel.
    is there any sample for this program or any suggestion are appreciated
    Thanks and best regards,
    Kevin

    Hi
    Try using the option blocking (under status tab in PR).
    Thanks

  • Detect I/O before running sql statement

    Hi all,
    how do I detect I/O before running sql statement?

    do you mean:
    how do I know how much I/O is occurring before running a query?
    or
    how do I know how much I/O will be used to retrieve the data for this query?
    Which OS? You can look at OEM and "top" to see your current I/O. Detecting and deciding on whether or not you want to continue to submit the query is another problem.
    The question is: what problem are trying to solve? Is it really a problem or just something you imagine might occur???
    Don't try to fix a non-existent problem.

  • My Mac Book Pro has slowed to less than a crawl (possibly from a worm or virus).  How do I make sure it's running at peak efficiency before I complain to comcast

    My Mac Book Pro has slowed to less than a crawl (possibly from a worm or virus).  How do I make sure it's running at peak efficiency before I complain to comcast

    Please answer as many of the following questions as you can. You may already have answered some of them; in that case, there's no need to repeat the answers.
    Restart the router and the broadband device, if they're separate. Any change?
    Run Software Update and install all available updates for OS X or the computer's firmware. Any change?
    If possible, connect to the router with an Ethernet cable and turn off Wi-Fi. Any difference?
    Are any other devices on the network, and if so, are they the same?
    If you can connect to more than one network, are they all the same?
    Are all network applications affected, or only some? If only some, which ones?
    Is networking always the same, or is the problem intermittent?
    Disconnect all other devices from the network. Any change?
    If you're running a MacBook with the lid closed, open the lid. Any difference?
    Start up in safe mode and test. Any difference?
    Start up in Recovery mode. From the OS X Utilities screen, select Get Help Online. A clean copy of Safari will launch. No plugins, such as Flash, will be available. Any difference?
    If possible, turn off Bluetooth and disconnect any USB 3 devices. Any difference?

  • How can I execute a statement before a VO is running

    JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
    I use ADF BC
    how can I execute a statement before a VO is running

    thanks for the answer
    i use a logon function before I run a VO
    after a certain time will be disconnected
    and I have to call the function again
    sorry for my English
    public String logon(String username, String password){
    CallableStatement st = null;
    this.username = username;
    this.password = password;
    try {
    st = getDBTransaction().createCallableStatement("begin ep_security.LogOn(?,?); end;",0);
    st.setObject(1, username);
    st.setObject(2, password);
    st.executeUpdate();
    this.getDBTransaction().commit();
    } catch (SQLException e) {
    System.out.println("ERROR "+e.getMessage());
    this.addWarning(new JboWarning("Quote retrieved successfully"));
    System.out.println("...RETURN ERROR");
    return "error";
    } finally {
    if (st != null) {
    try {
    // 7. Close the statement
    st.close();
    } catch (SQLException e) {
    e.printStackTrace();
    }

  • OBIA How to truncate all fact tables automatically before running a full load

    With every run data gets appended to the fact tables.How to configure so that with every run data gets deleted before we start the load.
    We have OBIA 11g

    If you are using DAC for scheduling the ETL jobs, you can list out the fact tables that are being used in your execution plan and set the Refresh dates for those tables as NULL. This action makes the dac execution plan to consider loading the data freshly into the fact tables.
    Steps to make Refresh date as NULL in DAC:
    To make the refresh dates as NULL for your fact tables in DAC, go to Setup tab -> Physical Data Sources
    Now select the connection Datawarehouse(In my case) -> Refresh Dates
    Query your fact tables and go to Refresh Date column and click on the calendar Icon
    Click on NULL button to make the refresh date as NULL for that particular table and click on ok and save.
    In the similar manner do it for all the fact tables you want.
    After the above process, once you run the execution plan then data will be loaded freshly.
    Regards,
    Obul

  • Report execute time nd how many records will be returned before hitting the "run" option?

    Post Author: Prasad15
    CA Forum: WebIntelligence Reporting
    Is there any way to know how long the report executes and how many records will be returned before hitting the "run" option?
    Regards
    Prasad

    To know if the report is going to return more than 10,000 records, you first have to run the query with a 'select count(1) from ... where ...' (with the same from and where clauses as you normal query). Since this takes about the same time as runnng your report, I wonder if you really gain anything (although formatting may take some time too).
    You may simplify the select count(1) query by omitting all the lookup tables that are only needed for formatting. That way your query may run a lot faster. You can put this in your after parameter form trigger.

  • Validate SQL string before executing

    I am attempting to find a way to validate an SQL script file before executing against a database. This is to allow any errors within the script to be identified and fixed before running against a pre-live / live database.
    These scripts may contain both DDL and DML.
    Is there any way to run the script and only have the changes visible to the current user, with all other database users unaffected until the changes have been checked (in a similar way to running an insert / update / delete without committing the changes)? Failing this, are there any tools to check the validity of the statements within an SQL script file?
    Any help with these or alternative solutions would be much appreciated.
    Cheers,
    Steve

    This is not sensible.
    How can you test a DML that creates a table (that does not create the physical table) and then test a DDL that uses that table that was not created and of which no record exist?
    The validity of a SQL statement (DML or DDL) depends on numerous factors, including the state of the database at that specific point in time that it is being run. You may test/check a DML that creates an index and it is fine.. until run on production where it times out as it cannot get a lock on the table in order to create the index.
    Or there is insufficient free space in the tablespace to build the index. Or the index is build in parallel and one of the PQs fail because on an Oracle bug, resulting in the complete DDL failing.
    Etc. Etc.
    If the intention is to be able to test an upgrade/patch/install script for a production database for every single potential problem and error, and then have a 100% guaranteed success rate in running that on production.. er.. excuse me for a moment..
    <mad laughter heard from outside>
    Er.. okay. Back again.
    This will need - no compromises and just for starters - the exact same h/w platform, o/s, Oracle s/w, and duplicated production database (cloned perhaps) as the test platform.
    And if this is not possible or feasible then you should forget about having that script tested in such a fashion in order to have a 100% guarantee of a successful production deployment... and investigate the optimum method to test as far as possible, and build a comprehensive plan for change management and dealing with problems out of this upgrade, on production.

  • To pass new session variable value to stored proc before running a report.

    Hi,
    Below is summary of the report requirement -
    Database level design
    1. Created a view and a global temporary table (GTT)
    2. Created an Oracle package procedure to accept from and to business dates on basis of which it will fetch, process and populate the GTT.
    Repository level design
    1. Created a business model containing the view and the GTT (mentioned above)
    2. Created two SESSION variables "from_dt" and "to_dt" to be initialized by their respective init blocks. Each of the variable is initialized with a DATE column value (of type DATETIME) from a database lookup table. I have also set the option "Enable that variable to be set by any user" for both variables.
    Query for these variables :
    from_dt = select from_date from <table>
    to_dt = select add_months(from_date,12) from <table>
    Presentation level design
    1. Using a text box, i display the default/initialized values of these variables like this -
    Current business date:@{biServer.variables['NQ_SESSION.from_dt']} Future business dt:@{biServer.variables['NQ_SESSION.to_dt']}
    Dates get displayed in YYYY-MM-DD 00:00:00 format
    The text msg displays these default dates and allows the user to specift different date range for which i create prompts as shown below.
    2. Using any random two columns of date type from the business model, i create two date dashboard prompts with labels "From Dt" and "To Dt".
    i select Calender Controls for both; setting Default To = Report Defaults.
    The Set Variable is set to Presentation variables - such that pv_from_dt maps to "From Dt" and pv_to_dt maps to "To Dt".
    3. i create the report using the business model created above. In the report "Advanced Tab" => "Prefix" field i specify the following -
    SET VARIABLE from_dt='@{pv_from_dt}',to_dt='@{pv_to_dt}';
    Note : The logic here is to display the default dates and allow user to specify different date values which will be stored in presentation variables.
    If the user does specify different "from dt" and "to dt" values, then using the presentation variables, i want to "write" back these new values to the corresponding session variables mentioned above.
    If the user does not specify different date range, then the default/initialized dates must be considered.
    I also display the default and new date values in the report title.
    Back to Repository level design
    To execute the stored procedure that will load the GTT before running the report I need to pass two date parameters to the stored procedure on basis of which it will fetch data, process and populate the GTT.
    In the Connection Pool --> Connection Script Tab --> Execute before query, I wrote the below query using the repository variables FROM_DT and TO_DT to execute the procedure -
    DECLARE
    v_from_dt date;
    v_to_dt date;
    BEGIN
    v_from_dt := VALUEOF(From_Dt);
    v_to_dt := VALUEOF(To_Dt);
    package_name1.package_body(v_from_dt,v_to_dt);
    END;
    Now when i try to run the report i get the following error :
    [nQSError: 10058] A general error has occurred. [nQSError: 23006] The session variable, NQ_SESSION.to_dt, has no value definition. (HY000)..
    Need help on this.
    Is it possible to "write back" a new value to a session variable ?
    Any other alternatives.
    Thanks
    Nusrat
    Edited by: user10309945 on Jan 24, 2011 10:08 PM

    Sandeep, I found a several topics where users describe saving values in DB through stored procedure or function. For example, [How to store OBIEE presentation level variable values in DB |http://forums.oracle.com/forums/thread.jspa?threadID=892006] I tried it and get an error
    *10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 17001] Oracle Error code: 14551, message: ORA-14551: cannot perform a DML operation inside a query ORA-06512*
    It's not a BI error. This error are generated by Oracle DB. If I write next:
    SELECT MyPLSQLFunction(p1,p2) FROM DUAL
    I get the same error.
    Oracle doesn't allow DML operations in SELECT.
    Did you relalize this feature yourself? Where did I mistake?

  • I have to back up the disc before running Bootcamp?

    I need to run Windows on my computer by tomorrow morning for a job.
    I'm working on a MacBook Pro (Mac OX S version 10.6.8).
    I am very computer illterate and was told to set up Bootcamp.
    When I try to start up Bootcamp it gives me two options before proceeding:
    Download the Windows Support software for this Mac.
    I have the Mac OS X installation disc that came with my Mac or I have already downloaded the Windows support softer for this Mac to a CD, DVD, or external disk.
    I keep choosing the second option because when I choose the first option I am given an error that reads, "The Window Support Software is not available."
    When I choose the second option I get an error that reads, "Back up the disk and use Disk Utility to format it as a single Mac OS Extended (Journaled) volume. Restore your information to the disk and try using Boot Camp Assistant again."
    I don't know how to do - I don't have an external hard drive, however, most my files are stored on flashdrives and Dropbox (just in case my computer ever happens to crash).
    So basically, can someone walk me through how to set this up? It's a bit of an emergency.
    I've tried looking up solutions to this problem but become a bit overwhelmed (like I said, "computer illiterate") and can't follow along with the advice.
    If anyone could write a possible solution in a kind of step-by-step format, then I'd be very grateful.
    Thank you so~ much to anyone who may reply.

    That error message tells you that you have more than one partition on your hard disk, so you have to delete it before running Boot Camp.
    1. First of all, if you have important data on that volume, copy it to the first partition before doing anything. You can access to that volume on Finder sidebar.
    2. Open Disk Utility, select your hard disk at the top of the sidebar and go to Partition tab.
    3. You will see a partitions bar with all the partitions of your hard disk. Select the last partition and press - button to delete it.
    4. Then, click at the bottom right corner of the first volume and drag it to the end of the bar, so your OS X partition will use all the space of the hard disk. Finally, press Apply.
    5. Close Disk Utility, open Boot Camp Assistant and follow the steps to install Windows.
    I give you some notes for the Windows installation:
    Boot Camp will create a FAT partition; however, Windows Vista and Windows 7 requires a NTFS partition, so on the partitioning screen (it will appear during the Windows installation), you have to select "BOOTCAMP" volume, press "Options" and choose "Format". When it finishes, press "Next" and Windows installation will start.
    After installing Windows, you have to install the Boot Camp drivers. Just insert the Snow Leopard DVD and follow the steps to install the drivers. They will give compatibility for all the hardware of your Mac, so you won't have any problem with Windows.
    After installing Windows, your Mac will always start into Windows by default. If you want to start into OS X, press X key while your Mac is starting. If you want to start always into OS X, press X key while your Mac is starting, open System Preferences > Startup Disk, and choose "Macintosh HD".
    If you do this last step, to start into Windows, you only have to press Option key while your Mac is starting and choose "Windows".
    If you want all the detailed steps to install Windows, you can print this PDF > http://manuals.info.apple.com/en_US/Boot_Camp_Install-Setup_10.6.pdf

  • OBIEE execute stored procedure to load tables before running report

    Hi..
    I want to execute a stored procedure to load database tables before running a report in OBIEE .
    I need to pass 2 parameters to the stored procedure which loads into tables.
    In the Connection Pool --> Connection Script Tab --> Execute before query, I wrote the below query using the repository variables VAR1 & VAR2 to execute the
    DECLARE VAR1 number; VAR2 number;
    BEGIN
    schema_name.package_name1.package_body('VALUE OF(VAR1)', 'VALUE OF(VAR2)'); COMMIT;
    schema_name.package_name2.package_body('VALUE OF(VAR1)', 'VALUE OF(VAR2)'); COMMIT;
    END;
    I am receiving the following error to declare the schema_name.package_name
    +++Administrator:2a0000:2a0004:----2010/06/21 14:29:00
    -------------------- Sending query to database named ACBS-OCC (id: <<49419>>):
    BEGIN schema_name.package_name1.package_body1('VALUE OF(VAR1', 'VALUE OF(VAR2'); COMMIT; schema_name.package_name2.package_body2('VALUE OF(VAR1)', 'VALUE OF(VAR2)'); COMMIT;END;
    +++Administrator:2a0000:2a0004:----2010/06/21 14:29:00
    -------------------- Query Status: Query Failed: [nQSError: 16001] ODBC error state: S1000 code: 6550 message: [Oracle][ODBC][Ora]ORA-06550: line 1, column 7:
    PLS-00201: identifier 'SCHEMA_NAME.PACKAGE_NAME1' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-06550: line 1, column 93:
    PLS-00201: identifier 'SCHEMA_NAME.PACKAGE_NAME2' must be declared
    ORA-06550: line 1, column 93:
    PL/SQL: Statement ignored.
    [nQSError: 16015] SQL statement execution failed.
    Please suggest how to declare and execute the stored procedure.
    Thanks in advance.

    Hi,
    I know that any Function / Procedure needs to be called using a EVALUATE function in OBIEE.
    Thanks,
    Vijay

  • How do i get my ipad to run itunes 10.6

    how do i get my ipad to run itunes 10.6

    If you haven't already done so then you need to download and install iTunes on your computer and add your music to it (File > Add To Library) and you should then be able to connect your iPad to your computer and sync your music to it.
    Syncing music : http://support.apple.com/kb/HT1351
    If you have iTunes 11 on your computer then you may find the instructions on that page easier to follow if you enable the left-hand sidebar via option-command-S on a Mac, control-S on a PC)
    If you haven't synced the iPad to that computer before then you may also find this page useful : https://discussions.apple.com/docs/DOC-3141

  • On another PC I want to backup my bookmarks but my Firefox browser is not working how can I do the backup before I reinstall Firefox

    On another PC I want to backup my bookmarks but my Firefox browser is not working how can I do the backup before I reinstall Firefox.
    Firefox can't renew it's last tabs and now won't run and let me do a backup

    It is possible that there is a problem with the files sessionstore.js and sessionstore.bak in the Firefox Profile Folder.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox Profile Folder.
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    See also:
    *http://kb.mozillazine.org/Session_Restore
    *http://kb.mozillazine.org/sessionstore.js
    *http://kb.mozillazine.org/Multiple_profile_files_created

  • How to know the stage where a running report is? - in Reports 3.0

    Hi!
    Thanks for paying attention.
    I have a problem with running the reports. When I call a report from the forms using the built-in, RUN_PRODUCT, the report is running. The problem is, some times, it may take few min and some times more than 10 min and some times, it stops responding. So, how do I know at what stage the report is in.
    For ex, if the report is run in Reports Designer, it shows a screen with client and server activity. Can I get the same effect by using the RUN_PRODUCT built-in.
    Please help me or suggest me with some solution
    Thank you
    regards
    RHR PRASAD

    Hello rhr_pras
    this is quotation form Report 3.0 manual:
    Description PRINTJOB specifies whether the Print Job dialog box should be displayed before running a report.
    Syntax
    [PRINTJOB]YES
    Values
    YES or NO
    Default
    YES
    Usage Notes
    n When a report is run as a spawned process (i.e., one executable, such as R30RUN, is called from within another executable, such as R30DES), the Print Job dialog box will not appear, regardless of PRINTJOB.
    n When DESTYPE=MAIL, the Print Job dialog box will not appear, regardless of PRINTJOB.
    Also look for other parameters in paramlist for Run_Product (maybe BATCH) and maybe report mode (SYNCHR/ASYNCHR)
    Hope this helps

  • Validation before running test script?

    Hello Gurus,
    I am getting started to learn eCATT and with different posts availabe I was sucessfully able to create and execute simple scripts. Thanks for posting all this and I am now able to create all four objects in eCATT. A special thanks to Sapna Modi for her step wise information.
    However, I have certain conditions to check before running test script. Like I want to check a table entry and if the entry exists then the test script should be executed. I tried with ABAP  ...ENDABAP and TCD recording.  I wasnt able to do it.
    Could anyone of you please let me know how we can accomplish this? Also when the entry isnt there in the table the test script should fail and appropriate message should be displayed in the log.
    Also, please let me know if we can use TCD and SAPGUI commands within ABAP ENDABAP commands.
    Your help is highly appreciated...
    Regards,
    GS...

    Hi,
    For your negative testing,if your entry is not listed in the table.Eventually CHETAB command wil fail and you see a Red log.
    For not executing the script,if your check fails.Please add some condition..
    In CHETAB/GETTAB table commands,Say you passed a value and it is found in the table.Then the return value for the CHETAB/GETTAB would be zero.If it is failed it return Non-zero values.This values can be captured by using the command &SUBRC.
    So please apply a condition for your next script to execute..
    If &SUBRC = 0
    give the script name
    else
    log(condition failed)
    endif.
    just add this code in between your code..and place the script you wanna execute after your check is successful.
    Hope it answers your doubts.
    Regards,
    Venky

Maybe you are looking for

  • Hiding fields in contract management SRM.

    Hi, How can we hide fields in the item data in the process contracts. the fields that i need to hide are: product type vendor number. Can we achieve it without using the BADI ??? Thanks, Pradeep. Edited by: Pradeep Purushottam on Apr 22, 2008 11:28 A

  • Redetermination of condition table for a condition type

    Hai Friends, I have a quiery regarding condition table redetermination from order to delivery.I have pricing procedure in which "ZMRP" is the mrp price for calculating other condition types.Here i have scenario While raising sales order ZMRP conditio

  • Dual Monitor Problem - Context Menus are in the wrong place

    Hey there, I've been looking all over google to try to find a solution to this problem, but to no avail. I'm currently using a second monitor together with my macbook pro on leopard. When ever i open up a context menu, the menu appears on the first s

  • Progress bar using htp.DIV

    Hi, Below is my Code to get a progress bar on the screen. PROCEDURE lp_progress_bar IS BEGIN htp.htmlOpen; htp.headOpen; -- Create Link to Style Sheet htp.linkrel(crel => 'stylesheet', curl => pk_constant.PATH_STATIC||'internal_body.css', ctitle => '

  • Where is the Mobile Reader White Paper

    Hi, I'm looking for this document to optimise PDFs for Android: http://www.adobe.com/products/acrobat/pdfs/MobileReaderWhitePaper.pdf     Does anyone know where it can be found? Cheers, Julius.