Insert new record

Hey Guys,
I am new in Oracle world. I am currently running version 8i. I created a table, inserted a few rows on the table but when I log off and log back in with the same account and do a select statement on the table, it tells me that the table is empty. The fact is that I can not insert a new record in any table even the existing ones.
What am I doing wrong, is there any script I need to run.
Thanks in advance
Maikiki

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Maikiki21:
Hey Guys,
I am new in Oracle world. I am currently running version 8i. I created a table, inserted a few rows on the table but when I log off and log back in with the same account and do a select statement on the table, it tells me that the table is empty. The fact is that I can not insert a new record in any table even the existing ones.
What am I doing wrong, is there any script I need to run.
Thanks in advance
Maikiki<HR></BLOCKQUOTE>
Dear Maikiki,
I assume that U are working at the SQL prompt and in the Linux environment. I am sure though that it will be same in the Windows platform also.
SQL> CREATE TABLE <TABLENAME> (
fieldname1 datatype(width) constraint,
fieldname2 datatype(width) constraint,
SQL> INSERT INTO <TABLENAME> VALUES (
value1, value2 ..... );
SQL> COMMIT;
This will surely help.
null

Similar Messages

  • Receiver JDBC: Error while doing the Deleting and Inserting new records

    Hi All,
              I am doing Idoc to JDBC scenario. In this I am collecting & bundling different type of Idocs and then sending to the JDBC receiver. My requirement is to delete the existing records in the database and insert the new records. I have configures as mentioned in the link
    Re: Combining DELETE and INSERT statements in JDBC receiver
    In the above link its shows for single mapping. In my scenario I am using multi mapping for collecting idocs in BPM. If I configured for normal mapping then it is working fine(Deleting existing records and Inserting new record). Whenever I am using multi mapping then I am getting following error in the receiver JDBC communication channel u201CError while parsing or executing XML-SQL document: Error processing request in sax parser: No 'action' attribute found in XML document (attribute "action" missing or wrong XML structure)u201D . Can you please tell me what might be the problem.
    Thanks & Regards,
    T.Purushotham

    Hi !
    check this out:
    JDBC - No 'action' attribute found in XML document - error
    JDBC receiver adapter: No 'action' attribute found in XML document
    It appears that the inbound payload (the one that is going from XI to the JDBC adapter) does not have the requiered tag to specify which SQL action to execute in the receiver system. Maybe the multimapping is not creating the desired output message format.
    Regards,
    Matias.

  • Problem with inserting new records in Oracle Forms

    Hi Friends,
    I am a new user to Oracle Forms and I need a help from you people. The problem is as follows:
    I have a data block in which I can display a number of records. In this data block the user will be able to edit the fields if no child records are found in another table. I have used when-new-record-instance to attain this scenario. All are text items. One item licensee_id which is made invisible by setting the property in property palette and required=no ( as this is the primary key of the table). Also the audit columns are made invisible.
    The code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
         v_cnt                          NUMBER;
    BEGIN
         SELECT COUNT (*)
    INTO v_cnt
    FROM id_rev_contracts
    WHERE licensee_id = :ID_REV_LICENSEES.licensee_id;
    IF v_cnt > 0 THEN
    set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_FALSE);
    ELSE
         set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- set_item_property('ID_REV_LICENSEES.LICENSEE_NAME', INSERT_ALLOWED, PROPERTY_TRUE);
    END IF;
    END;
    Now in this data block I should also be able to insert new records and for the same I have used PRE-INSERT trigger and the code for it is as follows:
    DECLARE
         v_alert_button NUMBER;
    CURSOR v_licensee_id IS SELECT id_rev_licensees_s.NEXTVAL FROM dual;
    BEGIN
    OPEN v_licensee_id;
    FETCH v_licensee_id INTO :id_rev_licensees.licensee_id;
    CLOSE v_licensee_id;
    IF :id_rev_licensees.licensee_id IS NULL THEN
    Message('Error Generating Next v_licensee_id');
    RAISE Form_Trigger_Failure;
    END IF;
    :ID_REV_LICENSEES.created_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.last_updated_by := :GLOBAL.g_login_name;
    :ID_REV_LICENSEES.create_date := SYSDATE;
    :ID_REV_LICENSEES.last_update_date := SYSDATE;
    EXCEPTION
    WHEN form_trigger_failure
    THEN
    RAISE form_trigger_failure;
    WHEN OTHERS
    THEN
    v_alert_button :=
    msgbox ('ERROR in Pre-Insert - ' || SQLERRM, 'STOP', 'Contact IST');
    RAISE form_trigger_failure;
    END;
    Every thing is compiling fine but at the run time when I am trying to insert a new record I am receiving the following error:
    FRM-40508:ORACLE error:unable to insert record
    I also think the pre-insert record is not firing at the time of inserting a new record and saving it. So I request you to please delve into this problem and suggest me how to overcome this problem. Code snippets would do more help for me. If you need any other things from me please let me know. I will see if I could be of any help in that concern because I may not be able to send the entire form as it is.
    Thanks and regards,
    Vamsi K Gummadi.

    first of all
    pre-insert fires after the implicit/explicit commit/commit_form is issued and before the real insert is submitted to the db.
    i would suggest to remove the error handling part for the moment
    because i believe you might be getting "ora-xxxx cannot insert null"
    and also make visible the primary column to check if the pre-insert is executed.
    it would be better to make visible for a while the not null columns of the table/block
    i suppose that the block is insert allowed and you are using table as the source of the block and not any procedures or something...

  • Urgent help : how when insert new record navigation off

    hi master
    Sir
    when i insert new record by mistake press down key and curser move to next record and my need is
    When I insert new record or change any record that time my form navigation musht be off and no move to next record how I restrict to navigation please give me idea which event and what code I use
    Thanking you
    aamir

    If u want the cursor not to move ahead from a particular field when the records are inserted or updated on that field then u can just write null to the
    key-next-item trigger of that particular item.
    ie IN key-next-item
    null;
    Hope this is what you wanted.

  • How to insert  new records in Master and detail Forms.

    Hi,
    I am having trouble inserting values in both master and detail view at the same time. The scenarios is I have a Dept Table (View Object-VO1) and Employee Table(View Object -VO2) both linked with a foreign key, as per Default HR schema in Oracle DB XE.
    Now I want to insert new record in both Dept(VO1) and EMP(VO2) table via a New page say ( Page2 ). There is a button on Page1 with button INSERT .I can only drag-drop "CreateInsert" operation on that button for VO1 or VO2. So only text box for Dept records are enable to insert data but not Emp records. Is there a way I can insert data in both the tables at the sametime??
    Thanks,
    MB

    Hi MuradRabbani,
    You can programmatically call both createInsert Operations,
    Add to your pageDef both CreateInsert Operations.
    Create a button tha will call insert method from Master (VO1) and then call insert method for Detail (VO2)
    Here is an Example code of calling the operations:
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer(); //you need ADFUtils.java and JSFUtils.java classes. You can find them in the sample applications in your JDeveloper.
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO1");
    oper.execute();
    -----------------NOTE: at this point you should have set values that compine the ViewLink on the master in order the detail will know where to link the new record there are many ways to do it.
    As an approach try to overrdi the create Method on the in the ViewRowImpl of your Master vo (VO1)
    e.g.
    @Override
    protected void create(AttributeList attributeList) {
    //before
    attributeList.setAttribute("NameOfAttribute", valueHere);
    super.create(attributeList);
    After that you should call the operation for your detail VO2
    e.g.
    DCBindingContainer dcb = ADFUtils.getDCBindingContainer();
    OperationBinding oper = dcb.getOperationBinding("CreateInsertVO2");
    oper.execute();
    The detail record will now have the values from your master automatically.
    Regards,
    Dimitris.

  • How do I insert new record and get results on a landing page

    how do I insert new record and get results on a landing page

    It's not clear from your post what you are asking. In a SQL database, you use the INSERT statement to insert a row into a table. You use the SELECT statement to retrieve rows. Here's some basic info on how to do that within PHP
    PHP MySQL Insert Into
    PHP MySQL Select

  • Settings for update/insert new records

    Hi everybody,
    I'm at the beggining of learning the OWB in order to create a Data Warehouse environment.
    I have successfully created a table in the target schema , which is a match of columns found in 4 tables in the source schema.
    Which settings(steps) are necessary in order to update some records according to the update done in 4 tables in source schema , which have already been inserted in the table in target schema- using the execute pop-up menu command?
    Additionally , how can I insert only the new records to the target schema by using the execute command in pop-up menu ...
    Thanks , a lot
    Simon

    Hi Simon,
    If you have constraints set on your target table, and the operator properties are set to "Match by Constraints = All Constraints", then the process recognizes automatically when to update which fields and when to insert new records.
    If you have no constraints on your target then the operator properties are set to"Match by Constraints = No Constraints", and in this case you should set the Loading properties for each attribute (Field) in the target table.
    Greetings,
    Ilona Tielke

  • Inserting new records into database table at runtime

    Hi all ,
    How to insert new records into database table at runtime on click update?
    Thanks.

    Hi Sasikala,
    Just for your understanding am giving a sample code snippet which you can use to read the contents of your Table UI element & save the data on to your database. Suppose you have a button up on pressing which you want to read the data from your screens table & save on to the database then you can proceed as shown below:
    1) Obtain the reference of your context node.
    2) Fetch all the data present in your table into an internal table using methods of if_wd_context_node
    3) Use your normal ABAP logic to update the database table with the data from your internal table
    In my example I have a node by name SFLIGHT_NODE and under this I have the desired attributes from SFLIGHT. Am displaying these in an editable table & the user would press up on a push button after making the necessary changes to the tables data. I would then need to obtain the tables information & save on to the database.
    data: node_sflight           type ref to if_wd_context_node,
            elem_sflight           type ref to if_wd_context_element,
            lt_elements            type WDR_CONTEXT_ELEMENT_SET,
           stru_sflight           type if_main=>element_sflight_node,
           it_flights             type if_main=>elements_sflight_node.
    "   navigate from <CONTEXT> to <SFLIGHT_NODE> via lead selection
        node_sflight_node = wd_context->get_child_node( name = 'SFLIGHT_NODE'  ).
       lt_elements = node_sflight->get_elements( ).
    "   Get all the rows from the table for saving on to the database
        loop at lt_elements into elem_sflight.
          elem_sflight->get_static_attributes( importing static_attributes = stru_sflight ).
          append stru_sflight to it_flights.
        endloop.
    " Finally save the entries on to the database
        modify ZSFLIGHT99 from table it_flights.
        if sy-subrc eq 0.
    endif.
    However a word of caution here.... SAP doesn't ever recommend directly modifying the database through an SQL query. You would preferably make use of a BAPI for the same. Try go through Thomas Jung's comments in [here|modify the data base table which is comming dynamiclly;.
    Regards,
    Uday

  • How to insert new record into altered table

    I am using JDBC with MySQL. I altered existing table and want to insert new record using java class. But it is not possible.How to do?

    How is it "not possible"?
    Either modify the Class for the new fields, or give the new fields default values (if applicable). If the type of an existing column has changed, then only the first option is available.
    Where's the problem?

  • Insert New Record in Master Data by Code

    Hi guys,
    I need to insert a new value in an infoobject by code creating:
    1 new record in table P (data not time dependent)
    1 new record in table S (SID table)
    This code could be executed by many tasks in parallel and so it could create problems of concurrency in writing and in quality of the value of new SID selected.
    The first question is:
    THERE IS A STANDARD CODE THAT INSERT A NEW RECORD ALSO CREATING SIDS, managing concurrency in writing and reading?
    The second (if not answer to first)
    This is a part of my code (draft)... any suggestions:
    insert into TABLE P
    INSERT INTO /bic/pzck9idfl VALUES st_p_zck9idfl.
    IF sy-subrc = 0.
    FLAG = 1.
    WHILE FLAG = 0.
        SELECT MAX( sid )
        INTO v_sididfl
        FROM /bic/szck9idfl.
        ADD 1 TO v_sid.
    *record for SID table
        st_zck9idfl-sid = v_sid.
        st_zck9idfl-/bic/zck9idfl = v_idfl.
        st_zck9idfl-chckfl = 'X'.
        st_zck9idfl-datafl = 'X'.
        st_zck9idfl-incfl  = 'X'.
    insert record in SID Table
        INSERT INTO /bic/szck9idfl VALUES st_zck9idfl.
        COMMIT WORK AND WAIT.
    IF Sy-subrc = 0.
    SELECT SINGLE FROM /bic/szck9idfl
    WHERE SID = v_SID
    AND /bic/zck9idfl NE v_idfl.
    IF Sy-SUBRC = 0.
    FLAG = 1.
    ELSE.
    FLAG = 0.
    ENDIF.
    ELSE FLAG = 1.
    ENDIF.
    ENDWHILE.
    Thanks and points to helpful answer!
    ciao
    C@f

    Hi Claudio,
    I would not recommend to do this. Please have a look for standard fm to that job of have a look into the class library to find some methods. On the first look at your code here my comments:
    SELECT MAX( sid )
    INTO v_sididfl
    FROM /bic/szck9idfl.
    ADD 1 TO v_sid.
    Not a pretty good idea, as there is a number range object for getting a sid for each infoobject. If you get your sid like this, all later standard postings will fail with 'duplicate records'.
    *record for SID table
    st_zck9idfl-sid = v_sid.
    st_zck9idfl-/bic/zck9idfl = v_idfl.
    st_zck9idfl-chckfl = 'X'.
    st_zck9idfl-datafl = 'X'.
    st_zck9idfl-incfl = 'X'.
    if you mark all these flags with 'X' you will tell the system that this record is used somewhere in masterdata or in a datatarget and you cannot delete it with standard methods.
    regards
    Siggi

  • How to insert new record in ALV GRID?

    Hi all,
       I am displaying ztable data into grid format using method  SET_TABLE_FOR_FIRST_DISPLAY of Class CL_GUI_ALV_GRID using OOPS concept.now i want to insert a new record into ALV grid?
    If anyone has tried then please tell me?
    Thanks and Regards,
    Arpita

    Hi Avinash,
    Thanks for replay.
    My problem is solved.i did it as follows.
    HANDLE_DATA_CHANGED
          FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
               IMPORTING ER_DATA_CHANGED
                           E_UCOMM.
    METHOD HANDLE_DATA_CHANGED.
    LOOP AT ER_DATA_CHANGED->MT_GOOD_CELLS INTO WA_GOOD_CELLS.
    CASE WA_GOOD_CELLS-FIELDNAME.
      WHEN 'ZCARRID'.
          CALL METHOD ER_DATA_CHANGED->GET_CELL_VALUE
              EXPORTING
                I_ROW_ID = WA_GOOD_CELLS-ROW_ID
                I_FIELDNAME = WA_GOOD_CELLS-FIELDNAME
              IMPORTING
                E_VALUE = ZCARRID1.
         WA_FLI-ZCARRID = ZCARRID1.
    ENDMETHOD.
    Using method CALL METHOD ER_DATA_CHANGED->GET_CELL_VALUE,
    i am reading individual values and assinning it to WA and then insert into ZTBALE.
    Thanks,
    Arpita

  • How do you insert new records into multiple tables using the same unique primary key?

    I’ve created a PHP site and MySQL server using a free app called XAMPP.  I have successfully created a form in Dreamweaver that will write data to a (name) table in the SQL database.  Here’s my question: How do you write to two (or more) tables in the same database and pass the same primary key to both tables?  In the SQL database, I defined the first field as ID and set it as the primary key with auto update.  So, when you insert a new record, it creates a unique primary key for that record.  In my form, I’m capturing info that needs to be stored to two tables at the same time; a Name table and Address table. Since the Name and Address tables use the ID field as the primary key, I believe I will need to pass the ID value from the Name table to the insert of the Address table to insure they both have the same primary key, right?

    No. You probably need the primary key from one table to be a foreign key in the other tables. In any case, I believe you can use two methods to obtain the auto generated key. First with SQL:
    http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
    And the other using a PHP function:
    http://us3.php.net/mysql_insert_id

  • Auto Increment ID Field Table in the Oracle Database (insert new record)

    I have been using the MySQL. And the ID field of the database table is AUTO INCREMENT. When I insert a new record into a database table, I can have a statement like:
       public void createThread( String receiver, String sender, String title,
                                 String lastPostMemberName, String threadTopic,
                                 String threadBody, Timestamp threadCreationDate,
                                 Timestamp threadLastPostDate, int threadType,
                                 int threadOption, int threadStatus, int threadViewCount,
                                 int threadReplyCount, int threadDuration )
                                 throws MessageDAOSysExceptionand I do not have to put the ID variable in the above method. The table will give the new record an ID number that is equivalent to the ID number of the last record plus one automatically.
    Now, I am inserting a new record into an Oracle database table. I am told that I cannot do what I am used to doing with the MySQL database.
    How do I revise the createThread method while I have no idea about what the next sequence number shall be?

    I am still very confused; in particular, the Java part. Let me try again.
    // This part is for the database table creation
    -- Component primary key sequence
    CREATE SEQUENCE dhsinfo_page_content_seq
        START WITH 0;
    -- Trigger for updating the Component primary key
    CREATE OR REPLACE TRIGGER DHSInfoPageContent_INSERT_TRIGGER
        BEFORE INSERT ON DHSInfoPageContent //DHSInfoPageContent is the table name
        FOR EACH ROW WHEN (new.ID IS NULL) // ID is the column name for auto increment
        BEGIN
            SELECT dhsinfo_page_content_seq.Nextval
            INTO :ID
            FROM DUAL;
        END;/I am uncertain what to do with my Java code. (I have been working with the MySQL. Changing to the Oracle makes me very confused.
       public void updateContent( int groupID, String pageName, int componentID,
                                  String content, Timestamp contentCreationDate )
                                   throws contentDAOSysException
       // The above Java statement does not have a value to insert into the ID column
       // in the DHSInfoPageContent table
          Connection conn = null;
          PreparedStatement stmt = null;
          // what to do with the INSERT INTO below.  Note the paramether ID.
          String insertSQL = "INSERT INTO DHSInfoPageContent( ID, GroupID, Name, ComponentID, Content, CreationDate ) VALUES (?, ?, ?, ?, ?, ?)";
          try
             conn = DBConnection.getDBConnection();
             stmt = conn.prepareStatement( insertSQL );
             stmt.setInt( 1, id ); // Is this Java statement redundant?
             stmt.setInt( 2, groupID );
             stmt.setString( 3, pageName );
             stmt.setInt( 4, componentID );
             stmt.setString( 5, content );
             stmt.setTimestamp( 6, contentCreationDate );
             stmt.executeUpdate();
           catch
           finally

  • Jclient - Jtree problem inserting new records

    I reviewed the component example of using a jtree and for display only it works fine but doesn't include any code to add new records. our example uses a polymorphic table called "levels", as:
    level1
    __| level2
    _____| level3
    inserting a record to the level1 vo works and redisplays in the jtree fine but inserts to level2 or level3 creates
    display issues and other tree issues. The data is recorded correctly and the tree displays correctly if you close the app and rerun it.
    We also attempted to correct this by setting
    vo.setAssociationConsistent(true) in each of the level table vos. this did not help.
    Is this a bug ? Can someone provide some example code if required to get this to display and insert correctly.

    Robert,
    I can't tell if the problem is a bug and it would require code reviews and test cases to be specific on that.
    I suggest contacting customer support with this issue so the problem gets documented, addressed and solved.
    See: metalink.oracle.com
    Frank

  • Inserting new record using BC4J

    Hello,
    I am currently trying create a form based on a view so I do not have to change the form every time the view changes. I would think there has to be a way to implement this manually, because when you use the wizard to make a browse form with a edittarget specified the option to make a new record is given. The "new" option creates a form that allows you to edit all the fields from the datasource, which is exactly the functionality I need. Ideas appreciated.
    Dusty

    Why cant you use the JSP pages generated by the wizard as your starting point? The application that I am creating needs to have a blank form on the front page rather then display the data table with new/edit/delete links.

Maybe you are looking for

  • Direct Path SQL Loader get error ORA-01555

    Hi All, 11.2.0.1 DB Has anyone here used sqlloader direct path option? Is there special setting I need for the Undo TS? I am testing my sqlloader direct path but I got error : ORA-01555: snapshot too old: rollback segment number 10 with name "_SYSSMU

  • T.code KKRS - target data missing in reports - t.code KKSB

    Hi Gurus, when i am extracting the product hierarchy reports using the t.code KKRS. I am unable to see target data in year 2012 report only. But for year 2011, i am able to see both the target data and actual data. In 2012 i am able to see only actua

  • Recover lost files after software update n95

    I have updated the firmware on my phone, using OVI suite, software updater tool. I missed the warning that it would erase everything on my phone to do the firmware update. I lost my phonebook, surprisingly got deleted from the sim card as well. Is th

  • Error while PGI Delivery order

    HI All, I am getting the following message when PGI delivery order "Material's product unit must be entered in whole numbers ". Could any one can help me to solve the issue please ? Thanks & Best regards, Saiful arif

  • Recommended version of BO 4.1

    Hi, we are using BO4.0 SP7and we are going to upgrade to 4.1 but we don't know which version should we choose. I read somewhere that SAP recommend some version and SP. Has anybody heard about it? Or which version do you recommed? We are going to use