Suggestions for this sql.

Hi,
Here is my code.
drop table t;
drop table p;
create table t (site_id number,
                state varchar2(2),
                county varchar2(100));
create table p(state varchar2(2),
               county varchar2(100),
               org1 number,
               org2 number,
               org3 number);
insert into t values (1, 'TX', 'DALLAS');
insert into t values (2, 'TX', 'DENTON');
insert into t values (3, 'CA','ORANGE');
insert into t values (4, 'PA','ERIE');
insert into t values (5, 'FL','SARASOTA');
insert into p values ('TX','DALLAS',121,122,123);
insert into p values ('TX',NULL, 124,125,126);
insert into p values ('CA','ORANGE',127,128,129);
insert into p values (null,null,130,131,132);
SELECT *
  FROM (SELECT t.site_id,
               t.state,
               t.county,
               p.org1,
               p.org2,
               p.org3,
               row_number() over(PARTITION BY t.state, t.county ORDER BY p.state, p.county NULLS LAST) rown
          FROM t,
               p
         WHERE t.state = nvl(p.state, t.state)
           AND t.county = nvl(p.county, t.county))
WHERE rown = 1
ORDER BY site_id't' is my driving table.
1) If I find an exact match on the join on 'state' and 'county', then, I should pick that row for the orgs in 'p'.
2) If no match in point 1, then, look for the same 'state' and null as the county in p.
3) If no match in point 2, then, look for the null state and null count in p
to pick the rows.
We came up with this sql.
1). Is this sql right? (first glance, it seems to give us the right intended data).
2). Could this have been written in a different way?
Thank you,
Rahul.

Frank Kulash wrote:
Hi, Rahul,
The query looks pretty good to me. I can't think of any better alternatives, or of any situations where that wouldn't get the results you want.
What is unique in those tables?
If t.site_id is unique, then I would suggest changing the PARTITION BY clause to "PARTITION BY t.site_id", especially if (t.state, t.county) is not unique.
Yes Frank, site_id is unique in my driving view. I will change it accordingly.
In table t, can state or county be NULL? If so, what results would you want? You might have to change the join conditions.
In table t, no, we DO NOT have state and county as nulls. (Good point, I will keep that in mind if not so).
Are you certain that p will always contain a row where both state and county are NULL? If not, you might need to make this an outer join.
Yeap, that is right.
Actually, there are no nulls in the 'state' and/or 'county' fields either. The data was actually a star '*'. I didn't know how to write this sql for * as the value, so, I used NVL in the join.
NULLS LAST is the default in ORDER BY. There's nothing wrong in explicitly saying NULLS LAST, That is what I thought, but, then, I think I saw in one case, my IDE (PL/SQL Developer in this case) showed NULLS FIRST if I just did an order by. I could have been wrong.
but if you're doing so for p.county, why not for p.state as well?Yes, you are right. I forgot to do NULLS LAST for state as well. that phrase is indeed per column.
So, for now, I will change this query to this:
SELECT *
  FROM (SELECT t.site_id,
               t.state,
               t.county,
               p.org1,
               p.org2,
               p.org3,
               row_number() over(PARTITION BY t.site_id, t.state, t.county ORDER BY p.state, p.county) rown
          FROM t,
               p
         WHERE t.state = nvl(p.state, t.state)
           AND t.county = nvl(p.county, t.county))
WHERE rown = 1
ORDER BY site_idEdited by: RPuttagunta on Jan 26, 2011 9:52 PM
Edited by: RPuttagunta on Jan 26, 2011 9:55 PM
EDIT: Love Chrome OS laptop, but, the trackpad feedback is a mess.

