Check the value of attribute of a child node in datatype xmltype.

Hello,
I have a xml stored in column having datatype as "XMLTYPE"
<?xml version="1.0" encoding="ISO-8859-1"?>
<Settings>
  <Setting Name="A1" Value="N"/>
  <Setting Name="A2" Value="N"/>
  <Setting Name="A3" Value="SOMEVALUE"/>
  <Setting Name="A4" Value="N"/>
  <Setting Name="A5" Value="Y"/>
  <Setting Name="A6" Value="N"/>
</Settings>I do not want to loop into each child node. But want to find out if the value of setting A5 is Y or N? Is there a way I can find that without doing the extract of "Setting" child node and then looping each node to find the value?
Regards,

You didn't specify your version of Oracle so here are two options. If 10.2 or greater, use XMLTable, else use the ExtractValue option.
-- The WITH simply simulates your existing table that I do not have.
WITH fake_tab AS
(SELECT XMLTYPE('<?xml version="1.0" encoding="ISO-8859-1"?>
<Settings>
  <Setting Name="A1" Value="N"/>
  <Setting Name="A2" Value="N"/>
  <Setting Name="A3" Value="SOMEVALUE"/>
  <Setting Name="A4" Value="N"/>
  <Setting Name="A5" Value="Y"/>
  <Setting Name="A6" Value="N"/>
</Settings>
') tab_col
  FROM dual)
-- For 10.2 and higher use this SELECT
SELECT a5
  FROM fake_tab,
       XMLTABLE('/Settings'
                PASSING fake_tab.tab_col
                COLUMNS
                a5   VARCHAR2(10)  PATH 'Setting[@Name="A5"]/@Value');
-- For 10.1 and before
SELECT ExtractValue(tab_col, '/Settings/Setting[@Name="A5"]/@Value')
  FROM fake_tab;

Similar Messages

  • How to check the value of "The Interrupt Status Flag"?

    Hi, thank you for reading this post!
    Invoking Thread.interrupt() sets the value of the Interrupt Status Flag.
    Just wondering if there is a Java method to check the value of this flag? Or is using isInterrupted() or interrupted() the only way to check?
    http://download.oracle.com/javase/tutorial/essential/concurrency/interrupt.html
    Thank you in advance for your help!
    Eric

    Below is the full code. As soon as the Thread.sleep() is taken out in main(), the interrupt is detected in the child thread. But if the sleep() stays, then the child thread goes into an infinite loop. It's not detected the interrupt.
    //ParentInterruptChildThreadCatchedDemo.java
    //Program function: This program demonstrates the parent thread (main()) interrupting a child thread (thread1).
    //Threaded class
    class TryThread extends Thread {
         //fields
         private String threadname;
         private long aWhile;
         //Constructor
         public TryThread(String tname, long delay) {
              threadname = tname;
              aWhile = delay;
         //run() method
         public void run() {
              while(!Thread.interrupted()) {
                   //Do work
              try {
                   System.out.println(Thread.currentThread().getName() + " was just interrupted!");
                   throw new InterruptedException();
              } catch(InterruptedException e) {
                   //System.exit(1);
                   return;
    public class ParentInterruptChildThreadCatchedDemo {
         public static void main(String[] args) {
              Thread thread1 = new TryThread("thread1", 2000L);
              thread1.start();
              try {
                   System.out.println("main() goes to sleep for 10 second.");
                   Thread.sleep(10000);
                   System.out.println("Statement after main() sleep().");
              } catch(InterruptedException e) {
                    e.printStackTrace();
                 //Interrupt thread1
                  int interruptFlag = 5;
                  for(int i=0; i<11; i++) {
                       if(i == interruptFlag) {
                            System.out.println("Condition met, going to interrupt thread1 ...");
                            thread1.interrupt();
                            System.out.println("Thread1 interrupted!");
                  System.out.println("Ending main()");
    /*Output:
    main() goes to sleep for 10 second.
    Statement after main() sleep().
    Condition met, going to interrupt thread1 ...
    Thread1 interrupted!
    Ending main()
    INFINITION LOOP
    */

  • How to check the value from user input in database or not?

    Hello;
    I want to check the value of user input from JtextFiled in my database or not.
    If it is in database, then i will pop up a window to tell us, otherwise, it will tell us it is not in database.
    My problem is my code do not work properly, sometimes, it tell me correct information, sometime it tell wrong information.
    Could anyone help,please.Thanks
    The following code is for check whether the value in database or not, and pop up a window to tell us.
    while( rs.next()) {
                    System.out.println("i am testing");
                    bInt=new Integer(rs.getInt("id"));
                    if(aInt.equals(bInt)){ // If i find the value in data base, set flag to 1.
                  flag=1;  //I set a flag to check whether the id in database or not
                        break;
             System.out.println("falg" + flag);
                if(flag==1){ //?????????????????????
              String remove1 = "DELETE FROM Rental WHERE CustomerID=" + a;
              String remove2 = "DELETE FROM Revenus WHERE CustomerID=" +a;
              String remove3 = "DELETE FROM Customer WHERE id=" +a;
              s.executeUpdate(remove1);
              s.executeUpdate(remove2);
              s.executeUpdate(remove3);
                    JOptionPane.showMessageDialog(null,"you have success delete the value");
              s.close();
             else//???????????????????????????????
                  JOptionPane.showMessageDialog(null,"I could not found the value"); -------------------------------------------------------------------
    My whole program
    import java.sql.*;
    import java.awt.BorderLayout;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JOptionPane;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    public class DeleteC extends JFrame
        public static int index=0;   
        public static ResultSet rs;
        public static Statement s;
        public static Connection c;
        public static  Object cols[][];
        private static JTable table;
        private static JScrollPane scroller;
        private static int flag=0;
        public DeleteC()
            //information of our connection
            //the url of the database: protocol:subprotocol:subname:computer_name:port:database_name
            String strUrl      = "jdbc:oracle:thin:@augur.scms.waikato.ac.nz:1521:teaching";
            //user name and password
            String strUser      = "xbl1";
            String strPass      = "19681978";
            //try to load the driver
            try {
                Class.forName("oracle.jdbc.driver.OracleDriver");
            catch (ClassNotFoundException e) {
                System.out.println( "Cannot load the Oracle driver. Include it in your classpath.");
                System.exit( -1);
            //a null reference to a Connection object
            c = null;
            try {
                //open a connection to the database
                c = DriverManager.getConnection( strUrl, strUser, strPass);
            catch (SQLException e) {
                System.out.println("Cannot connect to the database. Here is the error:");
                e.printStackTrace();
                System.exit( -1);
           //create a statement object to execute sql statements
        public void getData(String a){
            try {
             //create a statement object to execute sql statements
             s = c.createStatement();
                int index=0;
                Integer aInt= Integer.valueOf(a);
                Integer bInt;
                  //our example query
                String strQuery = "select id from customer";
                //execute the query
                ResultSet rs = s.executeQuery( strQuery);
                //while there are rows in the result set
                while( rs.next()) {
                    System.out.println("i am testing");
                    bInt=new Integer(rs.getInt("id"));
                    if(aInt.equals(bInt)){
                  //JOptionPane.showMessageDialog(null,"I found the value"); 
                  flag=1;
                        break;
             System.out.println("falg" + flag);
                if(flag==1){
              String remove1 = "DELETE FROM Rental WHERE CustomerID=" + a;
              String remove2 = "DELETE FROM Revenus WHERE CustomerID=" +a;
              String remove3 = "DELETE FROM Customer WHERE id=" +a;
              s.executeUpdate(remove1);
              s.executeUpdate(remove2);
              s.executeUpdate(remove3);
                    JOptionPane.showMessageDialog(null,"you have success delete the value");
              s.close();
             else
                  JOptionPane.showMessageDialog(null,"I could not found the value");
            catch (SQLException e) {
                 JOptionPane.showMessageDialog(null,"You may enter wrong id");
    My main program for user input from JTextField.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JOptionPane;
    import java.util.*;
    public class EnterID extends JFrame{
        public JTextField tF1;
        public EnterID enID;
        public String tF1Value;
        private JLabel label1, label2, label3;
        private static JButton button;
        private static ButtonHandler handler;
        private static String aString;
        private static Integer aInteger;
        private static Integer checkV=0;
        public static void main(String args[]){
           EnterID eId= new EnterID();
       public EnterID(){
          handler=new ButtonHandler();
          Container c= getContentPane();
          c.setLayout(new GridLayout(3,1));
          button= new JButton("ok");
          button.addActionListener(handler);
          label1 = new JLabel(" CustomerID, Please");
          label2 = new JLabel("Label2");
          label3 = new JLabel();
          label3.setLayout(new GridLayout(1,1));
          label3.add(button);
          label2.setLayout(new GridLayout(1,1));
          aString = "Enter Id Here";
          tF1 = new JTextField(aString);
          label2.add(tF1);
          c.add(label1);
          c.add(label2);         
          c.add(label3);            
          setSize(150,100);
          setVisible(true);     
       private class ButtonHandler implements ActionListener{
         public void actionPerformed(ActionEvent event){
             tF1Value=tF1.getText();
            //   CheckData cData = new CheckData();
             //  aInteger = Integer.valueOf(tF1Value);      
             if(tF1Value.equals(aString)){
              JOptionPane.showMessageDialog(null,"You didn't type value into box");
              setVisible(false); 
            else {
                DeleteC dC= new DeleteC();
                dC.getData(tF1Value);
                setVisible(false); 
    }

    You may have working code now, but the code you posted is horrible and I'm going to tell you a much much much better approach for the JDBC part. (You should probably isolate your database code from your user interface code as well, but I'm skipping over that structural problem...)
    Do this instead:
        public void getData(String a){
            PreparedStatement p;
            String strQuery = "select count(*) the_count from customer where id = ?";
            try {   
             //create a prepared statement object to execute sql statements, it's better, faster, safer
             p = c.prepareStatement(strQuery);
                // bind the parameter value to the "?"
                p.setInt(1, Integer.parseInt(a) );
                //execute the query
                ResultSet rs = p.executeQuery( );
                // if the query doesn't throw an exception, it will have exactly one row
                rs.next();
                System.out.println("i am testing");
                if (rs.getInt("the_count") > 0 ) {
                // it's there, do what you need to...
             else
                  JOptionPane.showMessageDialog(null,"I could not find the value");
            catch (SQLException e) {
                 // JOptionPane.showMessageDialog(null,"You may enter wrong id");
                 // if you get an exception, something is really wrong, and it's NOT user error
            // always, always, ALWAYS close JDBC resources in a finally block
            finally
                p.close();
        }First, this is simpler and easier to read.
    Second, this retrieves just the needed information, whether or not the id is in the database. Your way will get much much slower as more data goes into the database. My way, if there is an index on the id column, more data doesn;t slow it down very much.
    I've also left some important points in comments.
    No guarantees that there isn't a dumb typo in there; I didn't actually compile it, much less test it. It's at least close though...

  • How to check the value in Table CDPOS

    Mostly I can't see the following fields value in the table CDPOS,
      (1) CDPOS-VALUE_NEW
      (2) CDPOS-VALUE_OLD
    In fact, it should have values, so how to check the values, is there any special method needed?
    Thanks and best regards.

    Ferry Lianto,
    Thank you very much for your expertise.
    It's helpful to get some contents via FM:CHANGEDOCUMENT_READ_POSITIONS, the problem is, to some kind of DELETION operation, the log in table CDPOS is very simple, I still don't know which contents were deleted even though I found records in table CDPOS.
    Is there any other suggestions?
    Thanks and best regards.

  • Check the values while saving the values in SM30

    Hi all,
    I have created a Table maintennace for a ztable in SM30.
    I want to check the values while saving the values in the SM30.
    Can aynbody please give any idea how can i acieve this.
    Thanks,
    Tarangini

    Hi Tarangini,
    Go to the Table Maintenence Generator screen in Change mode. from this Screen go to the
    Enviorment->Modifications->Events.
    New screen will open and click on the New Entries button.
    then from the F4 Help of the first column, select ur appropriate Event and in the second column give the name of the Subroutine.
    and from the Third column u can do the coding for the subroutine as shown below.
    FORM BEFORE_DATA_SAVE.
    IF SY-UNAME EQ 'USER1' OR SY-UNAME EQ 'USER2'.
    ELSE.
       message 'No Authorization for Change...' type 'E'.
    ENDIF.
    ENDFORM.
    Regards
    Jagesh

  • Invalid text value. A text field contains invalid data. Check the value and try again

    Hello,
    I am having a problem with the error mentioned in the title. I see alot of others have experienced the same problem, but I have quite a twist to it.
    I see the problem when I try to edit a list item, and then try to save the changes.
    Here what I see in the ULS log:
    System.Runtime.InteropServices.COMException: Invalid text value. A text field contains invalid data. Check the value and try again  
    at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId,
    Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter
    pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)   
    at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean
    bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback,
    ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback)
    I have 3 front end servers(fx wfe1, wfe2, wfe3).  And here is the twist.
    If I access the library directly through wfe1 and wfe2, I get the error. If I access the library via wfe3 if works just fine.
    So because of this, I think it is safe to assume that is has nothing to do with the character limit of 255. Nor does it have anything to do with the field type, since it is already set to mulitible lines of text.
    So. Any ideas?
    Regards,
    Michael
    mic

    Check if there is any change in web.config of these servers
    http://support.microsoft.com/kb/2880758
    To work around this issue, limit the length of the personal message in the invitation to 256 characters or less.
    This is a known issue. Microsoft is working to resolve this issue.
    http://social.msdn.microsoft.com/Forums/en-US/7bb16e51-e7cc-439e-a8b3-755683ccac1a/max-length-on-custom-field-types
    To solve the problem you may have to change the field's parent type to "note". To do that you have to open your fldtypes... file under Templates/xml and change the line to:
    "<Field Name="ParentType">Note</Field>" from "<Field Name="ParentType">Text</Field>"
    You might also have to add a sql type if your text needs to be longer than 255 characters
    <Field Name=”SQLType”>ntext</Field>
    and inherit from SPFieldMultiLineText instead of SPFieldText
    If this helped you resolve your issue, please mark it Answered

  • Condition that checks the value of an Item derived from a select list

    I want to conditionally display and hide items in a region based on a select list item.
    Some items will display when the select list is at the default (%null%) and others will be displayed when the select list user selects from the select list.
    The display is then updated when the "SAVE" button is pressed and the page processed.
    How do I test the select list item to be null. The condition looks like this;
    Type: PL/SQL Expression
    :P1_SELECT is null
    I also tried, :P1_SELECT is not null and :P1_SELECT = '%nul%'.
    The latter changed the condition to :P1_SELECT = ''
    How can I test the valu in P1_SELECT?
    tia,
    Sam
    Message was edited by:
    After a long day I saw that I did not write the condition correctly. Mea culpa.
    slavanaway

    I had the problem wrong.
    The issue was a second field that could have a Y or N or null. When I checked it in PL/SQL expression as
    :P_YN != 'Y' and :P_SELECT is null
    assuming the null condition would resolve as != 'Y' I had to do an explicit check as
    (:P_YN != 'Y' or :P_YN is null) and :P_SELECT is null
    That fixed it.... I like null and I hate null
    Thanks for the reply

  • How to get the values and attributes of Longlived processes by using ProcessID.

    Hi Experts,
    For  every process we creates, LC ES2 creates processID.
    we know that if you creates  a long lived process, all  the  values which are in proces will be stored some where  in DB.
    Here my requirement is by using  processID I need to get all/some values/variables stored in database.
    I am not able to get values using processID. Here I don't have clue on  how to get the values.
    Please tell me  how to get the same by using  Process Management. Link/guide would be helpful
    Thanks
    Praveen.

    Searchable means you can put a filter criteria on it (e.g. where amount > 50000)
    Visible means you can add have this column returned as an output (and therefore you can add it as column in listview and see it in Task Details).
    These two attributes were provided so that queries could be done against the process variables, but the exact contents of the variables are not allowed to be seen.

  • Report to check the valued GR block stock

    Hi,
    I used movement type 107 to receive the PO with indicator 'Origin Accept', and would like to check how many stock I have received to the valued GR block stock.
    Anyone tell me which report I can use? I've checked the stock report under IM, but haven't found it.
    Thanks!
    Lin

    run Tcde MB52, and from change layout Ctrl+F8 move column Value BlockedStock.

  • How to ge the value for attribute for terminal services attribute in Active Directory from userParameters attribute

    I am using dirsync to get  the attributes value that have changed in Active Directory(changelog).
    The following link explains how the dirsync is used to get attribute values :
    'http://blogs.technet.com/b/isrpfeplat/archive/2010/09/20/using-the-dirsync-control.aspx'
    I am changing the attribute Local path under Remote Desktop Services Profile of a user. I have ran a client which uses dirsync to get the changed objects in AD.
    In the client the attribute that is changed is `userParameters` and the value is in encrypted form. 
        CtxCfgPresent                                   P☺CtxCfgPresent???? ☻☺CtxWFProfi
        lePath?↑→☺CtxWFHomeDir?????????????"☻☺CtxWFHomeDirDrive?☺CtxShadow????☺CtxMaxDis
        connectionTime????☺CtxMaxConnectionTime????☺CtxMaxIdleTime???? ☻☺CtxWorkDirector
        y?☺CtxCfgFlags1????"☻☺CtxInitialProgram?
    Is there a way to get  the actual value form the userParameters.

    Hi,
    What about other changed attributes? Are other attributes retrieved by DirSync control turn to be encrypted form?
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • How to check the value entered in one co from anethor CO

    Dear All,
    I have a Debrief screen in which one main region is attached to CO1 and a tab region is attached to CO2, the tab region  is an independent region in the main rdebrief main RN,
    Here i have a requirement if one of the field of the tab region is entered , that has to be captured in the Debrief main Region CO.
    could you help in assisting this.
    Regards
    AK

    AK,
    You can get handle of any item in the page from the mainCO by getting handle of the bean. You will have to get the handle of the tabbed region and get the handle of the corresponding field.
    Alternatively, you can get the value from the VO Attribute, if the field is mapped to a VO attribute.
    Cheers
    AJ

  • How can I check the values of a textbox, if the vaule is numeric?

    Hello,
    I have a (maybe simple?) problem:
    I'm using a Webform with a input-field. With JSP I want do check, if the value of this textbox is numeric.
    In Visual Basic there exists the method IsNumeric(). But I don't know how to check it with Java/JSP?
    What classes/methods have I to use ?
    Bye
    Chris

    If you don't want to work with the exceptions then, you could just check if all the digits are numbers or a decimal point, but then you may need exponents or comma's for seperation too.

  • Any way to get the value of attribute in method call

    Hi
    I am using ADF 11.1.1.3 and dynamic tab shell.
    I am trying to download file form my page fragment.
    *<af:commandLink text="#{row.bindings.element.inputValue.FileName}"*
    id="viewFileInfo"
    *actionListener="#{backingBeanScope.backing_fragments_auditChecklistUploadedFilesInfo.getFileInformation}">*
    *<af:fileDownloadActionListener filename="#{row.bindings.element.inputValue.FileName}"*
    *contentType="#{row.bindings.element.inputValue.MimeType};"*
    *method="#{backingBeanScope.backing_fragments_auditChecklistUploadedFilesInfo.getFile}"/>*
    *</af:commandLink>*
    I need the value of the filename *#{row.bindings.element.inputValue.MimeType};* inside my method *method="#{backingBeanScope.backing_fragments_auditChecklistUploadedFilesInfo.getFile}" D oyou have any idea how can i achieve the same..
    *Scenerio* -
    I have a table and inside a table filename column is a command link. And on click of the link i fetch the data from db for that file thats why i need file name inside **method="#{backingBeanScope.backing_fragments_auditChecklistUploadedFilesInfo.getFile}"* ..
    Any idea?

    Did you try the above code ?
    toolbean.finditerator does the following
        public static BindingContainer getBindingContainer() {
            return (BindingContainer)getValueExpression("#{bindings}");
        public static DCBindingContainer getDCBindingContainer() {
            return (DCBindingContainer)getBindingContainer();
        public static DCIteratorBinding findIterator(String name) {
            DCIteratorBinding iter =
                getDCBindingContainer().findIteratorBinding(name);
            if (iter == null) {
                throw new RuntimeException("Iterator '" + name + "' not found");
            return iter;
        }If you tried the above code is the iterator null ?
    What code are you using in your bean ?

  • How to get the value of attribute.

    Hi,
         I have requirement that i have to pass lineid  as parameter to procedure.
         Line id is prasent in the vo.
    So to capture the value of that line id after clicking update button.
    I've created one event on update button in that created the parameter
    updaterecord  ${oa.UpdateVO1.LineId}
    and to capture that i write the following code in the PFR.
    if("update".equals(pageContext.getParameter(EVENT_PARAM)))
    OAApplicationModule am=(OAApplicationModule)pageContext.getRootApplicationModule();
    String lid = pageContext.getParameter("updaterecord").toString();
    String promiseD=pageContext.getParameter("PromiseDate").toString();
    Serializable [] parameters1={lid,promiseD};
    am.invokeMethod("Update", parameters1);
    But its passing null value .
    Please any one will help how to capture the values.
    Regards,
    Sangu

    Hi Sangu,
    Try below code
    //In Controller
    java.sql.Date convDate; //declare variable
      String lid = pageContext.getParameter("updaterecord").toString();
      String promiseD=pageContext.getParameter("PromiseDate");
       OADBTransaction txn = am.getOADBTransaction();
         if(promiseD!=null)
                java.sql.Date javaSqlDate = txn.getOANLSServices().stringToDate(promiseD);
                convDate= javaSqlDate;
              // set converted value
                Serializable [] parameters1={lid,convDate};
                am.invokeMethod("Update", parameters1);
    Do  date conversion same way in AM before setting date Value.
    How to call pl/sql function from oaf
    Regards,
    Dilip

  • How to check the value of a string is numeric, alphanumeric or characters?

    Hi All,
    I have a task to validate an employee Id. Suppose the employee Id is E121212. Now as per the validation rule I need to check "the first letter of the employee Id is a character and rest are numbers." How can I do this? Please reply.
    Thanks & Regards
    Bibhuprasad Soumyaranjan

    >
    Hi Bibhuprasad,
    I have a task to validate an employee Id. Suppose the employee Id is
    E121212. Now as per the validation rule I need to check "the first letter
    of the employee Id is a character and rest are numbers." How can I do this? Please reply.Everyone else has proposed REGEXP_LIKE, and while it's very powerful, it is
    also very CPU intensive. You should always use Oracle's string functions
    instead of Regular Expressions if possible.
    I played around with
    WITH data
         AS (SELECT 'E11212' s FROM DUAL
             UNION ALL
             SELECT '121212' FROM DUAL
             UNION ALL
             SELECT 'EE121212' FROM DUAL
             UNION ALL
             SELECT 'É121212' FROM DUAL
             UNION ALL
             SELECT 'E1EEEEEEEE' FROM DUAL
             UNION ALL
             SELECT 'E134343444' FROM DUAL)
    SELECT s,
      CASE
        WHEN (SUBSTR(s, 1, 1) BETWEEN 'A' AND 'Z') -- AND (TO_NUMBER(SUBSTR(s, 2, LENGTH(s)), 999999) > 111111)
          THEN 'Correct Format'
        ELSE
          'Incorrect Format'
        END mySSN,
        SUBSTR(s, 2, LENGTH(s)) AS theNumber
    FROM data;I think that this can be worked so that it willl go what you require without using
    REGEXP_LIKE.
    HTH,
    Paul...
    Bibhuprasad Soumyaranjan

Maybe you are looking for