INSERT INTO with SELECT CASE

Hi all,
I've this problem: insert into Table_A some values from Table_B... with one derivated/calculated filed.
Example
INSERT INTO Table_A (id_part, vendtype, origin, proven, desc)
SELECT id_p, vendt, origin, proven, <calculate/derivated_field_desc>
FROM Table_BThe rules for calculate the field desc inserted on Table_A are 1. IF vendt='V' AND origin='N' AND proven!='04' THEN ---> desc='TRANSFER'
2. IF vendt='M' AND origin='N' AND proven!='04' THEN ---> desc='IMPORTED'
3. IF proven='04' THEN ---> desc='BAD'So what I use in <calculate/derivated_field_desc> on my INSERT INTO statement??
Can I use a SELECT CASE WHEN... or only DECODE is a right solution?
Edited by: trebbia on 15-nov-2010 12.51

Ok,
I prefer use select case when... because trasform my rules in DECODE statement is more difficult
So I write: INSERT INTO Table_A (id_part, vendtype, origin, proven, desc)
SELECT id_p, vendt, origin, proven, SELECT CASE WHEN vendt='V' AND origin='N' AND proven!='04' THEN 'TRANSFER'
                                                WHEN vendt='M' AND origin='N' AND proven!='04' THEN 'IMPORTED'
                                                WHEN proven='04 THEN 'BAD'
                                                END
FROM Table_BObtain this error:
40/56 PL/SQL: ORA-00936: missing expression
33/1 PL/SQL: SQL Statement ignored
PS: I use '<' '>' and not '!=' in my code... here not prompted correctly '<''>'
Edited by: trebbia on 15-nov-2010 13.04
Edited by: trebbia on 15-nov-2010 13.06

