Oracle Trigger - How can I capture and correct on the fly  ORA-01847

Oracle Trigger - How can I capture and correct on the fly ORA-01847 day of month must be between 1.
I have a table that has a date column. Sometimes an invalid date is passed and I'd like to capture and initilize the incoming value to null and have it inserted without error. Currently I get ORA-01847 day of month must be between 1.
Example:
create table ep1
col_1 number,
col_2 date
Now if a user does the following, I want no error to occure but rather for the date value to be set to null and inserted.
insert into ep1 values('1', '41-JAN-13')
The insert may come from any client and I can't change the calling code hence can't used a precedure to replace the insert. I'm guessing there is some way to catch system level exceptions on the DB level. This doesn't need to be nice, it just needs to work.
Here is the question on experts exchange. I'm told there is no way, but there must be. After all the exception is on a DB system level and I would think one could extend or override these, or disable them.
http://www.experts-exchange.com/Database/Oracle/PL_SQL/Q_23045306.html

SQL> declare
  2     wrong_month      exception;
  3     pragma exception_init (wrong_month, -1843);
  4  begin
  5    begin
  6      insert into emp (empno, hiredate)
  7      values (2345,to_date('13/25/81','MM/DD/YY'));
  8    exception
  9      when wrong_month then
10      dbms_output.put_line('I caught the bad month');
11      insert into emp (empno, hiredate)
12      values (2345,null);
13    end;
14  end;
15  /
I caught the bad month
PL/SQL procedure successfully completed.
SQL>
SQL> select * from emp
  2  where empno = 2345;
     EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
      2345Note the 1843 error vice 1847. It can be done outside of a trigger.

