Store value of multiple checkboxes in the database

Hello,
I have a table structure as table (masterid, types). Types has four values as AAA, BBB, CCC, DDD.
I was wondering if there is any easiest and good way to implement this in Oracle forms. Currently, I have four checkboxes in the form. Each checkboxes has When-Checkbox-Changed trigger. In the trigger, I have put insert and delete statement depending on the value of the checkbox.
Thanks for your help.
Edited by: user12068331 on Jun 2, 2010 11:42 AM

Hi Ammad,
Thank you for your reply.
I would really like the see the actuall table structure which you are having.
I have created a sample script identical to my table structure.
DROP TABLE "PEOPLE_INTERESTS" ;
DROP TABLE PEOPLE;
CREATE TABLE "PEOPLE"
(     "PEOPLEID" NUMBER,
     "FNAME" VARCHAR2(40 BYTE) NOT NULL ENABLE,
     "LNAME" VARCHAR2(40 BYTE) NOT NULL ENABLE,
     CONSTRAINT "PEOPLE_PK" PRIMARY KEY ("PEOPLEID")
insert into PEOPLE(PEOPLEID,FNAME,LNAME) VALUES(11111, 'ANDY', 'ADAMS');
insert into PEOPLE(PEOPLEID,FNAME,LNAME) VALUES(22222, 'BRIAN', 'BANK');
insert into PEOPLE(PEOPLEID,FNAME,LNAME) VALUES(33333, 'CAROL', 'CAMPS');
DROP TABLE "INTERESTS_TYPE" ;
CREATE TABLE "INTERESTS_TYPE"
(          "INTERESTID" CHAR(3 BYTE),
"INTERESTS" CHAR(30 BYTE),
          CONSTRAINT "INTERESTS_TYPE_PK" PRIMARY KEY ("INTERESTID")
insert into INTERESTS_TYPE(INTERESTID,INTERESTS) VALUES('AAA', 'AGRICULTURE');
insert into INTERESTS_TYPE(INTERESTID,INTERESTS) VALUES('BBB', 'BOOKS');
insert into INTERESTS_TYPE(INTERESTID,INTERESTS) VALUES('CCC', 'COMPUTER');
insert into INTERESTS_TYPE(INTERESTID,INTERESTS) VALUES('DDD', 'FINANCE');
CREATE TABLE "PEOPLE_INTERESTS"
(          "PEOPLEID" NUMBER,
"INTERESTID" CHAR(3 BYTE)
     CONSTRAINT "PEOPLE_INTERESTS_CHECK" CHECK (Interestid IN ('AAA', 'BBB','CCC','DDD')) ENABLE,
     CONSTRAINT "FK_PEOPLE_INTERESTS" PRIMARY KEY ("PEOPLEID", "INTERESTID"),
CONSTRAINT "FK_PEOPLE_INTERESTS_PEOPLE" FOREIGN KEY ("PEOPLEID")
     REFERENCES "PEOPLE" ("PEOPLEID") ,
CONSTRAINT "FK_PEOPLE_INTERESTS_TYPE" FOREIGN KEY ("INTERESTID")
     REFERENCES "INTERESTS_TYPE" ("INTERESTID")
insert into PEOPLE_INTERESTS(PEOPLEID,INTERESTID) VALUES(11111,'AAA');
insert into PEOPLE_INTERESTS(PEOPLEID,INTERESTID) VALUES(11111,'CCC');
insert into PEOPLE_INTERESTS(PEOPLEID,INTERESTID) VALUES(33333,'CCC');
insert into PEOPLE_INTERESTS(PEOPLEID,INTERESTID) VALUES(33333,'BBB');
insert into PEOPLE_INTERESTS(PEOPLEID,INTERESTID) VALUES(33333,'DDD');
In the form, when user search for 'ANDY ADAMS', the out of four checkboxes,''AGRICULTURE'' and 'COMPUTER' checkboxes should be checked.
I am working on what you wrote in the provious post and I get the idea of using cursor. Do I have to put his cursor in "WHNE_NEW_FORM_INSTANCE". I am sorry, you have to explain everything but I am new to this whole forms concept.
Thanks,
Girish

Similar Messages

  • How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do this Excel but don't know procedure in Numbers.  Thanks.

    How do I edit or enter values on multiple sheets at the same time in Numbers?  I can do it in Excel but I don't the procedure in Numbers.  Thank you!

    The only I way I can think of to modify a single value and have that value change in multipl locations is to have all "the other places" reference a single cell.  There is not way without a referene to modify a set of cells simulateously.
    This may be something like what you want:
    Enter a value in the table "Original Data" cell A1 and the A1 cells of tables Ref1, Ref2 and Ref2-1 will change

  • Value to multiple sprites through the same parameter

    I'm going to ask the same question "
    "contains" doubt in hexadecimal color value?" but in a
    different way, because I figured out that the solution is simpler
    that I thought, and the solutions goes by other way. I have this
    behavior:
    property pTargetSprite, pBlendValue
    on getPropertyDescriptionList me
    list = [:]
    addProp list, #pTargetSprite, [#comment: "Target Sprite:",\
    #format: #integer, #default: VOID]
    addProp list, #pBlendValue, [#comment: "Blend Value:",\
    #format: #integer, #default: 100]
    return list
    end
    on mouseDown me
    sprite(pTargetSprite).blend = pBlendValue
    end
    I would like to enter MULTIPLE sprites for 1 parameter, that
    is to say when the dialog box of the behavior appears and ask me
    the "Target Sprite:", I would like to input ...let's say 1 , 2 , 3
    , ... whatever numbers I want. Therefore, the blend values of that
    sprites will change according to the input Blend Value. Right Now
    is working perfect, but of course with only ONE sprite, but I want
    to be able to assign that Blend Value to multiple sprites over the
    same parameter.
    I guess it must be very simple, but I cannot get the answer
    anywhere in my brain, nor my director book, nor in the forums.
    Thanks!!!

    You have several options here. You can do as you suggest,
    create a list
    of the sprite numbers to change and then tell each of those
    sprite's
    blend value to change.
    Another method is to write a function in the behavior that
    you attach to
    each sprite and then use sendAllSprites() to fire each of
    those
    functions. If you are attaching behaviors to each sprite this
    may be the
    way to go.
    For method 1, you could amend your behavior like this:
    property spriteList
    property blendValue
    on getPropertyDescriptionlist
    myPropList = [:]
    myPropList.addProp(#spriteList,[#comment:"enter the sprite
    channel
    numbers to use, separated by
    commas:",#format:#integer,#default:"1,2,3"])
    myPropList.addProp(#blendValue, [#comment: "Blend Value:",\
    #format: #integer, #default: 100])
    return myPropList
    end
    on beginSprite me
    spriteList = stringToList(spriteList)
    end
    on stringToList(thisString)
    oldDelim = the itemDelimiter
    the itemDelimiter = ","
    thisManyItems = thisString.item.count
    tempList = []
    repeat with n = 1 to thisManyItems
    tempList.add(thisString.item[n])
    end repeat
    the itemDelimiter = oldDelim
    return tempList
    end
    on mouseUp me
    thisMany = spriteList.count
    repeat with n = 1 to thisMany
    sprite(n).blend = blendValue
    end repeat
    end
    for method 2 you could use something like this in each
    sprite's behavior:
    property blendValue
    property thisSprite
    on getPropertyDescriptionlist
    myPropList = [:]
    myPropList.addProp(#blendValue, [#comment: "Blend Value:",\
    #format: #integer, #default: 100])
    return myPropList
    end
    on beginSprite me
    thisSprite = me.spriteNum
    end
    on changeValue me
    sprite(thisSprite).blend = blendValue
    end
    and then you can call this second method from a mouse event:
    on mouseUp me
    sendAllSprites(#changeValue)
    end
    and every sprite that contains that function in the frame
    where it is
    called will execute.
    Rob
    Rob Dillon
    Adobe Community Expert
    http://www.ddg-designs.com
    412-243-9119
    http://www.macromedia.com/software/trial/

  • How to get the value of a checkbox in the backing bean

    How to get the valaue of a checkbox in the backing bean?

    Hi this may help you for selecting single check box
    <h:outputText value="Enabled : "/>
                              <h:selectBooleanCheckbox value="#{Bean.isEnabled}"/>                    
                              <h:commandButton value="Submit" action="#{Bean.submit}"/>
    private Boolean isEnabled;
        public Boolean getIsEnabled() {
            return isEnabled;
        public void setIsEnabled(Boolean isEnabled) {
            this.isEnabled = isEnabled;
        public String submit(){
         System.out.println(isEnabled);
            return isEnabled;
        }for selecting multiple check box
                              <h:selectManyCheckbox value="#{Bean.items}">
                                  <f:selectItem itemLabel="one" itemValue="one" />
                                  <f:selectItem itemLabel="two" itemValue="two" />
                                  <f:selectItem itemLabel="three" itemValue="three" />
                               </h:selectManyCheckbox>
                   <h:commandButton value="Submit" action="#{Bean.submit}"/>
    private List<String> items;
        public List<String> getItems() {
            return items;
        public void setItems(List<String> items) {
            this.items = items;
        public String submit(){
            System.out.println("List : " + this.items);
            return "done";
        }Hope this helps you

  • STORE A COMPLETE FILE SYSTEM IN THE DATABASE 11GR2

    Hi everyone
    I have the following issue:
    I tried to store in an oracle database TABLE the completre file structure
    of a file system that includes the follwing:
    -Name of the file
    -Date of last modification
    -Location
    -The entire content of the phisical file BLOB datatype
    I have the following piece of code to archieve this, but i still have a
    problem...
    When i tried to add the records to the database by implememting all
    the connecttions stuffs, oracle and java classes required the program
    inserts a FEW RECORDS and after that:
    ¡¡¡hangs up!!!.
    The main problem is that i cant release the connection and get another new when i using
    JDBC POOL so the server full their available connections.
    Please tell me what is the best approach or programming practice on order to
    meet this goal.
    Thanks from Colombia - Latin America..
    HERE IS THE CODE:
    import java.io.* ;
    * A simple class to demonstrate a recursive directory traversal
    * in Java.
    * Error handling was left out to make the code easier to understand.
    * In production code, you should check if the arguments from the
    * command line are really file files or directories.
    public class RecursiveTraversal
    * Works on a single file system entry and
    * calls itself recursively if it turns out
    * to be a directory.
    * @param file A file or a directory to process
    public void traverse( File file )
    // Print the name of the entry
    //System.out.println( file ) ;
    // Check if it is a directory
    if( file.isDirectory() )
    // Get a list of all the entries in the directory
    String entries[] = file.list() ;
    // Ensure that the list is not null
    if( entries != null )
    // Loop over all the entries
    for( String entry : entries )
    // Recursive call to traverse
    traverse( new File(file,entry) ) ;
    else
    if(file.isFile())
    System.out.println( file.getParent() ) ;
    System.out.println( file.getName() ) ;
    else
    System.out.println("*** WRONG VALUE ***");
    * The program starts here.
    * @param args The arguments from the command line
    public static void main( String args[] )
    // Create an object of this class
    RecursiveTraversal rt = new RecursiveTraversal() ;
    if( args.length == 0 )
    // If there are no arguments, traverse the current directory
    rt.traverse( new File(".") ) ;
    else
    // Else process every argument sequentially
    for( String arg : args )
    rt.traverse( new File(arg) ) ;
    }

    Thanks for the reply, the implementation that you refer is useful for another type of application i need to stored the file system in a TABLE of a database
    in order to make a part of an information system integration and can use SQL statements to acomplish this.
    I follow the recomendation and post it in the SQL/JDBC forum because when i try to release de active connection i can't acomplish this.
    And i need to know how to use JDBC connection poolling to open a connection just once, release and use it again.

  • How to insert multiple rows in the database table with the high performance

    Hello everybody,
    I am using the struts,jsp and spring framework. In my application there are 100s of rows i have to insert into the database 1 by 1. I am using usertransaction all other things are working right but i am not getting the real time performance.
    Can anyone tell me the proper method to insert multiple records and also with fast speed

    I don't know much about Spring etc, but if the jdbc Statemenet.addBatch(), Statement.executeBatch() statements let you bundle a whole lot of sql commands into one lump to execute.
    Might help a bit...

  • How to compare, current value in :block.text_item with the database value

    Hi
    Could you please tell me
    How to compare the current value in :block.text_item with the corresponding database column value.
    I am using forms 10g
    There is block and there is an text Item in that block.
    When I run the form and query the block (tabular), the :block.text_item shows me, whatever value there in the database.
    Now I add some value in the :block.text_item to the existing value.
    now
    the :block.text_item contains old+ new added value
    whereas
    the database table contains 'old' value
    Now on a button click , I want to find out what is the value that I have added
    Could you please tell me, is it possible without writing a select query?

    Hello,
    Now on a button click , I want to find out what is the value that I have addedSo you mean always user will add value in the existing value. Because this way will fail in one case. Let say
    Value in Database is = ABCD
    User opened the form and he removed the D and write E and now value is ABCE and length is still same 4. So, there is no addition.
    Anyway you can know the database value at runtime there is one property for item called DATABASE_VALUE. It gives the value which is in database while you are running the form before save. and you can use like this..
    Trigger = WHEN-MOUSE-DOUBLE-CLICK on item level
    DECLARE
      vItemValue DATATYPE; -- Set the data type according to your desired field.
      vValueAdded DATATYPE; -- Set the data type according to your desired field.
    BEGIN
      vItemValue:=GET_ITEM_PROPERTY('ITEM_NAME',DATABASE_VALUE);  -- It will return you the database value in vItemValue variable.
      IF LENGTH(vItemValue)>LENGTH(:FORM_ITEM_NAME) THEN  -- It mean something change or added
        vValueAdded:=SUBSTR(:FORM_ITEM_NAME,LENGTH(vItemValue)+1);
        MESSAGE('Added value is : '||vValueAdded);  -- It will show you the added value.
      END IF;
      -- now suppose you want to show the old and new value in message not the added one
      -- Then no need of IF condition. You can just use message like this
      -- And i would prefer to use like this way
      MESSAGE('Old Value : '||vItemValue||'  New Value - '||:FORM_ITEM_NAME);
      MESSAGE('Old Value : '||vItemValue||'  New Value - '||:FORM_ITEM_NAME);
    END;Hope it is clear.
    -Ammad

  • How to store a varying length string in the database

    Hi,
    what is the best way to store a string (which can be infinitely long) in the database?
    there's limitation on varchar2...can i use blobs/clobs ??
    Thanks in advance for any enlightenment!
    null

    Is this a JDBC question?
    Meta data solutions mean that you will only find problems at runtime that would be obvious at compile time with a non-metadata solution. Code generation makes production of large numbers of these easy.
    But if you want metadata then you create a seperate class in a seperate package which holds the constants. The specifics depend on the implementation but you will typically have one class for each 'type' that is supported.
    That package is used by both the server and the client code.
    You can of course put other common functionality in the package (like a wrappers for the collections themselves, validation of names, etc.)

  • Column value not being saved to the database

    I have an app I am developing in HTML DB. I added a column to my database table so I then went and added an item to my form and made the source the database and gave it the column name. However, when I populate this item it will not save the value to the database. It is saving all the other items. We have hit this issue in the past, and if we delete the item and add it again it will work but that is not the case for me this time.
    I have compared this 6 way to Sunday to ensure I have it setup like all others. I have no typo in the column name cause I cut and paste from a describe after a few failed attempts at getting this to work.
    I am able to get the report screen of this app to display the column.
    Anyone come across this and have a workaround? Note, there are no errors, it just won't save the value for some reason.

    anonymous - What is the column datatype? I suggest you install the application into your workspace on htmldb.oracle.com (and create the table in your application schema). Let us know the workspace name and application ID so we can take a look. Also, always give the version of the product you are using.
    And we'd like to see your first name.
    Scott

  • SQL Server 2008 R2 - Connection from multiple sources makes the database drop.

    Hey,
    I have a database being accesses from multiple sources - IIS and WPF application.
    Once a user enters the website(which is connected to the database through a Connection String), The WPF application stops its communication with the database, or vise versa.
    The problem being solved once I restart the IIS service or the SQL instance service.
    Thanks in advanced.
    Nir.

    Hello Nir,
    Thank you for your question. I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    If you have any feedback on our support, please click
    here.
    Regards,
    Elvis Long
    TechNet Community Support

  • Problem : Not able to select multiple checkboxes in the JTable

    Here i am trying to select the multiple check boxes in the jtable. But i am not able to do that. I set the jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); also.
    Can any one help on this...

    [email protected] wrote:
    Here i am trying to select the multiple check boxes in the jtable. But i am not able to do that. I set the jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); also.
    Can any one help on this...That's row selection, not check boxes. The normal way to have active checkboxes in a JTable is with an editable Boolean column. The effect of clicking such a checkbox is to cause the table to call setValueAt() in the data model with a Boolean object value, and it's up to the data model to deal with that change.

  • How to store images along with text in the database    ------its urgent

    i'm developing an application which will be similar to to the page which we use for posting the forum. if in a text field we enter some text and an image how does we store the whole the information in database which in the textarea (both the text entered and the image) and how it can be extracted as if the user entered

    Hi,
    Refer thsi link, this may help you
    http://www.sap-basis-abap.com/saphr003.htm
    Call the FM BDS_BUSINESSDOCUMENT_CREATEF to upload the images from System.
    codeLOGICAL_SYSTEM
    CLASSNAME PICTURES
    CLASSTYPE OT
    CLIENT 321
    OBJECT_KEY ZIMAGE [/code]
    and the table parameter Files pass
    code DOC_COUNT 00000001
    COMP_COUNT 00000001
    COMP_ID
    DIRECTORY C:\
    FILENAME WINTER.JPG
    MIMETYPE
    [/code]
    now check it.
    here you can upload multiple images inside a loop call the FM.
    Regards,
    Shiva.

  • How to capture values of multiple checkboxes.

    Hello gurus,
            i am dynamically creating checkboxes in my page .Now i have to capture the values of all the checkboxes that are being checked and then delete the values from database table after submitting the button. I have used HTML tags .
    Plz help.
    Regards
    Swati

    Here you go...
    <b>Layout:</b>
    <% data: v_checkbox_id type string,
          sy_tabix type string.
    Loop at itab into wa.
    sy_tabix  = SY-TABIX.
    concatenate v_checkbox_id 'CHK' sy_tabix into v_checkbox_id.%>
    <td>
    <input type="checkbox" id="<%= v_checkbox_id %>" name="<%= v_checkbox_id %>" maxlength="12" size="12"
    checked = "<%= wa-field1 %>" />
    </td>
    <% ENDLOOP.
    %>
    <b>In Oninputprocessing:</b>
    DATA: GT_TIHTTPNVP TYPE TIHTTPNVP.
    data: v_checkbox_id type string,
             wa_formfields      TYPE ihttpnvp,
          sy_tabix type string.
    REFRESH GT_TIHTTPNVP.
    CALL METHOD REQUEST->GET_FORM_FIELDS
      CHANGING
        FIELDS = GT_TIHTTPNVP.
    Loop at itab into wa.
    sy_tabix  = SY-TABIX.
    concatenate v_checkbox_id 'chk' sy_tabix into v_checkbox_id.
          READ TABLE GT_TIHTTPNVP INTO wa_formfields WITH KEY name = v_checkbox_id.
          wa-field1 = wa_formfields-value.
       append wa to itab.
    endloop.
    This will solve the problem..
    <i>* Reward each useful answer</i>
    Raja T

  • Re: Store big SQL(15000 char+)  in the database.

    I have 2 very big SQL (almost 15000 char each). I have to store them in 2 saperate columns in a database table.
    After storing them when ever require, sql will be retrieved and executed to get the values.
    As varchar2 supports only 4000 chars. What would be the best data type to store big SQLs in the same table?
    Thanks

    >
    Ooops, I misread original post. Somehow I read 15,000 as 150,000. MichaelS is right, PL/SQL VARCHAR2 is 32K-1 but is some cases it will work with up to 64K-1 (although not supported abd subject to change in next releases). Anyway, for up to 32,767 byte clobs:
    SQL> declare c clob := to_clob('select ''') || lpad('X',4000,'X') || ''' from dual';
      2  begin
      3  execute immediate c;
      4  end;
      5  /
    execute immediate c;
    ERROR at line 3:
    ORA-06550: line 3, column 19:
    PLS-00382: expression is of wrong type
    ORA-06550: line 3, column 1:
    PL/SQL: Statement ignored
    SQL> declare c clob := to_clob('select ''') || lpad('X',4000,'X') || ''' from dual';
      2  begin
      3  execute immediate to_char(c);
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL> SY.

  • How do I store oracle forms and reports in the database

    Hi !!
    Is there a way I can store the forms and reports runtime in the
    oracle database ??
    We are working on forms 5.0, reports 3.0
    oracle 8.0.5.0.0 on HP-Unix
    Can someone guide me step by step from storing the forms to
    accessing it back on the desktop.
    Thanks in advance,
    Shobhit Kumar
    null

    You need SMB compatible names.. for both TC and if you use wireless then wireless.. short, no spaces, pure alphanumeric.
    Go to the disk file sharing page.. turn on guest account.. read and write access.
    Give it the right workgroup .. usually WORKGROUP
    Load bonjour for windows onto the windows machine.. that should be included with the airport utility for windows.

Maybe you are looking for

  • Memory Leak Issue for Adobe Access iOS API

    Hi, We are trying to develop an iOS app (with ARC enabled) using Adobe Acces API 4.0 and we have identified that the function [drmManager createDRMSession] has memory leak. DRMSESSION = [drmManager createDRMSession:METADATA playlist:PLAYLIST error:ni

  • Printing Guidance

    Hi all I'm a fairly new transfer into the world of vector graphics and have been given a print assignment with the following instructions. Any clarification on this would be very helpful, in terms of sizing my artboard down and what would be acceptab

  • Recommended servers that will run Solaris 8 - Where have they all gone?

    I've been struggling to install Solaris 8 HW02/02 on some Dell Poweredge kit (2GHz CPUs) with no success and even supermicro boxes. Does any one have know of any rack mount 1U / 2U servers that will install and Run. Must be 1-2 CPUs, lots or RAM, hav

  • Abap code  for infopak

    Hello All I am new to bw. I need to write a  code in the infopackage that should load the data from the previuos loading date to the current current date. pls help me on this. thanks -rajesh

  • Access to apple care

    I have apple care.  I am working overseas and when I type in my phone number it says it is not a valid number.  I can't find an email address.  How do I get support?