Updating a DB Table using ColdFusion(CFC)

I need help BAD... please
I have this app. most stuff works perfect. I just can seem to
append the form fields to each row that gets checked in the
Datagrid. I get errors with the dateField also. Can anyone help?
This is my source:
http://www.youngsmarket.com/youngsmarket/programs/national/nataccpro/bin/srcview/index.htm l
This is the App in its current state. The form fileds update
if a date is not selected. But I cant send the DataGrid or the date
form fields:
http://www.youngsmarket.com/youngsmarket/programs/national/nataccpro/bin/NatAccPro.cfm?Sup plierID=30
My CFC that I want to UPDATE the table (I know need a loop or
something) is like this:
<cffunction name="addData" access="remote" output="false"
hint="I insert data" returntype="void">
<cfargument name="user" type="struct" required="true"
/>
<CFQUERY DATASOURCE="NationalAccounts">
INSERT INTO Programs
(SupplierID, Supplier, DBA, ItemID, Item, StartDate, EndDate,
ProgramType, Status, Priority, Descrip, FollowUp, TrackComp,
PresLocal, TrackSales)
values
('#Session.SupID#', '#Session.Sup#', '#user.DBA#',
'#user.ItemID#', '#user.Item#', '#user.StartDate#',
'#user.EndDate#', '#user.ProgramType#', '#user.Status#',
'#user.Priority#', '#user.Descrip#', '#user.FollowUp#',
'#user.TrackComp#', '#user.PresLocal#', '#user.TrackSales#')
</CFQUERY>
</cffunction>
Thanks
George

Hi
If at all you are using any DOWNLOAD and UPLOAD related function modules you can't run the BDC program in the background.
If it is a Z table update you can create the table maintenance generator.
other wise you can do it.
You can run session in background.
Reward points if useful
Regards
Anji