Similar Messages

  • I would like to get certified for the SAP Crystal Reports. So, I would like to get some info about the currently available Certification Exams for Crystal Reports (2011/2013). Also, would greatly appreciate  if you have any suggestions for thi

    Hi,
            I would like to get certified for the SAP Crystal Reports. So, I would like to get some info about the currently available Certification Exams for Crystal Reports (2011/2013). Also, would greatly appreciate  if you have any suggestions for this Certification Exam preparation materials from another 3rd party or from SAP directly .  I would like to prepare or get trained well before taking the exam as I see it costs around $500.
    Thanks in advance for your help in this regard!
    Sincerely,
    J

    Please search here.. Training and Certification Shop for your desired certification or training. Don't forget to set your location.
    Please use some summarized title for your query.

  • I started to have connectivity issues with a linksys router.  The linksys rep suggested ...Check from Apple if they have some particular ports for the Apple TV that we might need to open on the router, anyone have any suggestions for this?

    I started to have connectivity issues with a linksys router.  The linksys rep suggested ...Check from Apple if they have some particular ports for the Apple TV that we might need to open on the router, anyone have any suggestions for this?

    Hi RonWM,
    Thanks for visiting Apple Support Communities.
    This article lists the ports that are used by the Apple TV:
    Apple TV: TCP and UDP ports and protocols used
    http://support.apple.com/kb/HT2463
    Best Regards,
    Jeremy

  • Give me your Suggestion for this Online Banking EJB

    Dear Friends,
    i am developing online banking project,using J2EE server
    In this just checking the customer transaction status only
    that is status of(withdraw,loan,account info).
    In this what type of enterprise bean is needed ?
    my idea is Session bean is selected,in this i am selecting
    stateless session bean
    I have doubt in this selection,this is correct or not ?
    i am not select Entity bean becaues i am not stored any information
    to the database.
    But i am stored only new User Registration Page,for this purpose
    Entity bean is necessary or not ?
    In this Project Entity bean and Session bean both used is correct ya ?
    Give me your valuable suggestion to me

    You will need both session bean and entity bean. You might be able skip entity bean depends how you retrieve the status information. The web tier will call the remote interface of the session bean. The session bean has the business logic (in another word functions). The entity beans deal with the data storage. The session bean will interact with the entity beans through their local interface assuming they are in the same container. Never interact between web tier and entity bean directly. It is also not recommended to make database call from web tier either.

  • I have tried the steps suggestedf including deleting cookies.squilte (which is not present on my computer after a search) to keep signed in to e-mail accounts at yahoo and gmail and they haven't worked? Suggestions for this novice + user, anyone??

    Can't !. Say signed in to email websites for yahoo and gmail, and i've upgraded to firefox 3.6 to try to solve problem and the options for selecting answers are not available to me (for instance did search for "cookies.squilte" and either that or profile folder search brought up anything like the forum answers indicated were successful. 3. tried select "remember PW" in options answers but no cookies show up to except/remove so that is not an option. HELP FOR THIS LIMITED NOVICE + KNOWLEDGE USER APPRECIATED

    Copy and Paste this code in the Code field in the ''"Tools > Error Console"'' and click the ''Evaluate'' button to see the location of the profile folder.
    <code>alert(Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile).path);</code>
    See http://kb.mozillazine.org/Profile_folder_-_Firefox
    "Application Data" in XP/Win2K and "AppData" in Vista/Windows 7 are hidden folders, use %APPDATA% in the File name field.
    See also http://kb.mozillazine.org/Show_hidden_files_and_folders
    Go to: Control Panel > Folder Options > "View" tab > under "Hidden files and folders", select "Show hidden files and folders".
    You may want to un-check the box "Hide extensions for known file types" to see the file extensions of all files.
    XP: C:\Documents and Settings\&lt;user&gt;\Application Data\Mozilla\Firefox\Profiles\&lt;profile&gt;\
    Vista/Windows 7: C:\Users\&lt;user&gt;\AppData\Roaming\Mozilla\Firefox\Profiles\&lt;profile&gt;\

  • We saw this error in log, this is not hampering anything, but any suggestion for this.

    We saw this error in the log file, while running the application module, having two customize view objects added to it.
    java.sql.SQLException: invalid name pattern: FUSION_RUNTIME.FND_TABLE_OF_VARCHAR2_255
        at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:599)
        at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:506)
        at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:2143)
        at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:315)
        at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:222)
        at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:190)
        at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:172)
        at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:130)
        at oracle.apps.fnd.applcore.common.ApplSessionManagement.createSession(ApplSessionManagement.java:323)
        at oracle.apps.fnd.applcore.common.ApplSessionManagement.createSession(ApplSessionManagement.java:191)
        at oracle.apps.fnd.applcore.common.ApplSessionManagement.createAttachedSession(ApplSessionManagement.java:663)
        at oracle.apps.fnd.applcore.oaext.model.OAApplicationModuleImpl.prepareSession(OAApplicationModuleImpl.java:875)
        at oracle.jbo.server.ApplicationModuleImpl.prepareSession(ApplicationModuleImpl.java:6892)
        at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:181)
        at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:9075)
        at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:4603)
        at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2533)
        at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2343)
        at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:3242)
        at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:572)
        at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:505)
        at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:500)
        at oracle.adf.model.bc4j.DCJboDataControl.initializeApplicationModule(DCJboDataControl.java:516)
        at oracle.adf.model.bc4j.DCJboDataControl.getApplicationModule(DCJboDataControl.java:862)
        at oracle.jbo.jbotester.binding.TesterBinding.getApplicationModule(TesterBinding.java:189)
        at oracle.jbo.jbotester.binding.TesterBinding.initApplicationModule(TesterBinding.java:168)
        at oracle.jbo.jbotester.binding.TesterBinding.<init>(TesterBinding.java:164)
        at oracle.jbo.jbotester.binding.TesterBinding.<init>(TesterBinding.java:128)
        at oracle.jbo.jbotester.MainFrame.loadConfiguration(MainFrame.java:632)
        at oracle.jbo.jbotester.MainFrame.processArgs(MainFrame.java:597)
        at oracle.jbo.jbotester.MainFrame.main(MainFrame.java:428)
    any suggestion to remove this error.
    THanks
    VIpin

    Just to add on what it does:
    You are running the AM with username fusion_runtime which is granted privileges for fusion schema. On running the AM the ApplSession is created and a logon trigger is executed which sets the current schema to 'Fusion' (rather fusion_runtime). This results in wrong data type associations and causing the issue.
    The jvm parameter actually sets it back to 'fusion_runtime' and fixes the issue.
    Hope this helps
    vik
    Fusion Developer Relations Team
    http://blogs.oracle.com/fadevrel

  • Suggestion for PL/SQL programming

    can anyone suggest me the best book for learning PL/SQL programming

    First, understand the Database Concepts
    Then you can use the PL/SQL User Guide and Reference
    If you want to learn by example, follow this forum, having a go at answering peoples problems for yourself and learning from the people who supply the solutions.

  • Any layout suggestions for this?

    How can I place a JCheckBox and JButton components on the area beside the TabbedPane tabs (Top right corner position)?
    Final design should be like this image
    http://www.rejimani.com/backup/tabbed.jpg
    Any suggestions?
    Reji Mani

    * Test_AbsoluteLayout.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test_AbsoluteLayout extends JFrame {
        public Test_AbsoluteLayout() {
            initComponents();
        private void initComponents() {
            checkbox = new JCheckBox();
            button = new JButton();
            tabbedpane = new JTabbedPane();
            panel1 = new JPanel();
            panel2 = new JPanel();
            getContentPane().setLayout(new AbsoluteLayout());
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            checkbox.setPreferredSize(new Dimension(83, 21));
            checkbox.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    checkboxActionPerformed(evt);
            getContentPane().add(checkbox, new AbsoluteConstraints(350, 0, 20, -1));
            button.setText("OK");
            button.setMargin(new Insets(0, 0, 0, 0));
            button.setPreferredSize(new Dimension(71, 21));
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    buttonActionPerformed(evt);
            getContentPane().add(button, new AbsoluteConstraints(370, 0, 30, -1));
            tabbedpane.setPreferredSize(new Dimension(400, 300));
            tabbedpane.addTab("tab1", panel1);
            tabbedpane.addTab("tab2", panel2);
            getContentPane().add(tabbedpane, new AbsoluteConstraints(0, 0, -1, -1));
            pack();
        private void checkboxActionPerformed(ActionEvent evt) {
            System.out.println("check");
        private void buttonActionPerformed(ActionEvent evt) {
            System.out.println("ok");
        public static void main(String args[]) {
            new Test_AbsoluteLayout().setVisible(true);
        private JButton button;
        private JCheckBox checkbox;
        private JPanel panel1;
        private JPanel panel2;
        private JTabbedPane tabbedpane;
    class AbsoluteConstraints implements java.io.Serializable {
        static final long serialVersionUID = 5261460716622152494L;
        public int x;
        public int y;
        public int width = -1;
        public int height = -1;
        public AbsoluteConstraints(Point pos) {
            this(pos.x, pos.y);
        public AbsoluteConstraints(int x, int y) {
            this.x = x;
            this.y = y;
        public AbsoluteConstraints(Point pos, Dimension size) {
            this.x = pos.x;
            this.y = pos.y;
            if (size != null) {
                this.width = size.width;
                this.height = size.height;
        public AbsoluteConstraints(int x, int y, int width, int height) {
            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;
        public int getX() {
            return x;
        public int getY() {
            return y;
        public int getWidth() {
            return width;
        public int getHeight() {
            return height;
        public String toString() {
            return super.toString() +" [x="+x+", y="+y+", width="+width+", height="+height+"]";
    class AbsoluteLayout implements LayoutManager2, java.io.Serializable {
        static final long serialVersionUID = -1919857869177070440L;
        public void addLayoutComponent(String name, Component comp) {
            throw new IllegalArgumentException();
        public void removeLayoutComponent(Component comp) {
            constraints.remove(comp);
        public Dimension preferredLayoutSize(Container parent) {
            int maxWidth = 0;
            int maxHeight = 0;
            for (java.util.Enumeration e = constraints.keys(); e.hasMoreElements();) {
                Component comp = (Component)e.nextElement();
                AbsoluteConstraints ac = (AbsoluteConstraints)constraints.get(comp);
                Dimension size = comp.getPreferredSize();
                int width = ac.getWidth();
                if (width == -1) width = size.width;
                int height = ac.getHeight();
                if (height == -1) height = size.height;
                if (ac.x + width > maxWidth)
                    maxWidth = ac.x + width;
                if (ac.y + height > maxHeight)
                    maxHeight = ac.y + height;
            return new Dimension(maxWidth, maxHeight);
        public Dimension minimumLayoutSize(Container parent) {
            int maxWidth = 0;
            int maxHeight = 0;
            for (java.util.Enumeration e = constraints.keys(); e.hasMoreElements();) {
                Component comp = (Component)e.nextElement();
                AbsoluteConstraints ac = (AbsoluteConstraints)constraints.get(comp);
                Dimension size = comp.getMinimumSize();
                int width = ac.getWidth();
                if (width == -1) width = size.width;
                int height = ac.getHeight();
                if (height == -1) height = size.height;
                if (ac.x + width > maxWidth)
                    maxWidth = ac.x + width;
                if (ac.y + height > maxHeight)
                    maxHeight = ac.y + height;
            return new Dimension(maxWidth, maxHeight);
        public void layoutContainer(Container parent) {
            for (java.util.Enumeration e = constraints.keys(); e.hasMoreElements();) {
                Component comp = (Component)e.nextElement();
                AbsoluteConstraints ac = (AbsoluteConstraints)constraints.get(comp);
                Dimension size = comp.getPreferredSize();
                int width = ac.getWidth();
                if (width == -1) width = size.width;
                int height = ac.getHeight();
                if (height == -1) height = size.height;
                comp.setBounds(ac.x, ac.y, width, height);
        public void addLayoutComponent(Component comp, Object constr) {
            if (!(constr instanceof AbsoluteConstraints))
                throw new IllegalArgumentException();
            constraints.put(comp, constr);
        public Dimension maximumLayoutSize(Container target) {
            return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
        public float getLayoutAlignmentX(Container target) {
            return 0;
        public float getLayoutAlignmentY(Container target) {
            return 0;
        public void invalidateLayout(Container target) {
        protected java.util.Hashtable constraints = new java.util.Hashtable();
    }

  • I am having trouble downloading the new outlook mail.It returns error message about a sync services agent, database daemon etc. Also, I Can send an email but it returns with message: "message could not be sent." Any suggestions for this Apple novice?

    I try and download the new Outlook update and it says I have to close sync services agent and others.I do that,or 'think' I do but it doesn't close.

    PS - have found other posts indicating that clips smaller than 2s or sometimes 5s, or "short files" can cause this. Modern style editing often uses short takes ! Good grief I cannot believe Apple. Well I deleted a half a dozen short sections and can export, but now of course the video is a ruined piiece of junk and I need to re-do the whole thing, the sound etc. which is basically taking as much time as the original. And each time I re-do it I risk again this lovely error -50 and again trying to figure out what thing bugs it via trial and error instead of a REASONABLE ERROR MESSAGE POINTING TO THE CLIP IT CAN'T PROCESS. What a mess. I HATE this iMovie application - full of BUGS BUGS BUGS which Apple will not fix obviously, since I had this product for a few years and see just hundreds of hits on Google about this error with disappointed users. Such junk I cannot believe I paid money for it and Apple does not support it with fixes !!!
    If anyone knows of a GOOD reasonably priced video editing program NOT from APPLE I am still looking for suggestions. I want to do more video in future, but obviously NOT with iMovie !!!

  • Need suggestions for improving sql query.

    Hi,
    There is an sql query which loads data into a single table from 80 other tables which are loaded with data from different sites.The sql query to load from these 80 tables into single table is taking almost 40 min everyday with 6-7 million records.
    The notation followed
    the table is truncated first and then the constraints are disabled.
    insert into single table (column1,column2,column3)
    ( select * from table1
    union all
    select * from table2
    union all
    select * from table3
    union all
    select * from table80);
    enable the constraints.
    The database is 10.2.0.3.Is there any other way that can be implemented or modified this to get a better response time to load the data faster.
    Thanks

    A lot of IFs, but
    if you have a licence for the partitioning option, and
    if the data has some convenient partitioning column - such as a 'site' column which could be used for list partitioning, and
    if you don't need the separate tables to exist after you have consolidated the data
    if you can create all other necessary constraints on the base tables,
    you could:
    create main table as empty, but partitioned with 80 empty partitions
    exchange partition with table 80 times in a row.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • How much attached storage can a mac server handle? What would be the best suggestion for this?

    Hello, hopefully I am in the correct location, if not, i apologize. Please bear with me as I am fairly new to MAC server. Here is my dillema. I have a mac graphics group that uses about 6TB of storage currently on a Windows server. We are running into issues such as permissions and searching inability. I was considering moving them to a mac server but will need to add storage to this. What would be recommended for such large disk space? We do currenlty have 2 mac mini servers and all the users are bound to AD as well. Thank you in advance for any suggestions!

    One of the Mac Mini Server boxes I deal with has 24 TB hanging off of the box (configured as RAID-6), plus a two-disk RAID-1 mirror set inside the box.   That's also a pretty small configuration, both in terms of its physical size and in terms of its storage capacity in the grand scheme of things.
    A Mac Pro or Mac Pro Server will do 8 TB inside the box, plus a whole lot more outside the box either direct-attached storage (DAS) or via a Storage Area Network (SAN) configuration, but the performance of a Mac Pro Server is probably overkill for your needs, too.
    As much as you are focusing on the capacity, you'll also want to look at how you'll archive and manage that much storage.   At how you'll manage and conduct backups of your data.
    You'll also be looking at the speed and the design of your network, if you're moving large files around regularly.  Gigabit Ethernet does pretty well for small groups, but you may be looking for a different setup of that's not fast enough.

  • Any Suggestions for this Table??

    Iam facing problem while creating a report.
    I have to generate a report which is having dynamic columns and rows
    For Eg. In this report I have total 365 columns (M1 to M365)depends up on the user he can generate the report for 2 or 3 or may be 365 columns and rows also dynamic. If Product code are more then it will proceed printing in next page.In the next page also he will get same column headings.I am not able to decide the table for that can you sugest some table for that.
    Example
    Product code Desc M1 M2 M3 M4......M365
    PL1 PD1 1 2 4 3 10
    PL2 PD2 2 3 4 5 6
    null

    I'm assuming by normal tab, you want to insert a tab. So here's this:
    import java.awt.*;
    import java.util.HashSet;
    import java.util.Set;
    import javax.swing.*;
    public class TextAreaTab {
         public static void main( final String[] args ) {
              Runnable doCreate = new Runnable() {
                   public void run() {
                        new TextAreaTab().createGUI();
              SwingUtilities.invokeLater( doCreate );
         private void createGUI() {
              JButton button = new JButton( "Button" );
              JTextArea textArea = new JTextArea();
              textArea.setText( "TextArea" );
              KeyStroke ctrlTab = KeyStroke.getKeyStroke("ctrl TAB" );
              Set set = new HashSet( textArea.getFocusTraversalKeys( KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS) );
              set.remove( ctrlTab );
              textArea.setFocusTraversalKeys( KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set );
              textArea.getInputMap().put( ctrlTab , "insert-tab" );
              JFrame frame = new JFrame( "TextAreaTab" );
              frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              frame.getContentPane().setLayout( new BorderLayout() );
              frame.getContentPane().add( button, BorderLayout.SOUTH );
              frame.getContentPane().add( textArea, BorderLayout.CENTER );
              frame.setSize( new Dimension( 250, 100 ) );
              frame.show();
    }

  • Suggestions for this scenario...

    Hi. I have a tables named call_queue and call_history:
    Call_Queue:
    Name                                      Null?    Type
    PARTICIPANT_ID                            NOT NULL VARCHAR2(10)
    LAST_ACCESS_DT                                     DATE
    LAST_ACCESS_BY                                     VARCHAR2(15)
    CREATE_DT                                 NOT NULL DATE
    CREATE_BY                                 NOT NULL VARCHAR2(15)
    MODIFY_DT                                 NOT NULL DATE
    MODIFY_BY                                 NOT NULL VARCHAR2(15)
    CALL_STATUS                               NOT NULL VARCHAR2(3)
    PARTICIPANT_TYPE                                   VARCHAR2(3)
    Call_History:
    Name                                      Null?    Type
    PARTICIPANT_ID                            NOT NULL VARCHAR2(10)
    CALL_STATUS_IND                                    VARCHAR2(2)
    COMMENTS                                           VARCHAR2(100)
    CREATE_DT                                 NOT NULL DATE
    CREATE_BY                                 NOT NULL VARCHAR2(15)
    MODIFY_DT                                 NOT NULL DATE
    MODIFY_BY                                 NOT NULL VARCHAR2(15)On my application when a user is interacting with a Participant_Id's Call_Queue record I want to display the 5 most recent Call_History records for that Participant_Id. Seems easy enough if I create a Master-Detail Relationship between the two blocks.
    But my requirement is also that each time I display the 5 most recent Call_History records that I also provide the user a blank Call_History record so the user can insert a new Call_History record without having to 1) press an Insert button or select a menu item; or 2) scroll to the bottom of the 5 records displayed in order to insert the new record. Also, I don't want the user to have to redundantly enter the Participant_Id in the new Call_History record.
    Is there a way to have a blank record (always blank and ready for insert) displayed at the top of my 5 most recent Call_History records? What is the best way to handle this?

    Two options from my view:
    1. Take the ON-POPULATE-DETAILS-trigger on the master-block and pu an additional CREATE_RECORD along with a GO_BLOCK in it.
    2. Create an additional block which is similar to the call_history-block and put it's fields at the positon above your "real" call-history-block. Use that new block for the inserting.

  • A suggestion for this forum

    I think it would be useful to change the way that links in a thread work. Now when you click on them they open in the same page as the current thread, and it is quite annoying as you have to go back millions of pages when you are done visiting the other website.
    So i think it would be cool if you could change the way that links are set to open and if you can to change it to a blank window.

    lol ya ya i know.. i'm not that new to apple.. but actually it's just that when i HAVE to use a pc clicking on "open ina new window" takes ages.. like 5/7 seconds.. so ya.. it was just a suggestion tho.. i'm not pretending something.. lol

  • How to write Dynamic SQL for this SQL ?

    EXECUTE IMMEDIATE 'select COUNT(*) from dba_Tab_privs@' ||db_link|| ' WHERE Grantee <> 'DELETE_CATALOG_ROLE'
    AND Table_Name = 'LINK$'
    AND Grantee NOT IN (SELECT Grantee
    FROM dba_Role_privs
    WHERE Granted_Role = 'DBA')' into i using x;

    Hi bapalu,
    I take that x is the name of your db_link?
    If so,
    DECLARE
       i      NUMBER;
       x      dba_db_links.db_link%TYPE;
       stmt   VARCHAR2(255);
    BEGIN
       x := 'some_link';
       stmt :=
          'SELECT count(*)
             FROM dba_tab_privs@:db_link
            WHERE grantee <> ''DELETE_CATALOG_ROLE''
              AND table_name = ''LINK$''
              AND grantee NOT IN(SELECT grantee
                                   FROM dba_role_privs
                                  WHERE granted_role = ''DBA'')';
       EXECUTE IMMEDIATE REPLACE(stmt, ':db_link', x)
                    INTO i;
       dbms_output.put_line('The count: ' || i);
    END;Also, I think this is maybe not what you want:
    AND table_name = ''LINK$''Regards
    Peter

Maybe you are looking for

  • File names with last changed Date and time in a directory

    Hi All. I need to get all filename, last changed date, last changed time in a directory. Is there any function module for this? Regards, Venkat.

  • New Preview (image) update - not user friendly .

    New Preview software. Apple's new update to Preview is annoying  -  very annoying. a.  In the 'File options' it says "Save a Version".  Now that sounds like "Save a New Version", so it never does what I want.  Why not call it "Save", like it always w

  • Can't burn 57 min imovie to idvd 5

    Everything works fine, but at the end my movie did not burn to the dvd. I had to go to best quality as it was originally 4.0, I deleted some of the movie so not it is 3.9. I just downloaded idvd 5.01 any other suggetions? thanks, Pam

  • Location of Customer Statement Report

    Hi all, I am wanting to customize the Customer Statement Report - when printed it appears to be a Crystal Report, but in the list of reports in the Report and Layout Manager there appears to be no reference to it under Customer Receivables Ageing or

  • XML converted to string - encoding lost?

    Hi, I am using a socket to obtain xml data. Because it is a continuous stream, I need to check for <?xml version...> in order to split the data into parsable chunks because the parser can only parse one xml file at a time. In order to do this I use a