Updata a column in FORMS by giving a range

I have a FORM in D2K. It contains 2 columns. TRDATE, SUBCODE
Primary Key is TRDATE
The data in the table will be something like below.
TRDATE     SUBCODE
01/08/2004     NULL
02/08/2004     AB
03/08/2004     NULL
04/08/2004     AB
05/08/2004     NULL
06/08/2004     NULL
07/08/2004     NULL
08/08/2004     NULL
09/08/2004     NULL
10/08/2004     NULL
I need a trigger or a function to update the subcode when the user inputs data through the form.
i.e., check the data from Saturday to Thursday. If there are two AB’s or more in the subcode column update the next Friday with AB.

You need a PL/SQL procedure to do that. Forms will not update multiple rows in a block automatically.
Write a procedure to do the updating, then requery your Forms block when it finishes.

Similar Messages

  • How to update two columns in two tables?

    hi friends
    I have two tables linked to each other through SaleNo and SaleDT. their structure as below
    Sales Table============
    SaleNo int PK auto increment
    SaleDT Datetime PK
    Qnty decimal
    Units decimal
    Invoices table
    =================InvoiceNo int PK Auto incremented
    InvoiceDT Datetime
    SaleNo int FK
    SaleDT Datetime FK
    Note that SaleDT column is NOT assigned with getDate() expression.
    1. what I need to do is update the SaleDT column of Sales table and Invoices table with the value '2013-01-31 10:31:55.813', how do I do this without manually breaking the link between the tables?
    2. Assume SaleNos 15 to 27 needs update the SaleDT to '2013-06-12 10:31:55.813', how do I do this complex operation where I I have update SaleDt column of two table of SaleNo range from 15 to 27?
    thanks
    I use Visual studio 2012 Ultimate and SQL server 2008 developer edition!

    Why not below? May be you will not be able to change your design now, but just want to share.
    Sales Table============
    SALEID int PK autoincrement
    SaleNo int
    SaleDT Datetime
    Qnty decimal
    Units decimalUNIQUE (Saleno,SaleDT)
    Invoices table
    =================InvoiceNo int PK Auto incremented
    InvoiceDT Datetime
    SALEID int FK

  • How to update a column with default in a tabular form.

    We have a tabular form that has a submit button that does a multi row update. We would like to update a column with a defaut like APP_USER = updated user when the row is updated. Is this possible and how?

    used lovs and conditions.

  • Creating Infopath forms programmatically - unable to update promoted columns in the library

    I referred to the following article and was able to create the forms successfully.
    http://www.codeproject.com/Articles/33228/Programmatically-create-a-browser-enabled-InfoPath
    But, I noticed that the generated Xml looks a bit different than if I'm creating the document through Sharepoint directly,
    for example, a snippet of the generated Xml (through Sharepoint) looks like:
    <my:Employee>
              <my:LastName>Test</my:LastName>
              <my:GivenName>Test</my:GivenName>
              <my:EmployeeNumber>1</my:EmployeeNumber>
    </my:Employee>
    but it looks like the following when I create the document from my C# code:
    <Employee>
          <LastName>Test</LastName>
          <GivenName>Test</GivenName>
          <EmployeeNumber>1</EmployeeNumber>
    </Employee>
    The issue that I'm noticing is that if I chose to publish some of columns (when I publish the form to the sharepoint site) then
    the columns will not show the values (I'm guessing that is due to the missing "my" before the fields).
    Is there a way to work-around that? or am I doing something incorrect on my side?
    Thank you,

    Here is a complete method for creating a new infopath form and updating some columns of the new form using sharepoint client object model:
            public string AddNewForm(string WebUrl, string NewTitle)
                string strMsg = "";
                if (string.IsNullOrEmpty(WebUrl))
                    return "Empty URL!";
                try
                    // Starting with ClientContext, the constructor requires a URL to the server running SharePoint.
                    using (ClientContext client = new ClientContext(WebUrl))
                        //client.Credentials = System.Net.CredentialCache.DefaultCredentials;
                        // Assume that the web site has a library named "FormLibrary".
                        var formLib = client.Web.Lists.GetByTitle("FormLibrary");
                        client.Load(formLib.RootFolder);
                        client.ExecuteQuery();
                        // FormTemplate path, The path should be on the local machine/server !
                        string fileName = @"D:\Projects\FormTemplate.xml";
                        var fileUrl = "";
                        //Craete FormTemplate and save in the library.
                        using (var fs = new FileStream(fileName, FileMode.Open))
                            var fi = new FileInfo("newForm.xml");
                            fileUrl = String.Format("{0}/{1}", formLib.RootFolder.ServerRelativeUrl, fi.Name);
                            Microsoft.SharePoint.Client.File.SaveBinaryDirect(client, fileUrl, fs, true);
                            client.ExecuteQuery();
                        // Now we are going to update new form fields.
                        // Get library columns collection.
                        var libFields = formLib.Fields;
                        client.Load(libFields);
                        client.ExecuteQuery();
                        Microsoft.SharePoint.Client.File newFile = client.Web.GetFileByServerRelativeUrl(fileUrl);
                        ListItem item = newFile.ListItemAllFields;
                        // Here the index of Title column is 9, you may use this form to update any column (even promoted fields).
                        // To find the index of interested column you should inspect libFields at debug mode, look in the libFields.Fields collection to find the index!
                        item[libFields[9].StaticName] = NewTitle ;
                        item.Update();
                        client.ExecuteQuery();
                catch (Exception ex)
                    strMsg = ex.Message;
                return strMsg;

  • Issues in editing a PK column from FORM page

    Hi
    I am creating interactive report and a form on a table T1 with columns A (this is the PK column),B,C, etc.. In the creation wizard I chose "Existing Trigger" for populating my PK column values for both the pages as in my case, USER will be giving/populating these values. Now in the form page, I change the 'Display type' of PK column A from 'Hidden and Protected' to 'Text field' because user has to use this column in form page, for creation and editing jobs.
    Now, while creating a record, I have no issues, but while 'editing' the 'A' item from form page, the form gives errors like (ORA-20505: Error in DML) and (ORA-01403: no data found) and does not allow to edit this PK column. Any workaround? Please help.
    Thanks
    Bhavesh

    On edit page, under processes region you will find various processes active on this page. Edit process which do DML operation on table T. On edit process page you will find 3 check boxes: Insert, Update and Delete. de-select the update checkbox and create ur own process. As the PK is editable, create one hidden item (say PX_A) on page which will preserve the value of the column A before editing. This will help editing the table row which is identified uniquely by column A only.

  • Update a column for a subset of data

    Hi all,
    I hope you can help me with some suggestions in how to solve the issue i have for the table below
    SQL> select * from table1;
    NAME                         ID CONCAT               SAME_GR
    A                            10 100|200|300
    B                            11 100|200|300
    C                            12 100|200
    D                            10 100|200|300
    SQL> What i need to do is to flag the rows which have the same ID & Concat value by updating the same_gr column with the same value, something like
    SQL> select * from table1;
    NAME                         ID CONCAT               SAME_GR
    A                            10 100|200|300              GR1
    B                            11 100|200|300              GR2
    C                            12 100|200                   GR3
    D                            10 100|200|300             GR1
    SQL> One important note is that the value in SAME_GR column should have the form of GR<sequence>
    I've been trying to use lag/lead functions but i can't succeed in updating the column with the same value for each group of rows where ID & CONCAT are the same.
    I forgot to mention i'm on 11gR1.
    Any help is very much appreciated.
    Cheers,
    Dani
    Edited by: DanyC on Jun 18, 2010 10:40 AM

    yes, you can.. all you need to do add is sum operation. after dense_Rank column sepecify + 254 and thus it will add up the value with dense rank output.
    sample run...
    PRAZY@11gR2> select ename,dense_rank() over (partition by deptno order by empno) from emp;
    ENAME      DENSE_RANK()OVER(PARTITIONBYDEPTNOORDERBYEMPNO)
    CLARK                                                    1
    KING                                                     2
    MILLER                                                   3
    SMITH                                                    1
    JONES                                                    2
    SCOTT                                                    3
    ADAMS                                                    4
    FORD                                                     5
    ALLEN                                                    1
    WARD                                                     2
    MARTIN                                                   3
    BLAKE                                                    4
    TURNER                                                   5
    JAMES                                                    6
    14 rows selected.
    Elapsed: 00:00:00.13
    PRAZY@11gR2> select ename,dense_rank() over (partition by deptno order by empno)+300 from emp;
    ENAME      DENSE_RANK()OVER(PARTITIONBYDEPTNOORDERBYEMPNO)+300
    CLARK                                                      301
    KING                                                       302
    MILLER                                                     303
    SMITH                                                      301
    JONES                                                      302
    SCOTT                                                      303
    ADAMS                                                      304
    FORD                                                       305
    ALLEN                                                      301
    WARD                                                       302
    MARTIN                                                     303
    BLAKE                                                      304
    TURNER                                                     305
    JAMES                                                      306
    14 rows selected.
    Elapsed: 00:00:00.01Regards,
    Prazy

  • Writing an update statement in oracle forms 9i

    Hi ,
    I have a problem situation in which
    I am fetching values from a cursor and a recod group into two data block items text box and combo box respectively .
    Both the data is fetched from different tables .
    Now based on the selection from combo box I have to update the selected value in another table by writing an update statemet .
    I have created a button and on the trigger event of when button pressed I wrote a simple update statement but it's not working that way .
    Kindly help me how to write manual update statements in oracle forms 9i
    I can't used the update buil in of forms as I want to update in a table which is not mentioned in the property pallete of data block
    please help

    I just wrote a procedure
    PROCEDURE update_current IS
    BEGIN
    update table abc set xculumn= :block_name.item_name2 where ycolumn = :block_name.item_name1 ;
    commit;
    and I called the procedure from a when button pressed trigger
    it gave an error invalid identifier abc ( which is table name)
    pls help
    I am trying to do it with form_ddl(update_query)
    but here I am facing another problem
    I have update_query = 'update table abc set xculumn= ' || :block_name.item_name2 || 'where ycolumn = '||:block_name.item_name1
    now since xculumn and y column are varchar type so I suppose while preparing the query I have to concatenate single quotes ( ' ) at the start and end
    but i am facing problems in doing so
    please tell me an alternative way or how to concatenate single quotes in the above update_query variable

  • Retrieving column value from multiselect managed metadata column and updating metadat column in list.

    I have Library having metadata column when a document is uploaded i need update another list with metadata column of
    library in list.I have an event reciever to do that,Code is given below
    public override void ItemUpdated(SPItemEventProperties properties)
                base.ItemUpdated(properties);
                    SPList saList = properties.Web.Lists["mylist"];
                    SPListItem item = saList.AddItem();
                    item["Department"] = properties.ListItem["Department"].ToString();
                    EventFiringEnabled = false;
                    item.Update();
                    EventFiringEnabled = true;   
    my elements.xml file is as below
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <Receivers ListUrl="Documents">
          <Receiver>
            <Name>DocumentItemUpdated</Name>
            <Type> ItemUpdated</Type>
            <Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>
            <Class>MyDocuments.Documents.Documents</Class>
            <SequenceNumber>10000</SequenceNumber>
          </Receiver>
      </Receivers>
    </Elements>
    but i did not see the the List column getting updated.But when i use the code to update a column of single line of text
    it works fine.But when i do it for multi select metadata column in debug mode i could see its giving null value even though Library had column value.
    Any pointers on how to update Multiselect metadata column programatically on itemeadding event in library to a list will
    be helpful.

    You need to use the TaxonomyFieldValueCollection class. The following code is from SP2010 but should still apply in SP2013. It is an example of updating multivalued taxonomy fields.
    public static void SetListItemMultiMetaDataColumn(Int32 id)
    using (SPSite site = new SPSite("http://basesmc2008"))
    using (SPWeb web = site.OpenWeb())
    TermSet termSet = null;
    TaxonomySession txs = new TaxonomySession(site);
    SPList list = web.Lists["Shared Documents"] as SPList;
    SPListItem item = list.GetItemById(id);
    TaxonomyField field = item.Fields["multimanage"] as TaxonomyField;
    if (field != null)
    termSet = txs.DefaultSiteCollectionTermStore.GetTermSet(field.TermSetId);
    Term term = termSet.GetTerms("sts", false).FirstOrDefault();
    if (field.AllowMultipleValues)
    TaxonomyFieldValueCollection currentCollection = item[field.Id] as TaxonomyFieldValueCollection;
    TaxonomyFieldValue tfv = new TaxonomyFieldValue(field);
    tfv.TermGuid = term.Id.ToString();
    tfv.Label = term.GetPath();
    tfv.WssId = TaxonomyField.GetWssIdsOfTerm(site, txs.DefaultSiteCollectionTermStore.Id, termSet.Id, term.Id, false, 1).First();
    currentCollection.Add(tfv);
    field.SetFieldValue(item, currentCollection);
    item.Update();
    Blog |SharePoint Field Notes Dev Tool |
    SPFastDeploy

  • For Update Query from ORACLE Forms

    Hi
    We are using Oracle Forms 10g running with 10g database 10.2.0.1.0. We happend to see a query which is getting generated in AWR report like Select rowid, all_columns from TableName for Update of C1 Nowait. But no such query is really written in forms and we are aware that, Any query prefixed with rowid is definitely executing from Forms. But how the ForUpdate and Nowait clause is appended to the query.
    We have checked the following properties in the database Block
    *1) Locking Mode is set to Automatic*
    *2) Update Changed Columns only is set to YES*
    *3) Query all records is set to No (Though this particular property may not be relevant to the issue)*
    What is the property or setting which might trigger such a query from ORACLE Forms with ForUpdate and Nowait clause.
    Any ideas/suggestions on why such behaviour. Please have a healthy discussion on this. Thanks in advance.

    you can't dynamically add a query to the data model in reports.
    You should look into the XML based customization of Oracle Reports. This will enable you to define a report dynamically by creating a definition in XML.
    Also another option is to have the report with a query in it and use lexical parameters in reports to pass the query definition or just the where part of it.
    Look at the reports online help for both of these solutions.

  • How to programatically select a row in TableBean and update its column?

    Hi,
    Can anyone help me on How to programmatically select a row in a TableBean and update its column?
    Thanks,
    Jon

    Hi,
    My requirement is I need to update a column in a particular row of the table using fire action...
    I have a datefield bean serve as birhdate and base on this I need to update the age column depending on the given dates..
    Here's my code under the Process form request for your reference...
    if (actionInMainPersonScreen.equals("changeDate"))
    String checkId = pageContext.getParameter("paramDatePersonId");
    OAFormValueBean depPerId = (OAFormValueBean)depTable.findIndexedChildRecursive("ChildPersonID");
    OAMessageTextInputBean depFName = (OAMessageTextInputBean)depTable.findIndexedChildRecursive("FirstName");
    OAMessageDateFieldBean dateBirth = (OAMessageDateFieldBean)depTable.findIndexedChildRecursive("BDay");
    OAMessageStyledTextBean age = (OAMessageStyledTextBean)depTable.findIndexedChildRecursive("Age");
    Date changeBDate = new java.util.Date();
    Date dateToday = new java.util.Date();
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
    changeBDate = (Date)dateBirth.getValue(pageContext);
    Calendar cal = Calendar.getInstance();
    ResultSet empAge = null;
    String newAge = null;
    OADBTransaction trans = personam.getOADBTransaction();
    System.out.println("BirthDate: " + changeBDate + " Date Today: " + sdf.format(dateToday));
    String expQuery = "SELECT Trunc((sysdate - To_Date('" + pageContext.getParameter("paramDateBirth") + "'))/365) compAge, Sysdate from dual";
    System.out.println("SQL: " + expQuery);
    PreparedStatement expPreparedStatement = trans.createPreparedStatement(expQuery ,1);
    try
    empAge = expPreparedStatement.executeQuery();
    } catch (SQLException e) {}
    try
    while (empAge.next())
    newAge = empAge.getString("compAge");
    age.setText(pageContext, newAge);
    empAge.close();
    } catch (SQLException e) {}
    regards,
    Jon

  • Updating attribute columns

    Hi,
    we are on oracle applications 11i.
    We have a requirement to create a descriptive flexfield in the items form and suppliers form to accept ids generated in another system. update would be from database end.
    what is the impact of updating attribute columns in two tables: MTL_SYSTEM_ITEMS_B and po_vendors with a simple procedure, i.e without using existing Oracle APIs?
    Regards

    Hi,
    here is why i think i need to insert a row the value set table : fnd_flex_values .
    after i update the record of the table and alter attribute field with value XXX for value set segment GLOBAL_ID, I go to the application and query the record. It gives me error:
    Value XXX for the flexfield segment Global ID does not exist in the value set XX_GLOBAL_ID.
    this error only goes away when i insert the value XXX to the descriptive flexfield segment values list.
    I defined the value set as independent. If you have another mean where i can accomplish this, I will like to know about it.
    From ittoolbox forum i had the name of the package, which is fnd_flex_values_pkg. I need more details on the tables that i need to update or insert rows into and about the package; if possible.
    thanks

  • What property/preference sets block property "Update changed columns only"

    Hi, we are wondering how Designer (latest version 10.1.2.4) desides when it generates a form with block property "Update changed columns only" set to Yes.
    Under some cricumstances this property is No in the generated .fmb
    We checked the object library, but the .olb has this property set to No, so Designer overrules it.
    Our goal is to generate all blocks with the "Update changed columsn only" set to No, because we ran in a forms bug that it can't handle Insert statements on blocks with this property set to Yes (ORA-01036). This bug only occurs in the latest forms version 10.1.2.3
    Hope anyone can help to force this property to be No when we want to achieve 100% generation from Designer.
    Kind Regards
    Auke Quist
    Edited by: aukequist on Oct 13, 2008 8:49 PM

    I think that's not possible in designer. You could define a block with this property set in the template form or in the object library. The use this block use the template/library object property in designer.
    Regards Erik

  • Update Changed Columns Only

    How to generate a form with a data block with the "Update Changed Columns Only" property set to "yes" from Designer 9.0.4.6? Is there an equivalent for this property in Designer? Or do I have to create a library object which I then have to subclass from?
    Thanks in advance
    Gerald

    Hi Gerald
    When you look in the help of Designer (Generated data block properties (implicit/explicit)), the Forms property "Update Changed Columns Only" is not mentioned. That implies that there is no property/preference in Desinger that will influence the value of this Forms property.
    So yes, you have to create a library object and subclass from it.
    Another solution is to work with the Forms built-ins GET_BLOCK_PROPERTY and SET_BLOCK_PROPERTY in a Pre_Form trigger, but I personally would prefer a new library object for this.
    Kind regards,
    Lennart de Vos

  • Query on Non-base-table column in form

    Hi,
    Does anyone have an example of code to allow users to query on non-base-table column from forms? For example, a personnel form displays a persons' name and department name. The form is based on PERSON table, which contains the department id, not the name. The form uses post-query to display the department name. When in query mode, the user wants to enter department name, and display the people in the department (still using this form, which is based on PERSON table.
    Thanks!

    Try this:
    For data block person set these properties as follows:
    1.Set Query Data Source Name = "person , departments"
    2.Set DML data target name = "person"
    3.Set Where Clause to join i.e. condition "person.dno = departments.dno"
    For filed department name set these properties as follows:
    1.Data base item = "Yes"
    2.Column Name = "departments.dname"
    3.Query Only = "Yes"
    4.Insert Allowed = "No"
    5.Update Allowed= "No"
    6.Keyboard Navigable = "No"
    If you face ambiguous column name check for the same filed name exist on both tables and set column name for this filed to person.filed_name
    Regards
    null

  • Navigation to update a column in the table jtf.jtf_rs_resource_extns

    Hi All,
    I'm using oracle 11.5.10
    Can somebody tell me the frontend form which is related to the table jtf.jtf_rs_resource_extns
    I need to update a column in the above table from the frontend.
    Please explain me the navigation for doing the same
    Regards,
    Mohan

    I can't tell you the answer to your query but what I can tell you is that you have logged the thread in a wrong forum. As far as my knowledge goes, this table does not delong to HRMS.
    Just check the product in which you are working and then log the thread in the right forum.
    Thanks,

Maybe you are looking for

  • HP Envy 17 Touchpad Issues

    Product name: HP Envy m6 Notebook PC Product number: G5N44UA # ABA Hello,  For the past couple of weeks my touchpad has the pointer moving erratically on the screen. It sometimes responds to my commands to click or to scroll, but most of the time it

  • Important Drivers downloads for HP 15 R 045TX

    Hi All, I just got a new laptop HP 15 R 045TX without OS. I installed the Windows 7 on it. I need the drivers for it,  can anyone tell me the important drivers to install and the link to that. Windows 7 ultimate 64 bit OS

  • It takes a whole day to download a video of 70minutes. why? How can I download with less buffering?

    I have been trying to download a video of 70 minutes for the whole day. This is because of buffering. It downloads for only 4secs and buffers for 5mins sometimes more. How can I download without the video buffering?

  • BAR Chart Scaling Problem

    i have bar chart with baseline at zero in my report. i want to change scaling along y-axis. like now it is now stating from 0 goes like.. 0,2,4,6,8,10,12.... so when value like (e.g 70) comes along y-axis.it make a mess in chart. so i want scaling li

  • EXIT or BADI to TO01/TO02

    I need a EXIT or BADI after save to transaction TO01/TO02. Thanks, JNilson.