Two unique LOV values update

I have set up a form in the APEX that allows the user to select a city using a popup LOV. This is done in order to restrict the user in the selection of the city in a drop-down list itself is generated based on the field COUNTRY / STATE that the user has already filled (i.e., waterfall LOVs). It works fine using the following SQL code:

Select town_name as display_name, town_name as city return_value

TOWN_NAME is the column varchar2 with the list of the cities in the table of the CITY. The result is put in a CITY varchar2 column in the CONTACT table.

CITY table

TOWN_ID

TOWN_NAME

CONTACT table

CONTACT_ID

COUNTRY

STATE

CITY

TOWN_ID (hidden)

As you can see in the table of the CITY, each city also has a unique TOWN_ID which I also want to store in a hidden column in the CONTACT table. Can I change my SQL statement so that the return value is in the place of the TOWN_ID and joins the table of the CITY, but I really need store both (so that any user can easily export city in a CSV file names but the table also stores the TOWN_ID because it gives me access to other information about the city. Just store the name of the city is not enough it is not unique, because initially the cities are chosen depending on the COUNTRY and STATE in cascade LOVs).

I guess I need to set up some kind of trigger so that when the user selects a popup LOV city name then the return value is placed in the column of the CITY, but the CITY. TOWN_ID is also in the CONTACT. TOWN_ID without the user even knowing. I don't know how to get there so I hope someone can help?

Thank you

Put the following in the header HTML of your items:


Here is the link http://apex.oracle.com/pls/apex/f?p=31517:106:108980692579304:NO example check this

Tags: Database

