Multiple inserts and upadates in tables through procedures

how to do multiple inserts and updates of tables through procedures

Hi,
Not sure what you mean by 'multiple', without an example....
You could perhaps use [merge | http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9016.htm#i2091840] ?
Or perhaps you could use [multitable inserts | http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9014.htm#i2125362] ?

Similar Messages

  • Inserting & symbol to table through procedure

    I want to insert a data with & symbol into a table through the procedure.
    Is it possible.
    through the console i put set define off. it works fine on console.
    but in plsql i am unable to use set commands since it is a console command.
    please advice.

    Hi,
    '&' is a special symbol for SQL*Plus only. It's an ordinary character in PL/SQL.
    SQL> create table test_data(s varchar2(200));
    Table created.
    SQL> set define off
    SQL> create or replace procedure p as
      2  begin
      3    insert into test_data values('&');
      4    insert into test_data values('&&');
      5    insert into test_data values('&fff&&&');
      6    commit;
      7  end;
      8  /
    Procedure created.
    SQL>
    SQL> set define on
    SQL> exec p;
    PL/SQL procedure successfully completed.
    SQL> select * from test_data;
    S
    &fff&&&Regards,
    Dima

  • Inserting Record In same table through triggers.

    Hi,
    I've a table cus_mst ( cus_div_cd vachar2(1), cus_cd varchar2(5), cus_nm varchar2(100) )
    Records are inserted in this table through forms ...
    We need to automatically insert a record with a diff div_cd for any record inserted in the table .
    If div_cd 'I' is entered automatically a record with div cd 'S' with other coulmns having same values should get inserted .
    In case div_cd is 'S' then record with div_cd 'I' should get created.
    Eg : If in insert ( 'S', 'A0001', 'ABC COmpany' ); another record with values ( 'I', 'A0001', 'ABC Comapny' ) gets created;
    One way to do is to insert records in a view ( on the table ) and use instead of trigger to insert the corresponding record. But that is not possible as development team has to change form and use view instead of table.
    Have tried doing it by populating a collection in-each-row trigger and then using statment level trigger to insert from the collection. But this leads to recursive error.
    Would be great to get more insights into this..
    thanks
    cheers
    Jaani

    Hi,
    Within the following script you need to make adjustments according to your needs about the columns you need to test. But this might help you.
    Sorry for the layout. But I was not able to adjust it in a short time.
    drop table ad_test
    create table ad_test ( col1 varchar2(1), col2 varchar2(5), col3 varchar2(100) )
    create or replace package ad_test_pkg is
    procedure initialize_postpone ;
    procedure postpone_record( r_atst in ad_test%rowtype ) ;
    procedure handle_postponed_records ;
    end ad_test_pkg ;
    create or replace package body ad_test_pkg is
    type type_atst is table of ad_test%rowtype index by binary_integer ;
    t_atst type_atst ;
    procedure initialize_postpone is
    begin
    t_atst.delete ;
    end initialize_postpone ;
    procedure postpone_record( r_atst in ad_test%rowtype ) is
    begin
    t_atst(t_atst.count) := r_atst ;
    end postpone_record ;
    procedure handle_postponed_records is
    cursor c_test( cpiv_col1 in ad_test.col1%type ) is
    select 'x'
    from ad_test
    where col1 = cpiv_col1
    r_test c_test%rowtype ;
    r_atst ad_test%rowtype ;
    begin
    for i in t_atst.first .. t_atst.last
    loop
    r_atst := t_atst(i) ;
    if r_atst.col1 = 'I'
    then
    r_atst.col1 := 'S' ;
    else
    r_atst.col1 := 'I' ;
    end if ;
    open c_test( cpiv_col1 => r_atst.col1 ) ;
    fetch c_test into r_test ;
    if c_test%found
    then
    close c_test ;
    else
    close c_test ;
    insert into ad_test
    ( col1
    , col2
    , col3
    ) values
    ( 'S'
    , r_atst.col2
    , r_atst.col3
    end if ;
    end loop ;
    end handle_postponed_records ;
    end ad_test_pkg ;
    create or replace trigger test_ad_bis
    before insert on ad_test
    begin
    ad_test_pkg.initialize_postpone ;
    end ;
    create or replace trigger test_ad_air
    after insert on ad_test for each row
    declare
    r_atst ad_test%rowtype ;
    begin
    r_atst.col1 := :new.col1 ;
    r_atst.col2 := :new.col2 ;
    r_atst.col3 := :new.col3 ;
    ad_test_pkg.postpone_record( r_atst => r_atst ) ;
    end ;
    create or replace trigger test_ad_ais
    after insert on ad_test
    begin
    ad_test_pkg.handle_postponed_records ;
    end ;
    insert into ad_test values ( 'I', 'A0001', 'ABC COmpany') ;
    select * from ad_test ;
    Greets,
    Ad
    Edited by: loaddev on 10-nov-2010 4:47

  • Oracle forms 10g,multiple insert and update problem

    Hi,
    I have tabular form(4 records displayed) with one datablock(based on a view).
    After querying the form could not update all the records but only first record value can select from LOV.
    I called a procedure in in-insert and on-update
    The query is lik this
    PACKAGE BODY MAPPING IS
         PROCEDURE INSERT_ROW(EVENT_NAME IN VARCHAR2)
         IS
         BEGIN
              IF (EVENT_NAME = 'ON-INSERT') THEN
                   INSERT INTO XX_REC_MAPPING
                   (BRANCH_CODE,COLLECTION_ID,PAY_MODE_ID,RECEIPT_METHOD,CREATED_BY,
                   CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN)
                   VALUES
                   (     :XX_REC_MAPPING.OFFICE_CODE,
                        :XX_REC_MAPPING.COLLECTION_ID,
                        :XX_REC_MAPPING.PAY_MODE_ID,
                        :XX_REC_MAPPING.RECEIPT_METHOD,
                        :XX_REC_MAPPING.CREATED_BY,
                        :XX_REC_MAPPING.CREATION_DATE,
                        :XX_REC_MAPPING.LAST_UPDATED_BY,
                        :XX_REC_MAPPING.LAST_UPDATE_DATE,
                        :XX_REC_MAPPING.LAST_UPDATE_LOGIN);     
              ELSIF (EVENT_NAME = 'ON-UPDATE') THEN          
              UPDATE     XX_REC_MAPPING
              SET BRANCH_CODE=:XX_REC_MAPPING.OFFICE_CODE,
                        COLLECTION_ID=:XX_REC_MAPPING.COLLECTION_ID,
                        PAY_MODE_ID=:XX_REC_MAPPING.PAY_MODE_ID,
                        RECEIPT_METHOD=:XX_REC_MAPPING.RECEIPT_METHOD,
                        LAST_UPDATED_BY=:XX_REC_MAPPING.LAST_UPDATED_BY,
                        LAST_UPDATE_DATE=:XX_REC_MAPPING.LAST_UPDATE_DATE,
                        LAST_UPDATE_LOGIN=:XX_REC_MAPPING.LAST_UPDATE_LOGIN
                        WHERE ROWID=:XX_REC_MAPPING.ROW_ID;
              END IF;
         END INSERT_ROW;
    END MAPPING;
    Whether the table gets looked or sholud i use some other trigger or loops ?
    someone suggest me how to edit this query for multiple update.
    Thanks
    sat33

    I called a procedure in in-insert and on-updateWhy are you writing this code in the first place? If you have a block based on an updatable view, just let Forms do the inserts and updates.
    If it's not an updatable view, use instead of triggers on the view.
    See this current thread too:
    INSTEAD of Trigger View for an Oracle EBS New form development

  • Please help with multiple insert query into nested table!!!!

    I am having a problem with inserting multiple references to objects into a nested table using the following query:
    INSERT INTO TABLE(SELECT Taken_by FROM courses WHERE course_number= 001)
    (SELECT REF(p) FROM persons p
    WHERE p.enroled_in = 'Computing for Business'
    The database says that p.enroled_in is an invalid identifier. I know why this is. This is because the field enroled_in is part of a subtype of person called student_type and the query above is not accounting for this properly. I would like to know the correct syntax to use so I can insert into the nested table wherever a student is enroled into the 'computing for business' course. My full schema is below:
    CREATE TYPE person_type;
    CREATE TYPE student_type;
    CREATE TYPE staff_type;
    CREATE TYPE course_type;
    CREATE TYPE module_type;
    CREATE TYPE address_type AS OBJECT
    Street VARCHAR2 (30),
    Town     VARCHAR2 (30),
    County VARCHAR2 (30),
    Postcode VARCHAR2 (9)
    CREATE TYPE person_type AS OBJECT
    Name VARCHAR2 (50),
    Address address_type,
    DOB     DATE
    ) NOT FINAL;
    CREATE TYPE staff_type UNDER person_type
    Staff_number NUMBER (2,0)
    ) FINAL;
    CREATE TYPE student_type UNDER person_type (
    Student_number NUMBER (2,0),
    Enroled_in VARCHAR2(50),
    MEMBER FUNCTION getAge RETURN NUMBER
    )NOT FINAL;
    CREATE OR REPLACE TYPE BODY student_type AS
    MEMBER FUNCTION getAge RETURN NUMBER AS
    BEGIN
    RETURN Trunc(Months_Between(Sysdate, DOB)/12);
    END getAge;
    END;
    CREATE TYPE module_type AS OBJECT
    Module_number VARCHAR2(6),
    Module_name VARCHAR2(50),
    Credit NUMBER(2,0),
    Taught_in VARCHAR2(50)
    CREATE TYPE students_tab AS TABLE OF REF person_type;
    CREATE TYPE modules_tab AS TABLE OF REF module_type;
    CREATE TYPE course_type AS OBJECT
    Course_number NUMBER (2,0),
    Course_name VARCHAR2(50),
    Dept_name VARCHAR2(50),
    Taken_by Students_tab,
    Contains Modules_tab
    CREATE TABLE modules OF module_type(
    constraint pk_modules primary key (Module_number)
    CREATE TABLE courses OF course_type(
    constraint pk_courses primary key (Course_number)
    NESTED TABLE Taken_by STORE AS students_nt,
    NESTED TABLE Contains STORE AS modules_nt;

    By the way I am using oracle 9i and trying to insert into the nested table data from a subtype (i.e student is a subtype of person)

  • Insert value in a table through forms

    hello friends,
    I have table "log" with following fields.
    SQL> desc log;
    Name Null? Type
    IN_HR NUMBER
    IN_MIN NUMBER
    OUT_HR NUMBER
    OUT_MIN NUMBER
    DAYHR NUMBER
    DAYMIN NUMBER
    LOGUSER VARCHAR2(20)
    I created one form "user_activity" with two buttons named "IN" and "OUT"..
    when i press "IN" button i want to store follwing in LOG table..
    LOGUSER----> This should store the global variable value derived from another form called "login_main"...Actually i called "user_activity" form from "login_main" with global variable..this global variable have the username who is currently logged in...But my problem is i cant insert this value..
    NOTE: pls tell me how can i check this global variable is hold value or not...
    IN_HR---> This is successfully updated in log table..
    in_min--> This is successfully updated in log table..
    Pls help me how to store this global variable value into log table... my actual code is follows..I write this code in "when-button-pressed"trigger of "IN" Button..
    <code>
    declare
         name varchar2(30);
    begin
         name:=:global.username;
         insert into log(loguser)values(name);
    commit;
    :CUSTOMER.IN_TIME:=to_char(sysdate,'hh24:mi:ss');
    update log set in_hr=round(to_number(to_char(sysdate,'HH24'))),
    in_min=round(to_number(to_char(sysdate,'mi')))
    where loguser=name;
    commit;
    end;
    <\code>

    Hello,
    please don't open multiple threads for the same question. It only adds confusion to those willing to help you, and you won't get quicker answers when posting questions more then once.
    Also, mostly solutions to problems are version dependend, so the very first thing you should do is to provide the involved versions (database, forms, java, OS; remember that oracle products have 5 digit version numbers; 10g is not a version number, 10.2.0.5 is; also "Windows" has a lot of flavors; "Windows 3.11" is also "Windows", so don't say just "Windows"). Even if you think a solution isn't version dependend provide the involved versions. It isn't much effort on your side and saves us a question roundtrip when it is needed anyway.
    after that you didn't give us much to work with except a - sorry but I don't have any other word for this - ill data model where you seem to want to reinvent the date datatype and some code which seem to compile (no I didn't try it). Oh, and the fact that "it didn't work". Did you debug your code? How do you populate your global variable? Did you inspect your global variable before the insert? Also what should be stored in your global? is it the current logged on oracle user? You could simply use user to get this and forget about the global
    Oh, and before I forget it:
    please, don't reinvent the date datatype, and fix your data model.
    loguser varchar2(20)
    in_date date
    out_date date
    insert into log(loguser, in_date) values (user, sysdate);
    commit;no muss, no fuss and about 20% of the amount of code you wrote.
    cheers

  • Building index from multiple master and child relationship tables

    Hello,
    My question is:
    Is it possible to create the index for master and child tables?
    If yes, can you please point me out to any links or give me an example.
    Actually i just followed this below link to create the index using multiple tables
    Building index from multiple tables for text search
    I am able to create the index using above link,but problem accured , when i search for one master data column value then it is returning many rows with same master data for each child row.
    for example
    SELECT
    a.conc_program_name,
    a.conc_program_desc,
    b.param_name
    FROM a_master a, b_child b
    WHERE b.report_dtls_id = a.report_id
    AND CONTAINS (a.dummy, 'PAY') > 0
    Which retruns
    PAY Master A
    PAY Master B
    PAY Master C
    Please let me know is there any way i can restrict this to single row with concatination of child data like
    PAY Master A B C
    Another doubt is ,i have the column value like p_consolidation_set_id,when i give this in CONTAINS (a.dummy, 'p_consolidation_set_id') > 0 ,then not able to get the any results.
    please let me what shall i do for this issue.
    Thanks
    Message was edited by:
    user496798

    There are various ways to concatenate the values. One nice generic solution is to use Tom Kyte's stragg function:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2196162600402
    If p_consolidation_set_id is a variable name, not a value, then do not put quotes around it.
    Message was edited by:
    Barbara Boehmer

  • Data inserted twice in a table through concurrent program

    Hi All,
    I have a concurrent program that is run from two different responsibilities, CANADA and US respectively.
    Now it sometimes happens that since its being run from two different responsibilities, it is inserting data twice in a table.
    I want to know what is the best way to restrict this, setting incompatibility would be the right option, so that i make that conconcurrent program incompatible to itself or is there some better way possible.
    If setting the incompatibility is better, please let me know how do i do that.
    Regards,
    SK

    The process to make an program incompatible with itself is described in MOS Doc 142944.1 (How to Make a Concurrent Program Incompatible with Itself) - you will have to bounce the concurrent managers for the setting to take effect
    HTH
    Srini

  • Require help on coast center and work center tables through sales order

    dear experts
    my requirement is to report the cm05(capacity planning ) transaction.
    The original capacity planning consists of workcenter details.
    but my client needs the report as follows
    on which sales order and on which work center we require the capacity of materials.
    any tables and fields for this report please.
    help needed.
    kindly update me.

    hi,
    Please explore table CAUFV View "Order Headers PP/CO" ,here you will find the relationships between the three.
    Regards,
    Neha

  • Inserting the column values into table from view through procedure!!!

    below is my example code
    Create or replace procedure test_proc
    is
    cursor test_cur is
    select a.col1 , b.col2, c.col3, d.col4, e.col5
    from tableA a, tableB b, tableC c, tableD d, tableE e;
    test_cur_rec test_cur%rowtype;
    Begin
    insert into test_stg ( col1, col2, col3, col4, col5, col6, col7)
    Values ( test_cur_rec. col1,
    test_cur_rec .col2,
    test_cur_rec .col3,
    test_cur_rec .col4,
    test_cur_rec .col5
    -- col6, col7 );
    create view test2 (
    select f.col6, g.col7 from tableF f,tableG g);
    I m trying to insert values into the table test_stg but for col6 and col7 i need to get the data from the view test2.
    In simple word, all i need to do is get the 2 columns data from view and insert into a table through procedure. The above code is the example which looks very much like my actual code.
    How do i accomplish this task ??

    well there is joining condition for a, b,c ,d, e tables, i have not mentioned here. The where condition has nothing to do with the other two columns of the view.
    There is no relation ship between the these tables the view. The col 6 and 7 i m inserting from view is sysdate timestamp and the job_id number.
    so its pretty straight forward insertion into the table from view columns. These two columns has just one row with id number and timestamp. so i need to insert these data into the the table when i run a procedure.
    Thank you so much!!!

  • How to assign Values to nested table and pass as parameter to procedure?

    How to assign Values to nested table and pass as parameter to procedure?
    Below is the Object and its type
    create or replace type test_object1 as object
    val1 varchar2(50),
    val2 varchar2(50),
         val3 varchar2(50)
    create or replace type test_type1 is table of test_object1;
    create or replace type test_object2 as object
    val1 varchar2(50),
    val2 varchar2(50),
         val3 varchar2(50)
    create or replace type test_type2 is table of test_object2;
    GRANT ALL ON test_object1 TO PUBLIC;
    GRANT ALL ON test_type1 TO PUBLIC;
    GRANT ALL ON test_object2 TO PUBLIC;
    GRANT ALL ON test_type2 TO PUBLIC;
    here is the table made of object type:
    create table test_object_tpe
    sl_num NUMBER,
    description VARCHAR2(100),
    main_val1 test_type1,
    main_val2 test_type2
    NESTED TABLE main_val1 STORE AS tot1
    NESTED TABLE main_val2 STORE AS tot2;
    here is the procedure which inserts values into nested table:
    PROCEDURE INSERT_TEST_DATA(sl_num IN NUMBER,
    description IN VARCHAR2,
    p_main_val1 IN test_type1,
    p_main_val2 IN test_type2
    IS
    BEGIN
    FOR rec in p_main_val1.first..p_main_val1.last
    LOOP
    INSERT INTO xxdl.test_object_tpe
    sl_num,
    description,
    main_val1,
    main_val2
    VALUES
    sl_num
    ,description
    ,test_type1 (test_object1(
    p_main_val1(rec).val1,
                                       p_main_val1(rec).val2,
    p_main_val1(rec).val3
    ,test_type2 (test_object2( p_main_val2(rec).val1,
                        p_main_val2(rec).val2,
                        p_main_val2(rec).val3
    END LOOP;
    commit;
    END INSERT_TEST_DATA;
    here is the anonymoys block which assigns values to the object type and pass values into the procedure:
    set serveroutput on;
    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1(1).val1 := 'testx1';
    inval1(1).val2 := 'testx2';
    inval1(1).val3 := 'testx3';
    inval2(1).val1 := 'testy1';
    inval2(1).val2 := 'testy2';
    inval2(1).val3 := 'testy3';
    CSI_PKG.INSERT_TEST_DATA(sl_num => p_sl_num,
    description => p_description,
    p_main_val1 => inval1,
    p_main_val2 => inval2
    end;
    Can anybody correct me.
    Thanks,
    Lavan

    Thanks for posting the DDL and sample code but whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    >
    How to assign Values to nested table and pass as parameter to procedure?
    >
    Well you are doing almost everything wrong that could be done wrong.
    Here is code that works to insert data into your table (the procedure isn't even needed).
    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1.extend();
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    inval2.extend();
    inval2(1) := test_object2('testy1', 'testy2', 'testy3');
    INSERT INTO test_object_tpe
    sl_num,
    description,
    main_val1,
    main_val2
    VALUES
    (p_sl_num, p_description, inval1, inval2);
    commit;
    end;
    /See Example 5-15 Referencing a Nested Table Element in Chap 5 Using PL/SQL Collections and Records in the PL/SQL doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/collections.htm#CJABEBEA
    1. You don't even need the procedure since all it does is a simple INSERT into the table which you can do directly (see my code above)
    inval1(1).val1 := 'testx1';There is no element one (1) of 'inval1' since you haven't created any elements yet. You need to EXTEND the collection to add an element
    inval1.extend();And then there is an empty element but 'inval1' is a container for objects of type 'test_object1' not for scalars like 'val1', 'val2', and 'val3'.
    So you can't do
    inval1(1).val1 := 'testx1';You have to create an instance of 'test_object1'
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');And so on for the other collection
    You don't need the procedure (as my sample code shows) but once you populate the variables properly it will work.

  • Procedure with multiple Loops and Insert into table

    Hello All,
    I am trying to create the Procedure to create a new table for our DWH.
    In this Case, I have 2 tables and I need to create Loop for each value from one table and get the respective data from second table based on first table data.
    Please find the below example:
    First table: TABLE_A
    X             Y              Z
    1              a              10
    1              b             abc
    1              c              xy
    1              e             $
    2              a              11
    2              c              asf
    2              d             tal
    2              f              ghs
    Second Table: TABLE_B
    A             B             C             D             E              F
    10           abc         xy           sd           ew          100
    10           jhy          xy           sd           ew          100
    11           ght         asf          tal           ss            ghs
    11           ght         afr          tal           ss            ghs
    O/P Table from Procedure: OUTPUT_TABLE
    A             B             C             D             E              F              X
    10           abc         xy           sd           ew          100         1
    11           ght         asf          tal           ss            ghs         2
    Business Logic In the Procedure:
    CREATE OR REPLACE PROCEDURE OP_TAB_PROCEDURE IS
    BEGIN
                    -- First get the DISTINCT values from the TABLE_A to generate the Loop
                    FOR ID (SEELCT DISTINCT X FROM TABLE_A_
                    LOOP
                                    -- For Each ID get the Y ,Z values from TABLE_A other than $ in Z
                                                    TEMP:
                                                    SELECT Y, Z FROM TABLE_A WHERE X = ID.X AND Z <> '$' ;
                                                    Based on above SELECT statement, I need to construct dynamic SQL query to get the data from TABLE_B
                                                    OP_EACH_ID:
                                                    SELECT * , ID.X AS X FROM TABLE_A WHERE [In this place I need generate sql cond dynamically. For Example, For X=1 in TABLE_A , the where cond must A=10 AND B='abc' AND C='xy'
                                                                                                                                                                                                                     For X=2 , the Where cond must be WHERE A=11 AND C='asf' AND D='tal' AND F='ghs']
                                                    -- I need to INSERT all the values from OP_EACH_ID into OUT_PUT_TABLE
                    END LOOP ;
    END;
    I am new to PL/SQL , so please help me on the above case.

    duplicate post

  • Inserting multiple records in a table through detail block

    hi,
    i am new to oracle forms. i want to enter more than one records in a table through a master detail forms.
    the records will be entered by user in the detail section. can any ody help me?

    Hi Lance,
    Try creating records in detail block in the when new block instance trigger of
    detail block. Set the validation unit property of the form to FORM before trying this.
    Hope this might be helpful to you.
    V.Senthil Kumar

  • Need to insert data in 2 tables thro stored procedure

    I need to create a stored procedure which will insert data in two tables. The procedure will get
    its inputs from an Oracle Developer Form which will be inserted into the tables.
    The 2 tables structure:
    1.FEES_MASTER
    Name Null? Type
    FEES_ID NOT NULL NUMBER(8) -- Primary Key
    CS_ID NOT NULL NUMBER(8) -- Class Student ID; An enrolled student
    REC_DATE NOT NULL DATE -- Fees receipt date
    REC_AMOUNT NOT NULL NUMBER(6) -- Fees receipt amount
    2.FEES_DETAIL
    Name Null? Type
    FEES_ID NOT NULL NUMBER(8) -- Foreign Key
    MONTH NOT NULL DATE -- First of each month to identify fee month
    Scenario:
    A student submits fees for 3 months through Master/Detail related blocks in a Developer Form as
    Under:
    Fees Master
    Fees ID : 11002
    Class Student ID : 356
    Receipt Date : 06-JAN-2001
    Receipt Amount : 1500
    Fees Detail
    Fees ID Fees Month
    11002 01-JAN-2001
    11002 01-FEB-2001
    11002 01-MAR-2001
    I need to check each fees detail record for fees month duplication as well before inserting new records.
    How can this be achieved?
    Thanks in advance.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Fan Liu ([email protected]):
    create primary key in the detail table. i think it's FEES_ID + MONTH. then mark the columns in Forms as primary key property true, then call check_record_uniqueness built-in in on-check-unique trigger.<HR></BLOCKQUOTE>
    Thanks very much. But what I need is to ensure transaction integrity thro stored procedure. The system allows a certain CS_ID (i.e. Class Student ID, which is assigned a new one to every student annually) to submit fees for 12 months only, because a student stays in a class for a year. The 2 columns in the FEES_DETAIL table are composite primary key which only ensures that a certain FEES_ID will not be repeated for the same month. But suppose:
    1)this data already exist in the tables:
    Fees Master
    Fees ID : 11002
    Class Student ID : 356
    Receipt Date : 06-JAN-2001
    Receipt Amount : 1500
    Fees Detail
    Fees ID Fees Month
    11002 01-JAN-2001
    11002 01-FEB-2001
    11002 01-MAR-2001
    2)And this data is currently being inserted:
    Fees Master
    Fees ID : 11300
    Class Student ID : 356
    Receipt Date : 04-FEB-2001
    Receipt Amount : 1500
    Fees Detail
    Fees ID Fees Month
    11300 01-JAN-2001
    11300 01-FEB-2001
    11300 01-MAR-2001
    The data in the 2nd condition is perfectly valid but the application can't allow a student to submit fees for a month which he has already submitted. Now only a stored procedure can make sure after checking that the same student doesn't pay fees for duplicate months. Another reason for my emphasis on stored procedure is that what if a user tries to insert data thro an SQL* Plus session instead of the Form.
    PROBLEM: Now the problem I am having is I don't know how the procedure will take input for multiple records from the FEES_DETAIL block in the Form.
    Please assist in this regard. Thanks.

  • Update Yes/No field in access table through oracle procedure

    Hi,
    How to update Yes/No field in access table through oracle procedure. all other fields like AutoNumber, Text I can update it. Yes/No field how to update? Please, any one can help me?
    Thanks and Regards,
    Sudha.

    Sudha Teki wrote:
    select "fldPost" from tblPHd@ODBCLNKNot quite sure what you mean, but the way you select the column would indicate a case sensitive column name
    Look at this example
    SQL> create table t
      2  ("this" varchar2(10))
      3  /
    Table created.
    SQL> insert into t values ('hello')
      2  /
    1 row created.
    SQL> select *
      2    from t
      3  /
    this
    hello
    SQL> select this
      2    from t
      3  /
    select this
    ERROR at line 1:
    ORA-00904: "THIS": invalid identifier
    SQL> select "this"
      2    from t
      3  /
    this
    helloIs your column name also case sensitive?

Maybe you are looking for

  • Adding new fields to th custom segment

    Hi all, I have to add new fields to the custom segment Z1EDPZ1. Iam getting error msg saying  'Error while resetting release of segment Z1EDPZ1' when I click the cancel release inorder to add new fields in WE31. Thanks Saichand.

  • CS3 v CS2 quality of print to non-PS printer

    I went over to CS3 about 18 months ago and use print so little I've never resolved this issue. I have a greyscale image that prints perfectly to an old HP laserjet 6L printer from CS2, just using the embedded document profile and no fiddling with any

  • External photo bank not included in contents

    I store my photos on an external drive called Photo Bank. I recently upgraded to CS4, and when I open Bridge with the Photo Bank connected via USB, it is not included in the choices under content. I cannot find a way to locate the Photobank on bridge

  • Iphoto to .mac/iweb - subset of images?

    Hi - if you have an 'album" in iphoto of let's say 300 images and you want to take 20 of them and send them to your .mac/iweb setup as an album, can you do it right from iphoto as is or do you have to take those 20 images, copy them or move them into

  • OSB Express questions

    Hi, I'm planning to use Oracle Secure Backup Express (OSB-XE) , described as license free with some limitations. i have some questions : 1./ Does this free version allow me to use a Single Drive tape library (SAS ) attached to a server? 2./ Would be