How to specify a table column that is a PL/SQL reserved word

I am writing the following trigger
CREATE OR REPLACE TRIGGER SMS_MSG_TR_B_U
BEFORE UPDATE ON sms_msg
FOR EACH ROW
BEGIN
IF :OLD.BODY != :NEW.BODY THEN
RAISE_APPLICATION_ERROR(-20001,'Invalid update');
END IF;
END SMS_MSG_TR_B_U;
and I get the following error: PLS-00306: wrong number or types of arguments in call to '!='
This is because BODY is a reserved word in PL/SQL but it is not in SQL.
I tried to quote it with " but this does not work.
Does anybody knows the syntax to be able to test a column that has the name of PL/SQL reserved word?

You are exactly right, BODY is of type CLOB. So the problem does not lie with the name of the column but the type.
Thanks!
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Gints Plivna ([email protected]):
Hmm, quite interesting
I tried:::::
SQL> create table sms_msg (body VARCHAr2(100));
Table created.
SQL> CREATE OR REPLACE TRIGGER SMS_MSG_TR_B_U
2 BEFORE UPDATE ON sms_msg
3 FOR EACH ROW
4 BEGIN
5 IF :OLD.BODY != :NEW.BODY THEN
6 RAISE_APPLICATION_ERROR(-20001,'Invalid update');
7 END IF;
8 END SMS_MSG_TR_B_U;
9 /
Trigger created.
SQL> show err
No errors.
SQL> insert into sms_msg values ('qaqa');
1 row created.
SQL> update sms_msg set BODY=body;
1 row updated.
SQL> update sms_msg set BODY='qaqa1';
update sms_msg set BODY='qaqa1'
ERROR at line 1:
ORA-20001: Invalid update
ORA-06512: at "GINTS2.SMS_MSG_TR_B_U", line 3
ORA-04088: error during execution of trigger 'GINTS2.SMS_MSG_TR_B_U'
So You can see no problem!
Maybe body is of some exotic data type like long or clob, blob?
Is valid to use "!=" for these data types?
P.S. I tried this example on 8.0.3 and 8.1.6<HR></BLOCKQUOTE>
null

