Computing default value for column MRU. error.

hi
we moved from apex 3.x to 4.2
AN apex application was working fine..After upgrade it gave error while trying to insert using apex front end
Error computing default value for column Apply MRU.
ORA-06550: line 3, column 46: PL/SQL: ORA-00972: identifier is too long
The PK of the relevant table is based in a sequence.Can i relplace old seq. using new seq...will it help?
When we insert using regular insert statement in sql developer, its fine though.
thanks
kp
Edited by: user8612301 on Mar 15, 2013 7:09 AM

Hi,
Remember the error says "default value". What is your code to set the default value?
I've seen this error before where it was simply a statement like
    column = "text123456789012345678901234567890";where the identifier error was given because it should have been
   column = 'text123456789012345678901234567890';Since the string doesn't begin with an apostrophe, the parse thinks it's a LONG identifier. Hence, error!
Howard

Similar Messages

  • Import and default values for columns

    Hi guys
    I have a table in which there are default values for some columns. I take export of this table.
    I go to another database where this table structure is already there (but default values are not set). I run the import of table with ignore=Y. It does all...import the data...create the indexes and all...but doesn't set the default values for the columns.
    Shouldn't it do that also ? ignore=Y means that ignore the object creation errors and proceed with the rest of the stuff ? Or there is some problem in my understanding ?
    Version 10gR2 on AIX 5.3 and using traditional export/import.
    Thanks
    Amardeep Sidhu

    Hanji Sidhu Sahib.
    Mein Tuhade liye eh example try kita hai.
    SQL> conn simar/simar
    Connected.
    SQL> SQL> create table orders (
    dept varchar2(20) primary key,
    place varchar2(20),
    intcol integer default 12
    2 3 4 5
    Table created.
    SQL>
    Inserted few values ...........+ commit.
    SQL> conn simar/simar
    Connected.
    SQL> select * from orders;
    DEPT PLACE INTCOL
    SALES TORONTO 12
    HR LA 12
    BILLING FLORIDA 12
    IT HALIFAX 5
    exp simar/simar@RACDB file=exptest.dmp log=exptest.log
    rac01:/software/backup>exptest.dmp log=exptest.log <
    Export: Release 10.2.0.3.0 - Production on Tue May 6 23:35:58 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, Real Application Clusters, OLAP and Data Mining options
    Export done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
    About to export specified users ...
    . exporting pre-schema procedural objects and actions
    . exporting foreign function library names for user SIMAR
    . exporting PUBLIC type synonyms
    . exporting private type synonyms
    . exporting object type definitions for user SIMAR
    About to export SIMAR's objects ...
    . exporting database links
    . exporting sequence numbers
    . exporting cluster definitions
    . about to export SIMAR's tables via Conventional Path ...
    . . exporting table ABC 12 rows exported
    . . exporting table ORDERS 4 rows exported
    . exporting synonyms
    . exporting views
    . exporting stored procedures
    . exporting operators
    . exporting referential integrity constraints
    . exporting triggers
    . exporting indextypes
    . exporting bitmap, functional and extensible indexes
    . exporting posttables actions
    . exporting materialized views
    . exporting snapshot logs
    . exporting job queues
    . exporting refresh groups and children
    . exporting dimensions
    . exporting post-schema procedural objects and actions
    . exporting statistics
    Export terminated successfully without warnings.
    rac01:/software/backup>strings exptest.dmp |grep -i 'create'
    CREATE TABLE "ABC" ("A" VARCHAR2(10), "B" VARCHAR2(10)) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" LOGGING NOCOMPRESS
    CREATE TABLE "ORDERS" ("DEPT" VARCHAR2(20), "PLACE" VARCHAR2(20), "INTCOL" NUMBER(*,0)) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" LOGGING NOCOMPRESS
    rac01:/software/backup>strings exptest.dmp |grep -i 'alter'
    ALTER TABLE "ORDERS" MODIFY DEFAULT
    ALTER TABLE "ORDERS" MODIFY ("INTCOL" DEFAULT 12
    ALTER TABLE "ORDERS" ADD PRIMARY KEY ("DEPT") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "USERS" LOGGING ENABLE
    SQL> conn simar/simar
    Connected.
    SQL> drop table orders;
    Table dropped.
    imp simar/simar@RACDB file=exptest.dmp log=imp_exptest_1.log tables='ORDERS'
    rac01:/software/backup>exptest.dmp log=imp_exptest_1.log tables='ORDERS' <
    Import: Release 10.2.0.3.0 - Production on Tue May 6 23:46:48 2008
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, Real Application Clusters, OLAP and Data Mining options
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in WE8ISO8859P1 character set and AL16UTF16 NCHAR character set
    . importing SIMAR's objects into SIMAR
    . importing SIMAR's objects into SIMAR
    . . importing table "ORDERS" 4 rows imported
    Import terminated successfully without warnings.
    SQL> conn / as sysdba
    Connected.
    SQL> set heading off;
    set echo off;
    Set pages 999;
    set long 90000;
    SQL> SQL> SQL> SQL> SQL>
    SQL> select dbms_metadata.get_ddl('TABLE','ORDERS','SIMAR') from dual;
    CREATE TABLE "SIMAR"."ORDERS"
    ( "DEPT" VARCHAR2(20),
    "PLACE" VARCHAR2(20),
    "INTCOL" NUMBER(*,0) DEFAULT 12,
    PRIMARY KEY ("DEPT")
    USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS" ENABLE
    ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "USERS"
    SQL>
    Here the alter table statement is in the dmp file as well as in the imported table.
    Regards

  • Table editor problem with default value for column

    Hi there,
    I'm trying to use SQL Developer 1.2.1 on Ubuntu 7.10 (though I don't think the OS is relevant) and I'm running into a snag when trying to update table structures. If you go to edit the table to say modify a column name, and that column has a default value set, SQL Developer is encapsulating the value with brackets and quotes. When trying to save the changes, it complains about the default value being 4 chars too many for the column width. An example of this would be a currency code column of varchar2 (3) set with EUR as the default. SQL Developer changes the value to ('EUR') hence the error.
    Is there anyway to prevent this from happening?
    Cheers,
    Chris

    Could you please be more specific? In 1.2.1.32.40 I
    added the column COL1 VARCHAR2(3) with default value
    'EUR'. The data display field refreshed to show the
    default value, so I edited it in a couple of entries
    and comitted the change without problem. Then I
    renamed the column from the "Edit table" popup menu.
    Finally, I renamed the column from the "Rename
    column" popup menu, no problem either.Ah, you are correct. That does work. What I was trying is select tablename in the object browser, then right click on it and select "Edit" from the contextual menu. You are then presented with edit table dialog box. If you then select a column in that box you will see a column properties box. In that section you can change the name, default value, datatype et cetera. Note that your default column value which should just be EUR (or 'EUR' to denote that it's a string) is now ('EUR'). Once you try changing the name to of the column to something else and then click OK, you should then get an error complaining of "Invalid varchar2 default value" with a more specific message of "Default values size 7 is greater than the allowed 3"
    You have provided a work around, and thanks for that, but it would be nice to edit everything in the Edit table dialog box if you're modifying more than one column name. I'm tasked with cleaning up a bit of a messy database, and there are a good deal of columns to be renamed.
    Cheers,
    Chris

  • Default values of columns not transferred in SSIS Transfer Objects Task

    I am working on a project that is creating a new application, my area of the project being the migration of data from the old application database, transforming it, and populating the new database.
    The transformations to the old data are done in a staging database.
    At the end of the process, the staging database ends up with a lot of new applications tables, populated with the migrated legacy data.
    We need to move these tables from the staging database to (initially) our test databases, but ultimately what will be the live database.
    We have tried using the "Transfer SQL Server Objects Task" in SSIS, but have ran into a problem that a lot of the database tables have default values for columns.
    These default values are not brought over.
    Example. Tables contain a "GUID" field, which has a default of value of newid()
    Right clicking and the table generating the CREATE script generates 
    [GUID] [uniqueidentifier] ROWGUIDCOL NOT NULL CONSTRAINT [DF_tbCRM_Client_GUID] DEFAULT (newid()),
    However, the Transfer objects task does not create this default of newid()
    Examining the SQL generated by the Import / Export Wizard when investigating this shows that the wizard generates this column as
    [GUID] uniqueidentifier NOT NULL
    and the column default value is lost.
    Is there something i should be setting somewhere to force SSIS to bring these column definitions over correctly?

     Kaarthik Sivashanmugam wrote:
    This behavior is by design to maintain backward compatibility with the Copy SQL Server Objects task in SQL Server 2000. Only two constraints (Primary key and foreign key constraints) are expected to be copied by Transfer Objects task.
    thank you for you response Sivashanmugam.
    How can I move these tables (of which there are over a hundred) from my staging database into the application database - and keep the table definitions correct?
    I cannot use the transfer objects task, as this will not define the tables correctly.
    I cannot use the import and export wizard, as this will also not define the tables correctly.
    This means I will manually have to code the drop, create and inserts for over a hundred tables?

  • Default cell values for column not properly saved in uir file in labwindows 2009 (9.1.0 427)?

    I've run into a strange problem with the table control.  Basically, even though I set default cell values for a particular column as numeric, when I try to add items to the list it tries to add them as strings, and returns an error message that it is expecting *char instead of int.  Furthermore, when I open the uir file that contains the table in question in 2010, it appears as if the default cell values for that column are still set as strings, even though in 2009 when I open the uir file it shows as numbers.  I tried converting the uir to C code, and sure enough the C code indicated that the column still is a string type.
    I've gone ahead and made a small project to show the issue.  If you open this project in labwindows 2009 and click on the table in the table_bug.uir, and edit default cell values for column 1, you will see that the cell settings have type as numeric and data type as int.  When you run the project, however, it will fail with an error message saying that it is looking for a *char.  When this same project is loaded into labwindows 2010, clicking on the table in table_bug.uir and edit default cell values (column 1) shows the type as string.  When I change this to numeric (and change numeric attribute to int), this runs fine in 2010.  I tried simply changing the uir in 2010, and then using it in 2009, but 2009 complains that the uir is from a newer version (understandable).  If there is any workaround that would let me continue to use 2009 for the time that would be great.
    Any help would be greatly appreciated.
    thanks,
    Alex Corwin
    Solved!
    Go to Solution.
    Attachments:
    table_bug.zip ‏324 KB

    I opened the UIR in 2009 (but I have 2009 SP1) and it still showed that the default value for the first column was a string. I didn't have any problems changing it to a numeric int, and then building and running the project without error.
    Here are a few things you can try:
    1) Change the default value to a string. OK out of the dialog, re-enter the dialog, and change it back to Numeric int. Resave and see if the problem has gone away.
    2) You said you get a ".UIR is from a newer version" error when opening the 2010 UIR in 2009. Does the UIR still open if you click okay? Often times this will work just fine. Assuming you don't have any problems with this, make a minor change to the UIR in 2009, such as moving the table to the left, and then back to the right and then re-save. See if your program works now.
    Kevin B.
    National Instruments

  • Calling a user defined function as default value for a column

    Hi All
    Can we call a user defined function as default value for a column ??
    for example:
    create or replace  function test1  return number is
    begin
    return 10;
    end;
    create table testt
    (id  as test1,
      name varchar2(20));
    getting error:
    Error at line 1
    ORA-02000: missing ( keywordThanks
    Ashwani
    Edited by: Ashwani on Jan 16, 2012 1:19 AM

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Database » SQL and PL/SQL which you can get more quick response
    Regard
    Helios

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • SP Online - Managed Metadata column Default Value for folders (using CSOM)

    Hello,
    I am working on setting default values (metadata columns)  for different folders on my document library. As so far, I've found solution about how to set default values on whole library and many solutions which works for folders, but not for sharepoint
    online (using metadataDefaults object).
    The only working solution for folders in SPO I've found is editing file library/Forms/client_LocationBasedDefaults and add some data here.
    My question is: is there any easier method to set default values for each folder in document library without manually editing this file? 

    I second that, I have a client looking to do the same thing but I don't see a way to automate this.

  • Default  value for a column in Table Control

    Hi friends, can i set dinamcally a default value for a column in table control?, this column is check type. This default value must appear in empty rows,
    thanks

    ADD A MODULE AS Module yyyy In ur PAI.
    as
    In PAI.
    LOOP at  itab.
    Module YYYY
    ENDLOOP.
    Module YYYY.
    LOOP AT SCREEN.
        IF SCREEN-NAME = 'ITAB-VAL’.
          ITAB-VAL = 'XXXXXXXX'        "(DEFAULT VALUE)
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
        ENDIF.
    ENDLOOP.
    End module.
    *note
    make this event work only if the previous column is filled okay.
    the display will be in display mode on the screen as screen-input = 0.
    see that in the table control u can get the table field for all the rows even though you are processing on some fields .
    so what u do is make that particular filed masked(no i/p field and populate the field that will be better instead of populating all the columns okay.
    hope this helps you out ,
    regards,
    vijay.

  • Default Value for a column in matrix

    Hi,
    How to set default value for a column in matrix which is of type combo(Yes/No).
    The cell has combo in it
    Manoj

    Hi Manoj,
    The column is set as combo. Now you need to tell SBO what constituates a Y or N. In my example my Column "Col6" must display Yes if the RENTED column = 1 and No if the RENTED column = 0. (I'm obviously using a datasource to tie the data to the matrix)
    oMatrix = frm.Items.Item("YourMatrixID").Specific
            oColumns = oMatrix.Columns
    oColumn = oColumns.Item("Col6")
            oColumn.DataBind.SetBound(True, "@VIDEO", "U_RENTED")
            oColumn.ValOn = "1"
            oColumn.ValOff = "0"

  • Setting default values for a column

    Hi,
    I have a table having some default values for the columns. I am using a PreparedStatment to insert into this table. For null values I am using setNull(..) method but the default values given for the columns are not inserted for null values.
    eg: INSERT INTO TEST VALUES(?,?);
    where TEST table contains two columns col1 and col2 with default values 'AA' and 'BB' respectively. My requirement is to make sure that when null values are specified for the columns then the database default should be picked up. using setNull(..) method doesn't help.
    Thanks in advance.
    Gyan

    Default value for a column can be picked up from DatabaseMetaData class.
    The below snippet shows that: -
    DatabaseMetaData metaData = connection.getMetaData();
    ResultSet resultSet = metaData.getColumns(null, null, "TEST", "COL%");
    while ( resultSet.next() )
    String defaultValue = resultSet.getString("COLUMN_DEF");
    String datatype = resultSet.getString("DATA_TYPE");
    System.out.println("defaultValue = " + defaultValue);
    System.out.println("datatype = " + datatype);
    }

  • Default values for files and columns when adding a discoverer porlet

    Hi, i'd like to know how to configure the default value for numbers of columns and files when i add a new discoverer porlet in a portal page.
    The actual default value is 10 files and 6 columns and i always have to increase it to at least 100x100.
    Is there any config file where i can change that?
    I've found a configuration.xml in $ORACLE_HOME/discoverer/config/configuration.xml
    with a section
    <!-- Discoverer Servlet configuration. Defines behaviour of both
    discoverer/plus and discoverer/viewer servlets -->
    but couldnt find a parameter for those items.
    Thanks in advance.
    Daniel Perez

    I think triggers are the best device.
    Scott

  • Setting default value to columns on tabular form is not working.

    Hi,
    I created a tabular form and i want to set some default values to columns based on the values in page items.
    so i set the page item to column value in tabular form attributes by selecting the Default type as PLSQL Expression & Function DEFAULT value &P24_ISSUE_ID. it worked fine but
    in the similar way i tried for the another column by selecting the default type as pl/sql expression & function and default value &P24_CASE_NAME.
    but it throwing an error for this like failed to parse SQL query:    ORA-00904: "C254DB": invalid identifier
    i don't understand where i gone wrong even i checked for the data types of the columns, everything is fine.
    so please help me out of this problem.

    Tulasi 1243 wrote:
    for the first column
    i selected
    DEFAULT TYPE as PL/SQL Expression & FUNCTION
    Default as *&P24_ISSUE_ID.* This is a number data type column
    2nd column
    Default Type as PL/SQL Expression & Function
    Default as *&P24_CASE_NAME.* This is Varchar2 data type column.The appropriate options for a default value from a page item are Item (application or page item name) for Default Type and the item name ( P24_ISSUE_ID, P24_CASE_NAME etc) for Default.
    *&P24_ISSUE_ID.* is not a "PL/SQL Expression or Function".
    but it throwing an error for this like failed to parse SQL query: ORA-00904: "C254DB": invalid identifierWhat you are doing results in the APEX engine substituting the P24_CASE_NAME value "C254DB" into the default value and then trying to evaluate this string as a piece of PL/SQL. Outside of a block in which it is defined as a variable, constant or function "C254DB" is not a valid PL/SQL expression.

  • Default value for a reference cursor argument to a package function

    I'm trying to do the following to allow the caller to pass in a ref cursor arg or a SrcTextID (internal). Anyway, I'm just trying to use defaults, rather than overloading the routine, but I can't figure out how to default a ref cursor variable.
    FUNCTION f_execute_query_and_build_file(
         bn_debug_mode_in                              IN           common_func.BOOLEAN_NUMBER,
         n_ahs_file_definition_id_in          IN           AHS_FILE_DEFINITION.AHS_FILE_DEFINITION_ID%TYPE,
         lst_ordered_column_names               IN           common_func.STRING_TABLE,
         s_file_directory_in                         IN           VARCHAR2 := null,
         s_file_name_in                                   IN           VARCHAR2 := null,
         n_src_text_query_id_in                    IN           SRC_TEXT.SRC_TEXT_ID%TYPE := Null,
         refcur_query_in                              IN           sys_refcursor := Null,
         s_error_msg_out                                   OUT      common_func.T_ERROR_MSG )
    RETURN NUMBERThis causes a "PLS-00382 expression is of wrong type" msg. Okay, so fine. Then I thought that I would declare a package level "empty" ref cursor to act as "empty" default...which causes a "PLS-00994 Cursor Variables cannot be declared as part of a package" msg.
    Any ideas?
    Thanks,
    Jason

    in 10g you can...Unfortunately 9i doesn't like it:
    scott@ORA92> DECLARE
      2    variable_name SYS_REFCURSOR := NULL;
      3  BEGIN
      4    NULL;
      5  END;
      6  /
      variable_name SYS_REFCURSOR := NULL;
    ERROR at line 2:
    ORA-06550: line 2, column 34:
    PLS-00382: expression is of wrong type
    ORA-06550: line 2, column 17:
    PL/SQL: Item ignored
    scott@ORA92> DECLARE
      2    PROCEDURE procedure_name (
      3        parameter_name IN SYS_REFCURSOR := NULL)
      4    IS
      5    BEGIN
      6        NULL;
      7    END;
      8  BEGIN
      9    procedure_name;
    10  END;
    11  /
        parameter_name IN SYS_REFCURSOR := NULL)
    ERROR at line 3:
    ORA-06550: line 3, column 40:
    PLS-00382: expression is of wrong type
    ORA-06550: line 2, column 3:
    PL/SQL: Item ignored
    ORA-06550: line 9, column 3:
    PLS-00306: wrong number or types of arguments in call to 'PROCEDURE_NAME'
    ORA-06550: line 9, column 3:
    PL/SQL: Statement ignored
    Barbara what is the difference between 'DEFAULT' and
    ':=' in parameter declarations?Apparently there is no difference. My mistake. I have always used default. Somewhere along the way I obtained the misimpression that using := would overwrite a passed value, similar to the way it would when used between is/as and begin, whereas default would only use the default value if another value was not passed. I don't recall where I got that idea. The test below shows that my presumption was wrong:
    scott@ORA92> CREATE OR REPLACE PROCEDURE test
      2    (p_1 IN VARCHAR2 DEFAULT 'default value for p_1',
      3       p_2 IN VARCHAR2 := 'defualt value for p_2')
      4  AS
      5  BEGIN
      6    DBMS_OUTPUT.PUT_LINE (p_1);
      7    DBMS_OUTPUT.PUT_LINE (p_2);
      8  END test;
      9  /
    Procedure created.
    scott@ORA92> SHOW ERRORS
    No errors.
    scott@ORA92> SET SERVEROUTPUT ON
    scott@ORA92> EXECUTE test ('passed value for p_1', 'passed value for p_2')
    passed value for p_1
    passed value for p_2
    PL/SQL procedure successfully completed.
    scott@ORA92>

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

Maybe you are looking for