How to insert data into newly added column

Hi all,
i am having a doubt how to insert entries into newly added column..
i created a table with two columns and inserted the data into them then i altered the table by adding additional column.now i want to insert data into that..plz tell me how to do that..??
thanks in advance..help me

Small example:
[email protected]> create table t(id int, id2 int);
Table created.
[email protected]> insert into t values (1,2);
1 row created.
[email protected]> insert into t values (2,2);
1 row created.
[email protected]> alter table t add id3 int;
Table altered.
[email protected]> select * from t;
ID ID2 ID3
1 2
2 2
[email protected]> update t
2 set id3 = 10
3 where id = 1;
1 row updated.
[email protected]> select * from t;
ID ID2 ID3
1 2 10
2 2
Best Regards
Krystian Zieja / mob

Similar Messages

  • How to insert data into the BLOB column

    Hi All,
    Can anyone help me to insert data into the BLOB data type column?
    The table structure is
    CREATE TABLE XXATFL_DM_FORCAST_STG
    TASK_ID NUMBER,
    USER_ID NUMBER,
    CREATED_BY NUMBER(15),
    CREATION_DATE DATE,
    LAST_UPDATED_BY NUMBER(15),
    LAST_UPDATE_DATE DATE,
    LAST_UPDATE_LOGIN NUMBER(15),
    RECORD_STATUS VARCHAR2(1 BYTE),
    ERROR_MESSAGE VARCHAR2(4000 BYTE),
    DATA_FILE BLOB
    I want to insert data in the DATA_FILE column. and this insert statement will in inside a procedure.
    Please help me as soon as possible as this is very urgent for me
    Thanks & Regards,
    Chandan

    i tried like this
    sql> insert into tbl values(1, utl_raw.cast_to_raw('D:\pictures\pic2.bmp'));
    1 record created.
    sql>select * from tbl;
    sp2-0678:Column or attribute type can not be displayed by SQL*PLUS
    sql>
    is this saving only path or bmp file on that path?
    if it is saving bmp file, in which format and how can we retrive it?
    Edited by: user8967883 on Mar 31, 2010 12:57 PM

  • How to insert data into a CLOB column

    In UIX XML I used a bc4j:textInput control for a CLOB column and I cannot type any letter in this field....Why ?
    Regards,
    Lucian

    Hello again !
    Here are my findings (Content is a CLOB column; I use UIX XML + BC4J):
    1.If I put:
    <inlineMessage prompt="Content" required="no" vAlign="middle" >
    <contents>
    <bc4j:textInput name="Content" attrName="Content" columns="162" rows="5" />
    </contents>
    </inlineMessage>
    I cannot type any letter in the text Input field !!!!!!
    2. If I put
    <inlineMessage prompt="Content" required="no" vAlign="middle" >
    <contents>
    <bc4j:attrScope name="Content">
    <contents>
    <textInput name="Content" columns="162" rows="5">
    <boundAttribute name="text">
    <bc4j:attrProperty name="value"/>
    </boundAttribute>
    </textInput>
    </contents>
    </bc4j:attrScope>
    </contents>
    </inlineMessage>
    I can type in the textInput field, but I cannot save the text after a certain number of characters. Also I cannot see the saved text. I receive :
    Servlet error: Renderer failed: java.lang.ArrayIndexOutOfBoundsException: -35</PRE></BODY></HTML>
    inside the textInput field.
    Please help me ...
    Regards,
    Lucian

  • How to insert  data into BLOB column  using sql

    Hi all,
    How to insert data into BLOB column directly using sql .
    create  table temp
      a blob,
      b clob);
    SQL> /
    Insert into temp  values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ;
    ERROR at line 1:
    ORA-01465: invalid hex number
    Please help in this.Thanks,
    P Prakash

    see this
    How to store PDF file in BLOB column without using indirect datastore

  • Is there a way to Insert Data into a Lookup Column Type on a SharePoint List Destination in SSIS?

    Greetings.
    I have successfully worked out inserting SQL data (2008 R2) into my 2010 SharePoint list (New, Update, Delete) by creating an SSIS Data Flow Task as outlined here:
    http://fsugeiger.blogspot.com/2010/01/synchronise-sql-table-with-sharepoint.html
    However, the problem I am running into is inserting data into the SharePoint Columns that are "Lookup" column types. I verified that all of the values I am copying from SQL into the SharePoint lookup column exist in the customn list it is pointing to. It
    is important to have this column be a lookup column as it links to another custom list that has many more columns of related information.
    I have read and re-read the SharePoint SSIS Adapters 2011.docx from
    http://sqlsrvintegrationsrv.codeplex.com/ and the only section that seems to apply is this:
    "Looking Up Values in a SharePoint List
    If you have to look up a value in a SharePoint list, you can use the Lookup transformation in your data flow, and use the SharePoint List source to load the lookup table. You may have to add a Derived Column transformation or a Script component that splits
    data in the lookup column on the ";#" delimiter to separate the ID value from the description.
    If you are replacing values in your data with the values that you look up in the list, then loading the changed data back into SharePoint, you only have to include the ID from the lookup column. SharePoint ignores the description if you include it."
    I am not sure if the above statement means that I should be passing the assocaited ID's other than the actual data into the SharePoint List destination. If that is the case, that will not really work as the lookup contains hundreds of rows. Not too mention
    I have several of these lookup column types pointing to several different lists.
    Any guidance in how I can put data into a SharePoint Lookup column type via Data Flow Task would be so much appreaciated.
    Thank you.
    My errors are:
    Error: 0x0 at Data Flow Task, SharePoint List Destination: Error on row ID="1": 0x1 - Unspecified error, such as too many items being updated at once (batch), or an invalid core field value.
    Error: 0xC0047062 at Data Flow Task, SharePoint List Destination [1903]: Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.PipelineProcessException: Errors detected in this component - see SSIS Errors at Microsoft.Samples.SqlServer.SSIS.SharePointListAdapters.SharePointListDestination.ProcessInput(Int32
    inputID, PipelineBuffer buffer) at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostProcessInput(IDTSManagedComponentWrapper100 wrapper, Int32 inputID, IDTSBuffer100 pDTSBuffer, IntPtr bufferWirePacket)
    Error: 0xC0047022 at Data Flow Task, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "SharePoint List Destination" (1903) failed with error code 0x80131500 while processing input "Component Input" (1912). The identified
    component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will

    I have found a solution to my problem and thought I would share it here in case there are others who are struggling with the above scenario. If you have a better way, I would love to hear about it since my way is a bit tedious.
    In a nutshell, in order to have an SSIS package put data from an OLE DB Source into a SharePoint List Destination Lookup Column, you need to pass the ID of the value that is being looked up, not the value that is in the “master” OLE DB source.
    Rough explanation, OLE DB Source value for column “Approp” is “4005” --> SQL matches “4005” with the ID in the new lookup table (“4005” = ID “5” as defined in the SharePoint lookup list) --> “5” gets passed into SharePoint List destination lookup
    column --> SharePoint displays “4005” and successfully links to the lookup list.
    Funny thing (not really), the error(s) outlined in my original post are not related in getting data into a SharePoint Lookup column as I am now successful in getting data into the system but I am still getting the same above error(s). I think it has to do
    with the ID column in the SharePoint list destination. What I can’t seem to figure out is why since I am not linking any data to that ID column (at least on new records). I am however linking it on Update and Delete and the errors mentioned above disappear
    and things work well.
    There are three tasks that need to get done in order to get data from SQL into a SharePoint lookup column assuming you have already set up your SharePoint lookup lists:
    1. Create new lookup table(s) in SQL that has the IDs from the SharePoint Lookup list and the values coming from the “master” OLD DB Source. You can see the ID column in SharePoint by toggling it on in a view.
    2. Create a SQL command that JOINs all the databases and tables so that the ID is passed and not the value into the SharePoint lookup column
    3. Change the “Data access mode” to “SQL Command” instead of the “Table or view” in the OLE DB Source and paste your command into the “SQL command text:” area.
    Other helpful info is that you may also need to add additional columns in the new lookup tables in SQL for the scenarios when the data is not unique. You can see this two times in my SQL command example for Units and JobTitles:
    SELECT
    pps.SSNm,
    pps.file_updated,
    pps.Employee_id,
    /* pps.CheckDistNm,*/
    Check_Distribution_id = COALESCE( d.ID, 0 ),
    pps.Job_nbr,
    pps.SeqNm,
    pps.action_eff_dt,
    Fund_id = COALESCE( f.id, 0 ),
    Appropriation_id = COALESCE( ap.id, 0 ),
    ActionCode_id = COALESCE( ac.id, 0 ),
    SpecNumber_id = COALESCE( jt.ID, 0 ),
    pps.Employee_id,
    /* pps.Fund,
    pps.Approp,
    pps.Unit,*/
    Unit_id = COALESCE( u.ID, 0 ),
    PosNm,
    PosCode,
    pps.LastName,
    pps.FirstName,
    pps.MI
    FROM
    x_PPS.aReportVw.pps_screens_active AS pps
    LEFT OUTER JOIN dbo.DistributionNumbers AS d ON
    pps.CheckDistNm = d.Check_Distribution
    LEFT OUTER JOIN dbo.Units AS u ON
    pps.Fund = u.Fund AND
    pps.Approp = u.Approp AND
    pps.Unit = u.Unit
    LEFT OUTER JOIN dbo.Appropriations AS ap ON
    pps.Approp = ap.Approp
    LEFT OUTER JOIN dbo.Funds AS f ON
    pps.Fund = f.Fund
    LEFT OUTER JOIN dbo.ActionCodes AS ac ON
    pps.ActionCode = ac.ActionCode
    LEFT OUTER JOIN dbo.JobTitles AS jt ON
    pps.SpecNm = jt.SpecNumber AND
    pps.JurisClass = jt.JurisClass

  • How to insert data into two tables linke with foreign key..

    I have two tables
    1)EMP(emp_ID,username,emp_type_code)
    emp_ID is primary key, emp_type_code is a foreign key references emptype table.
    2)emptype(emp_type_code,emp_type_descripton)
    emp_type_code is primary key
    Could anyone help me ..how to insert data into EMP table. How to insert data into two tables linke with foreign key..

    CREATE TABLE "CATDB"."DWDIMUSER"
    "USER_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_ID" NUMBER(10,0),
    "FULLNAME" VARCHAR2(20 BYTE),
    "FNAME" VARCHAR2(20 BYTE),
    "LNAME" VARCHAR2(20 BYTE),
    "USER_SUBTYPE" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMUSER_PK" PRIMARY KEY ("USER_ID") 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 "CATDB" ENABLE,
    CONSTRAINT "DIMUSER_DIMSPECIALTY_FK" FOREIGN KEY ("SPECIALTY_ID") REFERENCES "CATDB"."DWDIMSPECIALTY" ("SPECIALTY_ID") DISABLE
    CREATE TABLE "CATDB"."DIMSPECIALTY"
    "SPECIALTY_ID" NUMBER(10,0) NOT NULL ENABLE,
    "SPECIALTY_NAME" VARCHAR2(100 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("SPECIALTY_ID") 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 "CATDB" ENABLE
    INSERT INTO DIMUSER (FullName, FNAME, LNAME, USER_TYPE, USER_SUBTYPE)
    SELECT DISTINCT
    Engineer AS FullName,
    regexp_substr(Engineer , '[^,| ]+', 1, 1) as FName,
    regexp_substr(Engineer , '[^,| ]+', 1, 2) as LName ,
    'Engineer'
    FROM EMPLOYEELOOKUP;
    INSERT INTO DIMSPECIALTY (SPECIALTY_NAME)
    SELECT DISTINCT SPECIALITY
    FROM EMPLOYEELOOKUP;
    COMMIT;
    CREATE TABLE employeelookup ...IS A TABLE THAT HAS ALL THE DATA NEDED TO BE FILLED IN BOTHE TABLES...
    CREATE TABLE "CATDB"."EMPLOYEELOOKUP"
    "EMPLOYEELOOKUP_ID" NUMBER(10,0) NOT NULL ENABLE,
    "ENGINEER" VARCHAR2(25 BYTE),
    "SPECIALTY" VARCHAR2(20 BYTE),
    CONSTRAINT "DIMSPECIALTY_PK" PRIMARY KEY ("EMPLOYEELOOKUP_ID") 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 "CATDB" ENABLE
    DATA IN EMPLOYEELOOKUP
    Engineer, Specialty,
    John, Dow, Electronis,
    Dow, Jons, Technician
    Stan Smithers Sales
    Mark, Richards Marketing
    Jenny, Lane Marketing
    John, Lee Sales
    I NEED TO LOAD THE FOREIGN KEY IN DIMUSER FROM THE DIMSPECIALTY TABLE?
    BY USING THE LOOKUP TABLE TO MARCH THE NAMES UNDER THE Engineer COLUMN, SPECIALTY COLUMNE DISTICTIVLY BY JOINING THE DIMSPECILTY TO RISTIVE THE PRIMARY KEY AND FILL IT IN THE DIMUSER TABLE AS A FOREIGNE KEY.

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • Its very urgent:how to insert data into database tables

    Hi All,
    I am very new to oaf.
    I have one requirement data insert into database tables.
    here createPG having data that data insert into one custom table.
    but i dont know how to insert data into database tables.
    i wrote the code in am,co as follows.
    in am i wrote the code:
    public void NewoperationManagerLogic()
    ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
    OADBTransaction oadbt=getOADBTransaction();
    if(!vo1.isPreparedForExecution())
    vo1.executeQuery();
    Row row=vo1.createRow();
    vo1.insertRow(row);
    in createPG processrequest co:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.NewoperationManagerLogic();
    process form request:
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if(pageContext.getParameter("Submit")!=null)
    ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
    am.getOADBTransaction().commit();
    please help with an example(sample code).
    its very urgent.
    thanks in advance
    Seshu
    Edited by: its urgent on Dec 25, 2011 9:31 PM

    Hi ,
    1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
    2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
    3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
    You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
    Thanks
    Pratap

  • How to insert data into datagrid dynamically and also programatically with data and column names being retrived from a xml file..

    iam not able to insert data into datagrid corresponding to the column names..as iam inserting both data and column names programatically..ie iam not able to co relate the data with the column names.plzzz help me asap

    A DataGrid is row-based rather than cell-based with each row
    corresponding to an item in an underlying collection (specified in the
    dataProvider property). In order to add data to a DataGrid you
    manipulate the underlying collection, rather than the grid directly.
    Based on the limited description of your problem I would imagine you
    would need to create dynamic objects with property names that correspond
    to the dataFields of your dynamically created datagrid columns.
    So if you had created columns with dataFields "alpha", "beta" and
    "gamma" on your datagrid, you could create an item in your grid by
    adding the following object to your dataProvider:
    var gridItem : Object = new Object();
    gridItem.alpha = "alphaValue";
    gridItem.beta = "betaValue";
    gridItem.gamma = "gammaValue";

  • How to insert data into a table only when data has changed its value (when compared to the previous inserted value)

    I wish to insert data into a table only when the value of the inserted data has changed. Thus, in a time series, if the value of the data at time, t-1, is 206 then if the data to be inserted at time t is 206, then it is skipped (not entered).
    If the value of the data at time t+1 is 206, it is skipped also; until the value changes, so if the value at t+1 was 205, then that would be inserted, and if at time t+2 the data is 206, it would be inserted too.
    What is the best way to do it without increasing overheads?

    This view works:
    SELECT
    i.IDNO,i.[Date],i.[Level]
    FROM
    mytable i
    INNER
    JOIN mytable
    d
    ON
    d.IDNO
    = i.IDNO-1
    WHERE
    i.[Level]
    <> d.[Level]
    on this mytable below.  A trigger could be quite useful here although I am cautious using them. However I wish to avoid the overhead by not having a temp table (which could be sizable).  mytable below
    should give 3 lines. The IDNO is an identity column.
    IDNO
    Item
    Date
    Level
    1
    X24
    12/23/13 10:41
    22996
    2
    X24
    12/23/13 10:41
    22996
    3
    X24
    12/23/13 9:21
    23256
    4
    X24
    12/23/13 9:21
    23256
    5
    X24
    12/23/13 9:22
    23256
    6
    X24
    12/23/13 9:22
    23256
    7
    X24
    12/23/13 9:22
    22916

  • How to insert data into a table from an xml document

    using the XmlSql Utility, how do I insert data into a table from an xml document, using the sqlplus prompt.
    if i use the xmlgen.insertXML(....)
    requires a CLOB file, which i dont have, only the xml doc.
    Cant i insert directly from the doc to the table?
    the xmlgen examples I have seen first convert a table to a CLOB xmlString and then insert it into another table.
    Isnt there any other way?

    Your question is little perplexing.
    If you're using XML SQL Utility from
    the commandline, just use putXML.
    java OracleXML putXML
    null

  • How to insert data into table control

    hi experts,,
           i have inserted data into data base table through table control .
    now i want to insert data into table control through database table.
      how to delete data from table control for selected row

    Hi
    go through this link.
    http://www.****************/Tutorials/ABAP/TableControl/Demo.htm

  • How to insert date into ms access database using sql query in servlet

    sir all thing is working well now only tell me how we can insert date into ms access database which is input by user .
    insert into db2(bookname,studentname,date) values('"+bname+"','"+sname+"',date_format)";{code}
    or either the system date is inserted with query .
      plz help me
    thanx                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    bhavishya wrote:
    sir all thing is working well now only tell me how we can insert date into ms access database which is input by user .
    insert into db2(bookname,studentname,date) values('"+bname+"','"+sname+"',date_format)";{code}
    or either the system date is inserted with query .
    plz help me
    thanxAnd that SQL statement is another reason to use PreparedStatement. I assume bname and sname are input from some form? Well, if that's the case, simply inserting them into SQL by simple String concatenation is just begging for all sorts of problems. What if there is an apostrophe in the entry? Broken Statement. Worse, it's a wide open invitation to an SQL Injection attack.

  • How to insert data into two tables at once using XSJS

    Hello Experts,
    My requirement is to insert data into two tables at once. I have a XS JS app and want to update these tables via xsjs. How can I do this ?
    Is there any mechanism like sql 'transactions' also in Hana ? If yes, how can I call it via xsjs ? If not, what are the ways to populate two different tables at once.
    Please advice. Any help is really appreciated.
    Thanks !

    There is nothing special about inserting into two tables at once in XSJS. Just issue two separate SQL Statements.  Don't execute the COMMIT until after both commands.  That way they are all one transaction.

  • How to insert date into a table by selecting form sysdate

    Hi
    My Table format is like this
    SQL>desc log;
    Name Null? Type
    EMP_ID VARCHAR2(30)
    LOGIN DATE
    LOGOUT DATE
    now when ever an employee logs in i w'd like to insert date into the table.
    i put up the following query
    SQL> insert into log(emp_id,login)
    2 values
    3 ('Ed_01',
    4 select
    5 sysdate
    6 from dual
    7 );
    select
    ERROR at line 4:
    ORA-00936: missing expression
    I got the above error how can i rectify that plz suggest me very urgently as i have to submit my project very early to my boss.

    try this :
    insert into log(emp_id,login) values ('Ed_01', sysdate);

Maybe you are looking for

  • An error occurred while backing up the user's  home folder

    I have a user account that I'm trying to remove from a computer. I have updated to 10.5.2, and restarted a number of times and repaired permissions. There were 3 accounts on the machine I'm trying to remove, and the first 2 deleted just fine. However

  • Obtain and Process Clicked Cell Contents for Detail Fetch

    I have a report region on a page. It is a bit different from the usual report in that every* cell contains key data....Imagine a "Periodic Table of Elements" chart... it's analogous to that. What I need to do sounds easy enough. I need to allow the u

  • Male to female cable

    Does a "Male connector" to "female connector" cabe exist? I need to connect my iPod to the top connector of the iPod HiFi in a remote manner. My bookshelf does not have the height to fit the iPod ON TOP of the iPod HiFi...

  • Programming project: does this code look clean enough to turn in?

    Hi, i was just wanting to know people's opinion on the format of my classes below, i haven't done much java programming and I just want to make sure that this program is easily understood. I will not be able to respond, because I have to wake up in 3

  • Findling all the xpaths matching a particular element

    Hi, I have to build java code using any built-in api (if any) to fetch all the possible XPATHs that match a value provided as input. Inputs would be pattern for search and XML from which the xpaths to be built. pattern could be an element name,attrib