Select random from the tables

Another problem of mine, I hope we can clear the air:
I have 4-5 tables with different products, these products have a price. In another table, I have just a column with a value (my money). What I have to do, he chooses one product from each table and the sum of all should not be greater than my money? A randomization but how?
If you need to learn more, say please and I'll post an example, I need help thanks

Hello

You can create the source of the page as a SQL something like element:

WITH X AS (
SELECT ROWNUM RR, DRINKS.NAME || ' ' || DRINKS.PRICE || ' ' || F1.PRODUCT || ' ' || F1.PRICE || ' ' || F2.PRODUCT || ' ' || F2.PRICE || ' ' || DESERT.PRODUCT || ' ' || DESERT.PRICE OUTPUT
FROM MONEY M
CROSS JOIN DRINKS
CROSS JOIN F1
CROSS JOIN F2
CROSS JOIN DESERT
WHERE DRINKS.PRICE + F1.PRICE + F2.PRICE + DESERT.PRICE <= M.MONEY)
SELECT X.OUTPUT
FROM X
WHERE X.RR = TRUNC(DBMS_RANDOM.VALUE(1, (SELECT COUNT(*) FROM X)))

Andy

Tags: Database

Similar Questions

  • Form check synchronize on Popup to the selected record from the table

    I'm trying to recreate what I did on the portals of the OAS in Weblogic/ADF. I have JDeveloper 11.1.1.2.0. What I do seems to be a little different than the tutorials: I need something like the tutorial master-detail, but instead the details appearing on the same page, it should appear in a popup. I managed to build the part table/popup. But when the popup appears, it displays the wrong record. Here are the steps I used to create this page:

    After you create the ADF Fusion Middleware project:

    1 create templates for the tables I need.
    2. create the JSF Page.
    3 drop panelCollection on the page.
    4. remove my data to see in panelCollection control and choose the Table read-only ADF. Select the sorting and selection options.
    5 change table properties: selected = DisplayRow, EditingMode = clickToEdit
    6 drag the Popup on the page.
    7. remove my data from view in popup control and choose the form of the ADF. Select the send option.
    8 drop showPopupBehavior on the page. Name of the popup. The value triggerType to the 'selection '. (triggerType "click" works, too)
    9 deploy.

    The table is displayed. I click on a line. The pop-up window appears. The form of popup displays the first record in the table. I click on any line.

    I just bought the merger Oracle 11g Developer Guide, but were not able to answer this question yet.

    Any ideas?

    Thank you.

    See this video for how it works for me:
    http://www.ScreenToaster.com/watch/stWUtcRkVLQ1BcSV1aX15Q

  • Grant select on all the table schema in the role

    Hi, it is possible to grant is selected on all the table on a diagram to a role?

    Yes.

    SELECT 'GRANT ALL ON' ||TABLE_NAME || ' to ROLE_NAME;' from dba_tables where owner='SCHEMA';
    
  • I can open a new browser window, but not a new tab, or by clicking on the sign more or select it from the menu. I have completely updated to firefox and also rebooted. What is going on?

    I can open a new browser window, but not a new tab, or by clicking on the sign more or select it from the menu. I have completely updated to firefox and also rebooted. What is going on?

    Try to disable or uninstall the extension "Ask Toolbar".

  • Save the selected value from the ListBox with its respective values control tab dropdown selected in another list box

    Hi all

    I'm doing a vi where I save the selected value from the ListBox with values respective tab control dropdown selected in another list box. Whenever I select Item1 can change of course and the respective tab will be open for this element. But now I want to just save the selection and put it into another ListBox.SO I can't renmove or add my wishes. Please help me.

    It will work.

    Probably not the greatest solution well.

  • Add and remove users from the table

    Hi, guys. I do a system that allowed admin in the user control.

    The ID is = admin

    The neck is = 6649481

    Can someone help me to check add it and remove the part.

    Actually, it may work, but I would like to make he repeats no is allowed, but it works on the index of '0' and then index 1, it will not stop the user to add id repeated.

    Delete if I had to remove the loop will be fine and work well, but it can only remove the top. It's like first first concept but I would like to do as a function of the ID given to remove from the table.


  • Under Vista, cannot restart, select reboot from the start menu, but it stops at the place

    my computer is not restarted. When I select Restart from the Start button, computer stops and restarts do not, but power LED works. my computer is HP, 3.20 GHz, 1 GB of RAM.

    Hello

    That sounds like a hardware issue check with a real computer store (one that makes service in the House
    and not of leeks and glances at a Best Buy or other department stores) or HP support.

    Support HP & drivers
    http://welcome.HP.com/country/us/en/support.html

    Contact HP
    http://welcome.HP.com/country/us/en/contact_us.html

    HP forums
    http://h30434.www3.HP.com/PSG/

    I hope this helps.

  • My toshiba satellite is now gel up randomly from the recent installation of windows 8.1!

    * Original title: freeze

    My toshiba satellite is now gel up randomly from the recent installation of windows 8.1!

    Seems to happen, especially when streaming movies but when to check email or whatever.

    It should stop when it happens because keyboard function used.

    What can I do to fix?

    Hello

    See if this helps you improve performance.

    Search for malicious software with the FREE version of this program.

    And does not accept the option "Pay for the version" trial installation

    Download, install, update and scan your system with the free version of Malwarebytes AntiMalware:

    http://www.Malwarebytes.org/products/malwarebytes_free

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    You can clean your hard drive using these two methods.

    "Delete files using Disk Cleanup"

    http://Windows.Microsoft.com/en-us/Windows/delete-files-using-disk-cleanup#delete-files-using-disk-cleanup=Windows-8

    Using the free CCleaner program:

    http://www.Piriform.com/CCleaner

    In NO case use the registry cleaning Option in CCleaner

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    Make sure you have the latest updated drivers:

    Access the site on your computer or equipment manufacturing > Driver and Software Support Section > search your computer or hardware model number > then your operating system > locate the correct drivers > download and install.

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    "How to optimize the performance of Windows 8 and 8.1" . "

    http://www.eightforums.com/tutorials/37511-optimize-performance-Windows-8-a.html

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    Worth the read as:

    "How to optimize Windows 8.1 for a desktop PC.

    http://www.howtogeek.com/167013/how-to-optimize-Windows-8.1-for-a-desktop-PC/

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    " " Performance & maintenance"

    http://Windows.Microsoft.com/en-us/Windows/performance-maintenance-help#performance-maintenance-help=Windows-8&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    And I would check to see if it has damaged system files.

    Each method/step below progresses to another if the first does not all corrupted files which are, etc..

    «Use the System File Checker tool to repair missing or corrupted system files»

    https://support.Microsoft.com/en-us/KB/929833

    _________________________________________________

    And these eightforums.com tutorials are very detailed for the problems resulting from Scan SFC:

    "How to run the command" SFC/scannow"at the start or in Windows 8 and 8.1" . "

    http://www.eightforums.com/tutorials/3047-sfc-scannow-command-run-Windows-8-a.html

    Read it in conjunction with the rest of the information they give link above.

    Note

    If SFC could not fix something, then run the new command to see if it can be able to next time. Sometimes, it can take by running the sfc/scannow command 3 times restart the PC after each time completely fix everything what he is capable of.

    If this isn't the case, then run Dism/online/Cleanup-Image /RestoreHealth to repair any corruption component store, restart the PC later and try the sfc/scannow command.

    If still no, then try using ONE OPTION above to run the command sfc/scannow at the start

    If still no, then you could do a Refresh of Windows 8, or run a System Restore using a restore point dated before the wrong file occurred to fix. You may need to repeat doing a restore of the system until you find a restore point that is older that may work.

    If not yet, then you can use the steps in the TIP box in the section THREE OPTION to manually replace the files SFC could not fix.

    See you soon.

  • Impossible to delete previously selected items from the drop-down lists at the click of the button Reset on a page of the screen.

    Hello

    I'm unable to clear previously selected items from the drop-down lists at the click of the button Reset on a page of the screen. The code I did to clear the previous value when the click on the button Reset is as below.

    {} public void onReinitialize (ActionEvent actionEvent)

    System.out.println ("onReinitialize is called ::");

    UIComponent uiComp = actionEvent.getComponent ();

    If (uiComp is nothing)

    {

    otherwise we use the button that we linked to that bean

    uiComp = getButtonResetByBean ();

    _logger.info ("reset fields: buttonID =" + uiComp.getId ());

    }

    on the other

    {

    _logger.info ("reset fields: CompID =" + uiComp.getId ());

    }

    Pass the component inside the uniforms, UIXForm, UIXSubform, UIXRegion, UIXPopup, RichCarousel

    or RichPanelCollection that contains the components to reset

    getTextIDLOV () .setValue (null);

    ResetUtils.reset (uiComp);

    }

    ---

    Using this code Iam able to clear the entrance to the text box but can not clear previously selected items from the drop-down lists when the reset button is clicked

    Can anyone please help on this issue.

    It's simple, you can set GenerateIsNullClauseForBindVars = "false" in the viewCriteria who created in EmployeeView

    After doing that it will fill the list of employees only after the Department selection

    Again check the enclosed application

    Ashish

  • How to export data from the table with the colouring of cells according to value.

    Hi all

    I use jdeveloper 11.1.1.6

    I want to export data from the table with a lot of formatting. as for color cells based on value and so much. How to do this?

    You can find us apache POI-http://poi.apache.org/

    See this http://www.techartifact.com/blogs/2013/08/generate-excel-file-in-oracle-adf-using-apache-poi.html

  • Get columns from the table shown in the iterator

    Hello...

    I have the table in a collection of standard panel.  So, I can show/hide certain columns in the table using the columns in the view menu.

    Then I'm trying to do is export to excel (using apache poi) by looping through the table iterator.  What I can't do is search if the column is not displayed.  I don't want all the columns that are exported without worrying.  How can I achieve this?

    My bean is similar to the following for loop through the iterator:

    BindingContext bindingContext = BindingContext.getCurrent ();

    BindingContainer bindingContainer = bindingContext.getCurrentBindingsEntry ();

    DCIteratorBinding dcIteratorBinding = (DCIteratorBinding) bindingContainer.get ("EmployeesIterator");

    lines [] oracle.jbo.Row = dcIteratorBinding.getAllRowsInRange ();

    for (oracle.jbo.Row line: lines) {}

    {for (String colName: {row.getAttributeNames ())}

    output to excel cell here using row.getAttribute (colName) m:System.NET.SocketAddress.ToString)

    }

    }

    Thank you.

    Hello

    It's like ask the engine in your car to what colors the seats have. The iterator doesn't know anything about the visible state of a column. If the displayed columns must be determined from the table instance (richeTableau)

    The following article solves exactly the requirement that you have: Oracle ADF: Build Your Own it comes with a sample that you can download here: http://www.oracle.com/technetwork/issue-archive/2013/13-jul/o43adf-1940728.zip

    Have a look at CustomPanelCollectionBean.java:

    The method and code that you want to look for is:

    private String getRowHtml (row rw) {}

    StringBuffer rowHtmlBuf = new StringBuffer();

    Read visible columns in the table of the table instance. This way the

    PanelCollection can be used to show/hide columns and exclude

    printing to HTML

    Table richeTableau = this.getRichTable ();

    the list of columns determine the print attributes

    The list of columns in = table.getChildren ();

    int attrCount = columns.size ();

    rowHtmlBuf.append (this.addRowStart ());

    for (int i = 0; i)< attrcount;="" i++)="">

    for all visible columns, add columns to print

    If (((RichColumn) columns.get (i)) .isVisible ()) {}

    If (rw.getAttribute (i) instanceof ViewRowSetImpl) {}

    ignore the collections of detail used for master/detail example

    constraints in British Colombia ADF

    } ElseIf (rw.getAttribute (i) instanceof oracle.jbo.domain.Timestamp) {}

    shorten date to exclude the infromation times

    SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");

    String dateFormatString = sdf.format (((Timestamp) rw.getAttribute (i)) .getData ());

    rowHtmlBuf.append (this.addDataCell (dateFormatString));

    } else {}

    Prnt attribute values and if sure that null values don't raise a NPE. Add a white character to NULL

    attribute values

    rowHtmlBuf.append (this.addDataCell (rw.getAttribute (i)! = null? rw.getAttribute (i) m:System.NET.SocketAddress.ToString ():))

    " "));

    }

    }

    }

    rowHtmlBuf.append (this.addRowEnd ());

    Return rowHtmlBuf.toString ();

    }

    You need to access the Rich Table instance (for example using the JSF component binding) to then compare the attribute in the iterator with the visibility of the column

    Frank

  • Is it possible to see/get the data from the table to a dump file

    I have files dmp generated using expdp on oracle 11 g...

    expdp_schemas_18MAY2013_1.dmp

    expdp_schemas_18MAY2013_2.dmp

    expdp_schemas_18MAY2013_3.dmp

    Can I use a settings file given below to get the data from the table in the file sql or impdp the only option to load the data of table in database.

    VI test1.par

    USERID = "/ as sysdba".

    DIRECTORY = DATA

    dumpfile=expdp_schemas_18MAY2013%S.dmp

    SCHEMAS = USER1, USER2

    LOGFILE = user_dump_data.log

    SQLFILE = user_dump_data. SQL

    and impdp parfile = test1.par.

    No,

    DataPump cannot retrieve a dumpfile data in a flat file.

    Dean

  • Right-click DeptEmp.jsf and select run from the context menu

    Hello

    Please consider article Oracle Magazine "Catch Me If You Can ' Frank Nimphius
    at http://www.oracle.com/technetwork/issue-archive/2013/13-mar/o23adf-1897193.html

    In the article, it is offered several times to
    «... Right-click DeptEmp.jsf and select run from the context menu...'.»
    When you use JDeveloper 11.1.2.3.0 it will result in JDeveloper starting a browser requesting a URL "/ faces/DeptEmp" (without ".jsf").
    (Note that in the sample adfc - config.xml has a view with the id "DeptEmp" activity, but for pages without an activity view corresponding to the stream of unrelated task (adfc-config.) (Xml) JDeveloper starts a browser requesting a "/ faces/otherPage.jsf" URL (with ".jsf").)

    Still, I wonder if we should really run (JSF) pages, or rather an activity view in the flow of a task?

    After running into issues with calling (JSF) page URL rather than controller unbounded ADF task flows view activity URL in another forum thread [1], I try to avoid pages (JSF) (execution of the task-flow unlimited instead) running.
    to Re: login after logout is not possible using af: commandButton
    John Stegeman wrote:
    ... especially since it is very common for people new FAD (and indeed no-so-news-to-ADF people like me) to run their app via a page rather than the workflow and then wonder why it does not work :)...
    But also the Oracle documentation seems to suggest that page running a (JSF) is the way to go (or "a" way to go), see the section "41.2.1 how to run an Application in Integrated WebLogic Server "
    saying: ""in the navigation Application, select the project, a task flows, JSF page or file as the target execution. ".
    at http://docs.oracle.com/cd/E37975_01/web.111240/e16182/deployment_topics.htm#ADFFD22047

    So, who is? Is there a preferred way to run? Running a (JSF) page "also recommended"?

    -[1] ' login after logout is not possible using af: commandButton.
    during the connection after disconnection is not possible using af: commandButton

    Thank you very much
    Jan Vervecken

    Hello

    Still, I wonder if we should really run (JSF) pages, or rather an activity view in the flow of a task?

    The recommendation is to run the activity. I think it's just my laziness to boot from the JSF file in the case of the article (and given my article only has a single page in the workflow unlimited I wonder if my attempt failed, if there was a need for a navigation to another view in the flow of unlimited work). The risk from a page directly, it is a physical implementation of a view that could be used by multiple streams of different tasks (although the common use of the stubborn workflow is to go with fragments of the page, always bounded task flows could be defined using complete documents). His recommendation that you start an activity to view pages in order to ensure the ADFc is used (I wasn't even not aware of 11.2.3 to automatically change request activity instead of the file if there is an activity of referencing).

    Frank

  • Toggle buttons control according to the selected line in the table?

    Hello

    I have used JDev 11.1.1.2.0

    On my main page, it has a query section and view the result to a component of the lookup table and also has functioning as (update/deletion) buttons in the toolbar.

    I want to toggle buttons operating according to some value of the selected line in the table, and I searched on the OTN forum, found more than issues like that, but seemed no found a good solution.

    The table is a unique and has a status column selection, its data type is integer, and I want to activate the buttons when the value of the status field of the selected line is 0 or 1, disable the buttons when the State value is other values.

    Code of the table as:

    < af:table value = "#{bindings." Var VO1.collectionModel}"="row ".
    lines = ' #{bindings. " VO1.rangeSize}.
    emptyText = "#{bindingsVO1.viewable?" '} ". No data to display. ': 'Access Denied. »} »
    fetchSize = "#{bindings." VO1.rangeSize}.
    rowBandingInterval = '0 '.
    filterModel = "#{bindings." VOCriteriaQuery.queryDescriptor}.
    queryListener = ' #{bindings. " VOCriteriaQuery.processQuery}.
    filterVisible = "true" varStatus = "vs."
    selectedRowKeys = ' #{bindings. " VO1.collectionModel.selectedRow}.
    selectionListener = "#{bindings." VO1.collectionModel.makeCurrent}.
    rowSelection = "single" id = "resId1" >

    Operation code buttons like:
    < af:commandToolbarButton text = "Update" id = "ctb2" action = "editDAF" / >

    Any suggestions would be very helpful.

    Thank you
    zeroxin

    Hello

    bind to the attribute in the PageDef file for the status field. Then configure the PartialTriggers property button to point to the ID of the table. Of the disabled button property then points to the status as attribute link

    #{bindings.statusField.inputValue == 'value'}

    Frank

  • How do I get the selected row in the table (FacesCtrlHierBinding).

    I am trying to get the data of the selected row in the table:

    RowBinding () (FacesCtrlHierBinding) tab.getSelectedRow = FacesCtrlHierBinding;
    Line rw = rowBinding.getRow ();

    But for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding be found since my 11 JDev to import.
    What is a good package for FacesCtrlHierBinding?

    Hello
    This is the code I use to get the selected rows in a rich table of adf:

        public void deleteMarkedRows()
        {
    
            RichTable table = this.getImportTable(); //get table bound to UI Table
            RowKeySet rowKeys = table.getSelectedRowKeys();
    
            Iterator selection = table.getSelectedRowKeys().iterator();
            while (selection.hasNext())
            {
                Object key = selection.next();
                table.setRowKey(key);
                Object o = table.getRowData();
                JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) o;
                Row row = rowData.getRow();
                row.remove();
            }
    
            //prepare table to show changes
            table.setFirst(0);
            RequestContext.getCurrentInstance().addPartialTarget(table);
        }
    

    Hope this helps

    Timo

Maybe you are looking for

  • Several problems with my Satellite A200-1QZ

    Hello I'm sorry to open a new thread, but I already looked around for awhile and has failed to find the answers I need. Since I have several different problems, some of which are probably unique, I thought I might as well start a new thread. So lets

  • HP Sparekey administrator password

    Hello I bought the laptop HP Probook 4321 s year 2010 of China. I have all the documents that gave me at the time of purchase. I have 5 questions. You help will be appreciated. Thank you. (1) my PC came without windows pre-installed. What happens if

  • external supermulti drive Toshiba will not write on windows xp pc. work on vista machine.

    drive supermulti external Toshiba not able to write my mini dell windows xp, works very well on a vista machine. Toshiba suppport said need to remove upper and lower filter and it is a problem of knowing. What is the solution?

  • Windows Photo Gallery does not

    Hello I use Windows Photo Gallery to see all my photos. Recently, when I tried to display a photo (in jpg format) file an error appears and says "error loading C:\ProgramFiles\WindowsPhotoGallery\PhotoViewer.dll the system cannot find message for mes

  • Change the language in which Microsoft security essentials is installed

    Microsoft has downloaded a version French of MSE on my PC can't I change to English?