Add column to table
When adding a new column to a table, it is not possible to insert/update data during the same session because new column is named "null" in the generated SQL-statement.
In case you want to update an existing record after adding a new column, you can do a rollback. If after that you try to delete the existing record, you get the error message "Data updated by another user, cannot delete row."
Did you use the right-click Column > Add? When I do this, it prompts me to name my new column and if I do not provide a name, the resulting sql fails. When I add a valid column, I have no problem adding data. Depending on which tab you are on when you add the column, you might need to refresh the display before adding data.
-- Sharon
Similar Messages
-
How to add column in table control for transaction APPCREATE
Hi All,
How can i add the additional column in table control for transaction APPCREATE.
There is structure PT1045_EXT present behind table control. But not found any customer exit or badi to display on screen.
Please help...You can add new columns
If you add new columns in tr. PHAP_CATALOG -
SHDO - add column in table control in CRMD_ORDER
Hi,
is it possible to add a EEWB generated column to table control (on the first screen)
in TCODE CRMD_ORDER ?
did anyone ever do that ?
thank you,
Regards,
michalhehe
it would be great to get feedback on everything here but I'd better obey the forum rules
too many opened forums and I sometimes get a little lost
Regards,
michal -
Add columns to Table & maintaining width
I want to add a coulmn to a table in InDesign wihout changing the overall width of the table. In Quark there is an option called Maintain Geometry which allows you to add a column or columns to a table without changing the overall width--so that if you start off building a 4" wide table w/4 columns you could add more columns and still maintain the 4" width, as long as that option checked. Can't figure how to do this in Indesign. Is it possible? Thanks all.
With the Type tool move over the right border of the table. If you hold down the Shift key and drag the border, the cells to the left will all scale smaller so you can adjust to the new width. Then you click click on the right border of each column and drag to adjust column width. You can also numerically change the width of a column in the Table panel or the Control panel when the column is selected.
-
Insert another column in table
Hello,
i make an EMP table, i insert data in it. after that if I want to create one more column in that table, so what is command for that????refer this thread...
Re: add column(in table) in required position -
How to add a column in table control
Hi ,
Can any one tell me how to add a column in table control? My requirement is to add two columns ( custom fields ) into table control ( It is a standard program). I have added the column in the table and also in the table control. But when I am running the standard program, The newly added column is not there. But I have added in the perticular screen. Change is not reflected.
Can anyone help me on this please.
Thanks in advance.
Regards,
Lakshmi.Hi,
Ensure the following :
1. After adjusting the database, you`ll have to use the database utility and activate the table.
2. If you have changed the standard screen, in tcode se80 -- right click on the program and click activate all. This activates all objects related to that program.
Now execute the program.
Reward if helpful.
Regards -
How to add a new columns in table contorl in standard screen.
Hi All,
I am working on a enhancement for transaction VA01. I have to add few column for tab Additional Data B. In this tab column are displayed in table control. Now i have to add two more column in table control. Could you please help me to find out the exit and the way to populate the new columns.
Thanks
Piyush MathurHi Piyush,
That table control might have been created using an internal table i.e declared in the exit. Add two more fields which you want to that internal table. And come to the layout and create table control once again using that internal table.
Reward if helpful.
Regards,
Ramana -
How to check 2 tables(Table A and Table B) and figure out new columns present in Table A and add these new columns to Table b.
DDL-
Create table A
( A INT,
B INT,C VARCHAR(2)
Create table B
A INT,
B INT
Any advice on the best approach or method to achieve this.
I understand that I need to check the schema of the columns and then do a match between 2 tables and find new columns and then alter my target table
MudassarCan you try this..
CREATE TABLE A ( A INT, B INT, C VARCHAR(2) )
CREATE TABLE B ( A INT, B INT )
Declare @ColumnVar nvarchar(128),@DatatypeVar nvarchar(128)
SELECT @ColumnVar=x.COLUMN_NAME, @DatatypeVar=x.DATA_TYPE
FROM INFORMATION_SCHEMA.COLUMNS AS x
WHERE TABLE_NAME = 'A'
AND NOT EXISTS ( SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'B'
AND COLUMN_NAME = x.COLUMN_NAME )
Declare @SQL VarChar(1000)
SELECT @SQL = 'ALTER TABLE B ADD ' + @ColumnVar + ' '+ @DatatypeVar
Exec (@SQL)
select * from B
Please Mark This As Answer if it helps to solve the issue
http://stackoverflow.com/questions/2614101/alter-table-my-table-add-column-int -
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. -
How to add column to report from the same table? Gives error now
Steps to reproduce:
Build a report on a table with easy report, select all columns
Add column to the table
Edit report and add column (one has to click Show Related Tables Only: No to view the same table!)
Report will give error as it will be build as
SELECT ... FROM table1, table1AH HAAA!!!!
And I was afraid to convert from the "SQL (Structured Query)" to "SQL". Probably because I blew up my other reports...
Thanks! -
Cannot add column to flexible table when ddl autocommit is off using Procedure
Hello All,
Through procedure I am trying to insert data into the target(EX_92) table(with schema flexibility)
Source table data
ID
PRODUCT_CODE
PRODUCT_NAME
PRICE
COLOR
TYPE
1
1
rugg
101.22
2
1
rugg
101.22
3
2
book
200.32
BLUE
Y
Target table QUERY
drop table EX_P2;
CREATE COLUMN TABLE EX_P2(
ID INTEGER PRIMARY KEY,
PRODUCT_CODE VARCHAR(3),
PRODUCT_NAME NVARCHAR(20),
PRICE DECIMAL(5,2)
) WITH SCHEMA FLEXIBILITY;
Procedure to insert above records with additional columns into the target table(EX_P2)
Procedure
drop procedure "DS_O1"."PROC";
create procedure "DS_O1"."PROC"(IN max_value INTEGER, IN schema_name varchar(40), IN table_name varchar(40), IN column_list varchar(400))
LANGUAGE SQLSCRIPT AS
BEGIN
DECLARE maxid integer :=0;
DECLARE INSERT_STR VARCHAR(1000) :='';
select max(ID) into maxid from "DS_O1"."EX_P2";
select :maxid from dummy;
INSERT_STR :='insert into "' || 'DS_O1' ||'"."EX_P2" ('||:column_list||') (select ' ||:column_list||'
FROM "'||:schema_name||'"."'||:table_name||'"' || ' where ID >' || :max_value || ')';
EXECUTE immediate(:INSERT_STR);
END;
Now while executing above procedure
CALL "DS_O1"."PROC" ( 0, 'DS_O1', 'TMP_EXL2','ID,PRODUCT_CODE,PRODUCT_NAME,PRICE,COLOR,STATUS,TYPE');
I am getting the following error
Could not execute 'CALL "DS_O1"."PROC" ( 0, 'DS_O1', 'TMP_EXL2','ID,PRODUCT_CODE,PRODUCT_NAME,PRICE,COLOR,STATUS,TYPE')' in 23 ms 564 µs .
SAP DBTech JDBC: [7]: feature not supported: [7] "DS_O1"."PROC": line 18 col 1 (at pos 779): [7] (range 3): feature not supported: cannot add column to flexible table when ddl autocommit is offHi Rajnish,
I had the same issue. For what it’s worth I was able to do a workaround basically creating all the columns when I create the table. The following code works for me to create the table which is just a matrix with one Integer column as the key and the rest as type Double.
It is not ideal in all scenarios because the table columns cannot be added dynamically via a procedure at a later point. This table has 27K columns now
Of course one of the advantages of a flex table would be programmatically adding columns dynamically. This works, but maybe there is still a way to add columns dynamically from a procedure, and someone else can advise.
Apparently dynamically adding columns via procedures may have some "minor" limitations due to the need to compile the procedure with knowledge of the flex table DDL. But again, hopefully someone knows another solution.
Best regards,
Mark
DROP PROCEDURE CREATE_MATRIX;
CREATE PROCEDURE CREATE_MATRIX(
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER
AS
/*********BEGIN PROCEDURE SCRIPT ************/
BEGIN
-- cursor over messages
declare cursor matrix_cursor for
select distinct TERM
from TERMS
order by term;
declare cnt INTEGER := 0;
declare temptxt NVARCHAR(500000) := 'CREATE COLUMN TABLE DOC_MATRIX ( CONTENT_ID INTEGER ';
for cur_matrix as matrix_cursor do
cnt:=:cnt + 1;
select temptxt || ', C' || cnt || ' DOUBLE' into temptxt from dummy;
end for;
temptxt:=temptxt || ' ) WITH SCHEMA FLEXIBILITY';
EXEC :temptxt;
select :temptxt from dummy;
END;
DROP TABLE DOC_MATRIX;
CALL CREATE_MATRIX(); -
Nsert/Update and Add Column at the same Table and at the "same" Time
Hello,
I want Insert/Update and Add Column at the same Table and at the "same" Time but in different sessions.
Example:
At first the "insert/update" statement:
Insert into TestTable (Testid,Value) values (1,5105);
After that the "add" statement:
Alter table TestTable add TestColumn number;
- sadly now I get the message: ORA-00054: resource busy and acquire with NOWAIT specified
"insert/update" statement:
Insert into TestTable (Testid,Value) values (2,1135);
After that the execute commit.
I don't know when the first session set the commit statement so I want that the DB the "Alter Table..." statement execute if it's possible.
If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.
Thanks for ideasWell I want to walk in the rain without and umbrella and still stay dry, but it ain't gonna happen.
You can't run a DDL statement against a table with transactions pending. Session 2 has to wait until session commits or rollbacks (or until the session is killed). That's just the way it is.
This makes sense if you think about it. The data dictionary has to be consistent across all sessions. If session 2 was allowed to change the table structure whilst session 1 has a pending transaction then the database is in an inconsistent state. This is easier to see if you consider the reverse situation - the ALTER TABLE statement run by session 2 does a DROP COLUMN TESTID rather than adding a column: now what should happen to session 1's INSERT statement? You have retrospectively invalidated a statement that was perfectly legal when it was executed.
If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.Fnord.
Cheers, APC -
How to add columns for existing table dynamically?
Hi,
I created table structure only. I want to add columns for this existing table. Columns are not fixed, according to the user choice i need to write code.
Plz give me reply asap.
Thanks
ShirishaHi Shirisha,
I think the following code snippet will help you.
int l_no_cols = 0;
//Get the number of columns in this variable, something like the following
//l_no_cols = wdContext().currentContextElement().get<Context_attribute_name>;
IWDTable l_tab;
IWDTransparentContainer l_tbl_cont = (IWDTransparentContainer)view.getElement("TableDataCont");//ID of Container
l_tab = (IWDTable)view.getElement("TableData");//ID of Table
l_tab.setVisible(WDVisibility.VISIBLE);
l_tab.bindDataSource(wdContext.nodeTable_Data().getNodeInfo());
for(int a = 1; a <=l_no_cols; a++)
//Creating the column
IWDTableColumn l_tab_col = (IWDTableColumn)view.createElement(IWDTableColumn.class,"COL"+a);
//Creating Caption for Column Header
IWDCaption l_tab_cap = (IWDCaption)view.createElement(IWDCaption.class,"Caption"+a);
l_tab_cap.setText("Col"+i);
l_tab_col.setHeader(l_tab_cap);
//Creating Table Cell Editor for column
IWDInputField l_tab_cell = (IWDInputField)view.createElement(IWDInputField.class,"CellEditor"+a);
//creating context node attribute for the column dynamically
wdContext.nodeTable_Data().getNodeInfo().addAttribute("Col"+i,"com.sap.dictionary.String");
l_tab_cell.bindValue(wdContext.nodeTable_Data().getNodeInfo().getAttribute("Col"+i));
l_tab_col.setTableCellEditor(l_tab_cell);
l_tab.addColumn(l_tab_col);
l_tbl_cont.addChild(l_tab);
Regards,
Alka -
ORA-22856: cannot add columns to object tables
Oracle 9i
==========
I tried to alter a table using a simple script.
ALTER TABLE tablename ADD col VARCHAR(50);
And it gave me the error: -
ORA-22856: cannot add columns to object tables
Can someone give me some direction on how to resolve this? The script executes fine on a test env.
Thanks in advanceThanks for replying...
exit Null? Type
BUS NUMBER
REP VARCHAR2(60)
COS NUMBER
REP VARCHAR2(50)
ACC NUMBER
ADJ VARCHAR2(2000)
BAS NUMBER
BIL VARCHAR2(360)
BIL VARCHAR2(50)
BIL VARCHAR2(3)
BIL VARCHAR2(50)
BLP VARCHAR2(240)
BLP NUMBER
BOO DATE
COM NUMBER
COM NUMBER
COM NUMBER(15)
COM NUMBER(15)
COM VARCHAR2(4000)
COM VARCHAR2(30)
CUR NUMBER
CUS VARCHAR2(240)
DEA VARCHAR2(240)
EVE VARCHAR2(240)
HEA VARCHAR2(240)
HEA VARCHAR2(240)
HEA VARCHAR2(240)
HEA VARCHAR2(240)
INC VARCHAR2(30)
INV DATE
MAN VARCHAR2(360)
ORD NUMBER
ORD VARCHAR2(240)
PAY VARCHAR2(240)
PAY NUMBER
HEL NUMBER
PEO VARCHAR2(150)
PER NUMBER
PER VARCHAR2(30)
PER NUMBER(15)
PRO VARCHAR2(240)
PRO VARCHAR2(240)
QUA NUMBER(15)
QUO NUMBER
QUO DATE
QUO DATE
QUO VARCHAR2(80)
RED VARCHAR2(240)
REP VARCHAR2(360)
REP VARCHAR2(30)
REP VARCHAR2(30)
REP VARCHAR2(150)
REP VARCHAR2(3)
REP VARCHAR2(150)
REP VARCHAR2(50)
ROL VARCHAR2(60)
SHI VARCHAR2(360)
SPL VARCHAR2(240)
STA DATE
TER DATE
TOT VARCHAR2(240)
TRX NUMBER
TRX VARCHAR2(240)
TRX VARCHAR2(20)
TRX VARCHAR2(30)
WAI VARCHAR2(240)
YEA NUMBER
MAN VARCHAR2(30)
BUF NUMBER
BUF VARCHAR2(60)
EMC NUMBER
EMC VARCHAR2(60)
INT NUMBER
INT VARCHAR2(60)
SUP NUMBER
SUP VARCHAR2(60)
BRM NUMBER
BRM VARCHAR2(60)
SUP NUMBER
SUP VARCHAR2(60)
REP NUMBER
REP VARCHAR2(60)
DIV NUMBER
DIV VARCHAR2(60)
SUP NUMBER
SUP VARCHAR2(60)
REG NUMBER
REG VARCHAR2(60)
SUP NUMBER
SUP VARCHAR2(60)
ARE NUMBER
ARE VARCHAR2(60)
DIS NUMBER
DIS VARCHAR2(60)
ROL VARCHAR2(240)
ACC NUMBER
BON NUMBER
COM VARCHAR2(240)
COM VARCHAR2(240)
REP NUMBER
BIL NUMBER
BAS NUMBER
TOT NUMBER
TOT NUMBER
OVE NUMBER
BLP NUMBER
QUO VARCHAR2(30)
FN_ NUMBER
FN_ VARCHAR2(10)
SAL NUMBER
RES NUMBER
CRE NUMBER
MAN VARCHAR2(100)
PER NUMBER
PLA NUMBER
PLA NUMBER
REV VARCHAR2(30)
REP VARCHAR2(150)
OU_ NUMBER
OU_ NUMBER
EXC VARCHAR2(1)
MAN NUMBER
INV NUMBER
REP NUMBER
UPL VARCHAR2(1)
COM NUMBER
SEQ NUMBER
QUO NUMBER
PRO VARCHAR2(10)
PRO NUMBER
PRO NUMBER
BI_ NUMBER
CUR NUMBER
YTD NUMBER
PAY NUMBER
PAY DATE
PAY VARCHAR2(1000)
PAY VARCHAR2(80)
PAI VARCHAR2(1)
HOL VARCHAR2(1)
SRP NUMBER
WAI VARCHAR2(1)
WAI VARCHAR2(1)
GBK VARCHAR2(10)
TRX DATE
PAY NUMBER(15)
FIX NUMBER
TER DATE
ADJ VARCHAR2(240)
PAY NUMBER
PRO DATE
OIC DATE
OIC NUMBER
OIC VARCHAR2(30)
OIC NUMBER
HEL NUMBER
COM NUMBER
TRA NUMBER
HDR VARCHAR2(30)
LIN VARCHAR2(30)
LIN DATE
SRC DATE
EM_ DATE
EM_ DATE
ORD VARCHAR2(30)
REP VARCHAR2(150)
BIL VARCHAR2(300)
PER VARCHAR2(240)
Excuse the incomplete column names. All datatypes are basic ones and there are no constraints defined on any of the columns (dw env). The table is partitioned. -
I am experiencing issue with my SharePoint site , when I am trying to add new Item in List . Error given below :--> 02/03/2015 08:23:36.13 w3wp.exe (0x2E04) 0x07E8 SharePoint Server Logging Correlation Data 9gc5 Verbose Thread change; resetting trace
level override to 0; resetting correlation to e2e9cddc-cf35-4bf8-b4f3-021dc91642da c66c2c17-faaf-4ff9-a414-303aa4b4726b e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015 08:23:36.13 w3wp.exe (0x2E04) 0x07E8 Document Management Server Document Management 52od
Medium MetadataNavigationContext Page_InitComplete: No XsltListViewWebPart was found on this page[/sites/00003/Lists/PM%20Project%20Status/NewForm.aspx?RootFolder=&IsDlg=1]. Hiding key filters and downgrading tree functionality to legacy ListViewWebPart(v3)
level for this list. e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015 08:23:36.17 w3wp.exe (0x1B94) 0x1A0C SharePoint Server Logging Correlation Data 77a3 Verbose Starting correlation. b4d14aec-5bd4-4fb1-b1e3-589ba337b111 02/03/2015 08:23:36.17 w3wp.exe (0x1B94)
0x1A0C SharePoint Server Logging Correlation Data 77a3 Verbose Ending correlation. b4d14aec-5bd4-4fb1-b1e3-589ba337b111 02/03/2015 08:23:36.31 w3wp.exe (0x2E04) 0x07E8 SharePoint Foundation Database 880i High System.Data.SqlClient.SqlException: Cannot insert
the value NULL into column 'tp_DocId', table 'Content_SP_00003.dbo.AllUserData'; column does not allow nulls. INSERT fails. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavi... e2e9cddc-cf35-4bf8-b4f3-021dc91642da 02/03/2015
08:23:36.31* w3wp.exe (0x2E04) 0x07E8 SharePoint Foundation Database 880i High ...or runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream,
Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,
RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand
command, CommandBehavior behavior,Are you trying to setup P2P? Could you explain the process you followed completely? By anychance you create the backup and then created the publication?
Regards, Ashwin Menon My Blog - http:\\sqllearnings.com
Maybe you are looking for
-
How can I update my 2008 iMac to the latest Safari OS?
This iMac has not been used for several years. It has Safari Version 5.0.6 (5533.22.3) and is not compatible with my HP Deskjet 1512, but when I check for new software the messages says my software is up to date. My operating system is Mac OS X Versi
-
Soft KeyBoard is not working on ios 7 with Air sdk 3.8
Hi In my app Soft KeyBoard is not working on ios 7 with Air sdk 3.8. Does any one know soluton for this ?
-
I downloaded the appropriate software blackberry desktop after purchasing a Blackberry curve 9300. I am getting my hotmail on both the phone and on my samsung notebook, but I want the calendar and the task applications to synchronise as well. When I
-
Recording a Line Signal through Motu 828mk3 into Cubase, Please help!
Hello everyone, So i use Motu 828mk3, pair of m-audio monitors, I have logic but find Cubase more compatible for my style. I want to record a line in signal from my DJ mixer (allen&heath xone 62, pair of Pionner cdjs-1000). So i connect the main outs
-
Append in Oracle SQL/DBMS/Procedure
Hi, I am running a direct SQL statement against a field. When the user enters values into a field, I want the values to be passed into the Oracle 9 database. When the user adds more info into the same field, I want the new info appended to the previo