Similar Questions

  • If I have the two LOV in the same table then how to connect when I select first and second LOV value also change?

    Mr President

    If I have the two LOV in the same table then how to connect when I select first and second LOV value also change?

    My two fields are FLOW AND DR_NAME

    FLOW = ACCT_ID

    DR_NAME = ACCT_NAME

    I created with success of LOV for these fields.

    First LOV gives acct_id in the debit field and second LOV gives the value of acct_name to dr_name.

    How can I report these lov, it's that when I change my acct_id then acct_name also change

    I have these two tables

    CREATE TABLE "NOM"  (
      "ACCT_ID" VARCHAR2(7) NOT NULL ENABLE, 
      "ACCT_NAME" VARCHAR2(50) NOT NULL ENABLE, 
      "O_BAL" NUMBER(13,2),
      CONSTRAINT NOM_PK PRIMARY KEY ("ACCT_ID")ENABLE
       
       );
    CREATE TABLE "VOUCHERDET" (
      "V_ID" VARCHAR2(9) NOT NULL ENABLE,
      "LINEITEM" NUMBER ,
      "DEBIT" VARCHAR2(7) , 
      "DR_NAME" VARCHAR2(50), 
      "CREDIT" VARCHAR2(7) , 
      "CR_NAME" VARCHAR2(50), 
      "PARTICULARS" VARCHAR2(100), 
      "AMOUNT" NUMBER(21,2),
    CONSTRAINT VOUCHERDET_PK PRIMARY KEY ("V_ID","LINEITEM")ENABLE, 
    CONSTRAINT PUR_SAL_LINE_POD_FK FOREIGN KEY(PROD_ID)
      REFERENCES PRODUCTS (PROD_ID)ENABLE,  
    CONSTRAINT VOUCHERDET_DEBIT_FK FOREIGN KEY ("DEBIT")
       REFERENCES "NOM" ("ACCT_ID") ENABLE, 
    CONSTRAINT VOUCHERDET_CREDIT_FK FOREIGN KEY ("CREDIT")
       REFERENCES "NOM" ("ACCT_ID") ENABLE,  
    CONSTRAINT VOUCHERDET_V_FK FOREIGN KEY ("V_ID")
       REFERENCES "VOUCHER" ("V_ID") ON DELETE CASCADE ENABLE
      );
    
    

    Concerning

    so, instead of this second ActId, choose ACCT_NAME:

  • Two queries LOV in a point... is that possible?

    Hello

    I created a list of value form DML as below-

    Select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    of ptcs_cost_record_status RFT

    But, depends on "pcrs.port_cost_record_status_id" I want only certain values to display in the list.

    For example:
    -If pcrs.port_cost_record_status_id 2
    - then view the State 2,3,4

    Select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    of ptcs_cost_record_status RFT
    where pcrs.port_cost_record_status_id in (2,3,4)

    -If the State id is 1
    -can view the status of 1.5

    Select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    of ptcs_cost_record_status RFT
    where pcrs.port_cost_record_status_id in (1.5)

    Any ideas on how I can have two different LOV in one?

    Thank you!!
    Ling

    LC says:
    Hello

    port_cost_record_status_id is a COMPONENT and it is retrieved from the database when the form is opened.

    It doesn't look like one (the convention is that page elements are prefixed with their page number and referred to as bind variables using the ":").

    Regarding the original question, which precedes the LOV query is:

    select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    from ptcs_cost_record_status pcrs
    where pcrs.port_cost_record_status_id in (2,3,4)
    and :p1_port_cost_record_status_id = 2
    union all
    select pcrs.cost_record_status, pcrs.port_cost_record_status_id
    from ptcs_cost_record_status pcrs
    where pcrs.port_cost_record_status_id in (1,5)
    and :p1_port_cost_record_status_id = 1
    
  • Why my computer Vista did lose two weeks of Windows updates?

    My computer has lost two weeks of windows updates. Why?

    Hi Unca,
     
     
    This can occur if the Windows Update component is damaged.
     
    I suggest that reset you the Windows update components and check if it works fine.
     
     
    How to reset the Windows Update components?

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • create popup LOV values depends on the return values of select tabular list

    Hello

    My requirement is

    In a table, first column is selection list and second column is LOV Popup.

    I want to create if select user from the selection list value 'A' then displays the popup LOV values.

    If the user selects 'B' values in the select list and then display nulls within the popup LOV.

    Kind regards

    Arianne.

    Hi ujwala1234,

    ujwala1234 wrote:

    In a table, first column is selection list and second column is LOV Popup.

    I want to create if select user from the selection list value 'A' then displays the popup LOV values.

    If the user selects 'B' values in the select list and then display nulls within the popup LOV.

    Use the Popup LOV cascading given by Jari wool in this blog: Blog APEX of Jari: pop-up list of the 'waterfall' Article on slot form of

    Write your Popup LOV query such as if, 'A' is selected it returns other values it will return null value.

    Kind regards

    Kiran

  • Problem with load LOV value reset

    12.1.3 ADF

    I am facing a problem with load LOV set to reset.

    I have a page in waterfall surrounded by af LOV: PanelFormLayout. Also do some validation on the data entered by the user when clicked on submit. If the validation fails, an alert will appear on the validation failed and user will stay on the same page.

    Values LOV child get back their null or empty when you click on the "submit" button. It works as expected when the validation failed and the user has navigated to the next page. But if validation fails, the user stays on the same page and child LOV connection reset to NULL or emptyvalue. For this reason, NPE error occurs when the user attempts submit again and have to select again the child value LOV.

    Is it possible to keep the child LOV value even after submitting a form?

    Page code:

    < af:panelBox text = "Product Details" id = "pb4" >

    < af:panelFormLayout id = labelWidth "180px" = "pfl4" >

    < af:selectOneChoice value = "#{bindings." ProdType.inputValue}.

    label = "#{bindings." Required to ProdType.label'} = 'true '.

    requiredMessageDetail = "product Type cannot be NULL. Please select a value.

    shortDesc = "Select the Type of product" id = "soc1' autoSubmit = 'true '.

    showRequired = "true" contentStyle = "width: 150.0px".

    Binding = "#{viewScope.provBean.prodType} '"

    valueChangeListener = "#{viewScope.provBean.prodTypeVCL}" >

    < f: selectItems value = "#{bindings." ProdType.items}"id ="si1"/ >

    < f: validator binding = "#{bindings." ProdType.validator} "/ >"

    "< af:target execute="@this "make ="soc2"/ >

    < / af:selectOneChoice >

    < af:selectOneChoice value = "#{bindings." ProdVer.inputValue}.

    label = "#{bindings." Required to ProdVer.label'} = 'true '.

    requiredMessageDetail = 'Product Version cannot be NULL. Please select a value.

    shortDesc = 'Select Product Version' id = 'soc2 '.

    Disabled = ' #{bindings. " ProdVer.inputValue == null} ".

    contentStyle = "width: 150.0px" showRequired = "true".

    Binding = "#{viewScope.provBean.prodVer}" >

    < f: selectItems value = "#{bindings." ProdVer.items}"id ="si2"/ >

    < f: validator binding = "#{bindings." ProdVer.validator} "/ >"

    < / af:selectOneChoice >

    < / af:panelFormLayout >

    < / af:panelBox >

    Timo thanks for your response.

    Child LOV I created is an attribute of transient and resolved the problem by setting the property of passivation to true.

  • C.P. LOV values in order

    Dear all,

    I use below following the defined table type value for current month and 12 months in the program simultaneous lov.

    When I run the SQL in Toad returning rows in descending order as jul-14, jun-14, May 14 up etc 12 months.

    But when I check in the program simultaneous lov, values are not in order, they are scattered like first august13 apr-13 jul-14, jan-14 as.

    Could you please advise how I can limit it someone and values will be returned in descending order.

    Kind regards

    Amit

    Please try to add order by clause

    level control

  • Starting from two data tables, how do you get the values in two columns using values in a column (values get col. If col. A is not null values and get the pass. B if col. A is null)?

    Two tables provided, how you retrieve the values in two columns using values in a column (the pass get values. If col. A is not null values and get the pass. B if col. A is null)?

    Guessing

    Select nvl (x.col_a, y.col_b) the_column

    from table_1 x,.

    table_2 y

    where x.pk = y.pk

    Concerning

    Etbin

  • Unique nutrient values in the parameters of the effect of comps pre duplicated?

    I have a composition before with some fairly complex particle systems I'd like to reproduce several times in a final model.

    The thing is I want to apply a unique 'XY position' value to the effects within each instance precomp.  I already have the values chained with the selection inside the demo icon, so all 'position XY' values can be moved as a unit.

    He can feed the unique effect values down in the stack of comps pre uses phrases or some other thing?

    You can have only one instance of a set of precomps that makes differently when it is used several times.

    You will need to create several sets of these precomps and put different values. You could do this by recording all the precomps as a project then import several times. Or there is a script to duplicate a comp here hierarchy: http://aescripts.com/true-comp-duplicator/

    Before that, you can use expressions to power a random some properties value so that they would be automatically in each set in doubles. For example, this would be a random position XY value:

    seedRandom(1,true);

    x = random (0,640);

    y = random (0,480);

    [x, y];

  • DeafultDependent LOV values are get clear on the compensation of the dependent values

    Hello

    I have a lov that lists the city, State and zip code information.

    When I choose a combination, it will automatically default the information of State and zip. But when I have a province/postal code clear information all 3 values get erased.

    How to prevent them of fades is not even on the children/dependents lov values read.

    Thank you
    Mahesh

    Mahesh

    Make sure that you have not set the criteria for the State element and zip under lovMappings.

    Point criteria must be set only for item LOV.

    Thank you
    AJ

  • How to create a table with two unique columns

    How to create a table with two unique columns. I use the following syntax below and I get the error message such unique or primary key already exists.

    create the table COPQ_WORKCELL_GOAL
    (
    Type_id varchar2 (4) NOT NULL UNIQUE,
    Tyle_Location varchar2 (30) NOT NULL UNIQUE,
    Type_Description varchar2 (20).
    KEY elementary SCHOOL (Type_id)
    );

    Use 1 or the other column type_id;

    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4),
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20),
      PRIMARY KEY (Type_id)
    );
    
    Table created
    drop table COPQ_WORKCELL_GOAL;
    
    Table dropped
    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4) primary key,
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20)
    );
    
    Table created
    
  • Problem of two Casding Lov

    Hello

    I have a strange problem.

    Jdev Version: 12.1.3

    Scenario:

    1. I have an input list three of the value in a form fields.

    2. first lov is a simple select statement without any variable binding.

    3. second lov is dependent on the first lov and has a variable binding.

    4 third lov is dependent of the lov first and second and two bind variables.

    5. I have defined the key attributes, mapped dependencies and set accessors.

    6. now if I run the jsf page, third lov is the data list correctly, but if I select a value, the value is not updated in the lov entry field.

    There is no code involved in the steps above.

    Please ask your entries on the same.

    You can use a transitional attribute and apply on it lov and this passenger lov you can set the value in the DB field

    check - https://blogs.oracle.com/adf/entry/combo_lov_how_to_display

    Lov on editable primary key using creates problem like that, avoid this

    Ashish

  • How to disable the LOV values based on the State of some?

    Hello

    I have a requirement like this.

    (1) LOV Field (1), when I get a value here then based on the query I get two new values and assign to another two LOV Fields (2,3) and then disable them. However, when I enter the value in the field LOV (1) based on one of the conditions I won't have no default value then LOV fields must be enabled so that the user can select the values of LOV.

    (2) now an another LOV domain (4) when I go here again, then again two fields a LOV (5), and the free text field must be filled in.

    To do this, I wrote the logic in the following way:

    (1) get the LOV box-1 value and deriving the new values and set the session Variable to 1 and then refresh the Page. Now in PR get the Variable from Session 1 and assigning new values to LOV fields 2 and 3 and then using the property Setdisabled I deactivation.

    (2) getting the value of LOV field-4 and then drifting two new values and set the session Variable-2 and refresh the Page. Now in PR get Session-2, and then set the new values for the LOV-5 field and free text. But once the Page Refreshed and assigning values, values that we have given in the Point 1 in the LOV-2 fields, 3 turn white and field's get activated.

    Can you please let me how to achieve this? and also why the values are empty when I implement Point-2.

    Thank you
    Clarriiza

    Clarriiza,

    This VO have no matter what right SQL query, so even if you run the VO by using vo.executeQuery (), you will not get all the lines in the VO.

    So in the PR you need createRow and insert VO (otherwise your page no mistake) the below blog can be considered as an example.

    Reference: Oracle tips of Johny: OAF: how to create a PVO and use for Spel link in Oracle Application Framework

    On top of which is explained in the blog above, you set the values for the attributes of the useful, likely to set the value for the other LOV.

    I hope this helps.

    See you soon

    AJ

  • DBAdapter retains the unique causing value sequence force error

    Hi gurus BPEL.

    I am facing a problem in EBS integration of the invoice of the OTM.
    AP invoice header is inserted, the AP invoice lines does not get inserted due to the below error in BPEL. Import of payment fails, as there are no invoice lines.


    Anomaly of the non-recoverable system:
    Exception occurred when the link was invoked. Exception occurred during invocation of the JCA binding: "JCA binding run reference"insert"operations have to: DBWriteInteractionSpec Execute Failed Exception." insertion failed. The descriptor name: [APInvoice.ApInvoicesInterface]. Caused by java.sql.BatchUpdateException: ORA-00001: unique constraint (AP. AP_INVOICE_LINES_INTERFACE_U1) violated. Check the logs for the record output full DBAdapter before this exception. This exception is considered non reproducible, probably due to an error of modeling. To be classified as reproducible rather add property nonRetriableErrorCodes with the value "-1" for the deployment descriptor (i.e. weblogic - RA.Xml). Auto retry a reproducible fault set composite.xml for this invoke these properties: jca.retry.interval, jca.retry.count and jca.retry.backoff. All properties are integers. ". The called JCA adapter threw an exception of resource. Please review the error message above carefully to determine a resolution.


    SOA DB Connections seem to retain the sequence used in the cache and assign the same when the Bill for the line is inserted. This causes the Unique constraint error when inserting the table of AP invoice lines in EBS.

    I call the standard APInvoices.wsdl to make the insertion AP_INVOICE_LINES_INTERFACE. I noticed that in the file APInvoice - or - mappings.xml contains the following code
    > the sequence name < AP_INVOICE_LINES_INTERFACE_S < / sequence-name >
    < table sequence-field = "AP_INVOICE_LINES_INTERFACE" name = "INVOICE_LINE_ID" / >
    < / sequencing >
    < cache >
    weak-reference < cache-type > < / type of cache >
    <-cache size >-1 < / cache size >
    true < always refresh > - < / always refresh >
    < / cache >
    < remote caching >
    weak-reference < cache-type > < / type of cache >
    <-cache size >-1 < / cache size >
    < / remote caching >

    Is their anything I can change something in the BPEL process to refresh the cache of the sequence all the time.

    Alternative, I think now is below.
    1. check with customer if they can do the sequence AP_INVOICE_LINES_INTERFACE_S as NOCACHE.
    2. pull the invoice line via pl/sql adapter and complete the invoice line. But in this case, I'm not sure if Web APInvoice service code will try to update with the generated BPEL sequence.

    Any direction on this issue will be of great help.

    Thank you
    Shobz

    Hi Anushal,
    Thanks for the reply.

    Hi all
    The problem has been resolved with the creation of this «sequencePreallocationSize» DBAdpater
    As this property is set to 50 DB adapter's default, it did not fit with the INCREMENT BY the AP_INVOICE_LINES_INTERFACE_S sequence that has been set to 1.

    What happens in the adaptor DB is, when the first record is created, it takes the nextval in the sequence (assume it is 20), however it uses then his own sequence internal for the next 50 files by reference to the value set in this property (by creating records with primary keys from 20 to 70) and only when this internal sequence is exhausted it will return to the sequence of database.
    Meanwhile, any other inovoice created AP would recover DB, which could be his word to say value 21, in conflict with the inserted by BPEL, throw a unique constraint.

    Setting this property to 1 or corresponding increment sequence solved the problem.

    Thank you
    Shobz

  • Two multi string value in a single

    Hi all

    11 GR 2 DB.

    We have two channels, for example "x 1, x 2, x 3, x 4' and 'y1, y2, y3, y4".»

    Goal is to make a single as string ' x 1, y1, x 2, y2, x 3, y3, x 4, y4.

    The number of values in each channel is not fixed - it can vary from 1 to 4, IE 4 maximum and minimum 1. Number of values in the two strings for will be the same.

    We do this using several SUBSTR and InStr.

    Can we do using REGEXP?

    Thank you

    Or even simpler...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 'x1,x2,x3,x4' str1, 'y1,y2,y3,y4' as str2 from dual union all
      2             select 'x1,x2,x3', 'y1,y2,y3' from dual union all
      3             select 'x1,x2', 'y1,y2' from dual union all
      4             select 'x1', 'y1' from dual)
      5  select str1, str2
      6        ,regexp_replace(str1||',#'||str2
      7                       ,'([^,]*,)?([^,]*,)?([^,]*,)?([^,]*,)?#([^,]*,)?([^,]*,)?([^,]*,)?([^,]*,)?'
      8                       ,'\1\5\2\6\3\7\4\8'
      9                       ) as result
     10* from t
    SQL> /
    
    STR1        STR2        RESULT
    ----------- ----------- ----------------------------------------
    x1,x2,x3,x4 y1,y2,y3,y4 x1,y1,x2,y2,x3,y3,x4,y4
    x1,x2,x3    y1,y2,y3    x1,y1,x2,y2,x3,y3
    x1,x2       y1,y2       x1,y1,x2,y2
    x1          y1          x1,y1
    

    which is a unique regexp_replace with a unique pattern just manipulate the string input to make it work. ;)

Maybe you are looking for

  • Where is Clean Up selection?

    Is it well enough.  Is it possible to access?  Or is it just went?

  • Bookmark sorting

    I have more than a page of bookmarks. When I try to sort them by name, only three of them appear in the sidebar. One for Fox News and the other two are Facebook. I have not all Facebook bookmarks in my bookmark list. I don't know whence these two.

  • remove the HP advisor dock

    Whenever I turn on my HP G56 laptop, the HP Advisor Dock appears. I have not been able to find out how to uninstall it and as I have no use for it, do not want them appearing on the desktop every time on start up. How can I get rid of it permanently,

  • Change the screenshot output folder (directory)

    Hello! I installed Skydrive application (so I have a C:\Users\account\Skydrive-folder). I want my screenshots taken with win + print src to a C:\Users\accound\Skydrive\Screenshots instead of in my \Pictures folder. This way I can take a screenshot of

  • Lost in Adobe Sketch project

    Hello. I got an iPad Pro about a month for a specific reason – to complete this unique project. I started and finished half of the project in Adobe sketch during the month, and today, I noticed that the project has disappeared. It is quite possible t