Condition on a column in a table

Hi,
Can anybody tell me, how to include a condition on a column value in a table.
what i mean is, for example, i have a table with 4 columns namely a,b,c,d. i want to have a condition on column c that its value should always be greater than value of column d. i guess, check constraint cannot handle this, as it would not be possible to know the value until column d is populated.
can anybody please tell a solution to this?

I am a newbie in dba side, just asking a doubt:
sql>desc t;
Name Null? Type 
SNO     NUMBER 
TDATE     DATE 
SNO2     NUMBER 
sql>alter table t
add constraint cons_check check (sno>sno2);
Table altered.
sql>insert into t
values(100,null,null);
1 row created
sql>update t
set sno2 = 101
where sno = 100;
update t
ERROR at line 1:
ORA-02290: check constraint (HR8.CONS_CHECK) violated
Thus can he ever by pass the constraint?Pls clarify..
jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Implement Conditional Read-Only of Column Across Two Tables

    Hello,
    I would like to implement a "conditional read-only" mechanism on a column in a table with two tables in total being involved in this situation.
    I have a demo/proof of concept of this and things are working as expected in the tests I have performed; however, I would like any input as to whether there is a better way, etc.
    Here's a contrived demo but which illustrates the key ingredients nevertheless. Oracle version 10.2.0.4 64-bit on Windows Server 2008 Release 2 64-bit.
    - Table DDL and small sample data
    create table band(
      band_id   number primary key,
      band_name varchar2(20),
      status    varchar2(20)
    create table band_member(
      band_id references band,
      member_name varchar2(20)
    insert into band values(3, 'The Rutles', 'prefab4');
    insert into band values(4, 'The Beatles', 'established');
    commit;
    insert into band_member values(3, 'Ron Nasty');
    insert into band_member values(3, 'Dirk McQuickly');
    insert into band_member values(3, 'Stig O''Hara');
    insert into band_member values(3, 'Barrington Womble');
    commit;
    insert into band_member values(4, 'John Lennon');
    insert into band_member values(4, 'Paul McCartney');
    insert into band_member values(4, 'George Harrison');
    insert into band_member values(4, 'Ringo Starr');
    commit;- The rules regarding the conditional read-only goal
    1. Not permitted to update band.band_name when band.status='prefab4'
    2. Not permitted to insert/update/delete any rows in band_member when the parent row has band.status='prefab4'
    - Triggers used to implement the goal (current solution)
    create or replace trigger t1
    before update of band_name on band
    for each row
    when (old.status = 'prefab4' or new.status = 'prefab4')
    begin
      raise_application_error(-20010,
        'can not update band_name when status=''prefab4''');
    end;
    create or replace trigger t2
    before insert or update or delete on band_member
    for each row
    declare
      l_status band.status%type;
      l_band_id band_member.band_id%type;
      cursor l_cursor (p_band_id number) is
      select status from band
      where band_id = p_band_id
      for update;
    begin
      if updating or inserting then
        l_band_id := :new.band_id;
      else
        l_band_id := :old.band_id;
      end if;
      open l_cursor(l_band_id);
      fetch l_cursor into l_status;
      close l_cursor;
      if l_status = 'prefab4' then
        raise_application_error(-20011,
          'can not update child when parent status=''prefab4''');
      end if;
    end;
    /- Quick sample test for each condition
    update band
    set    band_name = 'THE RUTLES'
    where  band_id = 3;
    update band
    ERROR at line 1:
    ORA-20010: can not update band_name when status='prefab4'
    ORA-06512: at "DEMO.T1", line 2
    ORA-04088: error during execution of trigger 'DEMO.T1'
    update band_member
    set    member_name = 'RON NASTY'
    where  member_name = 'Ron Nasty';
    update band_member
    ERROR at line 1:
    ORA-20011: can not update child when parent status='prefab4'
    ORA-06512: at "DEMO.T2", line 18
    ORA-04088: error during execution of trigger 'DEMO.T2'As I say, whilst my simple tests look to show the correct results, I'm left wondering if there might be a better way to implement said functionality.
    I've attempted to provide the required information, but if I've managed to omit anything, please let me know.
    Cheers,
    Chalfont

    Hi, Chalfont,
    user13146957 wrote:
    I went the cursor route to add the "for update" clause to force serialisation on the row - i.e. the idea was to avoid the case where another session might have wanted to update the status an instant after my fetch but before the remainder of the code completed. Does that make sense?No not really. The trigger on band prevents anyone from ever changing status from 'prefab4' to anything else (or vice-versa).
    Even aside from that, you're putting in some effor to prevent something that will be allowed a split second later (or maybe the other way around). What's so significant about that split second?
    I've been thinking of other ideas rather than the trigger approach, but have come up empty, as it were, thus far. I'm open to using other approaches and making some schema changes is not off the table either.FGA (Fine Grained Access), or its older sibling VPD (Virtual Private Database) can also do what you want, but, instead of raising an error, they just ignore the illegal action. This may be an advantage or a disadvantage, depending on your requirements.
    Another approach is for the owner of the table not to grant INSERT, UPDATE or DELETE privileges to anyone: all DML must be done through a procedure (or procedures) owned by the table owner, who grants EXECUTE privileges instead of the other privileges.

  • To get list of materialized views/views using a column of a table

    Hi,
        I am removing sal column from table tab_emp;
    i want to check whether any materialized view or view using this column by  querying using data dictionary :-
    if i use like condition against query column of all_mviews it is throwing error sicne it is long data type.
    is there a way to search it without creating any function and use it in a query
    Thanks,
    Ajoy

    start with select * from dictionary where table_name like '%VIEW%'
    to identify appropriate dictionary views.
    Then read: Ask Tom "Converting Longs to LOBS" and Ask Tom "Long to Varchar2 conversion.... "
    to be able to search LONG descriptions for column names.
    For example:
    create table check_table as
    select owner,view_name,text_length,to_lob(text) text_lob from all_views
    Column Name
    Data Type
    Nullable
    Default
    Primary Key
    OWNER
    VARCHAR2(30)
    No
    VIEW_NAME
    VARCHAR2(30)
    No
    TEXT_LENGTH
    NUMBER
    Yes
    TEXT_LOB
    CLOB
    Yes
    select * from check_table where instr(upper(text_lob),'SAL') > 0
    OWNER
    VIEW_NAME
    TEXT_LENGTH
    TEXT_LOB
    SYS
    USER_ENCRYPTED_COLUMNS
    147
    select TABLE_NAME, COLUMN_NAME, ENCRYPTION_ALG,SALT, INTEGRITY_ALG from DBA_ENCRYPTED_COLUMNS where OWNER = SYS_CONTEXT('USERENV','CURRENT_USER')
    Regards
    Etbin

  • Hiding columns in a table?

    Hi there,
    I wonder if any of you know of an easy way to hide columns in a table in InDesign CS5? To further explain, i have two documents currently, one is a price guide and the other is bascially identical but without the prices, lets call that the product guide. It seems daft to have to update the two (especialy when i actually have four as i have each in two languages!) every time there is a slight change to the product listing. So, i was thinking if i have the price guide, make a PDF of that, hide the column with the prices in, and then hey presto, I've got the product guide. Seems simple but i can't seem ot find a simple way of hiding the column.
    Is there such an option? Or any suggestions as to how best do it? I don't want to delete it as i will need to update this column occasionally, and i really want to avoid having lots of different InDesign documents as i have this situation for 5 different country's guides, each with a local language and english language version, making 20 in total if i keep them separate (10 if i don't, which is enough imho) - mental i know! But thats the way work want it
    Cheers!
    (On Mac OSX 10.6.4 and running InDesign CS5)

    linziloop wrote:
    Hi there,
    I wonder if any of you know of an easy way to hide columns in a table in InDesign CS5? To further explain, i have two documents currently, one is a price guide and the other is bascially identical but without the prices, lets call that the product guide. It seems daft to have to update the two (especialy when i actually have four as i have each in two languages!) every time there is a slight change to the product listing. So, i was thinking if i have the price guide, make a PDF of that, hide the column with the prices in, and then hey presto, I've got the product guide. Seems simple but i can't seem ot find a simple way of hiding the column.
    Is there such an option? Or any suggestions as to how best do it? I don't want to delete it as i will need to update this column occasionally, and i really want to avoid having lots of different InDesign documents as i have this situation for 5 different country's guides, each with a local language and english language version, making 20 in total if i keep them separate (10 if i don't, which is enough imho) - mental i know! But thats the way work want it
    Cheers!
    (On Mac OSX 10.6.4 and running InDesign CS5)
    * If you experiment with some table cell settings, you can probably find a design that works when the columns are exposed, and when they're set to their minimum width - 3pt.
    Setting the column width to its minimum may not conceal cell content if the cell side margins are so small as to allow content to touch the cell sides, so you may need to pay attention to the margin values. If the column has vertical rulings, you may also need to pay attention to their stroke width and color.
    * Conditional text won't hide a column, but if the column is the furthest left or right, you might achieve what you want by applying a condition to the text in each cell of the column and hiding or showing it as needed. The width will be preserved, but no text will appear when hidden.
    * Similar to conditionalizing the cell content, you can define a paragraph style for only the cells in the column, and redefine the character color to None or Paper to hide the content, and redefining the color to Black to show it.
    * It may be possible to script a solution. I'm not familiar enough with available scripts. Inqire on the scripting forum.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Can we Export selected columns of a table in ADF 11g

    Hi,
    My problem is I want a table to be exported to Excel format.But my condition is only particular cloumns of a table to be exported not all the visible columns of the table.
    For example, I have 8 cloumns in a table.I need pre-determined 5 cloumns only to be exported into Excel format.I dont want to use PanelCollection Views-->Collumns to be sellected.
    Sorry,I dont know whether this is a valid question or not.But Im looking for this condition.
    Can you please help me.
    Regards,
    Felix

    I dont know how to continue.
    I have emloyee table in the HRSchema.
    I used employee table in the PanelCollection
    All the collumns are in display.
    Here in a commandButton I use a ExportCollectionListener for which id i used the employee table id.
    If I click the button it exports all collumns
    I dont know what condition I can give in the EL expression in the render or visible property of the collumn.
    can you please give further more ideas,
    Regards,
    Felix

  • How to focus a specified column in ADF Table at run time?

    I drag and drop an ADF table.It contains *10 column*..I bind the column using ArrayList..First 3 column is set frozen =True..At the time of runtime,a Horizontal scroll is appeared..*May be for certain conditions , only 8th column contains values at run time.So i want to focus that column Only*.Because it is very easy for an user to see the value..If not,user has to scroll the bar to check. How can  i focus a specified column?

    Hi Briston,
    You can make the column selected by setting "selected" property of column to true
    Sireesha

  • Background color change of a column in Advance table

    Hi,
    We have requirement to change the background color of column in advance table based on some condition. We tried putting code to change background color in Custom.xss using background-color property and setting newly created css dynamically based on condition but it seems it only changes the background color of text not the complete cell. We want to change the color of complete cell in an advance table.
    Please let me know if there is any other way I can achieve this requirement. Any help would be highly appreciated.
    Thanks

    <FONT FACE="Arial" size=2 color="2D0000">
    Pls look into "Alter Table"section.
    LOB_storage_clause
    This might help
    -SK
    </FONT>

  • Update 1 column,1 single table based on where results of multiple tables

    I would like the my_id column in 1 table updated to the static value of 247 for my_id stored in the 1 single table based on the where clause, which uses the my_id column in it.
    The update statement updates all rows in table1, instead of just the rows where
    the condition ( (b.my_id=a.my_id)
    and ( b.my_name like 'OIS SrClerk%')
    and (a.f_id=m.f_id)
    and (trunc(m.cr_time) < '02-Apr-2008')) is true
    What needs to be changed?
    update table1 a
    set a.my_id=247
    from table1 a, table2 b, table3 m
    where
    (b.my_id=a.my_id)
    and ( b.my_name like 'OIS SrClerk%')
    and (a.f_id=m.f_id)
    and (trunc(m.cr_time) < '02-Apr-2008')

    Are you looking for this?
    UPDATE table1 A
       SET A.my_id = 247
    WHERE EXISTS (SELECT 'x'
                     FROM table2 b,
                          table3 M
                    WHERE b.my_id = A.my_id
                     AND b.my_name LIKE 'OIS SrClerk%'
                     AND A.f_id = M.f_id
                     AND TRUNC (M.cr_time) < to_date('02-apr-2008 00:00:00','dd-mon-yyyy HH:MI:SS') )changed date string to to_date
    Message was edited by:
    devmiral

  • Hide a column in a table

    Hi,
    Can anybody tell me how to hide a column in a table using smart forms.

    Hi,
    One way you can do is by putting a condition on the Text that is displaying in that column.
    Or
    If you want to remove the entire column ... Create 2 tables One with the column and other without.
    Display the data in the tables conditionally.
    Regards,

  • Write protect a column in ALV Table

    Hi All,
    I have an ALV Table with few columns. Some of the columns has got check boxes. Now my question is, depending on the conditions i want to write protect a particular column. Could you tell me how to do it?
    Thanks & Regards,
    Ravi

    Hi Ravi,
    By default the column of ALV table are in read only mode but you want them to based on certain contion them first make that column editable by using the following code
    data l_table type ref to cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
    lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
    lr_column_settings ?= l_table.
    l_column = lr_column_settings->get_column( 'CARRID' ).
    CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'CARRID'.
    l_column->set_cell_editor( lr_input_field ).
    data: lr_table_settings type ref to if_salv_wd_table_settings.
    lr_table_settings ?= l_table.
    lr_table_settings->set_read_only( abap_false ).
    Now create an event handler associated with the ON_CLICK event of alv and used the following code the made the column read only (based on condition)
    data l_table type ref to cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).
    data: lr_table_settings type ref to if_salv_wd_table_settings.
    lr_table_settings ?= l_table.
    lr_table_settings->set_read_only( abap_false ).
    I hope it helps.
    You can also refer this article[Editing ALV in Web Dynpro for ABAP |https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1].
    Regards
    Arjun

  • Is it possible to insert a column break in table text?

    I have a bullet list--a Purchase Order checklist.
    Each list item is fairly short, so I designed the checklist with a two column format.
    I have implemented this in my LiveCycle form by breaking the checklist into two blocks of source text, each mapped to a table cell.
    However, my customer is unhappy with the idea of their text being broken into two pieces as it will display in their web UI as two pieces and they think this will be confusing. (Customers. Go figure.)
    Is there a character I can insert in the text to force a break so the text will flow to the next column in the table? I tried using a conditional break but that did not work as I can only specify content areas, not fields.
    Thanks,
    Janet

    holding the <option> key while typing return will insert a newline character in a cell

  • How to make column headers in table in PDF report appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp

    Hi my name is vishal
    For past 10 days i have been breaking my head on how to make column headers in table appear bold while datas in table appear regular from c# windows forms with sql server2008 using iTextSharp.
    Given below is my code in c# on how i export datas from different tables in sql server to PDF report using iTextSharp:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Data.SqlClient;
    using iTextSharp.text;
    using iTextSharp.text.pdf;
    using System.Diagnostics;
    using System.IO;
    namespace DRRS_CSharp
    public partial class frmPDF : Form
    public frmPDF()
    InitializeComponent();
    private void button1_Click(object sender, EventArgs e)
    Document doc = new Document(PageSize.A4.Rotate());
    var writer = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    doc.SetMargins(50, 50, 50, 50);
    doc.SetPageSize(new iTextSharp.text.Rectangle(iTextSharp.text.PageSize.LETTER.Width, iTextSharp.text.PageSize.LETTER.Height));
    doc.Open();
    PdfPTable table = new PdfPTable(6);
    table.TotalWidth =530f;
    table.LockedWidth = true;
    PdfPCell cell = new PdfPCell(new Phrase("Institute/Hospital:AIIMS,NEW DELHI", FontFactory.GetFont("Arial", 14, iTextSharp.text.Font.BOLD, BaseColor.BLACK)));
    cell.Colspan = 6;
    cell.HorizontalAlignment = 0;
    table.AddCell(cell);
    Paragraph para=new Paragraph("DCS Clinical Record-Assigned Dialyzer",FontFactory.GetFont("Arial",16,iTextSharp.text.Font.BOLD,BaseColor.BLACK));
    para.Alignment = Element.ALIGN_CENTER;
    iTextSharp.text.Image png = iTextSharp.text.Image.GetInstance("logo5.png");
    png.ScaleToFit(105f, 105f);
    png.Alignment = Element.ALIGN_RIGHT;
    SqlConnection conn = new SqlConnection("Data Source=NPD-4\\SQLEXPRESS;Initial Catalog=DRRS;Integrated Security=true");
    SqlCommand cmd = new SqlCommand("Select d.dialyserID,r.errorCode,r.dialysis_date,pn.patient_first_name,pn.patient_last_name,d.manufacturer,d.dialyzer_size,r.start_date,r.end_date,d.packed_volume,r.bundle_vol,r.disinfectant,t.Technician_first_name,t.Technician_last_name from dialyser d,patient_name pn,reprocessor r,Techniciandetail t where pn.patient_id=d.patient_id and r.dialyzer_id=d.dialyserID and t.technician_id=r.technician_id and d.deleted_status=0 and d.closed_status=0 and pn.status=1 and r.errorCode<106 and r.reprocessor_id in (Select max(reprocessor_id) from reprocessor where dialyzer_id=d.dialyserID) order by pn.patient_first_name,pn.patient_last_name", conn);
    conn.Open();
    SqlDataReader dr;
    dr = cmd.ExecuteReader();
    table.AddCell("Reprocessing Date");
    table.AddCell("Patient Name");
    table.AddCell("Dialyzer(Manufacturer,Size)");
    table.AddCell("No.of Reuse");
    table.AddCell("Verification");
    table.AddCell("DialyzerID");
    while (dr.Read())
    table.AddCell(dr[2].ToString());
    table.AddCell(dr[3].ToString() +"_"+ dr[4].ToString());
    table.AddCell(dr[5].ToString() + "-" + dr[6].ToString());
    table.AddCell("@count".ToString());
    table.AddCell(dr[12].ToString() + "-" + dr[13].ToString());
    table.AddCell(dr[0].ToString());
    dr.Close();
    table.SpacingBefore = 15f;
    doc.Add(para);
    doc.Add(png);
    doc.Add(table);
    doc.Close();
    System.Diagnostics.Process.Start("AssignedDialyzer.pdf");
    if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.Yes)
    var writer2 = PdfWriter.GetInstance(doc, new FileStream("AssignedDialyzer.pdf", FileMode.Create));
    else if (MessageBox.Show("Do you want to save changes to AssignedDialyzer.pdf before closing?", "DRRS", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation) == DialogResult.No)
    this.Close();
    The above code executes well with no problem at all!
    As you can see the file to which i create and save and open my pdf report is
    AssignedDialyzer.pdf.
    The column headers of table in pdf report from c# windows forms using iTextSharp are
    "Reprocessing Date","Patient Name","Dialyzer(Manufacturer,Size)","No.of Reuse","Verification" and
    "DialyzerID".
    However the problem i am facing is after execution and opening of document is my
    column headers in table in pdf report from
    c# and datas in it all appear in bold.
    I have browsed through net regarding to solve this problem but with no success.
    What i want is my pdf report from c# should be similar to following format which i was able to accomplish in vb6,adodb with MS access using iTextSharp.:
    Given below is report which i have achieved from vb6,adodb with MS access using iTextSharp
    I know that there has to be another way to solve my problem.I have browsed many articles in net regarding exporting sql datas to above format but with no success!
    Is there is any another way to solve to my problem on exporting sql datas from c# windows forms using iTextSharp to above format given in the picture/image above?!
    If so Then Can anyone tell me what modifications must i do in my c# code given above so that my pdf report from c# windows forms using iTextSharp will look similar to image/picture(pdf report) which i was able to accomplish from
    vb6,adodb with ms access using iTextSharp?
    I have approached Sound Forge.Net for help but with no success.
    I hope anyone/someone truly understands what i am trying to ask!
    I know i have to do lot of modifications in my c# code to achieve this level of perfection but i dont know how to do it.
    Can anyone help me please! Any help/guidance in solving this problem would be greatly appreciated.
    I hope i get a reply in terms of solving this problem.
    vishal

    Hi,
    About iTextSharp component issue , I think this case is off-topic in here.
    I suggest you consulting to compenent provider.
    http://sourceforge.net/projects/itextsharp/
    Regards,
    Marvin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Dynamically Hiding Column in a Table View in VC Model

    How to dynamacally hide the columns in a table view in a VC model. Through the expression in Control Property, Form element/field or table view as a whole can be made hidden, however, the individual column can not seem to be hidden.
    I am using VC server version 700.8.0.1.
    Any help would be much appreciated.
    Kind Regards
    Sanjoy

    In this scenario, if the source is SAP BI, you can use the webapi commands. If not, you would have to have 2 separate tables in different layers and you can show and hide those layers or UI elements...

  • Unable to see a column of a table in portal for a particular User

    Hi,
    A particular user is unable to see a particular column of a table in the portal . The application is developed in Webdynpro ABAP. The table contains two columns. Both the columns contain text type fields. What appears to the user is that the left column has disappeared and the right hand column has shifted to the left.
    This is occuring for a particular user only. We have checked in our development and quality systems but we are unable to replicate the issue. Please help.
    Thanks and regards,
    Satya.

    Hi Vikas.
    You can use BAPI in LSMW to craete Material or You can use direct input method. Both methods as follows below:
    Using BAPI in LSMW:
    First maintain IDOC Inbound Processing steps by giving PORT and Partner Type and Partner Numberby clicking 'settings' icon in menu path in LSMW Screen.
    Adn then execute LSMW and maintain the values as below in the first step.
    BusinessObject Method(BAPI)
    Business Object       BUS1001006                      Standard material
    Method                     SAVEDATA                        Create and change materia
    Message Type         MATMAS_BAPI                   Create and change materia
    Basic Type               MATMAS_BAPI03               Create and Change Materia.
    For the selecting of views, you can maintain fields for all views(From Basic view to costing view) in your excel and populate with 'X' in respective fields for activating views.
    In the 6th step (Maintain field mapping and conversion rules). you can map those fields for views which you want to activate since we have all views are in the standard structure.
    Using Direct Input Method:
    Standard Batch/Direct Input
    Object                      0020                                             Material master
    Method                     0000
    Program Name          RMDATIND
    Program Type           D                                                  Direct Input
    For the selecting of views, you can maintain fields for all views(From Basic view to costing view) in your excel and populate with 'X' in respective fields for activating views.
    In the 6th step (Maintain field mapping and conversion rules). you can map those fields for views which you want to activate since we have all views are in the standard structure.

  • Specific Model not showing rows in a table in a column of a table

    Hello,
    Fairly simple issue here (I think):
    I have a table bound to a global model and its rows bound to "/items"
    I then have a column within that table which has a valuehelpfield that pops open a dialog with a table.
    This tables rows inside the dialog are bound to a temp model. Now I know this temp model has the correct data and format and I do not get a "no data" messages when I bind it's rows to the node on the temp model, and to double check that I tried binding it to an incorrect node and it did say "no data" and I tripple checked by getting the jsonstring of the model and it's exactly how it should be.
    Here is the code:
    oTable.addColumn(new sap.ui.table.Column({
                label: new sap.ui.commons.Label({
                    text: "Shop",
                    required: true
                width: "200px",
                template:  new sap.ui.commons.ValueHelpField({       
                value:"{shopdesc}",
                 valueHelpRequest: function(oEvent){   
                 var locModel = oTable.getModel();
                 var rowContextPath = oEvent.getSource().getBindingContext().getPath();
                 var oRowObj = oEvent.getSource().getBindingContext().getObject();
              var oDataOld = sap.ui.getCore().getModel().getData();
             var tempModel = new myJSONModel;
          tempModel.setData({
          shops: []
      sap.ui.getCore().setModel(tempModel, "tempModel");
             tempModel = sap.ui.getCore().getModel('tempModel');
                d = tempModel.getData();
                arr = d.shops;
              var shops = oDataOld.shops;
                 for (var i = 0; i < shops.length; i++) {
                     if (shops[i].area == oRowObj.area) {
                             arr.push(shops[i]);
                 var oValueHelpDialog = new sap.ui.commons.Dialog(
                            { modal: true,
                                title: "Select a Shop",
                                closed: function (oEvent) {
                                var oContext = oTableJobs.getContextByIndex(oTableJobs.getSelectedIndex());
                                if (oContext) {
                               var oSel = oContext.getModel().getProperty(oContext.getPath());
                             locModel.setProperty(rowContextPath + "/shop", oSel["shop"]);  
                             locModel.setProperty(rowContextPath + "/shopdesc", oSel["shopdesc"]); 
                 var oTableJobs = new sap.ui.table.Table({
                     visibleRowCount: 15,
                     firstVisibleRow: 1,
                     selectionMode: sap.ui.table.SelectionMode.Single,
                     width : "300px"
                 var oOkButton = new sap.ui.commons.Button({
                     text: "OK",
                     press: function (oEvent) {
                       oEvent.getSource().getParent().close();
                 oTableJobs.addColumn(new sap.ui.table.Column({
                     label: new sap.ui.commons.Label({text: "shop"}),
                     template: new sap.ui.commons.TextField().bindProperty("value", "shop"),
                     editable:false,
                     width: "100px"
                 oTableJobs.addColumn(new sap.ui.table.Column({
                     label: new sap.ui.commons.Label({text: "Shop Description"}),
                     template: new sap.ui.commons.TextField().bindProperty("value", "shopdesc"),
                     editable:false,
                     width: "300px"
                 var jsonString = tempModel.getJSON();
                 alert(jsonString);
                     oTableJobs.bindRows("tempModel>/shops");                                       
                     oValueHelpDialog.addButton(oOkButton);
                     oValueHelpDialog.addContent(oTableJobs);
                     oValueHelpDialog.open();               
            var oModel = sap.ui.getCore().getModel();
            oTable.setModel(oModel);
            oTable.bindRows("/items");
    Any help would be appreciated, I can't see what's wrong here, all seems fine to me! Thanks!

    HI Bob
    I briefly scan thru your code and spotted one common issue. When we are binding property, we need to include the model name. e.g.
    template: new sap.ui.commons.TextField().bindProperty("value", "shop"),
    should be
    template: new sap.ui.commons.TextField().bindProperty("value", "tempModel>shop"),
    -D

Maybe you are looking for