How to restrict special characters for a specific column

Dear gurus,
i have a table emp with a field field_1
in this particular field_1 is an address column where data can be like '12 st first floor' but suppose mistakenly user has entered the data as '12 st first floor & ' it should be restricted (not using trigger but can this be possible by using constraints )so for this how can we restrict the special characters not to get entered into the column.
regards,
friend

Another way of doing it.
drop table test_table;
create table test_table (col varchar2(50));
alter table test_table add constraint chk_address check (NOT regexp_like(col, '[[:punct:]]+'));
insert into test_table
(select  'some text' col from dual);
1 rows inserted.
insert into test_table
(select  'some text!' col from dual);
Error starting at line 20 in command:
insert into test_table
(select  'some text!' col from dual)
Error report:
SQL Error: ORA-02290: check constraint (FDL_DEV.CHK_ADDRESS) violated
02290. 00000 -  "check constraint (%s.%s) violated"
*Cause:    The values being inserted do not satisfy the named check
*Action:   do not insert values that violate the constraint.
insert into test_table
(select  'some text House#32' col from dual);
Error starting at line 23 in command:
insert into test_table
(select  'some text House#32' col from dual)
Error report:
SQL Error: ORA-02290: check constraint (FDL_DEV.CHK_ADDRESS) violated
02290. 00000 -  "check constraint (%s.%s) violated"
*Cause:    The values being inserted do not satisfy the named check
*Action:   do not insert values that violate the constraint.
insert into test_table
(select  'some text
(with new line)' col from dual);
Error starting at line 26 in command:
insert into test_table
(select  'some text
(with new line)' col from dual)
Error report:
SQL Error: ORA-02290: check constraint (FDL_DEV.CHK_ADDRESS) violated
02290. 00000 -  "check constraint (%s.%s) violated"
*Cause:    The values being inserted do not satisfy the named check

Similar Messages

  • How to remove special characters in a particular column

    Hello,
    i have a csv feed and i load it into a sql table (the sql table has all varchar data type fields)
    feed data looks like (just sampled 2 rows but my file has thousands of like this)
    "K" "AIF" "AMERICAN IND FORCE" "FRI" "EXAMP" "133" "DISPLAY" "505250" "MEDIA INC." 03/01/10" "INV31202" ".00" ".00" "0.00" "ALLO" ;
    "K" "AIF" "AMERICAN IND FORCE" "THU" "TRTH" "123" "MUN MARCH 2010" "505099" "SOCIALTYZE" "03/01/10" "1308" "40,282.32" "40,282.32" "45564.64" "DIS" ;
    some times i got some special characters in my table column (example: in my invoice no column some time i do have # or ! kind of invalid characters ) so how can i remove some kind of special characters in my column
    once it is eliminated then i can write it to new table (with correct data format such as integer)
    could some one please tell me how can i remove special character in a column of particular table
    thanks in advance
    asita

    Removes any characters from
    @myString that do not meet the
    provided criteria.
    CREATE FUNCTION dbo.GetCharacters(@myString varchar(500), @validChars varchar(100))
    RETURNS varchar(500) AS
    BEGIN
    While @myString like '%[^' + @validChars + ']%'
    Select @myString = replace(@myString,substring(@myString,patindex('%[^' + @validChars + ']%',@myString),1),'')
    Return @myString
    END
    Go
    Declare @testStr varchar(1000),
    @i int
    Set @i = 1
    while @i < 255
    Select
    @TestStr = isnull(@TestStr,'') + isnull(char(@i),''),
    @i = @i + 1
    Select @TestStr
    Select dbo.GetCharacters(@TestStr,'a-z')
    Select dbo.GetCharacters(@TestStr,'0-9')
    Select dbo.GetCharacters(@TestStr,'0-9a-z')
    Select dbo.GetCharacters(@TestStr,'02468bferlki')
    perfect soluction

  • How to restrict project details for a specific person

    HI all,
                  In our client we have different projects and responsible persons also different. How can I restrict other persons not to see the details of another project.
    Ex., budget & actual report. How can we restrict a report to show only for a specific project to  a specific person???
    thanks & regards
    msr

    hi..
    for authorization...refer the following notes 638781,522426.
    Ashis

  • How to apply Filter condition for a specific column but not to the report?

    Hi,
    I am having a issue in applying a filter condition to one of the column.
    I have a schema with one fact table and around 10 dimension tables. My requirement is to bring a count on the fact table with related to some other columns from the dimension tables.
    Lets consider a scenario with tables like Sales (Fact), Region (Dimension), Year(Dimension), Sale Type (Dimension).
    Now my requirement is to bring out the fields
    City(Region) --City                                   
    Year -- Year
    Sales Count(Sales table) ---Count of all sales from the fact table
    Sales Count(Sales table) -- Count of all sales from the fact table where sales type is 'CASH'
    Here my issue is how do I apply the filter condition of Sales Type='CASH' only on one of the Sales Count column which is from the fact table. I want the filter condition to be imposed only for the fourth column.
    Can anyone let me know how to achieve this?
    Thanks

    This is quite simpe. Edit the column formula for the 4th column and put something like this. I am doing this from memory so the syntax might need checking:
    Case When "Dimension Table"."Sales Type"='CASH' Then "Fact Table"."Measure" Else Null End
    You could also consider making this a permanent addition to your RPD if this measure will be used again and again. You would add a new logical column and use the expression builder to arrive at the same result.

  • How do you turn off the special characters for letters?

    How do you turn off the special characters for letters? Where you hold down the key and it comes up with variations of the letter. For example ï í î ò œ å ß ł û
    It is very annoying when I try to play any online games. Thanks for the help

    Thank you so much It worked Thank you

  • Restricting special characters

    Hi All
    I am currently doing the payment extract interface program for the bank. The point here is that the bank doesn't allow some characters which are considered as special characters like (#,$,%,^,*,&) etc..In most of the information like vendor name and invoice numbers they are using these characters.
    In my interface program, i am removing this special characters and replacing it with space or '+' symbol as prescribed by bank through translate command.
    translate(VENDOR_NAME,'/!;<>"{}[]|=_*&^%$@~#',' ')
    But my question is how could i restrict them at the entry level itself?
    In case of invoice creation form, when they enter #INV123 then i should intimate them that they have used special characters. Is that possible to do it in Forms personalisation?
    Regards
    Santhosh

    Duplicate post see:
    Restricting special characters
    Gareth

  • How to print Special Characters in Sap-Scripts

    How to print Special Characters in Sap-Scripts
    Thanks,
    Ravi

    Hi
    if u want print special characters we can use hot codes i.e '  '  (single inverted commas). in between these hot codes insert u r special characters.
    write    '    !@#$%^&*( )  '.
    for the above write statement output is
    output is   !@#$%^&*( )

  • How to remove special characters in xml

    Dear friends,
    How to remove the special character  from the xml. I am placing the xml file and  fetching through file adapter.
    The problem is when there is any special character in xml. i am not able to pass to target system smoothly.
    Customer asking schedule the file adapter in order to do that the source xml should not have any special charatcters
    How to acheive this friends,
    Thanx in advance.
    Take care

    Hi Karthik,
    Go throgh the following links how to handle special character
    https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Restricting special characters in XML within XI..
    Regards
    Goli Sridhar

  • How to display special characters in Script...

    hi all,
    Can any one tell me how to display special characters in script...
    how to write in text element
    thanks in advance,
    prashant

    Hi Prashant ,
      What special characters would you like to include .
    There are a set of characters / icons /symbols that can be included in Script , for that open a window in edit mode and in the menu there will be an option called Insert  , here you can find a lot of characters/symbols that can be included .
    Regards,
    Arun

  • Restricted Special characters in KM Resource name

    Hi,
    While creating resources in KM, it is not allowing some special characters (ex: '?' , ':') in name.
    How do we know what are all the restricted special characters in KM?
    Please let me know.
    Thanks

    I think the file name restrictions which apply to naming of files on the PC apply to KM Resources as well since the file will have to be created on some file system itself.
    Do refer to [this|http://kb.wisc.edu/page.php?id=2533] link to peek at the list of restricted characters.
    Thanks,
    GLM

  • Special characters for projects

    Hi experts,
              Kindly explain to me how to define multiple Special characters in project system.
    Regards,
    Shynu John

    Hi,
    Do you mean Special characters for the Project coding mask?
    If that is the case, you can define the special characters in OPSK. A maximum of 8 special characters can be defined in it.
    And then create the project coding mask in OPSJ using those special characters as per your requirement. Alpha-numeric and numeric characters combination can be used along with the special characters while creation of coding mask.
    Regards,
    Kabir

  • Entering special characters for Social Beat on G'Zone Ravine?

    I've figured out how to enter special characters in a text, or in mobile IM. But I am unable to find a method for doing so in Social Beat. My username and password both use special characters, but I cannot find the option to enter these.

    Thank you for your inquiry and I apologize for any confusion. I am providing you steps for how to change your symbols to special characters when your at the long in screen when using the Social Beat application. I was able to locate this information from the online user manuel and here is a link for further reference. I hope these steps as listed below helps.
    To using Symbol Text Input to insert symbols or punctuation, follow these steps from the text entry screen:
    1. Press the Left Soft Key, select Symbols, then press the Center Select Key [OK].
    2. Press the Right Soft Key [Next] to view the next 12 symbols or Left Soft Key [Prev] to view the previous 12 symbols.
    3. Select the symbol you want to insert using the Directional Key, then press the Center Select Key [OK] to select it.

  • How to search special characters in a string

    Hi all,
    I want to search special characters in all string columns and all rows in the table.
    The table has about 5 string columns and about 5.000.000 rows. For each row and column, I have to search entries, which included special characters like ", !, ? or something else (f.ex. "Mama?Mia" or "!!!Hotel out of order!!!"). The problem, the character could stand at each position in the string.
    What's the best and most performance possibility to search such entries?? Is it possibility only by SQL; is there a special function for this?? Or must I use PL/SQL.
    Thanks for helping
    Dana

    HTH
    Laurent Schneider
    OCM DBA
    SQL> select * from z;
    S
    Mama?Mia
    a b c
    123
    SQL> select * from z where translate(s,'~ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz1234567890','~') is not null;
    S
    Mama?Mia
    SQL> select * from z where regexp_like(s, '[^[:alnum:][:space:]]');
    S
    Mama?Mia

  • How to write special characters in PDF using iText

    How to write special characters encoded with UTF-8 in PDF using iText.
    Regards,
    Pandharinath.

    I don't know what your problem is but that's almost certainly the wrong question to ask about it. Java (including iText) uses only Unicode characters. (You may consider some of them to be "special" if you like but Unicode doesn't.) And when it does that, they aren't encoded in UTF-8 or any other encoding.
    So can you describe your problem? That question doesn't make sense.

  • How to restrict the GR for Production Order when Goods Issue is not done

    Hi Gurus
    How to restrict the GR for Production Order when all the required components for production order are not issued with all required quantity. Even for partial issue system should not allow GR with 101. The user status with RMWA, RMWF & CGFB is not working.
    Pls suggest best solution.
    Abhijit.

    Hi,
    You can club together the GI nad GR at the time of confirmation..
    I.e Backflush for the components and auto GR for the Product.
    So that you can stream line the Process.
    The best Option would be to use the User Exit:
    Enhancement - MBCF0002
    Functional Module - EXIT_SAPMM07M_001
    Include - ZXMBCU02
    Refer below link for further details..
    How to stop the goods receipt before issueing the goods for production orde
    Regards,
    Siva

Maybe you are looking for

  • CS3: Page range problem

    I have a document with several short sections, 1- 4 pages each. Each section is numbered from page 1 and has a different section marker and prefix. All section prefixes are unique, so even though I have several page 1s, I have only one page AL1. Here

  • ITunes refuses to import mpeg-4 videos

    I have a few mpeg-4 video clips on my computer that I want on my ipod. iTunes refuses to import them. I've tried file>add folder to library, file>add file to library and attempting to add them individually, I've tried dragging and dropping, again as

  • Adding CFC timeout?

    iam trying add a timeout in a CFC but having some issues with it...I need help...here is my sample CFC which needs a timeout added....could somebody please help me how to add a timeout in the code..i tried requesttimeout using cfsetting but i could n

  • Need to add my program to excute when windows welcome

    Hello everybody! I need to add my program to excute when windows startup. I want my program run same Windows Update when startup. I need windows welcome wait my program end and next to login user Thank everybody

  • Urgent help!!! My new website shows blank in Explorer

    Hi Anyone My new website, http://www.mindjuicer.com, doesn't show up if you view it in Internet Explorer. It look all fine in Safari and Fireworks but it doesn't show anything with Explorer. Can anyone help???? Please, it's very urgent as I've been t