Add a new column and the value

I want to add a new column to a table with a single value for all rows of this column. for example, add a new column called 'sid' with the value of 'dbp'. can I use this statement?
alter table ... add sid varchar(8) 'dbp';
or I have to add first then update?

SQL> alter table blah add (sid varchar2(8) default 'dbp');
Table altered.
SQL> select * from blah;
                COL1 SID
                   1 dbp
                   2 dbp
                   3 dbpMessage was edited by: SomeoneElse
(used OP's column name)

Similar Messages

  • Need to add 2 new columns to the existing table control of C223 transaction

    Hi ABAP Gurus,
    I have to do a screen enhancement for transaction C223.
    Below is the requirement:
    need to add 2 new columns to the existing table control of C223 transaction.
    there is no customer exits, screen exit or user exit present for this transaction C223, i have found one enhancement spot for this transaction.
    i dont have any idea how to do this in standard transaction C223, the table control in C223 saves the data to MKAL table and the table control uses the structure MKAL_EXPAND in the screen program.
    i have created an append structure for  the 2 fields to the standard table MKAL.
    Can anyone please suggest me how this can be done in standard screen C223, will the enhancement spot can be used to do this....
    please sugest...
    Thanks & Regards

    Hi Santosh,
    Thanks for the reply. I have looked into this Enhancement Spot CPFX_SCREEN_SET , inside this there is only one method INPUT_DISABLED having below parameters
    IM_MKAL     Importing     Type     MKAL                                                                                Production Version
    EX_MSGID     Exporting     Type     SY-MSGID                                                                                Messages, Message
    EX_MSGTY     Exporting     Type     SY-MSGTY                                                                                Messages, Message
    EX_MSGNO     Exporting     Type     SY-MSGNO                                                                                Messages, Message
    EX_MSGV1     Exporting     Type     SY-MSGV1                                                                                Messages, Message
    EX_MSGV2     Exporting     Type     SY-MSGV2                                                                                Messages, Message
    EX_MSGV3     Exporting     Type     SY-MSGV3                                                                                Messages, Message
    EX_MSGV4     Exporting     Type     SY-MSGV4                                                                                Messages, Message
    EX_INPUT_DISABLE     Exporting     Type     CHAR1                                                                                Display Only if X Was Set
    the BADI definition present here is a SAP internal so we cant implement the BADI , but we can created a enhancement spot implementation for this. as per my understanding on this the enhancement spot is only for making the table control fields display / change .  i dont think this can be used to add two new coloumns to C223 table control.
    I am not sure thats why seeking your help/valuable sugestion on this.
    Please provide your sugestion on this , so that i can come to conclusion on this issue.
    Thanks & Regards
    Siddhartha Mishra

  • When I add a new bookmark, and the (star) Page Bookmarked window appears - is there any way to expand the size of that window so that I can see my entire list of folders when adding a new bookmark to an existing folder?

    When I add a new bookmark, and the (star) Page Bookmarked window appears - is there any way to expand the size of that window so that I can see my entire list of folders when adding a new bookmark to an existing folder? The endless scrolling technique is far too tedious when trying to add a new bookmark, because the window is simply too tiny. Is there maybe a plug-in that will let me grab the corner of that window and re-size it? Thanks!

    I suggest you install the "Add Bookmark to Here2" extension, then you can expand the the list but you will not see the bookmark itself in the list if that is what you wanted. At the top you have three major folders you can select one of them and scroll up and down. Below that you have your most recently used folders and you can select one of them instead and scroll up and down. You can see the folder the bookmark is in -- they get added to the bottom
    If you really want to see the bookmark within the folder the same extension allows you to bring the bookmark to the folder from say the bookmarks sidebar that is why it is named as such. I use it but mainly i use the dialog.
    Please continue reading about bookmarks and some related extensions at
    * http://kb.mozillazine.org/Sorting_and_rearranging_bookmarks_-_Firefox
    * https://addons.mozilla.org/firefox/addon/add-bookmark-here-2/
    * http://dmcritchie.mvps.org/firefox/firefox.htm#addbookmarkhere2
    * http://dmcritchie.mvps.org/firefox/kws.htm
    If you are not using tags at all, you can remove a whole lot of confusion by removing them from the dialog via the extension.

  • Need to add a new column in the extended VO

    Hi
    I have an urgent requirement like i need to add a new column in one of the extended VO.Can anyone give the procedure to do that..
    Please do the needful.
    Thanks
    Preeti

    Hi Gaurav,
    For example...
    Consider seeded VO is XXXVO and we added a new column to the XXX by extending XXCHRXXXVO(extended VO).and the we gone thru the full substitution process..
    Now new requirement came as add a new column to extended VO - XXCHRXXXVO.Can you please tell in this example scenario? It will be good if you provide the inputs...
    Thanks
    Preeti

  • ADD new Column in the form

    Is it possible to ADD new Column in the form like Sale Quotation, Sales Order and ...

    It is possible.
    go to tools >UDF > Manage UDF >choose marketing documents rows.
    select the row and say add to add a new column in the documents.
    Note: this will be applied to all documents \
    ie.quotation,order ,invoice, PO ,GRPO etc.
    U can hide these columns in form settings.
    This will help u
    Give points if helpful
    Regards
    Suresh Kannan

  • Add a new column to an "Insert Form" created by HTMLDB Wizard throws Error

    Hi,
    My table design has changed and I had to add 2 new columns.
    The corresponding Insert Form/Report/Update Forms created by the HTMLDB should now reflect the new columns that have been added.
    In report and update forms I did not have a problem but in the Insert form, under Edit Page Process I tried to change the sql and I get the below error
    "Encountered the symbol "end-of-file" when expecting one of the following: begin case declare end exception exit for goto if loop mod null pragma raise return select update while with "
    My Edit Page Process SQL is as below-(Last two columns are the NEW columns i.e CDPL and CDPLCA)
    insert into "L2ENTRIES"
    ("AUTONUML2E",
    "ROLLNO",
    "AWARDCODE",
    "ROLLCLASSCODE",
    "SURNAME",
    "FORENAME",
    "SEX",
    "DOB",
    "PPSNO",
    "M1",
    "M2",
    "M3",
    "M4",
    "M5",
    "M6",
    "M7",
    "M8",
    "M9",
    "M10",
    "M11",
    "M12",
    "M13",
    "M14",
    "M15",
    "M16",
    "FEES",
    "CNULLS",
    "CDUPPPS",
    "CROLL",
    "CAWARDS",
    "CMODULES",
    "CHECKCHAR",
    "CHECKNO",
    "VALIDPPS",
    "VALIDPPSUK",
    "PPSNOPAD",
    "CDPL",
    "CDPLCA")
    values (
    :P3_AUTONUML2E,
    :P3_ROLLNO,
    :P3_AWARDCODE,
    :P3_ROLLCLASSCODE,
    :P3_SURNAME,
    :P3_FORENAME,
    :P3_SEX,
    :P3_DOB,
    :P3_PPSNO,
    :P3_M1,
    :P3_M2,
    :P3_M3,
    :P3_M4,
    :P3_M5,
    :P3_M6,
    :P3_M7,
    :P3_M8,
    :P3_M9,
    :P3_M10,
    :P3_M11,
    :P3_M12,
    :P3_M13,
    :P3_M14,
    :P3_M15,
    :P3_M16,
    :P3_FEES,
    :P3_CNULLS,
    :P3_CDUPPPS,
    :P3_CROLL,
    :P3_CAWARDS,
    :P3_CMODULES,
    :P3_CHECKCHAR,
    :P3_CHECKNO,
    :P3_VALIDPPS,
    :P3_VALIDPPSUK,
    :P3_PPSNOPAD,
    :P3_CDPL,
    :P3_CDPLCA)
    It will be great if some one can assist me in this matter.
    Thanks.

    Resolved this by a simple ";" at the end of the insert sql.
    I did not think a ";" will be necessary because when you edit the page process a ";" is not visible.

  • How to add a new column in a standard transaction mb5b

    Hi,
    In t-code mb5b, there are columns which describe the material description, material , opening stock , opening value, etc. I have to add a column with the field name "opening rate". Values for opening rate are calculated using the formula
    opening rate = opening value / opening stock.Please help.

    Hi
    if you want to add a new Column in the Standard transaction you need to create a copy of program RM07MLBD. Add your field in the end of STYPE_BELEGE, Populate the text for field in FieldCat and in the end Populate the value by doing calculation on each row and modifying the table.
    Rajnesh

  • Can't add a new column to LCD table? Option there, just wont add it.

    I have a LCD form with a table in it. Im trying to simply add a new column to the table. The option is there but the column just wont appear after clicking add Column to Left. I selected a column, right clicked the space > Insert > Column to left. But wont intsert. The table object properties tab shows rows and colum numbers but they are grayed out.
    See screenshots:
    http://www.emermed.net/staging/forums...
    http://www.emermed.net/staging/forums...
    This is a dynamic table where a new row can be inserted using a button. Is that dynamic nature the issue? Id hate to undo all the dynamic flow and programming just to add a column then reapply everything.
    Thanks!

    Hi,
    You don't add columns in the Object > Table palette (Screenshot 2). I suspect that the problem is that there is not enough on the page (within the content area) to actually add the column. In Screenshot 1, if you look at the width of the highlighted column versus the space available to the right of the table, you will see that a column cannot be added due to space restrictions.
    Reduce the width of the highlighted column (temporarily), then add a column. Once added, you can resize the columns to match the page width.
    Hope that helps,
    Niall

  • How to add a new column to a existing table and add data to this column?

    I have a table with about 10 millions row and I want to add a new column to this table, then fill this new column with prepared data.
    How to do it ?
    Thank you

    Can I use insert statement to add the data to new-added column?No.
    07:19:37 oracle >create table test (x number);
    Table created.
    Elapsed: 00:00:03.05
    07:19:53 oracle >
    07:19:53 oracle >
    07:19:53 oracle >insert into test values (1);
    1 row created.
    Elapsed: 00:00:00.00
    07:20:01 oracle >insert into test values (2);
    1 row created.
    Elapsed: 00:00:00.00
    07:20:10 oracle >insert into test values (3);
    1 row created.
    Elapsed: 00:00:00.00
    07:20:12 oracle >
    07:20:13 oracle >commit;
    Commit complete.
    Elapsed: 00:00:00.00
    07:20:14 oracle >
    07:20:19 oracle >select * from test;
             X
             1
             2
             3
    Elapsed: 00:00:00.00
    07:20:22 oracle >
    07:20:36 oracle >alter table test add (y number);
    Table altered.
    Elapsed: 00:00:00.05
    07:20:41 oracle >
    07:20:41 oracle >
    07:20:41 oracle >
    07:20:41 oracle >select * from test;
             X          Y
             1
             2
             3
    Elapsed: 00:00:00.00
    07:20:43 oracle >
    07:20:44 oracle >
    07:20:44 oracle >update test set y=1;
    3 rows updated.
    Elapsed: 00:00:00.02
    07:20:52 oracle >commit;
    Commit complete.
    Elapsed: 00:00:00.00
    07:20:56 oracle >select * from test;
             X          Y
             1          1
             2          1
             3          1
    Elapsed: 00:00:00.00
    07:20:58 oracle >Anand

  • How to add a new column (Project Number) in the action items table under NPD Module?

    There are two projects with same name and created by same person in NPD.
    So when it is displayed in "Action Items" table, It looks similar.
    To avoid this, I need one more column (Project Number) to be added in the "Action Items" table and " Strategic briefs and projects" table.
    So, How to add a new column (Project Number) in the "Action Items" table and " Strategic briefs and projects" table under NPD Module?
    Please do the needful.

    There is no out of the box configuration available to add columns to NPD action items.   As always we welcome enhancement requests. 
    Thanks
    Kelly

  • MM50 : add new column in the material view

    Dear guru.
    I need to add a new column of material master in the material view of MM50.
    Do you have a solution (exit) in order to solve my problem ?
    Thanks.

    > I need to add a new field in the MM50 transaction not in MM02.
    Der Friend,
    Pls be specific about your query. As you know MM50 is for material view extension which is a std SAP trxn to help extend the views set by standard SAP pack and if you are referring new field as a new view then it is not so easily approachable.
    Shiva

  • 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

    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
    Mudassar

    Can 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 a new field to the Quote: Shipping and Bill Tab Payment region

    Hello All,
    We have a requirement to add payment description column to the Payment Region of Shipping and Bill tab in Quoting User(Quote Page).
    We have extended the View object HeaderPaymentsVOObj and created a custom view object, then created and ported the substitution.
    In Quotes page, 'Shipping and Bills' tab Payments region, we have created a new item(Payment Description), assigned the custom View object instance and attribute to it.
    We are able to enter and update the payment details before substitution, but after substitution while entering payment details we are facing the below error.
    At most one payment record can exist at quote header/line level.
    Help and inputs are highly appreciated.
    Thanks in advance.
    Regards,
    Supriya.

    Hi,
    So you need that this new field have data in old records?
    1.- If you are in BI 7.0 and the logic or data for that New field are in the same Dimension, you can use a Remodeling to fill it. I mean if you want if you want to load from a Master Data from other InfoObject in the same Dim.
    2.- If condition "1" is not yours.
    First add the new field, then create a Backup Cube (both cubes with the new field) and make a full update with all information in the original Cube. The new field willl be empty in both cubes.
    Create an UR from BackUp_Cube to Original_Cube with all direct mapping and create a logic in the Start Routine of the UR (modiying the data_package) you can look for the data in the DSO that you often use to load.
    To do that both cubes have to be Datasources ( right click on Cube-> aditional function-> and I think is "Extract Datasource")
    Hope it helps. Regards, Federico

  • Add new column to the report

    how can I add a new column to a report ?

    this the code for the trigger
    function BeforePForm return boolean is
    begin
    --     insert into test_java values(:p_order_by);
    --      commit;     
    --return true;
    IF Check_Access_For_Token(:p_Token, :p_Appmod_Code) THEN
         return (TRUE);
    ELSE
         srw.message(1, 'You do not have access to the report!');
         return (FALSE);
    END IF;
    end;
    please help I need this for today

  • J1INMIS - To add new columns in the output display - Need of User exits

    Hi,
    Is there Userexits or BADI or Enahncements to add new columns and display in the output for t.code J1INMIS(TDS report - Showing Withholding Tax)?
    If so kindly provide me the details of the same.
    Thanks & Regards,
    Raja Senthil.

    I don't think there is anything for that Tcode. What you can do is append a structure to the WITH_ITEMS structure which is used as item level and then you might have to do some code in the report, maybe through implicit enhancements.

Maybe you are looking for