Store APEX_ITEM.RADIOGROUP value into the database!

Hi All,
I am using the following query to display questions from a table. Does anyone know how we can insert the value of APEX_ITEM.RADIOGROUP(if it is a radiogroup with static LOV ie. Static2: very poor;1,good;2,very good;3,excellent;4) into the database.
select question_id,
question_desc,
APEX_ITEM.RADIOGROUP(1) as rating
from table_name
Thanks,
Parveen Sehrawat

Also tried it this way:
function reviewerID() {
var reviewer =html_RadioValue('f01');
if (reviewer == 1){
html_GetElement('P1_CUSTOMER_ID').value = 1;
if (reviewer == 2){
html_GetElement('P1_CUSTOMER_ID').value = 2;
if (reviewer == 3){
html_GetElement('P1_CUSTOMER_ID').value = 3;
if (reviewer == 4){
html_GetElement('P1_CUSTOMER_ID').value = 4;
if (reviewer == 5){
html_GetElement('P1_CUSTOMER_ID').value = 5;
its clumbsy but i thought it would do the job... am still gettin the same error trying it this way though....
l_This has no properties
l_Selects = l_This.getElementsByTagName('SELECT');
Help from anyone much appreciated!!

Similar Messages

  • How to Save the multiple selection check box values into the database

    i have the multiple selection check box implemented in UI through drop down list,i can choose the desired values from the drop down through checkbox, but i m unable to store these values and commit the values into the database all at a time.

    You can access the values using listbinding and can then store them as a string by using a delimiter.

  • SQL Server 2012 Management Studio: Creating a Database and a dbo Table. Inserting VALUES into the table. How to insert 8 Values for future use in XQuery?

    Hi all,
    In my SQL Server 2012 Management Studio (SSMS2012), I tried to create a Database (MacLochainnsDB) and a dbo Table (marvel). then I wanted insert 8 VALUES into the Table by using the following code:
    USE master
    IF EXISTS
    (SELECT 1
    FROM sys.databases
    WHERE name = 'MacLochlainnsDB')
    DROP DATABASE MacLochlainnsDB
    GO
    CREATE DATABASE MacLochlainnsDB
    GO
    CREATE TABLE [dbo].[marvel] (
    [avenger_name] [char] (30) NULL)
    INSERT INTO marvel
    (avenger_name)
    VALUES
    ('Hulk', 1),
    ('Iron Man', 2),
    ('Black Widow', 3),
    ('Thor', 4),
    ('Captain America', 5),
    ('Hawkeye', 6),
    ('Winter Soldier', 7),
    ('Iron Patriot', 8)
    I got the following error Message:
    Msg 110, Level 15, State 1, Line 5
    There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.
    How can I correct this problem?
    Please kindly help and advise.
    Thanks in advance,
    Scott Chang
    P. S.
    The reason I tried to create the Database, dbo Table, and then to insert the VALUES is to learn the following thing:
    You can query the entire node tree with the following xquery statement because it looks for the occurrence of any node with the /* search string:
    DECLARE @x xml;
    SET @x = N'<marvel>
    <avenger_name>Captain America</avenger_name>
    </marvel>';
    SELECT @x.query('/*');
    You can query the avenger_name elements from the marvel_xml table with the following syntax:
    SELECT xml_table.query('/marvel/avenger_name')
    FROM marvel_xml;
    It returns the following set of avenger_name elements:
    <avenger_name>Hulk</avenger_name>
    <avenger_name>Iron Man</avenger_name>
    <avenger_name>Black Widow</avenger_name>
    <avenger_name>Thor</avenger_name>
    <avenger_name>Captain America</avenger_name>
    <avenger_name>Hawkeye</avenger_name>
    <avenger_name>Winter Soldier</avenger_name>
    <avenger_name>Iron Patriot</avenger_name>
    You can query the fourth avenger_name element from the marvel_xml table with the following xquery statement:
    SELECT xml_table.query('/marvel[4]/avenger_name')
    FROM marvel_xml;
    It returns the following avenger_name element:
    <avenger_name>Thor</avenger_name>

    Hi Scott,
    The master database records all the system-level information for a SQL Server system, so best practise would be not to create any user-defined
    object within it.
    To change your default database(master by default) of your login to another, follow the next steps so that next time when connected you don't have to use "USE dbname" to switch database.
    Open SQL Server Management Studio
    --> Go to Object explorer(the left panel by default layout)
    --> Extend "Security"
    --> Extend "Logins"
    --> Right click on your login, click "propertites"
    --> Choose the "Default database" at the bottom of the pop-up window.
    --or simply by T-SQL
    Exec sp_defaultdb @loginame='yourLogin', @defdb='youDB'
    Regarding your question, you can reference the below.
    SELECT * FROM master.sys.all_objects where name ='Marvel'
    --OR
    SELECT OBJECT_ID('master.dbo.Marvel') --if non empty result returns, the object exists
    --usually the OBJECT_ID is used if a if statement as below
    IF OBJECT_ID('master.dbo.Marvel') IS NOT NULL
    PRINT ('TABLE EXISTS') --Or some other logic
    What is the sys.all_objects? See
    here.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Capture Web Cam image in APEX and Upload into the Database

    Overview
    By using a flash object, you should be able to interface with a usb web cam connected to the client machine. Their are a couple of open source ones that I know about, but the one I chose to go with is by Taboca Labs and is called CamCanvas. This is released under the MIT license, and it is at version 0.2, so not very mature - but in saying that it seems to do the trick. The next part is to upload a snapshot into the database - in this particular implementation, it is achieved by taking a snapshot, and putting that data into the canvas object. This is a new HTML5 element, so I am not certain what the IE support would be like. Once you have the image into the canvas, you can then use the provided function convertToDataURL() to convert the image into a Base64 encoded string, which you can then use to convert into to a BLOB. There is however one problem with the Base64 string - APEX has a limitation of 32k for and item value, so can't be submitted by normal means, and a workaround (AJAX) has to be implemented.
    Part 1. Capturing the Image from the Flash Object into the Canvas element
    Set up the Page
    Required Files
    Download the tarball of the webcam library from: https://github.com/taboca/CamCanvas-API-/tarball/master
    Upload the necessary components to your application. (The flash swf file can be got from one of the samples in the Samples folder. In the root of the tarball, there is actually a swf file, but this seems to be a different file than of what is in the samples - so I just stick with the one from the samples)
    Page Body
    Create a HTML region, and add the following:
        <div class="container">
           <object  id="iembedflash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="240">
                <param name="movie" value="#APP_IMAGES#camcanvas.swf" />
                <param name="quality" value="high" />
              <param name="allowScriptAccess" value="always" />
                <embed  allowScriptAccess="always"  id="embedflash" src="#APP_IMAGES#camcanvas.swf" quality="high" width="320" height="240"
    type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" mayscript="true"  />
        </object>
        </div>
    <p><a href="javascript:captureToCanvas()">Capture</a></p>
    <canvas style="border:1px solid yellow"  id="canvas" width="320" height="240"></canvas>That will create the webcam container, and an empty canvas element for the captured image to go into.
    Also, have a hidden unprotected page item to store the Base64 code into - I called mine P2_IMAGE_BASE64
    HTML Header and Body Attribute
    Add the Page HTML Body Attribute as:
    onload="init(320,240)"
    JavaScript
    Add the following in the Function and Global Variable Declarations for the page (mostly taken out of the samples provided)
    //Camera relations functions
    var gCtx = null;
    var gCanvas = null;
    var imageData = null;
    var ii=0;
    var jj=0;
    var c=0;
    function init(ww,hh){
         gCanvas = document.getElementById("canvas");
         var w = ww;
         var h = hh;
         gCanvas.style.width = w + "px";
         gCanvas.style.height = h + "px";
         gCanvas.width = w;
         gCanvas.height = h;
         gCtx = gCanvas.getContext("2d");
         gCtx.clearRect(0, 0, w, h);
         imageData = gCtx.getImageData( 0,0,320,240);
    function passLine(stringPixels) {
         //a = (intVal >> 24) & 0xff;
         var coll = stringPixels.split("-");
         for(var i=0;i<320;i++) {
              var intVal = parseInt(coll);
              r = (intVal >> 16) & 0xff;
              g = (intVal >> 8) & 0xff;
              b = (intVal ) & 0xff;
              imageData.data[c+0]=r;
              imageData.data[c+1]=g;
              imageData.data[c+2]=b;
              imageData.data[c+3]=255;
              c+=4;
         if(c>=320*240*4) {
              c=0;
              gCtx.putImageData(imageData, 0,0);
    function captureToCanvas() {
         flash = document.getElementById("embedflash");
         flash.ccCapture();
         var canvEle = document.getElementById('canvas');
         $s('P2_IMAGE_BASE64', canvEle.toDataURL());//Assumes hidden item name is P2_IMAGE_BASE64
         clob_Submit();//this is a part of part (AJAX submit value to a collection) two
    }In the footer region of the page (which is just a loading image to show whilst the data is being submitted to the collection [hidden by default]) :<img src="#IMAGE_PREFIX#processing3.gif" id="AjaxLoading"
    style="display:none;position:absolute;left:45%;top:45%;padding:10px;border:2px solid black;background:#FFF;" />If you give it a quick test, you should be able to see the webcam feed and capture it into the canvas element by clicking the capture link, in between the two elements - it might through a JS error since the clob_Submit() function does not exist yet.
    *Part 2. Upload the image into the Database*
    As mentioned in the overview, the main limitation is that APEX can't submit values larger than 32k, which I hope the APEX development team will be fixing this limitation in a future release, the workaround isn't really good from a maintainability perspective.
    In the sample applications, there is one that demonstrates saving values to the database that are over 32k, which uses an AJAX technique: see http://www.oracle.com/technetwork/developer-tools/apex/application-express/packaged-apps-090453.html#LARGE.
    *Required Files*
    From the sample application, there is a script you need to upload, and reference in your page. So you can either install the sample application I linked to, or grab the script from the demonstration I have provided - its called apex_save_large.js.
    *Create a New Page*
    Create a page to Post the large value to (I created mine as 1000), and create the following process, with the condition that Request = SAVE. (All this is in the sample application for saving large values).declare
         l_code clob := empty_clob;
    begin
         dbms_lob.createtemporary( l_code, false, dbms_lob.SESSION );
         for i in 1..wwv_flow.g_f01.count loop
              dbms_lob.writeappend(l_code,length(wwv_flow.g_f01(i)),wwv_flow.g_f01(i));
         end loop;
         apex_collection.create_or_truncate_collection(p_collection_name => wc_pkg_globals.g_base64_collection);
         apex_collection.add_member(p_collection_name => wc_pkg_globals.g_base64_collection,p_clob001 => l_code);
         htmldb_application.g_unrecoverable_error := TRUE;
    end;I also created a package for storing the collection name, which is referred to in the process, for the collection name:create or replace
    package
    wc_pkg_globals
    as
    g_base64_collection constant varchar2(40) := 'BASE64_IMAGE';
    end wc_pkg_globals;That is all that needs to be done for page 1000. You don't use this for anything else, *so go back to edit the camera page*.
    *Modify the Function and Global Variable Declarations* (to be able to submit large values.)
    The below again assumes the item that you want to submit has an item name of 'P2_IMAGE_BASE64', the condition of the process on the POST page is request = SAVE, and the post page is page 1000. This has been taken srtaight from the sample application for saving large values.//32K Limit workaround functions
    function clob_Submit(){
              $x_Show('AjaxLoading')
              $a_PostClob('P2_IMAGE_BASE64','SAVE','1000',clob_SubmitReturn);
    function clob_SubmitReturn(){
              if(p.readyState == 4){
                             $x_Hide('AjaxLoading');
                             $x('P2_IMAGE_BASE64').value = '';
              }else{return false;}
    function doSubmit(r){
    $x('P2_IMAGE_BASE64').value = ''
         flowSelectAll();
         document.wwv_flow.p_request.value = r;
         document.wwv_flow.submit();
    }Also, reference the script that the above code makes use of, in the page header<script type="text/javascript" src="#WORKSPACE_IMAGES#apex_save_large.js"></script>Assuming the script is located in workspace images, and not associated to a specific app. Other wise reference #APP_IMAGES#
    *Set up the table to store the images*CREATE TABLE "WC_SNAPSHOT"
    "WC_SNAPSHOT_ID" NUMBER NOT NULL ENABLE,
    "BINARY" BLOB,
    CONSTRAINT "WC_SNAPSHOT_PK" PRIMARY KEY ("WC_SNAPSHOT_ID")
    create sequence seq_wc_snapshot start with 1 increment by 1;
    CREATE OR REPLACE TRIGGER "BI_WC_SNAPSHOT" BEFORE
    INSERT ON WC_SNAPSHOT FOR EACH ROW BEGIN
    SELECT seq_wc_snapshot.nextval INTO :NEW.wc_snapshot_id FROM dual;
    END;
    Then finally, create a page process to save the image:declare
    v_image_input CLOB;
    v_image_output BLOB;
    v_buffer NUMBER := 64;
    v_start_index NUMBER := 1;
    v_raw_temp raw(64);
    begin
    --discard the bit of the string we dont need
    select substr(clob001, instr(clob001, ',')+1, length(clob001)) into v_image_input
    from apex_collections
    where collection_name = wc_pkg_globals.g_base64_collection;
    dbms_lob.createtemporary(v_image_output, true);
    for i in 1..ceil(dbms_lob.getlength(v_image_input)/v_buffer) loop
    v_raw_temp := utl_encode.base64_decode(utl_raw.cast_to_raw(dbms_lob.substr(v_image_input, v_buffer, v_start_index)));
    dbms_lob.writeappend(v_image_output, utl_raw.length(v_raw_temp),v_raw_temp);
    v_start_index := v_start_index + v_buffer;
    end loop;
    insert into WC_SNAPSHOT (binary) values (v_image_output); commit;
    end;Create a save button - add some sort of validation to make sure the hidden item has a value (i.e. image has been captured). Make the above conditional for request = button name so it only runs when you click Save (you probably want to disable this button until the data has been completely submitted to the collection - I haven't done this in the demonstration).
    Voila, you should have now be able to capture the image from a webcam. Take a look at the samples from the CamCanvas API for extra effects if you wanted to do something special.
    And of course, all the above assumed you want a resolution of 320 x 240 for the image.
    Disclaimer: At time of writing, this worked with a logitech something or rather webcam, and is completely untested on IE.
    Check out a demo: http://apex.oracle.com/pls/apex/f?p=trents_demos:webcam_i (my image is a bit blocky, but i think its just my webcam. I've seen others that are much more crisp using this) Also, just be sure to wait for the progress bar to dissappear before clicking Save.
    Feedback welcomed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hmm, maybe for some reason you aren't getting the base64 version of the saved image? Is the collection getting the full base64 string? Seems like its not getting any if its no data found.
    The javascript console is your friend.
    Also, in the example i used an extra page, from what one of the examples on apex packages apps had. But since then, I found this post by Carl: http://carlback.blogspot.com/2008/04/new-stuff-4-over-head-with-clob.html - I would use this technique for submitting the clob, over what I have done - as its less hacky. Just sayin.

  • (inserting values into a database using a Checkbox) HELP!!!!!!!!!!!!!!!

    Can anyone help me out ???
    I am getting some trouble with using multiple check boxes to store the information in a database (MS ACESS)
    Each checkBox has multiple values in them.(3).
    1)Should they have similar names for each one?
    I am also getting an error saying cannot resolve symbol stating about pnumber,itemname,price
    Can you also tell me that if my query statements are correct??
    I want to insert into the database multiple values of each checkboxes which are checked.
    Thanks!!!!!!!
    <!---------------------------------------------html PART--------------------------------------------------------------------------------------->
         <form method="POST" action="http://localhost:8080/cvc/jsp/addCart.jsp">
              <table align = "center" border="2" width="50%">
              <TBODY>
    <%               
                   getProducts.next();
                   pnumber = getProducts.getInt(1); //this part works since I am seeing it displayed in a table
                   itemname = getProducts.getString(2);                         
                   price = getProducts.getFloat(3);
    %>               
                   <tr>               
                   <td><img align= "centre" border=0 src="http://localhost:8080/cvc/ASA Technologies\mp3.jpg" /></td><td><%=itemname%></td><td align="right"><%=price%></td>
                   <td align="center"><input type="checkbox" name="items" value="<%=pnumber+":"+itemname+":"+price+":"%>" </input></td> //????????????
    <!--------------------------------------JSP PART-------------------------------------------------------------------------------------------------------------------->
    <%@ page import="java.util.*, java.io.*, java.sql.*" %>
    <%
    String insert;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String sourceURL = new String("jdbc:odbc:ASA");
    Connection con = null;
    con = DriverManager.getConnection(sourceURL,"","");
    java.sql.Statement statement = con.createStatement();
    while ( request.getParameter("pnumber+itemname+price") !=null)
    insert = "insert into Cart VALUES( ' "+pnumber+" ' ," + " '"+itemname+ " ' ,"+ " ' "+price+ " ' )"; //getting the error here :cannot resolve symbols
    statement.executeUpdate(insert);
    %>

    Syntax of insert was wrong..
    while ( request.getParameter("pnumber+itemname+price") !=null)
    insert = "insert into Cart VALUES( ' "+pnumber+" ' ," + " '"+itemname+ " ' ,"+ " ' "+price+ " ' )"; //getting the error here :cannot resolve symbols
    statement.executeUpdate(insert);
    try this........
    Column1, Column2, Column3 are the field names of your table Cart....
    ..changed it to your original fieldnames...
    insert = "insert into Cart (Column1,Column2,Column3) VALUES( ' "+pnumber+" ' ," + " '"+itemname+ " ' ,"+ " ' "+price+ " ' )";

  • Storing an array into the database using jdbc

    Hi,
    i�ve got a problem storing an array into a database. I want to store objects consisting of several attributes. One of these attributes is an array containing several int values. I don�t know exactly what is the best way to store these objects into a database. I have created two tables connected by a one to many relationship of which one stores the array values and the other table stores the object containing the array. Is that ok or should I use another way. It�s the first time I�m trying to store objects containing arrays into a database so I�m very uncertain in which way this should be done.
    Thanks in advance for any tips

    1. You should use blob or longvarbianry type colum to stor that array.
    2. All object in that array should be Serializable.
    3. Constuct a PreparedStatement object
    4. Convert array to byte[] object
    ByteArrayOutputStream baos=null;
    ObjectOutputStream objectOutputStream=null;
    baos = new ByteArrayOutputStream(bufferSize);
    objectOutputStream = new ObjectOutputStream(baos);
    objectOutputStream.writeObject(array);
    objectOutputStream.flush();
    baos.flush();
    byte[] value=baos.toByteArray();
    5. Now you can use PreparedStatement.setBytes function to insert byte[] value.

  • Initial value and value in the database

    Hello world ,
    i want to add initial value with value in the database depend on the date
    for example i have initial value for 30/09/2009
    i and to all it with value in the database in 31/12/2009
    take a look what i did
    PROCEDURE pkd_prem IS
    cursor gr_pkd_prem is select
    SUM(DECODE(mark,'01',FM_mark,TM_mark) A,
    SUM(DECODE(FMS,'01',LS,NS) b
    from fr_treaty_profile ftp, fr_monthly_summary
    where
    (ftp.tpr_cgp_id = fr_monthly_summary.fms_cgp_id )
    AND (ftp.tpr_cmp_id = fr_monthly_summary.fms_cmp_id )
    AND (ftp.tpr_treaty_origin = fr_monthly_summary.fms_treaty_origin )
    AND (ftp.tpr_uw_year = fr_monthly_summary.fms_uw_year )
    AND (ftp.tpr_class = fr_monthly_summary.fms_class )
    AND (ftp.tpr_type = fr_monthly_summary.fms_type )
    AND (ftp.tpr_serial = fr_monthly_summary.fms_serial )
    AND
    (fr_monthly_summary.fms_treaty_origin=:BLK1.EO_ORIGIN) AND
    (fr_monthly_summary.fms_uw_year=:BLK1.EO_UW_YEAR) AND
    (fr_monthly_summary.fms_class=:BLK1.EO_CLASS) AND
    (fr_monthly_summary.fms_treaty_type=:BLK1.EO_TYPE) AND
    ( fr_monthly_summary.fms_treaty_serial=:BLK1.EO_SERIAL)
    AND (FMS_TYPE ='P')
    AND FMS_SERIAL = '01'
    AND (FMS_OFC_ID !='X')
    and (FMS_YEAR =substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),7,4))
    and (FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)) ;
    ---Initial value
    cursor base is select EO_GR_BKD_PREM from FR_EN
    where
    EO_TREATY_ORIGIN=:BLK1.EO_ORIGIN AND
    EO_UW_YEAR=:BLK1.EO_UW_YEAR AND
    EO_CLASS=:BLK1.EO_CLASS AND
    EO_TREATY_TYPE=:BLK1.EO_TYPE AND
    EO_TREATY_SERIAL=:BLK1.EO_SERIAL AND
    EO_YEAR=:BLK1.EO_YEAR;
    A number(18,3);
    B number(18,3);
    v_base number(18,3);
    BEGIN
    open base;
    open gr_pkd_prem;
    fetch gr_pkd_prem into a,b;
    fetch base into v_base;
    :BLK1.EO_GR_BKD_PREM :=nvl(a,0)+ nvl(b,0)+ nvl(v_base,0);
    close gr_pkd_prem;
    close base;
    END;
    the proceudre is correct and the values come as i want
    but here
    FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2))
    suppose i will add from 6 to 9
    the value will come down to add with base value
    but next time i want from 10 to 12
    it will add value 10 to 12 with the base for just period 10 to 12
    i want to keep adding
    if i start from 6 to 9
    then shoud be
    add the value of 6 to 9 to 10 to 12
    but

    look ..
    i created a form and let's say there is one field called Base ..
    and i inert value on that field and saved .
    then
    i created cursor to fetch value from another table
    that value which i fetched from another table must add to past value
    take this scenario
    i started with value 6
    then i fetch by cursor value from 1/1/2010 to 31/3/2010 and that value = 33
    first action
    6+33
    then
    i fecth by using cursor from 1/6/2010 to 30/9/2010 and that value = 2
    the result of first action must add with the last value which is 2
    (6+33) from first action plus(+) 2 and display the result on the secreen

  • Page level validation to prevent duplicate data entry into the database

    Hello,
    Can anyone please help me out with this issue.
    I have a form with two items based on a table. I already have an item level validation to check for null. Now I would like to create a page level validation to check that duplicate data are not entered into the database. I would like to check the database when the user clicks on ‘Create’ button to ensure they are not inserting duplicate record. If data already exist, then show the error message and redirect them to another page. I am using apex 3.2
    Thanks

    Hi,
    Have you tried writing a PLSQL function to check this?
    I haven't tested this specifically, but something like this should work:
    1) Create a Page Level Validation
    2) Choose PLSQL for the method
    3) Choose Function Returning Boolean for the Type
    For the validation code, you could do something like this:
    DECLARE
        v_cnt number;
    BEGIN
        select count(*)
        into v_cnt
        from
        your_table
        where
        col1 = :P1_field1 AND
        col2 = :P2_field2;
        if v_cnt > 0 then return false;
        else return true;
        end if;
    END;If the query returns false, then your error message will be displayed.
    Not sure how you would go about redirecting after this page though. Maybe just allow the user to try again with another value (in case they made a mistake) or just press a 'cancel' button to finish trying to create a new record.
    Amanda.

  • Error while inserting BLOB value in the database

    I am trying to insert a BLOB value in the database. This action results in the following exception:
    java.sql.SQLException: ORA-22925: operation would exceed maximum size allowed for a LOB value
    The method i am using is as follows:
    public void insertBlob(Connection Con, StringBuffer Message)throws SQLException
    String Query = "INSERT INTO MSGBLOCKS (MSGDB_ID, MSGBLOCKTYPE, MESSAGE) VALUES (20, 1 , ?)";
    PreparedStatement PS = Con.prepareStatement(Query);
    byte[] bytes = new String(Message).getBytes();
    ByteArrayInputStream bi = new ByteArrayInputStream(bytes);
    PS.setBinaryStream(1, bi, bytes.length);
    PS.executeUpdate();
    The manifest file of ojdbc14.jar being used is: 10.1.0.5.0 and I am using jdk 1.4.
    Also the message being tried to insert is of 9 Kb only.
    Any help would be greatly appreciated.
    Thanks!!!

    Did you check if the Message is having only that small 9kb of data? also check the maximum allowed size for that column in the Oracle DB, the size can be restricted to 8Kb also.
    Edited by: DynamicBasics on Jul 28, 2010 5:54 PM

  • Uploading spreadsheet data into the database

    Hi
    I want to upload the spreadsheet data into the database through front end...I dont have any idea how to do upload without using the 'utilities' option..Can anyone please help me to do this?
    Thanks in advance
    Fazila

    Hi
    I refered the example sent by vikas...but i could not understand..I dont need to specify table name in runtime...my requirement is that I will have the constant table(say MD look up table)...and I will have some data under the column heading( say repid,split name)...
    Now I want to import my spreadsheet data which are under the heading repid and split name through my front end application and I have the option whether to 'overwrite' the records or 'append' the new records...after clicking the necessary option..I want to import my spread sheet data into the table defined already...and my another requirement is that I want to check the duplication of data between the spreadsheet and table...If I find the duplicates, I have to omit it and store the remaing details....
    Please give me some guidelines to solve this problem....
    Thanks in advance
    Fazila

  • Should be able to enter both Japanese data and English data into the database without

    Scenario 1:
    Database Char Set: UTF 8
    National CharSet :UTF8
    String Type:Varchar2
    Problem :Unable to enter more than 1/3rd of the field length specified when entering Kanji(Japanese) Data
    Scenario 2:
    Database Char Set: JA16EUC/JA16SJIS
    National CharSet :JA16EUCFixed/JA16SJISFixed
    String Type:NVarchar2
    Problem :Unable to enter/retrieve English data written into the database but works fine with Japanese
    Scenario 3:
    Database Char Set: UTF8
    National CharSet :JA16EUCFixed
    String Type:NVarchar2
    Problem :Unable to enter/retrieve English data written into the database but works fine with Japanese
    null

    You will not be able to display the process form, or edit those values from the view profile screen.
    You would need to create custom fields that are mapped from the process form to the user's profile. Then you would need to create user form update triggers from the User Defined Fields that when the user changes them, they get pushed to the target process form by adding those task names into the provisioning process definition. This would then trigger the updates to the target resource.
    -Kevin

  • How to import an .csv file into the database?

    and can we code the program in JSP to import the.csv file into the database.

    It is better to use Java class to read the CSV file and store the contents in the database.
    You can use JSP to upload the CSV file to the server if you want, but don't use it to perform database operations.
    JSPs are good for displaying information on the front-end, and for displaying HTML forms, there are other technologies more suitable for the middle layer, back end and the database layer.
    So break you application into
    1) Front end - JSPs to display input html forms and to display data retrieved from the database.
    2) Middle layer - Servlets and JavaBeans to interact with JSPs. The code that reads the CSV file to parse it's contents should be a Java Class in the middle layer. It makes use of Java File I/O
    3) Database layer - Connects to the database using JDBC (Java Database Connectivity), and then writes to the database with SQL insert statements.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Keeping the above concepts in mind, first build a simple JSP and get it to work,
    then research on Google , for Java File I/O , discover how to read a file,
    Then search on how to readh a CSV file using Java.
    After researching you should be able to read the CSV file line by line and store each line inside a Collection.
    Then research on Google, on how to write to the database using JDBC
    Write a simple program that inserts something to a dummy table in the database.
    Then, read the data stored in the Collection, and write insert statements for each records in the collection.

  • Import CSV into the Database Tables

    Hello All,
    I have a requirement to import the CSV coloum values into the backend table.
    It would be great if anyone could help me out with the procedure in APEX.
    Looking for response.
    Regards,
    Sandeep Reddy

    hi,
    i have tried a similar kind of stuff..,
    check the link_Import data in excel to database table for the process and steps..,
    for more information you can check the forums; http://forums.oracle.com/forums/thread.jspa?threadID=2206363&start=0&tstart=0
    i hope you get your solution there.
    Regards,
    Little Foot

  • Placing null values in the database

    Hi
    I'm using a PreparedStatement object to try to input a null value in the database. I'm using the following code :
    pstmt = connection.prepareStatement("INSERT INTO Conditions (Deal,ConditionDate,Condition ) VALUES (?,?,?)");
    pstmt.setString(1,"aDealName");
    pstmt.setNull(2,Types.TIMESTAMP);
    pstmt.setString(3,"aCondition");
    pstmt.executeUpdate();
    and I get the "SQL Data type out of range" error message.
    Does anyone know what might be the problem?
    Thanks for any help
    LGS

    Hi
    Sorry for the lack of info.
    I am using Microsoft Access 2000, the JDBC-ODBC driver v.4.00.6019
    and my TableModel class is as follows:
    public class MyTableModel2 extends AbstractTableModel
    private Connection conn;
    private Vector rows,columnHeads,firstColumn,columnTypes,columnWidths;
    private Validation validate;
    private String query;
    private int numColumns;
    String tableType;
    String [] columnNamesFrontPage = {"Deal","Spread","Next Event Date","Closing Date"};
    String [] columnNamesCommentsPage  = {"Date","Input By","Spread","Comment"};
    String [] columnNamesTimetable = {"Date","Event"};
    String [] columnNamesConditionsTable = {"Date","Condition"};
    private DBase2 db2;
    private String tableName,primKeyColName;
    public MyTableModel2 ()
    {} //Empty Constructor
    public MyTableModel2 ( Connection dbConn,String aQuery,String table)
      conn = dbConn;
      rows = new Vector();
      columnHeads = new Vector();
      query = aQuery;
      tableType = table;
      firstColumn = new Vector();
      db2 = new DBase2 (dbConn);
      columnTypes = new Vector();
      columnWidths = new Vector();
      validate = new Validation();
    }//End of Constructor
    public int getColumnCount ()
      return columnHeads.size();
    }//End of Method
    public int getRowCount ()
      return rows.size();
    }//End of Method
    public Object getValueAt(int aRow, int aColumn)
      Vector row = (Vector)rows.elementAt(aRow);
      return row.elementAt(aColumn);
    }//End of Method
    public String getColumnName (int column)
      String columnName = "";
      if(tableType == null)
       columnName = columnHeads.get(column).toString();
      else if (tableType == "FrontPage")
       columnName = columnNamesFrontPage [column];
      else if (tableType == "CommentsPage")
       columnName = columnNamesCommentsPage [column];
      else if (tableType == "Timetable")
       columnName = columnNamesTimetable [column];
      else if (tableType == "ConditionsTable")
       columnName = columnNamesConditionsTable [column];
      return columnName;
    }//End of Method
    public void query() 
      try {
       Statement statement = conn.createStatement();
       ResultSet rs = statement.executeQuery(query);
       ResultSetMetaData rsmd = rs.getMetaData();
       tableName = rsmd.getTableName(1);
       Integer i2;
       boolean moreRecords = rs.next();
       for (int i = 1; i <= rsmd.getColumnCount(); ++i)
         if (i == 1)
          primKeyColName = rsmd.getColumnName(i);
         else
          columnHeads.addElement(rsmd.getColumnName(i));
          if (rsmd.getColumnTypeName(i).equals("DATETIME"))
           i2 = new Integer (8);
          else
           int i1 = rsmd.getColumnDisplaySize(i);
           i2 = new Integer (i1);
          columnWidths.add(i2);
          String colTypeName = rsmd.getColumnTypeName(i);
          columnTypes.addElement(colTypeName);
          //JOptionPane.showMessageDialog(null,"Column Width="+i2,"Column Types  ",JOptionPane.INFORMATION_MESSAGE);
       do {
          rows.addElement( getNextRow (rs,rsmd));
       while (rs.next() );
      catch ( SQLException sqlex )
        sqlex.printStackTrace();
      }//End of Method
    private Vector getNextRow( ResultSet rs, ResultSetMetaData rsmd )
           throws SQLException
        Vector currentRow = new Vector();
         for ( int i = 1; i <= rsmd.getColumnCount(); ++i )
           Object o = rs.getObject(i);
           if (o == null)
             String emptyCell = "";
             currentRow.addElement(emptyCell);
           else if(o.getClass().toString().equalsIgnoreCase("class java.sql.Timestamp") )
             SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
             String formatted = sdf.format(o);
             currentRow.addElement(formatted);
           else
             if (i == 1)
              firstColumn.addElement(o);
             else
             currentRow.addElement(o);
          return currentRow;
        }//End of Method
    public void refresh ()
      rows.clear();
      firstColumn.clear();
      try {
       Statement statement = conn.createStatement();
       ResultSet rs = statement.executeQuery(query);
       ResultSetMetaData rsmd = rs.getMetaData();
       boolean moreRecords = rs.next();
       do {
          rows.addElement( getNextRow (rs,rsmd));
       while (rs.next() );
      catch ( SQLException sqlex )
        sqlex.printStackTrace();
      this.fireTableDataChanged();
    }//End of Method
    public boolean isCellEditable (int row, int col)
      return true;
    }//End of Class
    public void setValueAt(Object value, int row, int col)
       String objToString = value.toString();
       int columnWidth = Integer.parseInt(columnWidths.elementAt(col).toString());
       if(objToString.length() > columnWidth)
        validate.errorMessageDisplay("Maximum column width is "+columnWidth+" characters - Please retype","INPUT ERROR");
       else if (columnTypes.elementAt(col).toString().equals("DATETIME") && validate.validDateInput(objToString) == false)
        validate.errorMessageDisplay("Date is required in form dd/mm/yy - Please retype","INPUT ERROR");
       else if (columnTypes.elementAt(col).toString().equals("DOUBLE") && validate.validNumberInput(objToString) == false)
        validate.errorMessageDisplay("This column will accept numbers only - Please retype","INPUT ERROR");
       else
       //JOptionPane.showMessageDialog(null,columnTypes.elementAt(col).toString(),"Column Name  ",JOptionPane.INFORMATION_MESSAGE);
       Vector rowA = (Vector)rows.elementAt(row);
       rowA.setElementAt(value,col);
       fireTableCellUpdated(row, col);
       String newInput = value.toString();
       int id = Integer.parseInt(firstColumn.elementAt(row).toString());
       String colName = columnHeads.elementAt(col).toString();
       String query = "UPDATE "+tableName+" SET "+colName+" = '"+newInput+"' WHERE "+primKeyColName+" = "+id+"";
       db2.modifyDatabase(query);
       refresh();
      }//End of Method The method in which I am using PreparedStatement is:
    public void updateConditionsTable (String aDealName, String aCondition) 
       int result = 0;
       try
        pstmt = connection.prepareStatement("INSERT INTO Conditions (Deal,ConditionDate,Condition )"+
        " VALUES (?,?,?)");
       // pstmt = connection.prepareStatement("INSERT INTO Conditions (Deal,ConditionDate,Condition )"+
       // " VALUES (?,?,?)");
        pstmt.setString(1,aDealName);
        pstmt.setNull(2,Types.INTEGER);
        pstmt.setString(3,aCondition);
        pstmt.executeUpdate();
       catch (SQLException sqlex ) {
         //sqlex.printStackTrace();
         String output = "YOUR INPUT IS NOT VALID - PLEASE TRY AGAIN\n";
         output = output + sqlex.toString();
         JOptionPane.showMessageDialog(null,output,"SQL Error",JOptionPane.INFORMATION_MESSAGE);
        //return result;
       }//Closes Method Once again, thanks for any help

  • Insert multiple rows of records into the database

    The codes below allow me to insert a row of record into the database. How would I changed these to insert multiple rows at once? Please help!
    String sql = "INSERT INTO EMPLOYEES" +
    "(First_Name, Last_Name, Title, Phone) " +
    " VALUES " +
    PreparedStatement statement = conn.prepareStatement(sql);
    statement.setObject (1, First_Name);
    statement.setObject (2, Last_Name);
    statement.setObject (3, Title);
    statement.setObject (4, Phone);
    boolean returnValue = statement.execute();

    Hi mystiqueX,
    As wmolosho has suggested in his answer to this very same question that you also posted to the JavaServer Pages forum, you can create a batch of inserts and perform them using the "executeBatch()" method. I will use Craig's sample code to demonstrate:
    (Note that this code is untested!)
    conn.setAutoCommit(false);
    PreparedStatement statement = conn.prepareStatement(sql);
    // assume you have an array of objects here
    for (int i = 0; i < data.length; i++) {
      statement.setString(1, data<i>.getFirstName());
      statement.setString(2, data<i>.getLastName());
      statement.setString(3, data<i>.getTitle());
      statement.setString(4, data<i>.getPhone());
      statement.addBatch();
    statement.executeBatch();
    conn.commit();If you are not familiar with it, allow me to suggest looking at the Making Batch Updates lesson on the Java Tutorial.
    Hope it helps.
    Good Luck,
    Avi.

Maybe you are looking for

  • How can i call a method from the a subdirectory using packages

    This is my directory structure: java --p1 --One.java --p2 --Two.java package java.p1; import p2.Two; public class One      public static void main(String args[])           Two obj = new Two();           obj.p(); package java.p2; public class Two     

  • Saving After Effects CS 6 projects for use in CS 5.5

    Hello all, I'm a university student who has the academic version of After Effects CS 6 for use in my media classes. It works wonderfully and has the potential to be a real time-saver... I live off-campus and can't always get to the lab to work on my

  • I Cant find Sql Server 2014 express edition after installing it. How do I start the program

    Hello,            I have Installed Sql Server 2014 Express edition and downloaded the AdventureWorks 2014 database and Back up files. I cannot find an Icon for the Sql Server on my Desktop to start the Sql program. There is only an icon for the Serve

  • Finding recent file

    In CS3, I created an image about 10 days ago and can't find it. File>Open Recent lists only the seven most recent files. In File Handling of Photoshop Preferences I changed the "Recent file list contains: __ files" to 30. Open Recent still only lists

  • HT4637 Hi, does it support Arabic language; text and numerals?

    I have just purchased a macbook pro, first time to switch from a PC. I am really impressed wirh the overall experience of my new powerhouse with one MAJOR drawback; the Arabic Text and numeral support within the microsoft office package of applicatIo