Similar Messages

  • I can't update IPhoto, it says "the product distribution file could not be verified it must be damaged or signed in" I bought it on iTunes and have 8,000 photos already. how can I update and correct this??

    I can't update IPhoto, it says "the product distribution file could not be verified it must be damaged or signed in" I bought it on iTunes and have 8,000 photos already. how can I update and correct this??

    You might try resetting the App Store application and clear the cookies via this menu:
    as described in this website: Make use of the Mac App Store debug menu | MacFixIt - CNET Reviews
    OT

  • HT1296 How can I capture and save an image on my screen for later retrieval

    How can I capture and save an image on my iPad screen for later retrieval, perhaps on my Laptop (Windows 7)?
    Is there a way to copy the image to a storage device?
    Thanks, Don.

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    Its easy to take an iPad screenshot. Press & release the Home and the Power buttons quickly at the same time. I have trouble with that so I press & hold the Home button and then very quickly press and release the Power button. Your screenshot is stored in the Camera Roll of the Photos app. Probably the easiest way to get it to your PC is to be using iCloud, or email it to your PC. There are also some wireless sync apps in the iTunes app store that let you send photos from the iPad to a Mac or PC. I use PhotoSync.

  • How can I open and listen to the PDF documents with audio in my iPad?

    How can I open and listen to the PDF documents with audio in my iPad?

    You need to use a PDF reader that supports multimedia. Adobe Reader 10.3 does not. Adobe has not stated whether it will support multimedia in the future.
    In the meantime, you could buy an application that does like PDF Expert. Read about it here:
    Finding the Best Tablet PDF Reader

  • How can I copy and Paste in the newly converted PDF to WORD?

    How can I copy and paste in the newly converted document?  I can save it to any Word format and cut within it, but not paste what I just cut or copy and paste.

    Try copying all of the content in your Word document to a new document, then see if you can selectively copy and paste.
    Let us know if that helps!
    -David

  • My mini has a password on it now that I have iOS 7   I do not know the password. Nor will it let me restore since it has find my mini in iCloud. How can I restore and take off the password

    My mini has a password on it now that I have iOS 7   I do not know the password. Nor will it let me restore since it has find my mini in iCloud. How can I restore and take off the password

    Sounds like then maybe a "friend" got hold of your phone and set a SIM card password.  Not much you can do if that is the case if you do not know the password except go to your carrier and request a new SIM card.

  • I am a 66 year old novice. How can I find and print all the functions of the cmd key, please.

    How can I find and print out all the functions of a command cmd key please?

    You can also  go to MAC HELP and enter 'Key Board Shortcuts' in the entry field.
    Ciao.

  • How can I capture and re-present Oracle contraint/check/DML errors?

    Hi,
    New to APEX, I have a Designer/Web-PLSQL background.
    In Designer I can define the messages that I want the user to see when check, constraint, etc. errors are generated by the application interaction with the database server (done through table API and the integration of the Designer generated screens).
    In APEX, these types of errors all seem to show the default 'ORA' style message on an error page. How can I change these to 'human-readable' messages?
    I'm obviously missing the trick that changes an ORA-0001 message referring to CUST_CODE_UK to something like 'This Code has already been assigned to another customer'? I want to use standard functionality, not really keen on creating my own DML packages for every table that needs to be accessed through a screen.

    user8038482 wrote:
    dear sir,
    i have windows 7 and install oracle 10g,developer suite 10g 32 bit working everything fine but any forms trying to open giving errors oracle form designer stopted working check online sulition can you help get and send the like of patch file so i can download even i am able to download the patch file pls help i will be grateful for the same.
    thanks you..
    As'salamualikum, m z Islam
    check this Oracle Forms Designer has stopped working/ How to apply Patchset 7047034 ?
    Hope this works..
    hamid
    Mark correct/helpful to help others to get right answer(s).*

  • How can I capture and take screenshots of all the browser tabs and not only windows ?

    This class identifies all minimized windows and take a snapshot (screenshot) of them. I want to take screenshots also of all the broswer for example chrome tabs windows that are open but not in the front. Same idea that it get now the minimized windows but
    to get the screenshots of the broswer opened tabs ! What should I change in the WindowSnap class? Since both classes are a bit long I added them to pastebin.com
    What i'm doing now is to get all the minimized windows i mean all the the windows in the back if it's chrome browser windows or open tabs if it's program games other windows. This is what i'm doing in form1 constructor:
    this.listBoxSnap.Items.AddRange(WindowSnap.GetAllWindows(true, true).ToArray());
    int numitems = this.listBoxSnap.Items.Count;
    for (int i = listBoxSnap.Items.Count - 1; i >= 0; i--)
    string tt = listBoxSnap.Items[i].ToString();
    if (tt.Contains(" ,"))
    listBoxSnap.Items.RemoveAt(i);
    listBoxSnap is just a regular listBox1 in my form1 designer.
    And this is the WindowSnap class code, it's a bit long code but it's all connected:
    I'm not sure what to show here from this class what is the most important part so i added all the class code to a link to pastebin.com:
    WindowSnap.cs
    What i'm calling/using in form1 constructor from this WindowSnap.cs class is the GetAllWaindows method:
    public static WindowSnapCollection GetAllWindows(bool minimized, bool specialCapturring)
    windowSnaps = new WindowSnapCollection();
    countMinimizedWindows = minimized;//set minimized flag capture
    useSpecialCapturing = specialCapturring;//set specialcapturing flag
    EnumWindowsCallbackHandler callback = new EnumWindowsCallbackHandler(EnumWindowsCallback);
    EnumWindows(callback, IntPtr.Zero);
    return new WindowSnapCollection(windowSnaps.ToArray(), true);
    EnumWindowsCallBackHandler is:
    private delegate bool EnumWindowsCallbackHandler(IntPtr hWnd, IntPtr lParam);
    EnumWindows is:
    [DllImport("user32.dll")]
    [return: MarshalAs(UnmanagedType.Bool)]
    private static extern bool EnumWindows(EnumWindowsCallbackHandler lpEnumFunc, IntPtr lParam);
    Then i have the class called WindowSnapCollection:
    WindowSnapCollection.cs
    The problem is in form1 constructor i'm getting only 23-24 windows in the listBox1. When i'm doing this two lines:
    this.listBoxSnap.Items.AddRange(WindowSnap.GetAllWindows(true, true).ToArray());
    int numitems = this.listBoxSnap.Items.Count;
    I see in numitems about 30 windows and after filtering i'm getting 20 windows and i checked that's the correct number of opened minmizied windows i have in this example 20.
    Now what i want to do is somehow to get with all this windows in the listBox also all the opened tabs in chrome.
    For exmaple i have only 4 opened chrome windows. But in one of the chrome windows i have almost 40 tabs opened !
    I want somehow to add to the listBox all this opened tabs also as captured screenshots like i'm doing now with the windows.
    This is a screenshot of my program showing what i'm doing and what i get:
    So now i have 19 windows captured in the next refresh it will show 20.
    My question is if there is any way to capture also all the chrome opened tabs in all the windows if any opened tabs are opened at all ? Now i'm getting only the chrome opened windows captured screenshot. But i want to get also the chrome tabs captured screenshots.

    Hi Chocolade1972,
    Since this forum is discussing about Windows Forms general like winform controls, and your issue is related with Windows Desktop SDK, I will move this thread to the more related forum.
    Thanks for your understanding.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

  • HT2486 When you want to add another person from same company, how can you duplicate and then modify the card already entered?

    When usinf Mac Address Book and you have entered the information for one contact from a company, how can you duplicate the card so you can add another person from same company?

    I'm afraid the LU suffix is a new one on me.
    As long as you have all of the content in your library then that remove and sync warning shouldn't cause any loss of data, but it shouldn't be happening every time. It may pay to take the following steps to reset the connection between the two,
    Backup device.
    Restore as a new device.
    Restore the backup made earlier.
    Again, this assumes all content on the device is in your library. If that isn't the case see Recover your iTunes library from your iPod or iOS device first.
    tt2

  • How can I charge and listen at the same time?

    I'm using a windows PC and the USB connector. If I plug the cable in, iTunes automatically opens and I get the "do not disconnect" message and can't play music.
    If I eject my iPod from iTunes, it doesn't charge anymore.

    You can listen to the music on your iPod through iTunes. Just click on the nano icon where the library and store and playlists are and hit play at the top. If you want to listen to it while charging, you can do that by using a wall adapter to charge. I do this at work when my battery starts to get low.

  • How can I create a cluster on the fly?

    I'm inserting rows in a database table as part of a logging effort for our program.  The table in question has a lot of columns, many of which can be null at any particular time.  As such, I'd like to decide at run time (as situations warrant) which columns get a value when I add the new row.  The columns are of mixed data types... some strings, some floats, some ints, etc.
    For example...
    On one pass, I'd like to populate columns "temp", "volume", and "weight".
    On another pass, I may want to populate columns "temp", "color", and "notes".
    I gen the array of column names.  That part's easy
    How (in the world) do I create the cluster that feeds the DATA input of the "DB Tools Insert Data" VI?
    Sometimes I may need an int, a float, and a boolean.
    Other times I may need two ints and a string.
    Thanks!
    Solved!
    Go to Solution.

    Given this example you could have a table which contains a the timestamp and a record ID. Most databases can assign the key automatically and guarantee it to be unique. You may also store the machine name or other identifying information specific to this entry. However, all columns in this table would be populated in every record. You can then have another table which contains the specific data for that record. This table would have a column which contains the ID from your other table. You can have multiple entries in this table for that specific ID. This table would contain the ID from the other table, a column indicating what the specifc data is (voltage, temperature, pressure, etc.) and then the data itself. If you have different data types you can have a table for each specific data type (string, double, image, etc.). If you have separate tables for the different data types you would need a key/ID for each data value record. The data tables would simply be the ID for the data attribute and the value itself.
    So, table one may consist of the following columns: Table1-Key, Timestamp, Test ID
    The attributes table would have the following columns:  Table1-Key, Record Type, Data-Key
    Your Data Tables would have the following columns: Data-Key, Value (You could have multiple Data Tables for each data type.
    To get all the data for a specific time you join the results of the queries from the tables for a specific Table1-Key and the corrsponding Data-Keys from the data tables.
    If your table currently has dozens of columns but you are only storing a few at a time your are wasting a ton of space for all the empty columns. Some databases are better than others at reducing this waste but link table help you to store only the specific data for a given record and not fill the database with lots of empty records.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Please How can I capture and integrate a single pulse of a DC signal from an external circuit

    Hello everyone
    I am trying to integrate a signal from an external circuit I have built. I want to capture just a single pulse from the signal and integrate it. Please can anyone assist me with how I can perform this?

    The 6008 has no hardware analog trigger, so to capture a single pulse, you will need to trigger in software.  It does have a digital trigger, so if you have a digital way to signal the start of your pulse, it would make your life easier.  You will need to ensure you take enough data to get an entire pulse.  At that point, use one of the trigger VIs to find the start (and possibly end) of your signal.  Take a subset of your data and integrate it (LabVIEW does support integration).
    If you have trouble finding anything, let us know.  Find the trigger and integration VIs using the search feature of the palettes.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How can I find and correct corrupt Catalog files on Elements 9?

    I was trying to create a simple slideshow with sound when first my computer warned of low memory (something that doesn't seem plausible), and then Photoshop Elements 9 and the associated organizer crashed. When I brought it back, several photos were "grayed out" and my organizer is completely frozen. The error suggests that there are corrupt files. I tried to follow the instructions on the website, but cannot find any sort of Catalog menu or means of changing anything in the catalog or organizer as indicated in the troubleshooting and restoration instructions. Any use of the organizer is frozen.
    What am I missing? Thanks to all for your ideas.

    If you start up organizer while holding down the shift key, that should take you to the catalog manager where you can repair and optimize your catalog.

  • How can my Spouse and I share the same Itunes Music on separate machines?

    My Spouse is on a PC desktop and I am on a Macbook Pro.  I have a large Itunes library on my Computer and he has a fair sized Library too.  We listen to a lot of the same music and each have Ipods. It's crazy to buy the same music twice.... is there a way we can share our music and make playlists for our separate Ipods?

    Understanding Home Sharing
    iOS- Setting up Home Sharing on your iOS device
    Setting up Home Sharing for Apple TV (2nd & 3rd generation)
    iTunes- Setting up Home Sharing on your computer
    Troubleshooting Home Sharing

Maybe you are looking for

  • How to find supported versions of IE

    Can someone please tell me how to find which versions of Internet Explorer are supported by which versions of Interactive Reporting. I've been banging my head against the wall trying to find the documentation that will give me that information. I'm n

  • Creating Bridge on weblogic to connect between OSM and AIA

    Hi, Am trying to create a messaging bridge in weblogic server to move msg from a queue to AIA's queue. I have created both Source & Target destinations and associated to bridge. My doubt is as both servers are different app servers, if i use initial

  • Default value for bufferpools "IBMDEFAULTBP"

    Dear gurus, I check in one of my system that default bufferpool IBMDEFAULTBP is so small, around 16MB, where in other system it's up to 1.2GB. The configuration is STMM enabled, and IBMDEFAULTBP is set to automatic. When I alter bufferpool using this

  • Help for printer set up on NW 3.12.

    Does any one can help to set up a printer on my NW 3.12 server?? Thanks! Dan

  • (-5000) error message when trying to update my iPhone 3Gs

    I keep getting "An error (-5000) occurred when backing up this iPhone". My iPhone is a 3Gs, what can I do to fix this? Thx.