ORA-01400 - not null column with default value and item with authorization
I've searched - I would think someone has run into this. APEX 3.0.0.00.20 - I've created a simple form on a table. One of the column is a not null column with a default value. I have a select list on that item, but it has security on it - authorization scheme. So, it checks the user and if that user isn't of the right role, it will not even display that item. However, APEX appears to still send in the column in its sql! So, the default value is useless, it sends in null each time. Even if I set the default at the Item level, I get null. Argg. That's got to be a bug...
In debug, I do not see the item listed at all. It's not used. That's fine - but why is it trying to insert the value? I would think it would leave it off??? I think because the item is associated with a database column. But, getting around this is ugly. Having to create a hidden item for each one, and then check to see if I need to take the list value... horrible. Any way to get around this???
I should add - I guess I can always put my own custom process in to replace the DML. Just seems like a simple thing - if the value doesn't appear on the debug, isn't set with any default value... don't include it in the DML.
Similar Messages
-
I want to set a variable with default value and can be changed by the user
hi,
i want to set a variable with default value and can be changed by the user, so i new a variable with setting : customer exit, single value, optional, ready for input.
in my customer exit code, i set a default value, eg. 20070530
when the variable screen popup, it display the default value 20070530, i changed it to 20070529, but it doesn't work , it still display the data in 20070530, how can i solve this problem?
your help is appreciated.Liu,
As mentioned by Anil, you need to restrict your customerr Exit code to I_STEP = 1.
or.
<u>Open your Variable in change mode, in the Last Page os the Variable Maintenance you can provide default value. Note: you are doing same thing in Customer Exit. In your case no need of Customer Exit.</u>
Nagesh Ganisetti.
Assign points if it helps. -
Initializu00EDng select options field with default values and with NO INTERVALS
Dear All,
I have used WDR_SELECT_OPTIONS technology within WD Abap.
I also have added the fields which have to be taken into consideration.
lt_range_table =
wd_this->m_handler->create_range_table(
i_typename = 'PLANT' ).
wd_this->m_handler->add_selection_field(
i_id = 'PLANT'
it_result = lt_range_table
i_read_only = read_only ).
Can I assign two values to this field 'PLANT' whereby the user may take only these values.
I mean kind of pre initializíng of this select options field with default values.
Due to this handling it should be prevented that the user can give other values
except this values.
Additonally it should be fine whether it is possible to disable the second input field
of this select options field like NO INTERVALS .
Regard
sas
Regard
saswd_this->m_handler->add_selection_field(
i_id = 'PLANT'
it_result = lt_range_table
I_NO_INTERVALS = 'X'
i_read_only = read_only ).
Pls check 'WDR_TEST_SELECT_OPTIONS' web dynpro component -
Do we have a function in oracle to select not null columns at the begining
Hi,
I have 8 columns. Some of them might be null.
I want to display all 8 columns in my result. Not null columns will be first and null at the end.
Here is a sample data :
Employee table :
Employee_id Emp_fname emp_lname emp_mname dept salary emp_height emp_weight
1 aaa ddd d1 100 6 180
2 bbb ccc 120 169
3 dfe d2 5.9 223The expected result is :
result1 result2 result3 result4 result5 result6 result7 result8
1 aaa ddd d1 100 6 180
2 bbb ccc 120 169
3 dfe d2 5.9 223Thanks.
Edited by: BluShadow on 12-Jul-2012 16:12
added {noformat}{noformat} tags for readability. Please read {message:id=9360002} and do this yourself in future.The requirement doesn't make a lot of sense and tends to imply that you have an incorrect data model. If that's the case, you'd be much better off fixing the data model than in trying to write this sort of query (particularly since a poor data model is going to force you to write a bunch of creative SQL).
If you define a type and a function
CREATE TYPE num_tbl AS TABLE OF NUMBER;
create or replace function count_null( l_nums in num_tbl )
return number
is
l_cnt integer := 0;
begin
for i in 1..l_nums.count
loop
if( l_nums(i) is null )
then
l_cnt := l_cnt + 1;
end if;
end loop;
return l_cnt;
end;Then you can do something like this
SQL> ed
Wrote file afiedt.buf
1 select product,
2 coalesce( q1, q2, q3, q4 ) col1,
3 (case when count_null( num_tbl( q1 ) ) = 0
4 then coalesce( q2, q3, q4 )
5 when count_null( num_tbl( q1, q2 ) ) = 1
6 then coalesce( q3, q4 )
7 when count_null( num_tbl( q1, q2, q3 ) ) = 1
8 then q4
9 else null
10 end) col2,
11 (case when count_null( num_tbl( q1, q2 ) ) = 0
12 then coalesce( q3, q4 )
13 when count_null( num_tbl(q1, q2, q3) ) = 1
14 then q4
15 else null
16 end) col3,
17 (case when count_null( num_tbl( q1, q2, q3 ) ) = 0
18 then q4
19 else null
20 end) col4
21* from saleshist
SQL> /
PRODUCT COL1 COL2 COL3 COL4
Oracle EE 100 123 128
Partitioning 100 130 128Justin -
Oracle BPEL - Does not cater for not null columns and use of "default".
Oracle BPEL - Does not cater for not null columns and use of "default".
BPEL fails with message:
ORA-01400: cannot insert NULL into ("EDDB"."SEISMIC_LINES"."COORD_SYSTEM_ID")
But SQL*PLUS command works:
INSERT into EDDB.SEISMIC_LINES
(etc)
regards
Allan Ford
Analyst / Programmer - IT Application Services, IT Services, Shared Business Services
Santos Ltd
Level 4, 91 King William Street, Adelaide SA 5000
Phone: 08 8224 7944 Fax: 08 8218 5320
Email: [email protected]note: BPEL keeps it's own "offline" copy of table and database items. A column that is marked not null in the database can be marked as nullable in this area. (if you kmow that a trigger is going to cater for this ..)
One workaround is to use a trigger to provide value rather than use the column default .. -
OracleXMLSave - Insert into table with NOT NULL Columns
Im having trouble using OracleXMLSave (XSU12) to insert into a
table where columns are initialized on insert with system
derived values (see table script below) I get the following
error message.
Message: 'java.sql.SQLException: ORA-01400: cannot insert
NULL "TESTMEETING"."S_TERMID")
Im inserting this XML:
<ROWSET table="testmeeting">
<ROW>
<DESCRIPTION>TestMeeting</DESCRIPTION>
<STARTDATE>2001-10-22 00:00:00.0</STARTDATE>
<CATEGORYCODE>HR</CATEGORYCODE>
<STATUS>O</STATUS>
</ROW>
</ROWSET>
Table Script:
CREATE TABLE TESTMEETING (
S_TERMID VARCHAR2 (12) DEFAULT (USERENV('TERMINAL'))
NOT NULL,
S_RECORDCREATED DATE DEFAULT (SYSDATE) NOT NULL,
S_RECORDCREATOR NUMBER (4) DEFAULT (UID) NOT NULL,
DESCRIPTION VARCHAR2 (28),
CATEGORYCODE VARCHAR2 (2),
STARTDATE DATE,
STATUS VARCHAR2 (1))
If I remove these columns the insert works OK. Inserts also work
fine from sqlplus etc.
Apologies for the previous entry, itchy fingers.
Thanks for your helpHi.
try to insert data in column "TESTMEETING"."S_TERMID" by trigger.
Thanks.. -
How to Add column with default value in compress table.
Hi ,
while trying to add column to compressed table with default value i am getting error.
Even i tried no compress command on table still its giivg error that add/drop not allowed on compressed table.
Can anyone help me in this .
Thanks.Aman wrote:
while trying to add column to compressed table with default value i am getting error.This is clearly explain in the Oracle doc :
"+You cannot add a column with a default value to a compressed table or to a partitioned table containing any compressed partition, unless you first disable compression for the table or partition+"
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#sthref5163
Nicolas. -
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,
ChrisCould 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 -
Dropping a column's default value
How to drop a column's default value?
The following commands fails:
ALTER TABLE t1 ALTER COLUMN c1 DROP DEFAULT.
ALTER TABLE t1 MODIFY c1 DROP DEFAULT.
Thanks in advance.SQL> ALTER TABLE IDENTIFICADORES_DOMINIOS_RANGO MODIFY TIPO_DATO DEFAULT NULL;
Table altered
SQL> DESC IDENTIFICADORES_DOMINIOS_RANGO
Name Type Nullable Default Comments
CODIGO_IDENTIFICADOR NUMBER(7)
DESCRIPCION VARCHAR2(50)
TIPO VARCHAR2(1)
TIPO_DATO VARCHAR2(1) NULL Tipo de dato que contiene el Dominio-RangoI would like drop DEFAULT value; now, it's marked like NULL. It's not the same... is it? -
SSRS 2008 R2 Report parameters have default values and report not to auto run
Hi, I am using SSRS 2008 R2 one of my requirements for a Report is all the parameters have default value and I do not want this report to auto run when users open this report. I can create a dummy hidden parameter to break the auto run for this
report. But I am looking for solutions other than that.
Thanks in advance..........
IoneHi lone,
According to your description, you have a report with parameters. Now you want you report not to run automatically with your parameters default values. Right?
In Reporting Service, if you have parameters with default values in your report, your report will always auto run with these default values. We can say these default values are used for report running initially. So for your requirement, if you really need
to see your default value before the report running, the best workaround is set one more parameter to break the auto run like you have done. If you just want your report not to auto run, your can achieve it by removing those default values.
Reference:
Report Parameters (Report Builder and SSRS)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou (Pactera) -
How to preset fields in TA BP with default values
Hi!
I want to fill few fields in transaction BP with default values.
This should be if there`s a new business partner to insert.
If i can do this depending on the selected role it was the best
First i thought on SPA/GPA-parameters ... but then i can`t do it in depence on the selected role.
In customizing i can tell only if a field should be displayed or not, for input or not, ... but no values to insert.
Is here anybody with a good idea for me?
Thanks a lot in advance.
Best regards,
Ingo
Edited by: Ingo Schmökel on Jul 1, 2008 7:20 PMHi,
There is one possibility which requires an enhancement of the
BDT event ISDAT and a call to the function module
BUP_BUPA_FIELDVALUES_SET. This means that an ISDAT function module needs to be written (transaction BUS7) which calls the function module BUP_BUPA_FIELDVALUES_SET with the needed values that are to be defaulted. You can read the role value using BUS_PARAMETERS_ISSTA_GET (T_RLTYP).The fields which are possible can be found in the DDIC structure BUSDEFAULT. However this is limited only to the fields inside this structure.
Thanks and warm regards,
Smita. -
How to preset fields in a transaction BP with default values
Hi!
I want to fill few fields in transaction BP with default values.
This should be if there`s a new business partner to insert.
If i can do this depending on the selected role it was the best
First i thought on SPA/GPA-parameters ... but then i can`t do it in depence on the selected role.
In customizing i can tell only if a field should be displayed or not, for input or not, ... but no values to insert.
Is here anybody with a good idea for me?
I`ve posted my question first in crm-section but i think here it`s better
Thanks a lot in advance.
Best regards,
IngoHi,
There is one possibility which requires an enhancement of the
BDT event ISDAT and a call to the function module
BUP_BUPA_FIELDVALUES_SET. This means that an ISDAT function module needs to be written (transaction BUS7) which calls the function module BUP_BUPA_FIELDVALUES_SET with the needed values that are to be defaulted. You can read the role value using BUS_PARAMETERS_ISSTA_GET (T_RLTYP).The fields which are possible can be found in the DDIC structure BUSDEFAULT. However this is limited only to the fields inside this structure.
Thanks and warm regards,
Smita. -
Portal Forms - How to make a Field with DEFAULT value NON-EDITABLE by Users
I HAVE A FORM WITH A DATE FIELD ON IT WITH DEFAULT VALUE.
THIS IS A TABLE-FIELD.
I WANT THE FIELD TO BE DISPLAYED ON THE FORM BUT NOT TO ALLOW
USERS TO EDIT/CHANGE IT.
HOW CAN I DO THIS?
TKS IN ADVANCEHi,
see Re: sequencing problem-Forms
Regards Michael -
Initialize some fields in material master with default values
Hi,
I would like to initialize some fields in material master MM01 with default values.
for exemple in the view MRP1 there is a field MRP type I would like to initialize PD in the field as default value.
but when I go to the technical information there is no parameter id that I can use in SU3.
Do you know how I can the initialize the field those don't have parameter ID?
thank
DedeDear Glenn,
This is possible in SAP for this use T code MMD1 and create MRP profile and assign this MRP profile while creating material using MM01 in the organisation level put this created MRP profile. The values you maintained in this profile get copied to the material by default.
To maintain MRP profile go to MMD1->give your profile name...........> click on selection screen push button--->give here profile description--->select what MRP field which u want to make fixed one/default. if make fixed later you can not change--
>click on data screen 1 push button and maintain your value and save
sree -
Script to add not null columns to all tables in database
Hello,
I need to add 5 not null columns to my existing database (all tables).
The problem is that i do not want to loose the current data.
I need a script so that i need not do this manually for each table.
Can u suggest?
VishalHello,
I need to add 5 not null columns to my existing database (all tables).
The problem is that i do not want to loose the current data.
I need a script so that i need not do this manually for each table.
Can u suggest?
Vishal I always follow this step
1) Alter table <<tablename>> add(<<columnname>> <<datatype>>)
2) Update <<tablename>> set <<columnname>>=<<anyvalue>>
3) Alter table <<tablename>> modify(<<columnname>> <<datatype>> not null)
else
1) rename <<tablename>> to <<tablenamebk>>
2) drop table <<tablename>>
3) Alter table <<tablenamebk>> add(<<columnname>> <<datatype>>)
4) update <<tablenamebk>> set <<columnname>>=<<anyvalue>>
5) create table <<tablename>> (with additional columns with not null)
6) insert into <<tablename>> select * from <<tablenamebk>>
Maybe you are looking for
-
SQL Developer High Memory Consumption 3.2.20.09.87
Hello, I have been using SQL developer for quite some time and had initially had problems in the past with high memory consuption when I use this tool. I have received and applied advice from this forum and while it had helped a little, the majority
-
How to Provide Mailing/fax Facility from a report Pg
Hi all, We are trying to provide a mailing/fax facility through a report pg. We got following Error messages in "Procesing logs" 1.No communication type from strategy 1 could not be used.2.Communication type cannot be used following is what we have d
-
DC not found/updated after activation
Hello all, After successfully activating open activities over NWDS (and the DEV Runtime System already defined), the WebDynpro DC is not updated nor created. How do I resolve this issue. Please help. Thanks. Regards, Jan
-
I am not able to open a cd through my imac
I have an imac with a folder for Windows. I go back and forth and cannot remember how to get my cd to upload on my imac.
-
Problems after playbook update
Hello blackberry users, I installed the new upgrade for the playbook last week and since then I have been running into the same problems; - extreme lag when playing games or surfing the web - playbook freezing on games/web/home screen - "Browser" n