Similar Messages

  • How to modify a table column name

    Hi all,
    How to modify a table column name...
    Thanks

    could type the command here... but will not do that..because you are supposed to read the docs.
    You can find the command here..
    http://www.faqs.org/docs/ppbook/r22871.htm
    Regards,
    G.

  • How to test BLOB Table Column in BCBrowser??

    Hi,
    My requirement is to upload a file(pdf,doc,jpg, txt) into DB using ADF.
    I use, Jdev 11.1.1.6, Oracle 10g XE.
    For this, I created the following
    1. A table as MyFilesTab(ID Number, FileName Varchar2(80), File BLOB)
    2. An Entity Object MyFilesEO on MyFilesTab.
    3. Generated a default view object: MyFilesVO
    4. Application Module : TestAM with view instance "MyFiles"
    But When I run TestAM, I see MyFiles as an Input textbox. So I cannot able to add a file that will be stored in my Table.
    Please help me out.

    Just to clarify, my previous post is related to title of this thread("How to test BLOB Table Column in BCBrowser??"),
    and not to "My requirement is to upload a file(pdf,doc,jpg, txt) into DB using ADF" 
    Dario

  • How to edit planning table so that only promote option comes for user

    how to edit planning table so that only promote option not aproove, comes for user for process management in planning unit state first pass.
    i am using 11.1.1.3 planing version, i have to do this customization very urgently.
    guys pls give some clue...thanks in advance!

    Hi John,
    a lot of thanks for your valuable help on this forum.
    if u see first pass state options, it gives only two options(promote,approve) but for other states it give >2 options so they must have put some condition on first pass state by restricting it to two options only.
    do u have any idea in which table this condition has been put so that i can restrict it further to 1 option only.
    thanks.

  • How to specify custom table name for subclasses in Kodo 3?

    I'm migrating our codes from Kodo 2.5.x to version 3.
    In Kodo 2.x, specifying the class/subclass table name uses the extension
    like this "@jdo.extension vendor-name="kodo" key="table"
    value="DyeStuffs"" when using XDoclet to generate the .jdo metadata files.
    It no longer works in Kodo 3. Following the Kodo's documentation, I have
    upgraded XDoclet to 1.2b3 and changed all doclet tags to the ones that
    XDoclet understands.
    I noticed in the documentation, to specify custom table mapping, it uses
    nested vendor extensions. E.g
    <extension vendor-name="kodo" key="jdbc-class-map" value="vertical">
    <extension vendor-name="kodo" key="table" value="TABLOID"/>
    <extension vendor-name="kodo" key="ref-column.JDOID"
    value="MAG_ID"/>
    </extension>
    So how do I specify nested extensions when using with XDoclet's tags?
    Need help as I have to complete the migration by end of the week.
    Thanks,
    Makas

    Abe White wrote:
    Makas Tzavellas wrote:
    Does it mean I have to map all classes and fields to the existing tables?As I tried to point out earlier, in 3.0 all mapping information must be
    explicit all the time. So basically everything is like mapping to an
    existing schema (only Kodo can generate those mappings for you... as
    long as you're not using XDoclet for all your mapping! :)
    It seems quite a pain to manually map all the existing tables and
    fields, especially when Kodo gave the table and field names. I don't
    mind mapping the tables, but mapping the fields will be a horror with
    105 tables. Have I missed out anything in the migration documentation
    that might help me with this process? Also does Kodo require the
    ..mapping file to work or having everything in .jdo file is sufficient
    (looking at the documentation it seems ok to have .jdo file only)?
    If I do, I prefer to regenerate all tables without the base table,
    basically having tables to include all the fields from the base table.
    And migrate all existing data to the new table structure.I'm not entirely clear on what you want. Are you saying that you want
    each subclass to have its own table and repeate the columns from its
    superclass table in its own?
    Yes, that is exactly what I want.
    If so, then this is not supported by Kodo (yet... we're working on it
    though).
    Ok, I'll settle having Kodo 3 to only map back to the original tables,
    as I believe Kodo 3 will provide some performance improvement as
    compared to 2.x.

  • How to Merge ADF Table Column Header in ADF Table ?

    Hi All,
    We need to have ADF Table Column header to be "Merged",
    e.g :
    There are two columns Header : | Qty (Case) | Qty (Pack) |,
    can we customize it to display like this :
    | ----- Qty -------|
    | Case | Pack |
    where there are two rows in column header, the first one is "Merged".
    How can we do that ?
    Thank you very much,
    xtanto

    Hi Kelly,
    Thank you for your reply,
    Using Column Faced, Header I can format the header of one column Only.
    My requirement is to Merge header of two colums :
    | ----- Qty -------|
    | Case | Pack |
    'Case' &'Pack' is two different column, so I need to add one row on the header of the two colums, then 'merge' them, and add the word '----Qty----'.
    Is it possible ?
    Thank you,
    xtanto

  • How to fix skewed table columns and rows after re-import XML

    My question is regarding XML Import in InDesign CS3.
    I have a XML that has a table of 5 columns and 5 rows, when I import it into InDesign, the table shows up fine with 5 columns and 5 rows. However when I revise my table to have an additional column, and re-import the XML file, the table gets updated, but instead of with an additional column, it gets 'appended' with an additional row instead (InDesign seems to blindly replace each cell from left to right, top to bottom, and ends up with 6 rows instead). The XML file specifies the number of columns and rows (5 and 5 before, 5 and 6 after), why doesn't InDesign recognize it and automatically add a new column when I re-import the file?  Is this problem fixed in CS5.5? Is there a script to fix this?
    Here is an example of my old XML vs new XML:
    Old:
    <frame5>
    <Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table" aid:trows="5" aid:tcols="5">
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1"></Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2006</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2005</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2004</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2003</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores at beginning of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">678</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores opened during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">36</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">50</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">59</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">79</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores closed during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">13</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">9</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">7</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">4</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Total stores at end of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">869</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    </Table>
    </frame5>
    New:
    <frame5>
    <Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/"
    xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid:trows="5" aid:tcols="6">
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1"></Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2007</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2006</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2005</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2004</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2003</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores at beginning of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">123</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">678</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores opened during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">456</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">36</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">50</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">59</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">79</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores closed during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">789</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">13</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">9</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">7</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">4</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Total stores at end of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">1368</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">869</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    </Table>
    </frame5>

    What I mean is, right now there is a "workaround" which requires a user to manually add an extra column before re-importing the XML (with an extra column), otherwise the results get skewed. If by providing a script we can simply ask the user to "run" it, it would be a more "acceptable" solution.  
    Right. So, one solution would be to use Convert Text to Tables. If you find that works for you, then you can script it.
    That's why I asked you...
    Of course if nothing is required from the user other than simply re-importing, then that would be the best solution.
    Well, one could imagine a script that was attached to the re-import command, or to the link update notification, but probably the first step is to get something that works reasonably well without automating it completely. Especially because triggers to run scripts silently can introduce hard-to-debug problems.
    Sure we can switch to use "CALS table and see if this works. The question is, why should we need to? In the 2nd XML there is clearly a different "aid:tcols" value, and yet InDesign seems to ignore it and assume the same # of columns? This sounds like an Indesign bug, can someone confirm? Is there any plans to fix this?
    Not to be snarky, but do you want it to work or not? There are the tools you have and the tools you wish you had, and you can't really do much with the ones you wish you had. I'm kind of assuming you are looking for a solution today, not a solution in 2013.
    Yes,  I believe two of us have confirmed this appears to be a bug.
    Plans to fix? Well, we can't really tell you. You could try asking Adobe, but that's not easy information to get out. But you can certainly open a support case at http://adobe.com/go/supportportal and ask. It's not like we have special information here...
    But you're probably better off filing a bug first, in that same fashion.
    But let's assume no one had filed the bug. CS6 is expected in the March/April 2012 timeframe. That means that they're probably just putting the finishing touches on it right now, and it's going to be very difficult to fix things in it now. So then the earliest you'd likely get it fixed in CS6.5/CS7/whatever which presumably comes out by 2Q2013, and that's assuming Adobe decides to fix it...
    I also can't find much documentation on how to update my table to a "CALS table", any examples?
    Try this thread:
    Re: Importing a CALS table into InDesign CS3

  • How to not make Tables, Column and Data Available in Excel

    Goal:
    Not displaying the dimension table and its data in excel
    Problem:
    I was enable to deny access for the user roles in SSAS about denying access the data from the column but the next thing is that I do not know how dimension table and column not to be available in the excel.
    Information:
    *The datasource is SSAS
    *I have made three user to have access to two tables only.

    Hi Sakura,
    According to your description, you want the Manager role can see all dimension table and its data column. And the Employee role can't view all table, column and data, right? Currently we don't have a direct option to complete hide the dimensions or attributes
    to some roles. However you can use workarounds below.
    Using cube perspectives and hide the cube dimension attribute then set the perspectives to role.
    Perspectives
    Use this workaround discussed in the similar thread below.
    Dimension attribute security to hide or unhide an attribute
    based on certain condition
    Hope this helps.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How can I correlate two columns that belong to different worksheets?

    I am using beginner user of Numbers 3.2. I also thought of copying the columns of interest into a single sheet but don't know how to do so.
    Advanced thanks,
    Alex

    Hi alexander,
    If you are looking for a column that will update as your reference column changes, try this:
    In the first cell of your destination column type "=" (without the quotes)
    Navigate to your reference column and click the header of that column. Click the check in the formula editor. You are back at your destination cell.
    Copy.
    Click the destination column header and paste.
    quinn

  • How to add/remove table columns dynamically?

    Please help urgently!

    Don't access the view layout (UI element references) in action event handlers. You have to place this code in wdDoModifyView().
    In the action handler, store the information needed (e.g. table column ID, insertion position, whatever) in some context attribute or in some member variable of the view.
    In wdDoModifyView(), check if table modification should be done, get the table instance using view.getElement(<tableID>), use the IWDTable API to modify the table.
    Finally, reset the flag or configuration data indicating that the table should have been modified.
    This is not really elegant, but that's the way it is...
    Armin

  • How to know a table column name in HTML (Hyperion Interactive Reporting).

    Hello,
    I have a Hyperion Interactive Reporting dashboard section with an embembed table section on it.
    The dashboard it will be open only in HTML.
    I put the table as Active, so i can interact with her.
    So, what I need to know now is how can I know the column name or number when I double click in one cell of the table.
    Can anyone help me with this?
    Thank you in advance,
    Carlos

    Views don't have primary keys though their underlying tables might. You'd need to pick apart the view to determine where it's columns are coming from.
    You can select the text of the view in question from user_views.

  • How to display the table components that make up a structure?

    Hi,
    How does one display the table components that make up a structure?
    I want to see the table fields that make up the structure EKBEZ.
    Thx.
    Andy

    Hi
    GOTO SE11 , type the structure name in DataType optional feild , you will get the feilds that make the structure
    Kindly rewards the points accordignly
    Regards,
    Pranshu

  • How do you get table column names to show one time per page

    I have a report where I want the column names to show one time per page.
    I have the table with the column names set below the header and above the
    'for-each Row'.
    When I view the report in PDF format the colunm names show only one time on the first page and on the other pages the column names do not show at all. If I view the report in RTF, the same thing happens, shows column names on the first page, but not on the other pages after that.
    I highlighted the table and went to table properties, clicked on ROW tab and then checked (Repeat as header row at the top of each page) and it still does not work for PDF or RTF format. I have looked at other forums with this issue and it doesn't work for me in PDF format.
    Could someone tell me what I am doing wrong.....
    I appreciate anyone that can help me.
    Thank you,
    Susie

    I figured out what I was doing wrong.
    I was creating a seperate table for the column names and not using the table where the column names where created originally. I deleted the column names from the original table and created a seperate table above that table with the column names only.
    So I went back to the original table and highlighted the row with the column names and went to table properties/ROW tab/ and clicked (Repeat as header row at the top of each page) and now it works perfectly in PDF format where the column names show one time for each page. Deleted the other table where I had the column names only.
    thanks
    Susie

  • What is table type?How do i find tables behind that table type?

    Actually i know the trasaction,And in that transaction i find the required fields,But when i check for table name in technical settings i always finding table type ,not table.So How can i find table name for the field?

    Have a look at below link. It will give you all the details.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm
    Best Regards,
    Vibha Deshmukh
    *Please mark all the helpful answers

  • How to control internal table columns dynamically based on input

    i have 2 fields in the selection screen - user and tcode
    we can give any number of tcodes as in put
    based on requirement i need to display all the tcodes belongs to one user in one row
    in other words
    the out put table columns should increase dynamically based on number of tcodes entered
    in the input
    how to do this?
    Edited by: tummala swapna on Apr 7, 2009 11:55 AM

    This may be useful to you..
    FIELD-SYMBOLS : <FS_TABLE> TYPE ANY TABLE.
    DATA: DREF TYPE REF TO DATA,
          WA_DREF TYPE REF TO DATA,
          DY_LINE TYPE REF TO DATA,
          ITAB_TYPE TYPE REF TO CL_ABAP_TABLEDESCR,
          WA_TYPE TYPE REF TO CL_ABAP_STRUCTDESCR,
          STRUCT_TYPE TYPE REF TO CL_ABAP_STRUCTDESCR,
          ELEM_TYPE TYPE REF TO CL_ABAP_ELEMDESCR,
          COMP_TAB TYPE CL_ABAP_STRUCTDESCR=>COMPONENT_TABLE,
          COMP_FLD TYPE CL_ABAP_STRUCTDESCR=>COMPONENT,
          OTAB TYPE ABAP_SORTORDER_TAB,
          OLINE TYPE ABAP_SORTORDER.
    BEGIN DYNAMIC STRUCTURE FOR FINAL INTERNAL TABLE @@@@@@@@@@@@@@@@@@
    STRUCT_TYPE ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_NAME('table or structure name').
    COMP_TAB = STRUCT_TYPE->GET_COMPONENTS( ).
    STRUCT_TYPE = CL_ABAP_STRUCTDESCR=>CREATE( COMP_TAB ).
    ITAB_TYPE = CL_ABAP_TABLEDESCR=>CREATE( STRUCT_TYPE ).
    CREATE DATA DREF TYPE HANDLE ITAB_TYPE.
    ASSIGN DREF->* TO <FS_TABLE>.
    END DYNAMIC STRUCTURE FOR FINAL INTERNAL TABLE @@@@@@@@@@@@@@@@@@

Maybe you are looking for

  • My ipad doesn't want to connect to my computer.. Help.!!!

    When i try to add some music to my ipad, i can't. My computer Sees my ipad as an digital camera, i can only see my fotos. Please help:)

  • Cannot locate original music file error message???

    cannot locate original music file error message ??? i transferred to a new laptop then some of my music collection seems to get this message .

  • Creation of Process Order without assigning master recipe

    Hi, I want to create a process order without having default master recipe for the given material or default operation for the given order type. I want the user to select the master recipe manually in process order. We do not want to use production ve

  • Spry Horizontal Submenu behind DIV in IE

    Having problems in IE with this menu The menu is is an AP div, and the div that is blocking the submenu is position: relative; The Z-index is set that this shouldn't happen. Any help from the community would be greatly appreciated. Site Styles Menu S

  • Setting repaint behavior

    Hello I am now developing a swing application for my customer (which should work under windows and under MacOS X), and I have an issue to fix: When the main frame of my application is resized by pulling one of its borders with a mouse, the Swing trie