Similar Messages

  • I want to update the Custom table using the data available in ITAB.

    Hi,
    I want to updaste the Custom Table which is created by me (Ztable) using the data available in itab.(which i got from defferent standard tables)
    I want to update the custom table using the itab data How is it possible?
    Is any possible by using Modify ?
    DPK.

    example here
    modifying datbase table useing internal table
    advises before updating this datbase table plz lock that table to avoid incosistency
    write the logic for modifying
    Modify the database table as per new dunning procedure
    MODIFY fkkvkp FROM TABLE lt_fkkvkp .
    and finally unlock the table
    example
    *To lock table for further operations
    constants: lc_tabname TYPE rstable-tabname VALUE 'FKKVKP' . "FKKVKP
    CALL FUNCTION 'ENQUEUE_E_TABLE'
    EXPORTING
    tabname = lc_tabname
    EXCEPTIONS
    foreign_lock = 1
    system_failure = 2
    OTHERS = 3.
    IF sy-subrc EQ 0.
    To fetch all the contract accounts for customers of the segment
    Households/SME.
    PERFORM fetch_contract_accounts using lc_tabname .
    ENDIF. " IF sy-subrc EQ 0.
    *wrote the logic
    Modify the database table as per new dunning procedure from internal table
    MODIFY fkkvkp FROM TABLE lt_fkkvkp .
    *unlock the tbale
    CALL FUNCTION 'DEQUEUE_E_TABLE'
    EXPORTING
    TABNAME = uc_tabname .

  • Updating A z table using sap xi

    Hi,
    I am new sap XI would like to update a z table using
    sap xi.The dataset is  a flat file as test exercise.Can
    anyone tell me how to go about it .

    Hi Deepak,
    You can also go for abap proxies (server)
    http://help.sap.com/saphelp_nw04/helpdata/en/86/58cd3b11571962e10000000a11402f/frameset.htm
    Hope it will be helpful.
    Regards
    Suraj

  • How do i update a db table using one JSP page

    I created a JSP Form page and I want to update a db table when the user hit submit. Please help my job depends on it Send me small code example below is what I have (very new to JSP)
    <%@ page language="java" import="java.sql.*" import="java.io.*" %>
    <html>
    <head><title>accessing database</title></head>
    <body bgcolor="white">
    <%     Connection con =null;
         try {
    // Load Driver Class File
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //Make a connection to Data table
    con = DriverManager.getConnection("jdbc:odbc:SportsbookTables", "developer", "developer");
    Statement statement =con.createStatement();
    String SQL = new String("INSERT INTO tblLines (gameID,leagueType) VALUES (5,'gam')");
    statement.executeUpdate(SQL);
    statement.executeUpdate("INSERT INTO tblLines (gameID,leagueType) VALUES (6,'lea')");
    %>
    <table border=1 cellspacing=1 cellpadding=1>
    <form method="POST">
    <p><font color="#800000" size="5">Enter your name:</font><input name="leagueType" size="4"></p>
    <p><input type="submit" value="Submit"></p>
    </form>
    <%
    catch (IOException ioe)
    out.println("IO Exception:");
    out.println(ioe.getMessage());
    catch (SQLException sqle)
    out.println("SQL Exception:");
    out.println(sqle.getMessage());
    catch (ClassNotFoundException cnfe)
    out.println("Class Not Found Exception:");
    out.println(cnfe.getMessage());
    catch (Exception e)
    out.println("General Exception:");
    out.println(e.getMessage());
    finally {
    try
    if (con!=null) {
    con.close();
    catch(SQLException sqle)
    out.println(sqle.getMessage());
    %>
    </table>
    </Body>
    </HTML>

    First I would remove all the JDBC code you have in the JSP and place it in a servlet (or other Java) class, and have your form action call the servlet on submission. Then use the servlet API to extract the form data from the request and pass it to the JDBC in the servlet to update the DB. Once complete have it branch to another JSP/HTML to let the user know if they were successful or not.
    Take a look at some of the online tutorials as they will be helpful with regards to code examples.
    Depending on the size of your project, and deadlines naturally, you may also want to have a look at an MVC architecture and custom tags like Struts from Apache. These can make your job a lot eaiser.

  • Updating column in table using forms...

    Well guyz i had my presentation of the application today..every thing went fine ....but still they wanna add more features i.e wanna gift this application to various PM working in the company on various project ....initailly i was told that u gotta create this application for just our project now they are using my work to give it to other PMsss :( and take all the credit with no ackowledgement for me n u people who helped me a lot in building this application.... ... well they want me to create an application where in they can modify certain columns......i.e over write the existing value present in a column with a new value....
    Now suppose i have col1,col2 in table paymast how should i proceed to create trigger for when i press the button the form gets updated for the particular employee number(i mean if enter the respective info for the particular emp as soon as i press the button the old values shud b replaced by new values..
    One method that i noe is use DB wizard to create the form n then enter the value for in respective fields for the column to be updated n then press the F6 ......i dont wanna use this function...
    i wanna update the application by pressing the button
    cheers :)
    Edited by: Suhail Faraaz on Nov 15, 2009 12:26 AM
    Edited by: Suhail Faraaz on Nov 15, 2009 12:29 AM
    Edited by: Suhail Faraaz on Nov 15, 2009 12:30 AM
    Edited by: Suhail Faraaz on Nov 15, 2009 2:05 AM

    hi
    Examples:
    SELECT TXNID INTO :TXNID  FROM SAF
          WHERE
          NEXT_ATTEMPT=(SELECT MIN(NEXT_ATTEMPT)
    FROM SAF
    WHERE STATUS!='A' AND NEXT_ATTEMPT<=SYSDATE AND ATTEMPTS<10)
    AND
          STATUS!='A' AND ATTEMPTS<10 AND
          ROWNUM=1 FOR UPDATE;
       //processing==success  
       UPDATE  SAF SET  ATTEMPTS=ATTEMPTS+1, NEXT_ATTEMPT=NEXT_ATTEMPT+(10/(24*60*60))
              WHERE TXNID=:TXNID;
            commit;
        else
            rollback;
    Create trigger trigg_name
      After update of C on A
    For each row
    Is
    declare
    Pragma Autonomous_transaction;
      New_val  varchar2(27);
    Begin
    New_val := :new.C;
    Dbms_output.put_line(New_val) ;  
                /* this outputs the new value when
           evoking an update statement on Table A (Column C)  */
    If updating then
    update A set D=:new.C where C=:old.C;
           /* After compiling the trigger and evoking
              an update statement on Table A (Column C)
              the D column still not being updated */
    Commit;
    End;
    update t1
    Set t1.C1 = (Select t2.c1
    From t2
    Where t1.c3 = t2.c3),
    t1.C2 = (Select t2.c2
    From t2
    Where t1.c3 = t2.c3)
    update t2
    Set t2.C1 = (Select t1.c1
    From t1
    Where t1.c3 = t2.c3),
    t2.C2 = (Select t1.c2
    From t1
    Where t1.c3 = t2.c3)Its Correct/Helpful Please mark it.Thanks.
    sarah

  • Updation of  S tables using LIS

    Hi Experts,
    Can any how tell me the procedure of updating the S-tables through LIS..
    Thanks in Advance

    need to create program and Configure it

  • Error in updating custom database table using UPDATE SET Command

    Hi,
    I developed an automated collection system program in one of our clients simulating FBE1 (Payment Advice Creation) and F-28 (Posting of Incoming Payments) transaction codes. Upon posting, we encountered an error in PRD server wherein, for some of the posted items, the STATUS field in our custom table was not successfully updated. We tried to reverse the clearing document and debug the program. Upon posting, we were able to successfully update the status. We could not simulate the error in QAS since all the postings in QAS were successful and all status' relating to these postings were updated as well. We tried posting multiple times and the program seems to be working fine. In PRD, this behavior is just random and there is no specific pattern as to how the error occured. Provided below is the code I used for updating custom table ZFIACSF28. The STATUS field should be equal to '4' once the posting is successful. We are not sure if this is a database related issue. 7 users are authorized to do the postings in PRD and they are using the same user account.
    CODE:
      CALL TRANSACTION 'F-28' USING gt_bdcdata
                              MODE   'E'
                              UPDATE 'S'
                              MESSAGES INTO gt_messtab.
      READ TABLE gt_messtab INTO wa_messtab WITH KEY msgtyp = 'S'
                                                     msgnr  = '312'.
      IF sy-subrc EQ 0.
    update status for items cleared bearing the same OR Number*
        UPDATE zfiacsf28 SET status       = '4'
                             zsapdocument = wa_messtab-msgv1(10)
                             zruntime     = sy-uzeit
                             zrundate     = sy-datum
                       WHERE zor          = gv_zor
                       AND   customer     = gv_customer.
        COMMIT WORK.
    ENDIF.

    Hi,
    it's not possible that status isn't updated in zfiacsf28 while date and time are updated there, because it's hard coded.
    There must be other programs that also change your table zfiacsf28 and maybe clear those fields. Maybe the key fields zor and customer cannot provide  duplicate access, what is the meaning of field zor ?
    Please check the where used list of table zfiacsf28 to find other update programs.
    Regards,
    Klaus

  • File Format Mismatch while update into Internal table using RFC_REMOTE_FILE

    Hi All,
    I used RFC_REMOTE_FILE to communicate with the presentation server in Background Mode. I connected successfully and got output too.
    But my requirement is to update the .csv file into internal tables.
    With RFC_REMOTE_FILE i can get the data as single row. But I can't separate the fields and update into the corressponding table field.
    What is the solution for the above issue. Could anyone help me.
    For the above RFC Communication I followed the below link
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2&overridelayout=true

    Hi All,
    I used RFC_REMOTE_FILE to communicate with the presentation server in Background Mode. I connected successfully and got output too.
    But my requirement is to update the .csv file into internal tables.
    With RFC_REMOTE_FILE i can get the data as single row. But I can't separate the fields and update into the corressponding table field.
    What is the solution for the above issue. Could anyone help me.
    For the above RFC Communication I followed the below link
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/9831750a-0801-0010-1d9e-f8c64efb2bd2&overridelayout=true

  • How to update the database table using webdynpro??

    Hi,
    Can anybody helm me in updating database table....by entering the values on the output screen of webdynpro component??should i use any commit statement in function module ,which i used to update.

    hi martina....
    consider you are having two input fields bound to attr1 and attr2.
    now after pressing the save button:
    just read teh two attributes to field1, field2 using code wizard. then
    <db name>-<fieldname1> = <field1>.
    <db name>-<fieldname2> = <field2>.
    insert <dbname>.
    ---regards,
       alex b justin

  • Updating an existing table using Create Table As

    I want to update a table, because the schema has changed..
    Example:
    create table a (a number(2), b varchar(2) NOT NULL);
    insert into a values (22, 'JA');
    Suppose i want to ad a column c number(3) between a and b, and i want to increase datalength of b to 3,
    the i perform the following
    create table a_temp as (select a, cast(0 as number(3)) c, cast(b as varchar(3)) b from a);
    drop table a;
    rename a_temp to a;
    But now all columns allow null... I want the last column to be NOT NULL!
    How do i do this (within the statement)?
    Then another question, the statement:
    RENAME a_temp to a;
    does not allow the owner name in it,
    but how does it know which table it has to rename?
    Cant you rename a table for another owner?
    Is it true that owner==tablespace?
    Thanks in advance

    You may find this article helpful:
    http://www.dizwell.com/prod/node/63
    It uses the online table redefinition capability to partition a table which previously wasn't partitioned. It's exactly the same principle adding a column, changing constraints, renaming columns, making columns longer and so on.
    You might also find this article useful:
    http://www.dizwell.com/prod/node/64
    It discusses the issues surrounding renaming a table, including how I can rename your tables.
    Generally, you might want to poke around the articles link at www.dizwell.com if you are in a learning sort of mood.
    No, it's not true that owner=tablespace. A tablespace is a logical way of thinking of a set of physical data files. Those files can contain anything (index, cluster, table, materialized view) owned by anyone who happens to have the rights to store things there. Therefore, the tablespace representation of those files also contains lots of objects owned by lots of users.
    The only relationship between an owner and a tablespace is that when I create you as a user, I state which tablespace will be used to store your objects **by default** -but that default can always be over-ridden, provided that you have been granted rights (that is, space quotas) on other tablespaces.

  • Update the Oracle Table using BAPI

    Hi All,
        I would like to update Oracle Data Base with my custom BAPI using the Business Logic Transaction.
    Could any one please give me some logic how to do it?.
    Thanks
    R M

    RM,
    Please follow the steps below:
    1) Create and Configure the Data Server for the database you want to access/update (basically
        you are creating a database connection here).
    2) Save and test the connection by clicking the 'Status' button
    3) Create new query template with template type as 'SQL Query' and select the server you have
        configured in step#1
    4) Select the mode as 'Command' and type-in your Insert/Update statements in the 'Fixed Query'
        tab. For example: insert into yourtable values ('[Param.1]','[Param.2]')
    5) Test the query by passing parameters from the 'Parameters' tab. You are supposed to get a
        'Command Execution Successful'  message if the data is successfully posted to the database.
    6) Create a 'SQL Query' action block in your Business logic transaction to access the above query
        and map your Param.1, Param.2 etc. to your BAPI result (on the Link Editor).
    Hope this helps.
    John

  • How to check/verify running sql in lib cache is using updated statistics of table

    How to check/verify running sql in lib cache is using updated statistics of table used in from clause.
    one of my application table is highly busy i.e frequent update/insert/delete.
    we gather table stats every 30 min.

    Hello, "try dynamic sampling" = think "outside the box", maybe hit two birds with same stone.
    As a matter of fact, I was just backing up your statement: "30 minutes seems pretty extreme"
    cheers

  • Unable to insert the record to table using pre-insert & pre-update trigger

    Hi All,
    I have tried to insert and update the backend table using the pre-update and pre-insert triggers. But its not working for me. Please find below the code which i have used in the triggers.
    Pre-insert trigger:
    DECLARE
    v_cust_num_cnt NUMBER;
    BEGIN
              SELECT      COUNT(customer_number)
              INTO      v_cust_num_cnt
              FROM cmw_bc_mobile_number
              WHERE substr(customer_number,1,15)=substr(:BLOCKNAME.CUSTOMER_NUMBER,1,15);
              IF      v_cust_num_cnt = 0 THEN
                        INSERT INTO cmw_bc_mobile_number (CUSTOMER_NUMBER
                                                                                                   ,MOBILE_NUMBER
    ,CREATION_DATE
    VALUES
    (substr(:BLOCKNAME.CUSTOMER_NUMBER,1,15)
    ,:BLOCKNAME.MOBILE_NUMBER
    ,SYSDATE
    COMMIT;                                                                                                    
    END IF;          
    END;
    PRE_UPDATE TRIGGER:
    BEGIN
              IF :SYSTEM.RECORD_STATUS = 'CHANGED' THEN
              UPDATE apps.cmw_bc_mobile_number
         SET mobile_number = :BLOCKNAME.MOBILE_NUMBER,
         creation_date = SYSDATE
              WHERE customer_number=substr(:BLOCKNAME.CUSTOMER_NUMBER,1,15);
              COMMIT;
         END IF;
    EXCEPTION
              WHEN OTHERS THEN
                   NULL;     
    END;
    Please let someone assist in gettting it resolved.
    Regards,
    Raj.

    Just use MESSAGE (we don't know what fnd_message is, that is some custom code):
    message('v_cust_num_cnt='||v_cust_num_cnt);
    IF v_cust_num_cnt = 0 THEN
      message('Now inserting...');
      INSERT INTO cmw_bc_mobile_number (CUSTOMER_NUMBER... 
    else
      message('Nothing to insert');
    end if;

  • Updating custom table using call transaction

    How to update a custom table using Call Transaction method. How can we use Table control (Module Pool) for this purpose).

    Vignesh,
    Create a table maintenance transaction for ur custom tables. Check this link for ref...
    http://allaboutsap.blogspot.com/2007/04/table-maintenance-in-sap-step-by-step.html
    And create a BDC recording and code a program accordingly...
    regards,
    karthik

  • How do u save datas more than one table using net beans ide using JSF

    Hi,
    I am new to JSF.
    I save / delete / update / New master table using POJO (Plain Old Java Objects), database - oracle and Toplink Persistence Unit.
    How do u save data more than one table using net beans ide using JSF (I am using POJO) ?
    and also Tell me the reference book for JSF.
    Thanks in advance.
    regards,
    N.P.Siva

    SivaNellai wrote:
    I am new to JSF.
    So, I am using net beans IDE 6.1 from sun microsystem. It is a free software.No, you don't drag'n'drop if you're new to JSF. Switch to source code mode. Write code manually, with the help of IDE for the speed up.
    So, please guide me the reference books, articles. I need the basic understanding of JSF, net beans IDE.[JSF: The Complete Reference|http://www.amazon.com/JavaServer-Faces-Complete-Reference/dp/0072262400] is a good book. The [JSF specification document|http://jcp.org/aboutJava/communityprocess/final/jsr252/index.html] is also a good reading to understand what JSF is and how it works. There are also javadocs and tlddocs of Sun JSF Mojarra.

Maybe you are looking for

  • How do I get m4r ringtone files to load on iPhone 5

    A note about me...  I don't watch movies, listen to music, play games, tweet, twitter, or any of that.  I use my phone as a phone, have a few basic apps that I find useful.  I use of the camera to capture the needed documentation every so often.  I w

  • Optical out not working, or is it the reciever...

    I just received a Belkin PureAV 6ft. Optical Cable with Mini Toslink Adapter today, in fact I opened it about 1 hour ago. My Denon AVR-65 doesn't seem to receive the optical signal from my Mac Mini at all. It at least won't lock on to the signal's fr

  • ICloud backup questions?

    Quick question- I see a message that says my phone needs to be locked for iCloud to back up all my stuff? Is that true? or will it back up if I'm using it? I will be going to get a new iPhone very soon so I want to make sure all my data is backed up.

  • Make code inspector window independant?

    Is there any way to toggle/switch the code inspector window to be independant of the normal design page view (which might be in design or code view)? To me this would seem to be one of the main advantages of having a separate code inspector. i'd love

  • Varchar2(8) field with 7 characters gives length = 8

    table1 uoe varchar2(8) has a 7-character string in it 'bnorton' when inserted into (insert into...select from) table2 uoe varchar2(8) it becomes an 8 character string. 1. I can't tell what the extra character is. 2. temporarily goes away if I rebuild