How to fetch the junk values of a column and the column name in oracle

Hello,
Can anyone help me in writing a procedure/dynamic SQL to fetch the column where the junk values appears and its value. Eg: If emp table contains ID and Name columns, and ID column contains junk values, the result should be the Id column and the junk value/s. It should be dynamic because next time if the other column contains junk values(like $,%...), the query should display the other column too..
Thanks in advance..

Try this, I'm not sure if it'll help... and get some idea...
try to modify it as per your requirement -
select * from junk_vals;
1     ranit1
2#     ranit2
3     ranit3
4$     [email protected]
5     ranit5
6     r^anit6
select 'ID', id, val from junk_vals
    where regexp_like(id,'[^a-zA-Z0-9]')
UNION
select 'VALUE', id, val from junk_vals
    where regexp_like(val,'[^a-zA-Z0-9]');
-- "Output :"
ID     2#     ranit2
ID     4$     [email protected]
VALUE     4$     [email protected]
VALUE     6     r^anit6
NOTE - I've considered anything other than Alphabets and Numbers as a Junk Value
Edited by: ranit B on Jan 4, 2013 5:07 PM
-- o/p added

Similar Messages

  • Getting the original values in table maintenance and the new one and send t

    Hello experts,
    In table maintenance, I need to capture the original values in that selected column/field and
    also the new one and send it to email. For example, I have a field in my z table named zaddress and whenever
    the user changes the contents of that selected row I need to get/fecth the original value and the new and send it to email.
    So the email will be something like this:
    Dear Admin,
    Changes were made to ztable. Here are the changes:
    Customer : Customer 1
    Order no : 1
    Original Address : example address A
    New Address : example address B
    NOTE: Do not reply to this email.
    Again, thank you guys and have a nice day!

    Hi Vijay,
    <b>1</b>.
    If u r using Modulepool programming to change the field contents ,u just capture field value into one  variable .This is possible in <b>PBO</b>.before displaying .once u change the field value and press something ,now capture changed value in another variable .This is possible in <b>PAI</b>.After pressing something to modify Database.
    I think u can get one idea after reading this .
    <b>2</b>.
    For sending mail it is not a problem.
    You can check the following code.
    *-------Mail related tables ,structures and variables
    DATA:
       w_subject       LIKE sodocchgi1,
       i_pack_list     LIKE sopcklsti1 OCCURS  1  WITH HEADER LINE,
       i_objhead       LIKE solisti1   OCCURS  1  WITH HEADER LINE,
       i_contents_text LIKE solisti1   OCCURS 10  WITH HEADER LINE,
       i_cont_bin      LIKE solisti1   OCCURS 10  WITH HEADER LINE,
       i_objhex        LIKE solix      OCCURS 10  WITH HEADER LINE,
       i_receiver      LIKE somlreci1  OCCURS  1  WITH HEADER LINE,
       i_listobject    LIKE abaplist   OCCURS  1  WITH HEADER LINE,
       pdf             LIKE tline      OCCURS 100 WITH HEADER LINE,
       content_out     LIKE solisti1   OCCURS 0 WITH HEADER LINE.
    DATA:
       tab_lines       TYPE i,
       doc_size        TYPE i,
       att_type        LIKE soodk-objtp,
       obj_desc        LIKE w_subject-obj_descr,
       sent_to_all     LIKE sonv-flag,
       client          LIKE tst01-dclient,
       name            LIKE tst01-dname,
       objtype         LIKE rststype-type,
       type            LIKE rststype-type,
       is_otf          TYPE c ,
       no_of_bytes     TYPE i,
       pdf_spoolid     LIKE tsp01-rqident,
       jobname         LIKE tbtcjob-jobname,
       jobcount        LIKE tbtcjob-jobcount,
       pn_begda        LIKE sy-datum,
       val(1)          TYPE c,
       pripar          TYPE pri_params,
       arcpar          TYPE arc_params,
       lay             TYPE pri_params-paart,
       lines           TYPE pri_params-linct,
       cols            TYPE pri_params-linsz,
       spool_name      TYPE pri_params-plist.
      CLEAR :w_subject,
             sent_to_all,
             i_pack_list[],
             i_objhead[],
             i_cont_bin[],
             i_contents_text[],
             i_receiver[].
      i_cont_bin = '  |  '.
      APPEND i_cont_bin.
    Subject of the mail.
      obj_desc  = 'Outstanding Appraisals' .
      w_subject-obj_name  = 'MAIL_ALI'.
      w_subject-obj_descr = obj_desc.
    Body of the mail
      DATA :head_desc LIKE i_contents_text,
            body_desc LIKE i_contents_text.
      i_contents_text = space.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      CONCATENATE
      'Please refer to the attached list of appraisal(s) that require your'
      'attention. Please log in to the eHR System and use the eAppraisal'
      'function to work on it.'
      INTO body_desc
      SEPARATED BY space.
      i_contents_text = body_desc.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      CLEAR body_desc.
      i_contents_text = 'Thank You.'.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      i_contents_text = space.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
      CONCATENATE '(Note: This is system generated message, please'
                  'do not reply'
                  'to this Email.)'
               INTO i_contents_text
               SEPARATED BY space.
      APPEND i_contents_text.
      CLEAR  i_contents_text.
    Write Packing List (Body)
      DESCRIBE TABLE i_contents_text LINES tab_lines.
      READ     TABLE i_contents_text INDEX tab_lines.
      w_subject-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(
      i_contents_text ).
      CLEAR i_pack_list-transf_bin.
      i_pack_list-head_start = 1.
      i_pack_list-head_num   = 0.
      i_pack_list-body_start = 1.
      i_pack_list-body_num   = tab_lines.
      i_pack_list-doc_type   = 'RAW'.
      APPEND i_pack_list.
      CLEAR  i_pack_list.
    Create receiver list
       i_receiver-receiver = g_email_next_man.
      i_receiver-rec_type = 'U'.
      APPEND i_receiver.
      CLEAR  i_receiver.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = w_subject
          put_in_outbox              = 'X'
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = sent_to_all
        TABLES
          packing_list               = i_pack_list
          object_header              = i_objhead
          contents_bin               = i_cont_bin
          contents_txt               = i_contents_text
          receivers                  = i_receiver
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc NE 0.
      ENDIF.
    I think it helps u something.
    <b>Thanks,
    Venkat.O</b>

  • How to fetch geometry of values

    How to fetch geometry of values,
    I wanted to fetch the 4th positioned n 5th positioned values from the
    SDO_ORDINATE_ARRAY and one unique Column ID,
    sample data for the same follows
    SQL> desc TEST
    Name Null? Type
    GEOMETRY MDSYS.SDO_GEOMETRY
    ID NUMBER
    SQL> select id, geometry from test
    where rownum<7
    TEST GEOMETRY(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    1 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408551.27, 2925997.25))
    2 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(.011493516, -.99993395, 0, 408442.69, 2925997.45))
    3 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(-.02636329, .999652428, 0, 408551.45, 2926096.46))
    4 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408551.77, 2926212.98))
    5 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408552.01, 2926314.81))
    6 SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(1, 0, 0, 408470.67, 2926137.08))
    6 rows selected.
    SQL>
    another table TESTZ is created to insert the fetched values from TEST
    table
    SQL> desc TESTZ
    Name Null? Type
    TEST NUMBER
    ES NUMBER
    NR NUMBER
    The following pl/sql program is used for fetching the required data
    DECLARE
    CURSOR p_cur
    IS
    select id,geometry from test order by rownum ;
    es number;
    nr number;
    locus mdsys.sdo_geometry;
    BEGIN
    for i in p_cur
    loop
    locus := i.geometry ;
    es:=locus.sdo_ordinates(4);
    nr:=locus.sdo_ordinates(5);
    insert into testz values(i.idz,es,nr);
    end loop;
    END;
    ERROR at line 1:
    ORA-06533: Subscript beyond count
    ORA-06512: at line 20
    the same Script is working well for other data sets But its giving the
    following Errror for the ABOVE
    data set, the test table got 90,000 records
    please Suggest me the required Solution to fecth the 4th and 5th
    postioned values from SDO_ORDINATE_ARRAY ;
    Many thanks
    ZameeR

    As I said in another posting (this is a cross-post):
    drop table test;
    create table test (id integer, geometry mdsys.sdo_geometry);
    insert into test ( id, geometry ) values (
    1,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408551.27, 2925997.25)));
    insert into test ( id, geometry ) values (
    2,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(.011493516, -.99993395, 0, 408442.69, 2925997.45)));
    insert into test ( id, geometry ) values (
    3,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(-.02636329, .999652428, 0, 408551.45, 2926096.46)));
    insert into test ( id, geometry ) values (
    4,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408551.77, 2926212.98)));
    insert into test ( id, geometry ) values (
    5,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(0, 1, 0, 408552.01, 2926314.81)));
    insert into test ( id, geometry ) values (
    6,SDO_GEOMETRY(2001, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 0, 6000, 4, 1, 1), SDO_ORDINATE_ARRAY(1, 0, 0, 408470.67, 2926137.08)));
    commit;
    select a0.id, c.column_value, e.column_value
    from test a0,
          (select b1.id, mod(rownum,5) rown, b2.*
             from test b1,
                  table(b1.geometry.sdo_ordinates) b2
          ) c,
          (select d1.id, mod(rownum,5) rown, d2.*
             from test d1,
                  table(d1.geometry.sdo_ordinates) d2
          ) e
    where ( c.id = a0.id and c.rown = 4 )
      and ( e.id = a0.id and e.rown = 0 )
    /Requires no external functions or packages.
    regards
    Simon

  • How to set a default value in my DropDown using the key  ?

    Hello All,
      Can someone advose how I can achieve the above ? I will like to know how to select a default value for the dropdown by key using the key value instead of description.
      The reason why I need to do so instead o fusing description is because my application will populate the dropdown using web services based on the language selection. Hence, if I were to set the default value using description, den other languages will not work anymore.
      Any help will be greatly appreciated. Thank you !!
    from
    KWok Wei

    Kwok,
    Assuming that:
    1. You have a node NodeX, where attribute TargetAttr defined
    2. You have a DropDownByKey UI control, its property selectedKey bound to NodeX.TargetAttr attribute
    Then:
    Place in your code:
    wdContext.currentNodeXElement().setTargetAttr("yourKey");
    VS
    P.S. This topic was raised several times, and forum search works good enough to find an answer

  • How to retrieve a property value from an iview in the back-end?

    Hi,
    I am looking for a back-end function module or any other way to retrieve the property value of an iview in the portal.
    Is this possible?
    thanks,
    Bert Caryn

    Hi,
    Look at the following threads,
    For programmatically getting the iview properties,
    Programmatically getting iView Properties
    Also,
    Get Properties of IView Programmatically
    Permanent change of iView property programmatically
    Hope these threads help u.
    Regards
    Srinivasan T

  • The fixed value date is empty and not displayed in the VA05 report

    Hi SD Gurus,
    With in the Sales Order in the line item level in the billing tab we have the fixed value date (VBKD - VALDT) were entered. 
    But when we try to execute the report VA05 were the fixed value date column shows empty (i.e without the date it shows the blank).  Can you any one help me with regard.
    We would like to fix this problem.
    Thanks in advance for providing solution to this query.
    Thanks and Regards,
    SAP-SD group

    Hi janarthanam,
    Ok.
    Goto t-code SQVI,SAP Quickviewer.
    Give a name to your query and enter description ,etc.
    Next enter the table from which you want to fetch data,ie,VBKD .
    Select "Layout mode" for displaying data on the SAP screen or "Basis mode " if you want to extract the data to a word doc,excelsheet or a flat file.
    Next you can select the fields you want to display into your report,their position and ascending/descending order,Here make sure u select
    the field u need to display ie. the fixed value date ( VALDT) .
    also select the fields u wish to have in the selection criteria.
    Enter these required information and u would get a report on the SAP screen or in your desired format.
    Hope it will suffice you.
    For any queries ,your are welcomed.
    Thanks,
    Umesh.

  • Cannot set the default value of an item in the detailed table

    Hi,
    I have Master-Detail group, both are Table formats.
    I need to set the default value of an item in the details row to the value of an item in the selected row in the Master table.
    I tried Default Display Value=#{row.MasterItem}, but it seems it is trying to access current details row instead of the Master.
    I tried #{bindings.MasterGroupColumnName.inputValue}, but it does not work.
    Any ideas
    Thanks in advance
    Mohamed

    I think I now what I'm doing differently, I had the "New Rows" JHS property of the detailed table group "empty" instead of the default "2" value.
    It seems that "Default Display Value" expression works only for the new records specified in the "New Rows" property. But when I try to "Add" new record using the "Add Row" button, the new record inserted does not have the default values generated, only has values populated for the items of the FK (in the view link) but not the ones set through the property.
    I guess in a nutshell, how I can get the details item to behave like the FK columns?
    Thanks much
    Mohamed

  • How to fetch service order with partucular system status and user status

    Hello All,
    How to fetch service orders with specific system status and user status.
    thanks

    I want tables or views from where I can fetch service orders. I have to design ALV report based on this.
    I want to fetch released service orders with status INIT and RENT.
    Here, SYSTEM Status = Released and
             USER Status     = INIT
                                        RENT
    So is there any function module available for the same.....

  • How to get STPOV structure values using BOM number and Plant number

    hello All,
    could you please help me out
    'How to get  STPOV structure values using BOM number and Plant number'
    is there any function module where can i give input as bom and plant number .
    waiting for your response.
    regards
    srinivas

    I did a quick where-used lookup in SE11 on the structure STPOV in function module interfaces and came up with the following:
    Function Module                             Short Description                                          
    CK_F_TOTALCOST_COMPUTE                                                                      
    CS_ALT_SELECT_COUPLED_PRODUCT                                                               
    CS_WHERE_USED_CLA                Bills of material; class use                               
    CS_WHERE_USED_CLA_ANY        Bills of material; direct class use or via other class     
    CS_WHERE_USED_CLA_VIA_CLA        Bills of material; class use via classes                   
    CS_WHERE_USED_COP                                                                           
    CS_WHERE_USED_DOC                Bills of material; document use                            
    CS_WHERE_USED_DOC_ANY:Bills of material; direct and (indirectly) document use via
    CS_WHERE_USED_DOC_VIA_CLA        Bills of material; document use via classes                
    CS_WHERE_USED_KNO                Bills of material; use object dependency                   
    CS_WHERE_USED_MAT                Bills of material; where-used list                         
    CS_WHERE_USED_MAT_ANY:Bills of material; where-used list as article or class item
    CS_WHERE_USED_MAT_VIA_CLA        Bills of material; where-used list via classes             
    EXIT_SAPMC29M_001                BOM; Article Where-Used List   
    It appears that this structure is primarily used for where-used look-ups for components within the BOM.  I don't know if any of these are what you're in need of.
    Hope this helps,
    Mark Schwendinger

  • How do i fix my wifi if it connects and the bars are blue but no check sign appears next to the wifi name and does not connect to the internet???

    How do i fix my wifi if it connects and the bars are blue but no check sign appears next to the wifi name and does not connect to the internet???

    Did you already try to reset the iPod by holding the sleep and home button for about 10sec, until the Apple logo comes back again? You will not lose data.
    If this does not work, try to reset the network settings in Settings/General/Reset. After that you'll have to put in the passwords for all known networks again.
    More troubleshooting can be found here:
    iOS: Troubleshooting Wi-Fi networks and connections

  • How to fix: Music corrupts when transferred to ipod. This happens with the same songs on multiple ipods and the song plays regularly in itunes...

    Basically, I've already described the problem. Some songs play perfectly fine in itunes but the same songs corrupt when placed on different devices of varying age. Therefore, I don't think there's something wrong with the original file and I don't think there's something wrong with all of my devices. Why is this happening and how can I fix it?

    Hello there klundie,
    I was researching the issue you are experiencing, and have come to the conclusion that the songs in question may need to be converted and re imported. This article, iTunes: How to convert a song to a different file format outlines how to re import songs that are already in your itunes library, which I believe will resolve the issue.
    You can find the article here: http://support.apple.com/kb/HT1550
    To convert a song's file format:
    Open iTunes Preferences.
    Windows: Choose Edit > Preferences.
    Mac: Choose iTunes > Preferences.
    Click the General button, then click the Importing Settings button in the second section of the window.
    From the Import Using pop-up menu, choose the encoding format that you want to convert the song to, then click OK to save the settings.
    Select one or more songs in your library, then from the Advanced menu, choose one of the following (The menu item changes to show what's selected in your Importing preferences):
    Create MP3 version
    Create AAC version
    Create AIFF version
    Create WAV version
    Create Apple Lossless version
    If you haven't imported some songs into iTunes yet, you can import and convert them at the same time. This will create a converted copy of the file in your iTunes Library based on your iTunes preferences. To convert all the songs in a folder or on a disk, hold down the Option key (Mac) or Shift key (Windows) and choose Advanced > ConvertImport preference setting. The Import preference setting will match what you chose in step 3. iTunes will prompt you for the location of the folder or disk you want to import and convert. All the songs in the folder or on the disk will be converted. Note: Some purchased songs are encoded using a protected AAC format that prevents them from being converted. iTunes Plus purchases are not protected and can be converted.
    The song in its original format and the newly converted song appear in your library.
    All the best,
    Sterling

  • HT201272 How do i see a list of the apps that have been downloaded and the dates and times and amounts?  Tried to follow the on-line thing but i want to compare what has been downloaded with my visa bill.  HELP!!

    How do i see a list of the apps that have been downloaded and the dates and times and amounts?  Tried to follow the on-line thing but i want to compare what has been downloaded with my visa bill.  HELP!!

    See this -> http://support.apple.com/kb/HT2727

  • I have lost sound on my iPad in apps unless I use headphones ,does anyone know how to get sound back without them .I have used the mute volume on the bar at bottom of screen and the slider volume control there only shows when headphones are plugged in !

    I have lost sound on my iPad in apps unless I use headphones ,does anyone know how to get sound back without them .I have used the mute volume on the bar at bottom of screen and the slider volume control there only shows when headphones are plugged in !
    I also tried resetting settings all to no avail ...I looked up some advice and watched utube video advice on how to fix without success..
    The volume control button on side does not work ,I got the iPad last August and wonder if it is a fault that means I must return it for replacement from where it was purchased ?

    The Retrospect you used way back when is no longer around. The company was sold and that company produced a new version of Retrospect - Retrospect 8.x
    So, as you've been told, you would have to be running a Tiger system with an old version of Retrospect software (5.x or 6.x - you would need to know) assuming you can find the software.
    As best I can remember you cannot extract files from a Retrospect backup except using the software since Retrospect did not normally make a file by file backup rather it created an archive of the files in the backup. I'm assuming that the EMC/Retrospect people have told you that old Retrospect backups are not accessible by Retrospect 8.x?

  • So my phone is plugged into the computer for a software update and the update went halfway through and hasnt made any advancements. how do i get my phone back without losing anything?

    so my phone is plugged into the computer for a software update and the update went halfway through and kind of stopped. it says its still updating but I cant figure out how to stop it and just get my phone back. how do i get my phone back without losing anything?

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • How do I get Pages to capitalize the first word of a sentence and the letter 'I?"

    How do I get Pages to capitalize the first word of a sentance and the letter "i" automacticly?

    I am also having this problem. Does anyone have an answer?
    I jus upgraded from Pages 4.3 and it's in Preferences. Not so in Pages 5.0.

Maybe you are looking for

  • Indesign CS6 crashing all the time when Placing an image

    Repost from Installation forum. Indesign from Design Standard CS6 installed about 2 months ago on a Dell Precision Laptop with 4 Gb Ram Windows XP SP03.  No other programs are running.  I open Indesign and create a document 4.8" high x 4.7" wide.  I

  • Logs not being generated

    I have two wfe servers, in one server the logs file are being generated but another server no log files only usage files what could be the reason. Under central admin monitoring uls logs have been already enabled.

  • Backsave PDF files out of CS5??

    I have to save files as PDF's for my job so that everyone in the company can view them with reader. All files are created in Illustrator CS5 with layers. I save them as PDF's, but when I do this..the other artists who are on CS3 open the files and al

  • How to turn off my imessage

    How can I turn off my imessage online?

  • How can I get list of columns used of specific table in all stored procedure?

    How can I get used column list of a specific table in among all stored procedure? Suppose that, I have a table(VendorMaster) which has 100 columns just I want to know how many columns used in among all stored procedure.