Similar Messages

  • INSERT INTO with SELECT invalid column name error

    I have a problem where I wish to update a table with only records that have changed or insert into a table with only new records. The Source table is queried using OPENQUERY as we have no staging db for this.
    I have the following code (adapted from a working example):
    INSERT INTO dbo.Contact
    SELECT contactID, lastUpdatedDateTime
    FROM
    MERGE INTO dbo.Contact AS DT
    USING (SELECT * FROM OPENQUERY(LINKED_SERVER,'SELECT contactID, lastUpdatedDateTime FROM Contact')) AS DS
    ON (DT.ContactID = DS.ContactID)
    WHEN NOT MATCHED THEN
    INSERT VALUES (DS.contactID, DS.lastUpdatedDateTime)
    WHEN MATCHED AND (DT.lastUpdatedDateTime <> DS.lastUpdatedDateTime) THEN
    UPDATE SET DT.contactID = DS.contactID, DT.lastUpdatedDateTime = DS.lastUpdatedDateTime
    OUTPUT $Action Action_Out
    AS MERGE_OUT
    WHERE MERGE_OUT.Action_Out = 'UPDATE';
    GO
    When I run this query I am getting the following errors referring to the columns in the SELECT:
    Msg 207, Level 16, State 1, Line 2
    Invalid column name 'contactID'.
    Msg 207, Level 16, State 1, Line 2
    Invalid column name 'lastUpdatedDateTime'.
    Am I missing something obvious as I can't quite work out why? The Target and source definitely exist with the specified columns present in both...

    Hello,
    The issue is because you are not outputting those values from the inner merge statement. All you are currently outputting is the action, so the error is correct as those columns do not exist.
    Change your output portion to be:
    OUTPUT inserted.contactID, inserted.lastUpdatedDateTime, $Action Action_Out
    Then it should work.
    Sean Gallardy | Blog | Microsoft Certified Master

  • Using combination of insert into and select to create a new record in the table

    Hello:
    I'm trying to write a stored procedure that receives a record locator parameter
    and then uses this parameter to locate the record and then copy this record
    into the table with a few columns changed.
    I'll use a sample to clarify my question a bit further
    -- Create New Amendment
    function create_amendment(p_mipr_number in mipr.mipr_number%TYPE, p_new_amendment_number in mipr.amendment_number%TYPE)
    return integer is
    new_mipr_id integer;
    begin
    THIS is causing me grief See comments after this block of code
    insert into mipr
    (select mipr_id from mipr where mipr_number=p_mipr_number),
    (select fsc from mipr where mipr_number=p_mipr_number),
    45,
    (select price from mipr where mipr_number=p_mipr_number),
    practical,
    (select part_number from mipr where mipr_number=p_mipr_number);
    THe above will work if I say the following
    insert into mipr
    (select * from mipr where mipr_number=p_mipr_number);
    BUt, Of course this isn't what I want to do... I want to duplicate a record and change about 3 or 4 fields .
    How do I use a combination of more than one select and hard coded values to insert a new record into the table.
    /** Ignore below this is fine... I just put a snippet of a function in here ** The above insert statement is what I need help with
    select (mipr_id) into new_mipr_id from mipr where mipr_number=p_mipr_number + amendment_number=(select max(amendment_number) + 1);
    return new_mipr_id;
    end;
    THANK YOU IN ADVANCE!
    KT

    function create_amendment(p_mipr_number in mipr.mipr_number%TYPE)
    return integer is
    new_mipr_id integer;
    tmp_number number;
    tmp_mipr_id integer;
    begin
    tmp_number :=(select max(amendment_number) from mipr where mipr_number=p_mipr_number);
    Question:
    tmp_number :=1; works..
    tmp_number doesn't work with the select statement?
    Obviously I'm a novice! I can't find anything in my book regarding tmp variables... What should I look under is tmp_number a
    variable or what? In my Oracle book, variable means something different.
    Thanks!
    KT
    I have the following code in my stored procedure:
    Good luck,
    Eric Kamradt

  • INSERT INTO TABLE (SELECT -----)

    I laready posted But i think people got confused this is the same query in easiest way
    Hi Please please here Insdie the curusr FOR Loop i am using INSERT INTO by SELECT (see the below code EACH INSERT WILL FETCH 800-1000 records Minimum !!!)
    In that satement here i am using the MINUS also ,,thi is taking minute to insert each record approx
    This way I need to insert 5 insert Into sattement for different tables see EXA
    Inside the FOR loop------
    INSERT INTO PICKSLIP
    ( SELECT FIELDS
    FROM table p, table d
    WHERE ---- AND ---
    AND ---
    AND -----
    IN ( SELECT Fields
    FROM p, d
    WHERE ---- AND ---
    AND ----
    MINUS
    SELECT PICKSLIP_PREFIX, PICKSLIP_NUMBER FROM C
    GROUP BY Fields);
    This WAY
    5 insert it dam slow taking 1 minutes to insert to all 5 tables ...this way i have lot of recordss....

    But i think people got confused this is the same query in easiest way I don't think this is more clear with your current thread. Your query is bad, and shouldn't work at all.
    It shouldn't work for too many reasons (at least because AND without nothing behind) and use a group by clause where is not required.
    Nicolas.

  • Unable to perform "insert into table select ...." using DBF_JDBC30

    below i post my code :
    import java.util.*;
    import java.sql.*;
    import java.io.*;
    import com.hxtt.sql.*;
    public class backofficeDbfVerification {
    public backofficeDbfVerification(String path) throws SQLException {
    Properties prop = new Properties();
    prop.setProperty("user", "");
    prop.setProperty("OtherExtensions","true");
    prop.setProperty("Version Number", "03");
    try {
    Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
    connection = DriverManager.getConnection("jdbc:DBF:/"+path, prop);
    catch (ClassNotFoundException classnotfoundexception) {
    System.out.println("could ot find HXTT class, make sure the classpath have been defined in your system !");
    catch(Exception e) {
    System.out.println(e.getMessage());
    public void createBadRecord(String table, String newtable, int blth) throws SQLException {
    Statement stmt = connection.createStatement();
    String insert = "insert into \""+newtable+"\" select * from \""+table+"\"";
    boolean bInsert = stmt.execute(insert);
    stmt.close();
    public static void main (String args[]) {
         String path = "C:\\MASTER\\SOURCEDATA\\AREA";
    try {
    backofficeDbfVerification test = new backofficeDbfVerification(path);
    test.createBadRecord("source\\area\\123.AA2","source\\area\\others\\89964568.AA1");
    catch(SQLException sqx) {
    System.out.println("Error "+sqx.getMessage());
    i try to perform simple query : insert into tablea select from tableb which has same structure. the source table has only 9 rows, but the process ran very long time, no error message raised,it just run and never end (which make me upset for the whole day).
    i have tried another simple query : insert into table1 values (1,2) using the same driver and execute successfully.
    is it becoz of function limitation since i used evaluation copy ?

    Copy the answer from HXTT's support forum:
    No function limitation. I just tested:
    create table testa1 select * from test;
    insert into testa1 select * from test;
    Passed.
    I also run your backofficeDbfVerification.java sample. Passed too. I'm using the same code as you. The difference is only my 89964568.AA1 and 123.AA2 is simulative tables files. If possible, please zip your 89964568.AA1 and 123.AA2 and email to [email protected] Thanks.
    BTW, I pasted the little modified backofficeDbfVerification.java below:
    import java.sql.*;
    import java.util.*;
    public class backofficeDbfVerification {
    Connection connection;
    public backofficeDbfVerification(String path) throws SQLException {
    Properties prop = new Properties();
    prop.setProperty("user", "");
    prop.setProperty("OtherExtensions", "true");
    prop.setProperty("Version Number", "03");
    try {
    Class.forName("com.hxtt.sql.dbf.DBFDriver").newInstance();
    connection = DriverManager.getConnection("jdbc:DBF:/" + path, prop);
    catch (ClassNotFoundException classnotfoundexception) {
    System.out.println("could ot find HXTT class, make sure the classpath have been defined in your system !");
    catch (Exception e) {
    System.out.println(e.getMessage());
    public void createBadRecord(String table, String newtable) throws
    SQLException {
    Statement stmt = connection.createStatement();
    String insert = "insert into \"" + newtable + "\" select * from \"" +
    table + "\"";
    boolean bInsert = stmt.execute(insert);
    stmt.close();
    public static void main(String args[]) {
    String path = "f:\\dbffiles";
    try {
    backofficeDbfVerification test = new backofficeDbfVerification(path);
    test.createBadRecord("source\\area\\123.AA2",
    "source\\area\\others\\89964568.AA1");
    catch (SQLException sqx) {
    System.out.println("Error " + sqx.getMessage());
    }

  • QUESTION ON INSERT STATEMENT WITH SELECT

    Hi
    I have a table which contains three fields
    Table name : USERS
    ID NUMBER(10),
    NAME VARCHAR2(50),
    EMAIL VARCHAR2(50)
    SEQUENCE by name SEQ_ID
    I am trying to insert values into USERS from EMPLOYEE by virtue
    of insert into USERS (SELECT NAME, MAIL from EMPLOYEE) but i
    want to have one id for all the rows fetched from my inner
    query.
    I would like to know if here is a way, by which i can fetch a
    constant in my select statement which is not present in the
    table and use it like
    insert into USERS ( SELECT constant, NAME, MAIL FROM EMPLOYEE );
    where constant is some number unique for a given insertion.
    Thanks
    Arun

    Why not just try it? All you had to do was type
    insert into USERS SELECT 1, NAME, MAIL FROM EMPLOYEE ;
    and you would have had your answer immediately instead of
    waiting for me to tell you.
    rgds, APC

  • Insert into with variables

    Hi!
    I've a procedure with a insert into phrase.
    For example:
    INSERT INTO type (NAME) values(A_CHA);
    type is not a table name it is a variable and name is not a column name it is also a variable.
    Can i make a insert into with variables?
    How is the right syntax?
    Thank's for help!
    Nicole

    Hi!
    I've found a way to do this:
    sql_statement:= 'INSERT INTO' || type_table || '('||NAME|| ',CABLE_NUM,FACILITY_NUM) values( '||A_CHA||','||CABLE_N||','||FAC_N||')';
    EXECUTE IMMEDIATE sql_statement;
    But when i execute my procedure i get the error:
    Keyword INTO is missing!
    Please help
    Nicole

  • Error With Insert Into From Select

    Hello,
    I have a problem with this query in pl sql developer with oracle 10G:
    insert into ca_nrj_rem(imsi,id_gamme_vente,domaine,date_topage,id_produit)
    (select a1.* from (select d.imsi, 1, 4, trunc(sysdate - 1), 'NRJ003'
    from ca_evenement_vsim a, ca_forfait b, ca_forfait c, ca_vsim_associe d
    where a.id_action = 'CP1'
    and bao.Lecture_Parametre_XML_V2(a.valeur_parametres, 'ancienCode') = b.code_forfait
    and b.code_gamme = 2
    and bao.Lecture_Parametre_XML_V2(a.valeur_parametres, 'nouveauCode') = c.code_forfait
    and c.code_gamme = 6
    and date_trace > sysdate - 6
    and a.vsimid = d.vsimid
    and d.date_fin is null
    group by d.imsi, trunc(sysdate - 1)) a1, ca_nrj_rem n
    where a1.imsi=n.imsi(+) and n.imsi is null);
    The select statement return X (163) values but the insert statement inserts Y (540) values
    Can you help me please ?
    Thanks You

    user511447 wrote:
    The select statement return X (163) values but the insert statement inserts Y (540) valuesNot possible if the select statements are identical.
    You'll have to provide more evidence and example output (format it on the forum by putting {noformat}{noformat} before and after it), so we can see exactly what you are doing.
    Are you sure that the table you are inserting into has no rows initially or that you are counting the rows correctly?
    Show us exactly what you are doing.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Insert into with problems

    Hy,
    i have a little question. Try this:
    create table strangetab (
    id varchar2(20),
    textfield varchar2(200)
    CREATE OR REPLACE PROCEDURE writestrangetab
    id VARCHAR2,
    textfield varchar2 default null)
    IS
    pragma autonomous_transaction;
    BEGIN
    INSERT INTO strangetab
    (id, textfield
    ) VALUES
    (id, textfield
    COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line(sqlerrm);
    rollback;
    END;
    After table and procedure creation, try to run this script (simple insert into in autonompus_transaction):
    set serveroutput on
    declare
    vstr varchar2(10000);
    begin
    for i in 1..2000
    loop
    vstr := vstr||'r';
    end loop;
    dbms_output.put_line('write a');
    writestrangetab( 'idx' , 'a');
    dbms_output.put_line('write big string');
    writestrangetab( 'idx' , vstr);
    dbms_output.put_line('write b');
    writestrangetab('idx' , 'b');
    end;
    The script generate this output:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    write a
    write big string
    ORA-12899: value too large for column "STRANGETAB"."TEXTFIELD" (actual:
    2000, maximum: 200)
    write b
    As i expect, the second write goes wrong but first and third no and it put string a and b into srangetable.
    Now try to run this:
    set serveroutput on
    declare
    vstr varchar2(10000);
    begin
    for i in 1..5000
    loop
    vstr := vstr||'r';
    end loop;
    dbms_output.put_line('write a');
    writestrangetab( 'idx' , 'a');
    dbms_output.put_line('write big string');
    writestrangetab( 'idx' , vstr);
    dbms_output.put_line('write b');
    writestrangetab('idx' , 'b');
    end;
    The only difference from the previous is the vstr dimension: first 2000 now 5000.
    In my db (10.2.0.4 on linux) the output of this, is:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    write a
    write big string
    ORA-01461: can bind a LONG value only for insert into a LONG column
    write b
    ORA-01001: invalid cursor
    If i query the strangetable i am non able to find string b (Only string a was registered)!
    As if that were not enough, If you try to insert others writestrangetab, anything after wath that produce the error will be stored!
    It is normal?
    By
    Stefano

    Tanks for your reply Jhon, but:
    1) "The second run you are trying to pass 5000 characters to a varchar, which caused your error when trying to call your procedure"
    Why you say "which caused". When i call a procedure can't pass more than 4000 Chars? I know that pl/sql varchar2 is up to 32000 Chars even in procedure calls!
    2) "That is why your cursor because invalid"
    Witch cursor? The strange thing is that there isn't any cursor in the autonomous procedure! The anly statement is an insert into!
    The problem of the second miss in the second run is ok: that wont register the string. The main problem is the miss of the third in the seconf run.
    Why it not register the third writestrangetab? In that case i pass only a 'b' char. Writestarngetab Is an autonomous transaction so i expect a miss if it fail, but the next, if ok, will be registerd. why not?
    By
    Stefano

  • System getting hanged whilst using Insert into table select * from table

    I have a peculiar problem.
    I am using the below statements:
    Query 1:
    insert into table ppms.erin_out@ppms_dblink select * from erin_out;
    Query 2:
    insert into table ppms.erin_out@ppms_dblink values(23,'dffgg',12',dfdfdgg,dfdfdg);
    I am in 'interfaces' schema (testing server) and executing above statements. We have testing server and development server, both are identical, i.e one is clone of the other.
    ppms_dblink is created in interfaces schema. ppms_dblink points to different database server which has two schemas 'clarity' and 'ppms'. ppms_dblink is create through authentication details of clarity schema.
    erin_out table is created on ppms schema on the same dababase server pointed by ppms_dblink.
    Question is :
    TOAD hangs while running query 1.
    Query 2 is working perfectly.
    As I have pl/sql script which is using query 1. I want to know why query 1 is creating problem.
    If I use query 2 in my pl/sql query then it may create performance issue as i have to use cursor then.
    On clarity schema, I have insert, update, select, modify rights on ppms.erin_out.
    I have tried same queries from another database server.
    That is I tried queries from 'interfaces' schema of development server ( clone of the testing server ). Its working perfectly.
    Message was edited by:
    user484158

    Dhanchik:
    The table from which I select rows, to insert into table on dblink, is having only one record. It may contatin maximum 100 rows at a time because I am scheduling the procedure through daemon process. Anyway transaction is not more than 100 records. I am trying with just 1 record for testing.
    So 1) Problem is not about the cost, TOAD is getting hanged ( to insert 1 record, cost does not mean much)
    2) there is no large amount of data, so no question of deteriorated performance
    Aron Tunzi:
    I think that should not be problem, because I am able to insert a record through query 2.
    Warren Tolentino :
    I am testing with 1 record only. Its not performance issue.
    Message was edited by:
    &#2352;&#2330;&#2367;&#2340;

  • Merge update insert into with exception

    I m opening a new thread for the same question i had posted earlier....
    create Table test(
    col1 varchar2(200),
    col2 varchar2(200),
    col3 varchar2(200),
    id varchar2(200),
    job_id varchar2(10)
    create Table test1(
    col1 varchar2(200),
    col2 varchar2(200),
    col3 varchar2(200),
    id varchar2(200),
    job_id varchar2(10)
    create Table test2(
    col1 varchar2(200),
    col2 varchar2(200),
    col3 varchar2(200),
    id varchar2(200),
    job_id varchar2(10)
    create Table err_tbl(
    col1 varchar2(200),
    col2 varchar2(200),
    col3 varchar2(200),
    id varchar2(200),
    job_id varchar2(10)
    ===============================================================
    merge into test t
    using (select distinct col1, col2, col3,id, job_id
    from test1
    where job_id = curr_job_id -- cur_job_id is variable which is declared in the procedure to sysdate
    union
    select distinct col1, col2, col3,id, job_id
    from test2
    where job_id = curr_job_id --cur_job_id is variable which is declared in the procedure to sysdate
    ) ss
    on (t.id = ss.id
    AND t.job_id = ss.job_id)
    when matched then update
    set t.col1 = ss.col1,
    t.col2 = ss.col2,
    t.col3 = ss.col3
    when not matched then insert into
    ( t.col1,
    t.col2,
    t.col3,
    t.id,
    t.job_id
    )Values
    ( ss.col1,
    ss.col2,
    ss.col3,
    ss.id,
    ss.jobid,
    exception
    when others then
    insert into err_tbl (
    col1,
    col2,
    col3,
    id,
    job_id )
    values ( ss.col1,
    ss.col2,
    ss.col3,
    ss.id,
    ss.jobid,
    Above, all i m trying to do is Updating or inserting into TEST table, and if there is any Duplicate records or any bad records then making use of exception i m INSERTING into ERR_TBL
    i get error with the merge insert update code ....
    The error i get is --- "ss.col1" column is not allowed here
    Any idea guys ????
    Hey one more quick question ....Can we use exception in merge insert update block ???

    user642297 wrote:
    I m opening a new thread for the same question i had posted earlier....
    Any idea guys ????
    Hey one more quick question ....Can we use exception in merge insert update block ???Did you learn nothing nothing from [Your other thread|http://forums.oracle.com/forums/thread.jspa?messageID=3810396&#3810396]
    (Maybe that's why you never bothered to close it)
    It looks like you did learn something, since you ended up saying
    Thanks alex...i think i got the answer.....so i cannot use exception handler in merge statement...
    Thank you so much!!!What beats me is that yu post the exact same question again, when you already got the answer
    ?:|
    Peter

  • How insert into table select from table works in jdbc driver?

    Hi, Supposing one table has two LOB fields, one LOB field is BLOB type while the other is CLOB type, I use the following sql statement to copy a row into a new row:
    insert into table (id, file_body, file_content) select new_id, file_body, file_content from table where id = '111';
    After commit on the connection, I can see the copied record in the table and both LOB fields are not null and this's the expected behavior.
    However after some days later, the copy function becomes to be a problem, the BLOB field named file_body can be null when the copy job is done, while other fields copy successfully.
    The issue can not be reproduced every time.
    I suppose the jdbc driver may try to allocate byte buffer in the heap to perform copy operation for BLOB fields,if there is no enough memory available in the heap the copy operation may fail but the commit on the connection can be successful.b/c I can see a lot of OOM errors in the log files and I believe this can contribute to the issue.
    Hope someone can give me a hint or comments.
    Thanks,
    SuoNayi

    I want to figure out what's memory leak point and I have tried the following solutions but none worked:
    1.I have tried to dump the memory of the JVM but failed,I can see the following errors :
    [root@localhost xxx]# jmap -heap:format=b 3027
    Attaching to process ID 3027, please wait...
    Debugger attached successfully.
    Server compiler detected.
    JVM version is 1.5.0_16-b02
    Unknown oop at 0x00002b21a24cd550
    Oop's klass is null
    Finding object size using Printezis bits and skipping over...
    Unknown oop at 0x00002b21a3634380
    Oop's klass is null
    Finding object size using Printezis bits and skipping over...
    2.and the thread stack can not be dumped successfully as well:
    Thread 3046: (state = BLOCKED)
    - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
    Error occurred during stack walking:
    the version of java is:
    java version "1.5.0_16"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
    Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_16-b02, mixed mode)
    I have to added dump thread stack option in JVM arguments, -XX:+HeapDumpOnOutOfMemoryError.
    If there are other solutions please let me know, thanks.

  • Using default values in INSERT INTO..SELECT..

    Hi,
    I like to do following insert in Oracle 10g
    INSERT
    INTO tab1
    x1,
    x2
    SELECT
    NVL(y1,DEFAULT),
    y2
    FROM tab2
    but oracle throws missing expression error. I don't want to substitute default values as it involves code change for any default value change. I suppose Oracle changes context to tab2 while SELECT, but is there any way to accomplishing the above INSERT?
    Edited by: ponn_raj on Jan 14, 2009 4:52 AM

    Hi,
    Welcome to the forum!
    DECLARE
      var number;
    BEGIN
        INSERT INTO test
            (col1,
             col2)
        VALUES
            (1,
             NVL(var, 0));
        COMMIT;
    END;
    /Also you can create the table and assign default values to the columns that you want. See [CREATE TABLE|http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7002.htm#i2095331].
    From the link above:
    DEFAULT
    The DEFAULT clause lets you specify a value to be assigned to the column if a subsequent INSERT statement omits a value for the column. The datatype of the expression must match the datatype of the column. The column must also be long enough to hold this expression.
    The DEFAULT expression can include any SQL function as long as the function does not return a literal argument, a column reference, or a nested function invocation.
    Regards,
    Edited by: Walter Fernández on Jan 14, 2009 10:44 AM

  • INSERT INTO  with Button

    Hi everyone.
    I'm working on my project for the faculty and I have one question.
    I want to insert comment into the table for comments.
    What should I do?
    Should I create Item or Page button.
    I now that i have to create a PL/SQL Page process.
    The comment table has ID column.
    How to make the process PL/SQL ( with INSERT INTO ) assign correct ID for the ID Column.
    Thanks in advance.

    Hi
    Please can you change your username so that we know who we're talking to.
    Also, can you pop an example on apex.oracle.com for me to have a look at.
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)

  • UPDATE/INSERT INTO with Connection with access DB

    Hello,
    I am trouble getting the update statement working when connecting to my database. The "Select" statement works fine but i am using:
    result2= stmt2.executeUpdate("INSERT INTO Table1 VALUEs('1', '1')");
    and i get the error incompatiable types...found int but expected java.sql.resultset
    I am not sure what i am doing wrong. Can anyone help?

    since you're using Access, be sure to close both your Statement and the Connection you used after your INSERT/UPDATE. It's well known that changes won't show up in Access unless you do.
    %

Maybe you are looking for