Check For Insert

Hi Friends,
I've created a Sql report with checkbox based on a view, I want to insert records into another table when i check the checkbox.
Am Using Apex 4.1 on Oracle 10g.
This is my query
SELECT
APEX_ITEM.CHECKBOX(1,REQUEST_ID,'UNCHECKED') "CHECK_THIS",
REQUEST_ID,
REQUEST_TYPE_NAME,
REQUEST_NUMBER,
REQUEST_CLASS_NAME,
REQUEST_STATUS_NAME,
REQUEST_DATE
FROM REQ_DET_VBrgds,
Max

Hi Max,
>
Thanks for reply what i want insert process will be done automatically when i chech the check box (No Button Press).
>
This implies you will have to use JavaScript. I am assume you know how handle the OnSubmit processing.
The simpler option is to initiate a Submit on the OnChange event of the checkbox only when it is checked . You can do the following:
SELECT
APEX_ITEM.CHECKBOX2(1,REQUEST_ID,'onchange="doInsert(this);" ','UNCHECKED',null,'f01_#ROWNUM#') "CHECK_THIS",
/* f01 because your first parameter is 1, f01_#ROWNUM# will assign a unique id to these elements */
REQUEST_ID,
REQUEST_TYPE_NAME,
....Declare the doInsert function in your HTML Header as follows
<script type="text/javascript">
function doInsert(pThis) {
  if (pThis.checked =  true) {
    apex.submit('INSERT'); //INSERT is the Request, change as required
</script>The this keyword is explained here.
What can be done with POJS (Plain Old JavaScript) can be done with DA as well. In this case I believe it will be easier with POJS.
Regards,

Similar Messages

  • Check for duplicate record in SQL database before doing INSERT

    Hey guys,
           This is part powershell app doing a SQL insert. BUt my question really relates to the SQL insert. I need to do a check of the database PRIOR to doing the insert to check for duplicate records and if it exists then that record needs
    to be overwritten. I'm not sure how to accomplish this task. My back end is a SQL 2000 Server. I'm piping the data into my insert statement from a powershell FileSystemWatcher app. In my scenario here if the file dumped into a directory starts with I it gets
    written to a SQL database otherwise it gets written to an Access Table. I know silly, but thats the environment im in. haha.
    Any help is appreciated.
    Thanks in Advance
    Rich T.
    #### DEFINE WATCH FOLDERS AND DEFAULT FILE EXTENSION TO WATCH FOR ####
                $cofa_folder = '\\cpsfs001\Data_pvs\TestCofA'
                $bulk_folder = '\\cpsfs001\PVS\Subsidiary\Nolwood\McWood\POD'
                $filter = '*.tif'
                $cofa = New-Object IO.FileSystemWatcher $cofa_folder, $filter -Property @{ IncludeSubdirectories = $false; EnableRaisingEvents= $true; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' }
                $bulk = New-Object IO.FileSystemWatcher $bulk_folder, $filter -Property @{ IncludeSubdirectories = $false; EnableRaisingEvents= $true; NotifyFilter = [IO.NotifyFilters]'FileName, LastWrite' }
    #### CERTIFICATE OF ANALYSIS AND PACKAGE SHIPPER PROCESSING ####
                Register-ObjectEvent $cofa Created -SourceIdentifier COFA/PACKAGE -Action {
           $name = $Event.SourceEventArgs.Name
           $changeType = $Event.SourceEventArgs.ChangeType
           $timeStamp = $Event.TimeGenerated
    #### CERTIFICATE OF ANALYSIS PROCESS BEGINS ####
                $test=$name.StartsWith("I")
         if ($test -eq $true) {
                $pos = $name.IndexOf(".")
           $left=$name.substring(0,$pos)
           $pos = $left.IndexOf("L")
           $tempItem=$left.substring(0,$pos)
           $lot = $left.Substring($pos + 1)
           $item=$tempItem.Substring(1)
                Write-Host "in_item_key $item in_lot_key $lot imgfilename $name in_cofa_crtdt $timestamp"  -fore green
                Out-File -FilePath c:\OutputLogs\CofA.csv -Append -InputObject "in_item_key $item in_lot_key $lot imgfilename $name in_cofa_crtdt $timestamp"
                start-sleep -s 5
                $conn = New-Object System.Data.SqlClient.SqlConnection("Data Source=PVSNTDB33; Initial Catalog=adagecopy_daily; Integrated Security=TRUE")
                $conn.Open()
                $insert_stmt = "INSERT INTO in_cofa_pvs (in_item_key, in_lot_key, imgfileName, in_cofa_crtdt) VALUES ('$item','$lot','$name','$timestamp')"
                $cmd = $conn.CreateCommand()
                $cmd.CommandText = $insert_stmt
                $cmd.ExecuteNonQuery()
                $conn.Close()
    #### PACKAGE SHIPPER PROCESS BEGINS ####
              elseif ($test -eq $false) {
                $pos = $name.IndexOf(".")
           $left=$name.substring(0,$pos)
           $pos = $left.IndexOf("O")
           $tempItem=$left.substring(0,$pos)
           $order = $left.Substring($pos + 1)
           $shipid=$tempItem.Substring(1)
                Write-Host "so_hdr_key $order so_ship_key $shipid imgfilename $name in_cofa_crtdt $timestamp"  -fore green
                Out-File -FilePath c:\OutputLogs\PackageShipper.csv -Append -InputObject "so_hdr_key $order so_ship_key $shipid imgfilename $name in_cofa_crtdt $timestamp"
    Rich Thompson

    Hi
    Since SQL Server 2000 has been out of support, I recommend you to upgrade the SQL Server 2000 to a higher version, such as SQL Server 2005 or SQL Server 2008.
    According to your description, you can try the following methods to check duplicate record in SQL Server.
    1. You can use
    RAISERROR to check the duplicate record, if exists then RAISERROR unless insert accordingly, code block is given below:
    IF EXISTS (SELECT 1 FROM TableName AS t
    WHERE t.Column1 = @ Column1
    AND t.Column2 = @ Column2)
    BEGIN
    RAISERROR(‘Duplicate records’,18,1)
    END
    ELSE
    BEGIN
    INSERT INTO TableName (Column1, Column2, Column3)
    SELECT @ Column1, @ Column2, @ Column3
    END
    2. Also you can create UNIQUE INDEX or UNIQUE CONSTRAINT on the column of a table, when you try to INSERT a value that conflicts with the INDEX/CONSTRAINT, an exception will be thrown. 
    Add the unique index:
    CREATE UNIQUE INDEX Unique_Index_name ON TableName(ColumnName)
    Add the unique constraint:
    ALTER TABLE TableName
    ADD CONSTRAINT Unique_Contraint_Name
    UNIQUE (ColumnName)
    Thanks
    Lydia Zhang

  • Checking for duplicate primary keys on row inserts

    Checking for duplicate primary keys on row inserts
    I have a situation where I will be making bulk table inserts knowing that the primary key value will in some cases already exist. In this is the case I simply want to ignore the duplicate inserts.
    Should I be performing a sub-query on the table and using a statement like:
    where not exist in
    Or is there a cleaner way of discarding or checking for duplicates on insert.
    My concerns were mainly one of performance, as my routine will be inserting a few thousand rows in its operation.

    The MERGE commnad is a good option when a large percentage of the data will exist in the target because it is much more efficient to attempt to update then insert when the update affects zero rows than capture an error and convert it to an update.
    However, since in this case it would appear that only a few rows will alreadys exist and we want to ignore the duplicates when they exist then
    begin
    insert
    exception
    when dup_value_in_index then null;
    end
    would be the way to code this one. The bulk insert version has in 9.2 the ability to store the errors so that they can all be handled at once which means the rest of the array insert can work.
    HTH -- Mark D Powell --

  • Check for required fields before locking subforms and submitting

    Hello,
    I have a 5-page form with many questions, to be completed by the original requestor and multiple approvers.  What I'm trying to do is have the original requestor's Submit button on p. 3 lock the input on the first three pages, but first check if all those fields have some content.  I currently have all the fields on pp. 1-3 set to "Required" in the object properties, but my script still locks them when there's is one empty one.  Here's what I have:
    //Lock portions of form
    Page1.access = "readOnly"
    Page2.access = "readOnly"
    Page3.access = "readOnly"
    //Save document, allow user to change name
    app.execMenuItem("SaveAs");
    //Submit via e-mail
    Submit_REAL.event__click.submit.target = "mailto:[email protected]" +
    "?subject=Subject text" +
    "&body=Message";
    Submit_REAL.execEvent("click");
    The automatic check for required fields happens after the pages get locked.  I would like the check to stop the process before it locks the pages.  Is there any way to check all at once that all "Required" fields on those pages have some content before allowing the script to proceed?  I know how to script it to manually check the 50 or so questions on those pages, but I would like to avoid that.  Thanks for any help.

    There are a few problems that I can see from the start. First, your code is going to pick up EVERY node that exists on these pages. Some of those nodes will not have a rawValue, and some will not have an actual name. As an example, you can take your code and create a text field to dump all of the names of the nodes that you get when you pull in all of the nodes this way. Here's an example:
    The result:
    Now, the question is, do you have a consistent naming convention for your fields that might be empty? That could be text fields, radio button lists, etc. For instance, I always prefix the names of objects in order to more easily keep track of what they are in scripts. Since I'm doing that, I can check the name of the field for tf, nf, rbl, cb, or whatever I have included to make sure that I'm checking an actual field before I check for things like rawValue.
    var nodeName = oNodes.item(nNodeCount).name;
    if (nodeName.indexOf("tf")>-1 || nodeName.indexOf("rbl") > -1 || /*check other field types*/) {
      //insert your code to check for empty answers here
    As for your line 7 issue. The syntax problem is that you've put extra parentheses in your if statement. Take out the parentheses that are just before and after the or "||".
    *This is my fourth attempt to reply. Something was going on with Adobe/Jive earlier, I suppose.

  • How can I check for spyware on my Intel based mid-2007 iMac running Lion?

    I recently received a message stating that my Intel based iMac desktop may contain spyware plus a friend sent me a copy of an email to my iCloud email address that i did not send to him, i was not even home using my iMac on that date. I do have anti-virus software on my iMac from Integra and I do a scan each day before i shutdown the iMac and have not received any such warnings from that software.
    I do appreciate any and all advise I can receive in this matter. A long time ago I did receive an email a Yahoo based email address and was notified that I could possibly loose my email account due to junk email being sent from my iMac. I did have the support/warranty from Apple at that time and a phone rep did talk me through steps to check for any intrusion to my iMac with negative results, the iMac was clear of any spyware, etc.
    Hoping there is the same for this issue.

    You can't use a specific Mac OS X disc for a Mac with a different computer. First, call Apple and buy Mac OS X Snow Leopard > http://support.apple.com/kb/HE57 Then, make a backup, insert the DVD and upgrade OS X. Finally, open  > Software Update and install the most recent version

  • Error while checking for update

    Lately, when I sync my iPad to iTunes on my mac, when I click on "Check for Updates" I get the following error message...
    "iTunes could not check for an update to the carrier settings for your iPad. An unknown error occurred (1631).
    Make sure your network settings are correct and your network connection is active, or try again"...
    The network is fine, both on the mac and the iPad... And the phrase "...could not check for an update to the carrier settings" doesn't even seem to make sense???? It used to work but this just started recently and now the error pops up every time I try... My iPad is WiFi + 3G but I've never activated the 3G coverage...
    Any thoughts??? thanks... bob..

    I hadn't seen that error either until just recently... I found this post,
    http://discussions.apple.com/message.jspa?messageID=12635600
    where folks with the same problem have appeared to have found an answer...
    All I did was toggled my Cellular Data switch from OFF (where it always was before) to ON for a few seconds... That is not to say I signed up for AT&T service... I just toggled the Cellular Data switch but I was still running in WiFi mode as always...
    And it worked... Message gone... Other folks on that same post talk about inserting non-active SIM cards into their iPads to clear the error??? Don't know about that but the Cellular Data from default OFF, to ON and then back to OFF has, for the moment anyway, cleared the message for me...
    bob...

  • Carriage return in textarea - how do I check for and remove it???

    I have an html form that has a <textarea> element for user input. I work mainly with Java and some JavaScript. Since carriage returns are permitted in a <textarea> element, upon retrieving the value submitted, my Java and/or JavaScript variables contain carriage returns as well, making the values incomplete.
    For Example :
    String dataSubmitted = request.getParameter("formInput");
    <script language="JavaScript">
    var textValue = "<%=dataSubmitted%>";
    ....//do other stuff
    </script>When I view the source of my JSP page, the above statement of code looks like this:
    var textValue = "This is some text that
    I submitted with a carriage return";I'm putting the text submitted through this form into a mysql database, and when I pull up the values I find that it has recorded the carriage return as well. There is an actual symbol representing a carriage return in the db field.
    What I'd like to do is use some Java code to go through each character of the String and find and remove the carriage return, perhaps replacing it with an empty space instead. But how do I check for a carriage return in a String variable?
    Also, is there a way to use JavaScript to alert the user when the carriage return button is pressed when they're in the <textarea>?
    Any input is appreciated,
    Thank You,
    -Love2Java

    What I'd like to do is use some Java code to go through
    each character of the String and find and remove the
    carriage return, perhaps replacing it with an empty
    space instead. But how do I check for a carriage return
    in a String variable?The carriage return is represented by the \r. Generally there is also a newline, the \n. You can use String#replaceAll() to replace occurences of them by a space.
    string = string.replaceAll("\r\n", " ");
    Also, is there a way to use JavaScript to alert the user
    when the carriage return button is pressed when they're
    in the <textarea>?You can capture keys using the 'onkeypress' attribute. The keyCode of a the return key is 13. So simply catch that:<textarea onkeypress="if (event.keyCode == 13) alert('You pressed the return button.'); return false;"></textarea>The return false prohibits the linebreak being inserted. If you remove that, then it will be inserted anyway.

  • Local streams for Insert Opertaion not working

    Hi
    I am configuring the stream for change data capture from one schema to another.
    For example i want to move the changed from Hr.emplyee table to apps.emp_del table.
    I am using the below scripts for configuration.
    BEGIN
    DBMS_STREAMS_ADM.SET_UP_QUEUE(
    queue_table => 'apps.streams_queue_table',
    queue_name => 'apps.streams_queue');
    END;
    BEGIN
    DBMS_STREAMS_ADM.ADD_TABLE_RULES(
    table_name => 'hr.employees',
    streams_type => 'capture',
    streams_name => 'capture_emp',
    queue_name => 'apps.streams_queue',
    include_dml => true,
    include_ddl => false,
    inclusion_rule => true);
    END;
    DECLARE
    iscn NUMBER; -- Variable to hold instantiation SCN value
    BEGIN
    iscn := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER();
    DBMS_APPLY_ADM.SET_TABLE_INSTANTIATION_SCN(
    source_object_name => 'hr.employees',
    source_database_name => 'orcl',
    instantiation_scn => iscn);
    END;
    CREATE OR REPLACE PROCEDURE emp_dml_handler(in_any IN ANYDATA) IS
    lcr SYS.LCR$_ROW_RECORD;
    rc PLS_INTEGER;
    command VARCHAR2(30);
    old_values SYS.LCR$_ROW_LIST;
    BEGIN
    -- Access the LCR
    rc := in_any.GETOBJECT(lcr);
    -- Get the object command type
    command := lcr.GET_COMMAND_TYPE();
    -- Check for DELETE command on the hr.employees table
    INSERT INTO ATESTA values('HELLO'||COMMAND);
    IF COMMAND='INSERT' THEN
    lcr.SET_COMMAND_TYPE('INSERT');
    lcr.SET_OBJECT_NAME('HR.EMPLOYEE_DUP');
    lcr.EXECUTE(true);
    END IF;
    IF command = 'DELETE' THEN
    -- Set the command_type in the row LCR to INSERT
    lcr.SET_COMMAND_TYPE('INSERT');
    -- Set the object_name in the row LCR to EMP_DEL
    lcr.SET_OBJECT_NAME('APPS.EMP_DEL');
    -- Get the old values in the row LCR
    old_values := lcr.GET_VALUES('old');
    -- Set the old values in the row LCR to the new values in the row LCR
    lcr.SET_VALUES('new', old_values);
    -- Set the old values in the row LCR to NULL
    lcr.SET_VALUES('old', NULL);
    -- Add a SYSDATE value for the timestamp column
    --lcr.ADD_COLUMN('new', 'TIMESTAMP', ANYDATA.ConvertDate(SYSDATE));
    -- Apply the row LCR as an INSERT into the hr.emp_del table
    lcr.EXECUTE(true);
    END IF;
    commit;
    exception
    when others then
    command:=sqlerrm;
    insert into atesta values(command);
    END;
    BEGIN
    DBMS_APPLY_ADM.SET_DML_HANDLER(
    object_name => 'hr.employees',
    object_type => 'TABLE',
    operation_name => 'INSERT',
    error_handler => false,
    user_procedure => 'apps.emp_dml_handler',
    apply_database_link => NULL,
    apply_name => NULL);
    END;
    BEGIN
    DBMS_APPLY_ADM.SET_DML_HANDLER(
    object_name => 'hr.employees',
    object_type => 'TABLE',
    operation_name => 'UPDATE',
    error_handler => false,
    user_procedure => 'apps.emp_dml_handler',
    apply_database_link => NULL,
    apply_name => NULL);
    END;
    BEGIN
    DBMS_APPLY_ADM.SET_DML_HANDLER(
    object_name => 'hr.employees',
    object_type => 'TABLE',
    operation_name => 'DELETE',
    error_handler => false,
    user_procedure => 'apps.emp_dml_handler',
    apply_database_link => NULL,
    apply_name => NULL);
    END;
    BEGIN
    DBMS_STREAMS_ADM.ADD_TABLE_RULES(
    table_name => 'hr.employees',
    streams_type => 'dequeue',
    streams_name => 'hr',
    queue_name => 'apps.streams_queue',
    include_dml => true,
    include_ddl => false,
    inclusion_rule => true);
    END;
    DECLARE
    emp_rule_name_dml VARCHAR2(30);
    emp_rule_name_ddl VARCHAR2(30);
    BEGIN
    DBMS_STREAMS_ADM.ADD_TABLE_RULES(
    table_name => 'hr.employees',
    streams_type => 'apply',
    streams_name => 'apply_emp',
    queue_name => 'apps.streams_queue',
    include_dml => true,
    include_ddl => false,
    source_database => 'orcl',
    dml_rule_name => emp_rule_name_dml,
    ddl_rule_name => emp_rule_name_ddl);
    DBMS_APPLY_ADM.SET_ENQUEUE_DESTINATION(
    rule_name => emp_rule_name_dml,
    destination_queue_name => 'apps.streams_queue');
    END;
    BEGIN
    DBMS_APPLY_ADM.SET_PARAMETER(
    apply_name => 'apply_emp',
    parameter => 'disable_on_error',
    value => 'n');
    END;
    BEGIN
    DBMS_APPLY_ADM.START_APPLY(
    apply_name => 'apply_emp');
    END;
    BEGIN
    DBMS_CAPTURE_ADM.START_CAPTURE(
    capture_name => 'capture_emp');
    END;
    if you observe i am using the DML handler emp_dml_handler procedure which is being called correctly for update and Delete on hr.employees table when i do insert on Hr.employess table there is no call to dml handler.
    Not sure if i am missing some step or something is wrong with scripts.
    Please help to resolve the issue.

    Hi,
    In this case you wouldn't need to create rules on the apply side, just create the apply with DBMS_APPLY_ADM.CREATE_APPLY. It will perform better if it has no rule sets.
    Also, there is no need to call SET_ENQUEUE_DESTINATION for your case, this is only when you want the apply to reenqueue the received LCR to another queue, as a user-enqueued LCR, when the received LCR matches the specified rule.
    Ilidio.

  • Duplicate record check before inserting records

    Hi All
    I want to show an user friendly message instead of (oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key). So in my EO i have written the following code:
    OADBTransaction transaction = getOADBTransaction();
    Object[] empNumberKey = {value};
    EntityDefImpl empDefinition =
    XXXXempEOImpl.getDefinitionObject();
    XXXXempEOImpl empNo=
    (XXXXempEOImpl)empDefinition.findByPrimaryKey(transaction,
    new Key(empNumberKey));
    if (empNo != null) {
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(),
    getPrimaryKey(), "CompanyNumber",
    value, "AK",
    "FWK_TBX_T_EMP_ID_UNIQUE");
    setAttributeInternal(COMPANYNUMBER, value);
    My observation is when duplicate empNumber is passed as '0011' then the error message is not thrown.But if i pass duplicate empNumber like '5411' error is thrown. So does it mean new Key(empNumberKey)) chops off leading 0's. Please note that in database the values are stored as '0011'. Pleasre advice. The validation fails only when value is having leading 0's.

    You need to create a select command before Insert and check for the result returned after executing ExecuteScalar, this will return the records count to decide whether to insert or not,
    Check the below example:
    http://stackoverflow.com/questions/15320544/how-to-check-if-record-exists-if-not-insert-using-vb-net
    Fouad Roumieh

  • Checking and inserting in one query

    Hi,
    I want to check for the existance of a record in a table. If the record is not present then I would like to insert the data.
    I have written a query for this but it is giving me error as ORA-01427: single-row subquery returns more than one row which is true.
    Please help me to rewrite this query. I do not want any procedures etc to apply. Just one query.
    insert into mif_type_temp (FLD_TYPE, FLD_VALUE) values ('SIN', (select b.empname from
    *(select empname from testing tes where not exists*
    *(select 1 from mif_type_temp where tes.empname = FLD_VALUE))b))*
    Thanks

    The VALUES clause can only accept scalar values. Maybe you could try something like this?
    INSERT INTO mif_type_temp
    ( fld_type
    , fld_value
    SELECT 'SIN'
         , empname
    FROM   testing test
    WHERE NOT EXISTS (
                       SELECT 1
                       FROM   mif_type_temp mtt
                       WHERE  test.empname = mtt.fld_value
    ;

  • Row Level Security for INSERT's

    Hello there,
    I implemented security-policies for the actions SELECT, UPDATE, DELETE and INSERT. All policies work well with exemption to the INSERT-policy. My question is:
    How does the dynamic predicate work for INSERT-actions?
    As far as I learned, a command like "SELECT ... FROM ..." is extended by a "WHERE " + predicate (from policy). But does this work with INSERT? I mean does something like "INSERT INTO Testtable VALUES(....)" + "WHERE " + predicate work? Am I constructing my predicate wrong or does RLS not work in this case?
    Regards
    Philipp Pott

    Ok, I found the answer myself:
    for INSERT's and UPDATE's the "update_check"-option of the DBMS_RLS.ADD_POLICY procedure (see PL/SQL Supplied Packages Reference, 61-5) is applicable. Setting this value to TRUE will let the server run the policy also after the insert.
    With running the policy after the insert suddenly my routine worked and now rejects (prohibited) inserts with error ORA-28115 "Policy with check option violation".
    Unfortunately this is not mentioned or shown by an example in the Oracle documentation. I found an example in the security-corner (http://otn.oracle.com/sample_code/deploy/security/9i_security.html) and some text in a technical white-paper (http://otn.oracle.com/deploy/security/oracle9iR2/pdf/VPD9ir2twp.pdf).
    Huhh, on to the next steps / problems ..
    Regards
    Philipp

  • UNIQUE constraint vs checking before INSERT

    I have a SQL server table RealEstate with columns - Id, Property, Property_Value. This table has about 5-10 million rows and can increase even more in the future. I want to insert a row only if a combination of Id, Property, Property_Value does not exist
    in this table.
    Example Table -
    1,Rooms,5
    1,Bath,2
    1,Address,New York
    2,Rooms,2
    2,Bath,1
    2,Address,Miami
    Inserting 2,Address,Miami should NOT be allowed. But, 2,Price,2billion is okay. I am curious to know which is the "best" way to do this and
    why. The why part is most important to me.
    Check if a row exists before you insert it.
    Set unique constraints on all 3 columns and let the database do the checking for you.
    Is there any scenario where one would be better than the other ?
    Thanks.

    Why? 
    Because the database engine does exactly what you want - it is designed to do this in a way that anticipates collisions with simultaneous inserts and allows only a single row for any given combination of values.  If you choose to manage this at the
    application level - which is the alternative you propose - then EVERY application that attempts to insert rows must be designed to both check immediately before insertion and immediately afterwards (since these inserts can occur simulateously and you must
    allow for communication delays between database and client).  And since we know that programmers are not infallible (many other adjectives come to mind as well), there exists a high probability that the duplicate checking logic will fail.  And do
    not forget that there are many ways of inserting data into the table - it is not just your front-end application that must use this logic - it is also every other application that is used to manage data (such as SSMS, SSIS, bcp, etc.) 

  • How to check for a  button

    I have a form that submits to itself. My submit is the
    standard :
    <input type="submit" name="btnsubmit" value="Submit Your
    Order">
    When the form is submitted, I check for the existence of
    btnsubmit using paramerexists or isDefined :
    <cfif parameterexsits(btnsubmit)>
    perform inserts, etc.
    </cfif>
    This works fine. But my question is what do I do if the
    type=button instead of submit ? For example
    <input type="button" name="btnSubmit" value="Submit Your
    Order">
    I have some javascrpt validation that will submit the form
    when the button is clicked. Howver, how do I determine whether the
    button was seleceted or not, so that I can do my processing
    (insert, etc. ) ? I tried to use the isDefined or parameterexists
    like before but that does not work ?
    What is the command to check that a button was selected
    ?

    Assuming your <input> button is inside of the form you
    are submitting,
    simply use
    <cfif isDefined('form.btnSubmit')>
    However - some browsers only pass the button value if that
    particular
    button is clicked.
    In other words, hitting 'enter' in another field of the form
    may not
    pass in the submit button value as part of the form scope. In
    this case
    you'd want to check for another one of the form variables,
    ideally a
    required field.
    trojnfn wrote:
    > I have a form that submits to itself. My submit is the
    standard :
    > <input type="submit" name="btnsubmit" value="Submit
    Your Order">
    >
    > When the form is submitted, I check for the existence of
    btnsubmit using
    > paramerexists or isDefined :
    > <cfif parameterexsits(btnsubmit)>
    > perform inserts, etc.
    > </cfif>
    >
    > This works fine. But my question is what do I do if the
    type=button instead of
    > submit ? For example
    > <input type="button" name="btnSubmit" value="Submit
    Your Order">
    >
    > I have some javascrpt validation that will submit the
    form when the button is
    > clicked. Howver, how do I determine whether the button
    was seleceted or not, so
    > that I can do my processing (insert, etc. ) ? I tried to
    use the isDefined or
    > parameterexists like before but that does not work ?
    >
    > What is the command to check that a button was selected
    >
    Michael Evangelista, Evangelista Design
    Web : www.mredesign.com
    Forums: news://forums.mredesign.com
    Blog : www.miuaiga.com

  • Stored proecedure tutorial for insert, delete, update,select

    I want to integrate the stored procedure in my project
    i am using jsp,
    any one suggest me, stored proecedure tutorial for insert, delete, update,select
    thanx.

    Whether you are using JSP or not should not affect your decision (though I would recommend checking out the MVC pattern, and recommend against doing data access code from your JSP's).
    You simply need one tutorial on how to invoke a stored procedure. The stored procedure you write can have INSERT, SELECT, UPDATE, DELETE, whatever. You simply have to master the concepts involved in java.sql.CallableStatement. (And then you can get more fancy with vendor-specific extensions).
    However, I am a bit confused. You want a tutorial on stored procedures, but then you indicate very normal DML statements like INSERT, UPDATE and DELETE. All of these (queries, DML and stored procedures) fall under the general umberella of JDBC. So, it is always a good place to start with a plain ole JDBC tutorial.
    java.sun.com/docs/books/tutorial/jdbc/index.html
    www.onjava.com/pub/a/onjava/2003/08/13/stored_procedures.html
    - Saish

  • Change notification for INSERT only

    Hi Oracle 10.2, C# user, is it possible to register change notification only for INSERT operation?
    Certainly change notification is working fine and I could filter by checking OracleNotificationEventArgs.Details.Rows[0]["Info"] but wondering if Oracle has filtering capability.
    Regards
    Bob

    The only change you can make is, go to:   Settings, Notifications, swipe up on the screen to reveal Contacts, tap Contacts, tap Customize for Contact, tap the contact, tap Email Messages, turn Off the Alerts you wish.

Maybe you are looking for