The logic behind subqueries/nested query

I am working on some complicated subqueries in Oracle 10g. I read all the documentation, I have reference books and files, and...google. I was hoping, someone might be able to provide a thorough explanation in their own words.
This is my understanding of the matter.
SELECT column1, column2
FROM table1, table2
WHERE join conditions
AND search field1 =
(SELECT column3, column4
FROM table3, table4
WHERE search and join condition0
Now, regarding AND search field1 =, must it be the same as column3 in the sub? How do I know which condition should be set aside for = (Subquery)?
thank you

Hi,
Sorry, I don't understand your question either.
There are a couple of things that I think I can explain for you, however.
First, you should never write, let alone post, unfomatted code. Indent you code so that how it looks on the screen somehow reflects what it does.
When posting code, or any formatted text, on this site, type these 6 characters:
{code}
(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
If you have to use pseudo-code, make it clear.
For example:
SELECT  column1
,     column2
FROM      table1
,     table2
WHERE      ...     -- join conditions go here
AND     search_field1 = ( SELECT column3
                       ,      column4
                 FROM      table3
                 ,      table4
                 WHERE      ...     -- search and join condition0 goes hereThis can help you spot many erriors. For example, there is no ')' at the end of the sub-query.
The are several different kinds of sub-queries.
One type is called Scalar Sub-Query : it can be used almost everywhere an expression is used.
For example, consider the following query, that finds people whose salary is lower than a given amount:
SELECT  *
FROM    scott.emp
WHERE   sal     < 1250
;The literal 1250 above is an example of an expression. Instead of a numeric literal, we could use a column there:
WHERE   sal     < commor a function:
WHERE   sal     < SQRT (1500000)or a CASE expression, or some combination of them.
What we can't use to the lright of the < sign is anything that is not a SQL datatype (a boolean condition, for example) or any kind of collection that has multiple values.
We could use a scalar sub-query, which is a query that returns no more than one row, and exactly one column.
For example
SELECT  *
FROM    scott.emp
WHERE   sal     < ( SELECT  AVG (sal)
              FROM    scott.emp
;You will get a compile error (ORA-00913) if the sub-query has more than one column, and a run-time error (ORA-01427) if it returns more than one row.
Scalar sub-queries can be correlated to the parent query.
The example above picked employees who earn less than the average of all employees.
The example below picks employees who earn less that the average for their job:
SELECT  *
FROM    scott.emp     m     -- m for Main
WHERE   sal     < ( SELECT  AVG (sal)
              FROM    scott.emp
              WHERE   job     = m.job
;

Similar Messages

  • Could you please help me understand the logic behind certain things in OSX?

    Ok, so I try to be an open-minded guy, and I bear no particular allegiance to either OS. I own a Sony TZ and a Mac mini, and my wife has a MacBook Pro. I use both Oses.
    There are certain things I have trouble understanding in th Mac OS, so what I'd really like to understand the logic behind certain design decisions in the OS, and why these might be better ways of accomplishing things. I know how to get around all of the things I mention, so I'm not looking for instructions; rather I'm looking for well-thought out explanations for why these features are the way they are.
    *1. Programs don't quit when you close the window.*
    - This totally puzzles me. Why design it so that program windows are independent are from the running program itself? There must be a reason, cold someone explain how this is more efficient? To me, it's simpler to click an X on the window you are working on to completely shut down a program, rather than to either mouse through menus to select quit, or be obligated to using Command Q keyboard shortcut.
    *2. Menu bars are on the desktop.*
    - Related to the first point, why make the main thing framing your desktop be something which is always changing depending on the program? Why have file menus outside the main window of the program. Having the menu bar on the desktop then necessitates an additional area, the dock, which has to be used as a launch bar and to tell you what programs are currently running. That obligates you to having 3 different areas of screen: 1 for program menus, 1 for running programs, and the program window itself. This seems very inefficient to me. Not to mention all the messy-looking floating palettes all over the place, again because everything is separated and not nicely contained in a single program window.
    - Really, having a changing menu bar that frames the desktop isn't even consistent wth the whole desktop metaphor, which is that you place things on a desktop, like programs, files, etc. Are you changing the whole desk everytime you load a new program, yet the wallpaper stays the same? Doesn't seem to be logically consistent to me.
    *3. No delete key.*
    - This one really gets me. Why make such a commonly used key be a function key (Fn + Backspace)? Why make the user press a secondary key for a major function?
    *4. No Cut command.*
    - I read something about how Cut doesn't actually make sense when moving files around, but I obviously didn't fully understand it. Why make the user command drag, when you can just do Ctrl X??.
    *5. Launching Apps from the Finder.*
    - This seems weird to me, that you find and launch applications from the same thing you use to view files. Program icons in the finder are placeholders for the entire program, not files, yet they are found in the file viewer. Again, to me this seems logically mixed. I really dislike scrolling through Finder to look for apps. I know there is Spotlight and the dock (used as a quicklauncher), but these are really just workarounds for a setup which seems inherently illogical. To me at least, a menu of applications make more sense, ie, the start menu.
    Anyway, those are all I can think of now, although there are other things aout OSX that don't make sense to me.
    Thanks in advance! If I can understand Apple's reasoning and it is convincingly better, that will go a long way towards making me more comfortable with this OS.

    1. Programs don't quit when you close the window.
    That's really more a matter of what you're used to. It comes down to a programming decision as to what Apple and Microsoft considered to make sense. MS thinks that if there are no open windows, you're done using the app. Apple thinks you aren't necessarily done yet, as others have mentioned. I certainly wouldn't want Photoshop to quit every time I closed the last open image I was working on. Would be nice though if Safari would quit when I close the last open browser window. It's quick to relaunch if you really weren't done with it, so wouldn't be much of a bother to have it shut down with the last window.
    2. Menu bars are on the desktop.
    Makes way more sense the Microsoft's approach of repeating the same file menu on every open document in a program. How many places do you need to see File, Options and other common menu headings?
    2. Menu bars are on the desktop.
    Related to number two. The forward app is the only one you can directly work in, so why not have the menu bar change to reflect the choices for that application? When you go back to the previous app you were in, the menu bar changes back. So what loss of functionality is there? It comes back to not having menu bars on every single open window. There's no need or purpose for it.
    3. No delete key.
    Backspace does the same thing.
    4. No Cut command.
    Command+X, not Ctrl+X. This is Mac, not Windows. There's also very little need to ever do this from the keyboard. If you're moving files that are on the same drive/partition, then just drag and drop from the target folder window to the source. It's automatically a move. If going from one physical drive or partition to another, it's automatically a copy. Press and hold the Command key during the drag to make it a move.
    Besides, you don't really think Windows cuts the entire folder or file contents into RAM, do you? If your computer has 4 GB of RAM, and you cut 12 GB of data, it of course can't possibly fit in the clipboard. All Windows does when you do a cut is visually remove the files and folders from the screen. If the items are going to a location on the same drive/partition, it does the same thing as if you did a drag and drop move. The file table is simply updated to reflect the new file or folder locations. If it's to a different drive/partition, it then performs a copy then delete action, same as OS X.
    5. Launching Apps from the Finder.
    A program is just as much a file as any other file. It takes up space on the drive. The OS of course knows what to do with it when you double click an app. Same as it knows what to do when you double click a document related to an app. Windows is no different. An .exe file is also just as much a file as a .doc file. The .exe extension tells Windows to try and treat it as a program to load into RAM. It's not just a simple placeholder. The program has to be made up of something.

  • What is the logic behind the start routine

    Dear One's,
    Kindly take a moment and explain the logic behind this start routine written in update rules of ODS.
    PROGRAM UPDATE_ROUTINE.
    $$ begin of global - insert your declaration only below this line  -
    $$ end of global - insert your declaration only before this line   -
    The follow definition is new in the BW3.x
    TYPES:
      BEGIN OF DATA_PACKAGE_STRUCTURE.
         INCLUDE STRUCTURE /BIC/CST_T07_O006.
    TYPES:
         RECNO   LIKE sy-tabix,
      END OF DATA_PACKAGE_STRUCTURE.
    DATA:
      DATA_PACKAGE TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
           WITH HEADER LINE
           WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    FORM startup
      TABLES   MONITOR STRUCTURE RSMONITOR "user defined monitoring
               MONITOR_RECNO STRUCTURE RSMONITORS " monitoring with record n
               DATA_PACKAGE STRUCTURE DATA_PACKAGE
      USING    RECORD_ALL LIKE SY-TABIX
               SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
      CHANGING ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
    $$ begin of routine - insert your code only below this line        -
    fill the internal tables "MONITOR" and/or "MONITOR_RECNO",
    to make monitor entries.
    DATA: ITAB_/BIC/AT07_O00600 TYPE SORTED TABLE OF /BIC/AT07_O00600
          WITH HEADER LINE
          WITH UNIQUE DEFAULT KEY INITIAL SIZE 0,
          DATA_PACKAGE_NEW TYPE STANDARD TABLE OF DATA_PACKAGE_STRUCTURE
          WITH HEADER LINE
          WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
    sort the datapackage based on lead number and lead program definition
    SORT DATA_PACKAGE BY /BIC/TLDNR /BIC/TLDPRGFTE.
    from the resources ODS read all lead values based on the values those
    SELECT * FROM /BIC/AT07_O00600 INTO TABLE
             ITAB_/BIC/AT07_O00600
             FOR ALL ENTRIES IN DATA_PACKAGE
             WHERE /BIC/TLDNR = DATA_PACKAGE-/BIC/TLDNR.
    FIELD-SYMBOLS: <LS_DATA_PACKAGE> TYPE DATA_PACKAGE_STRUCTURE.
    FIELD-SYMBOLS: <LS_/BIC/AT07_O00600> TYPE /BIC/AT07_O00600.
    loop at internal table of ODS to check if there are lead program defin
    from the source which mean the values of lead program definition in OD
    values of lead program definition in datapackage.
       LOOP AT ITAB_/BIC/AT07_O00600 ASSIGNING <LS_/bic/at07_o00600>.
         READ TABLE DATA_PACKAGE
          TRANSPORTING NO FIELDS
          WITH KEY
          /BIC/TLDNR = <LS_/bic/at07_o00600>-/BIC/TLDNR
          /BIC/TLDPRGFTE = <LS_/bic/at07_o00600>-/BIC/TLDPRGFTE
          BINARY SEARCH.
          IF SY-SUBRC <> 0.
    new lines with zero values are inserted because there are no correspon
    DATA_PACKAGE_NEW-/BIC/TLDNR = <LS_/BIC/AT07_O00600>-/BIC/TLDNR.
    DATA_PACKAGE_NEW-/BIC/TLDPRGFTE = <LS_/BIC/AT07_O00600>-/BIC/TLDPRGFTE.
      DATA_PACKAGE_NEW-/BIC/TLDFTE = 0.
      APPEND DATA_PACKAGE_NEW.
         ENDIF.
      ENDLOOP.
    append the new records which are created for the leads in the datapack
      APPEND LINES OF DATA_PACKAGE_NEW TO DATA_PACKAGE.
    reset the sorting of the datapackage back to its original state
      SORT DATA_PACKAGE.
    if abort is not equal zero, the update process will be canceled
      ABORT = 0.
    $$ end of routine - insert your code only before this line         -
    ENDFORM.
    Thanks in advance

    hi,
    it's retrieve data from table /BIC/AT07_O00600
    and add to data package, so your records will be more than from source
    hope this helps.

  • What is the logic behind the oracle database connections....

    Hi,
    We have crontab alerts are enabled for the oracle database client connection.
    For Production databases the alerts are coming continuously until it gets connected.
    For QA databases it will throw the message that the oracle client connection fails and again it will prompt whenever it gets connected.
    Please let me know the logic behind these scnerions.
    Pavan..
    Edited by: dm_ptldba on Feb 14, 2012 6:45 AM

    Hi,
    Thanks for the update, Sorry the question was not clear. let me put it in a clear way.
    Following is our crontab which alerts us if any database/listener goes down. But it alerts us only once for one successful/unsuccessful connection. For Eg: If the crontab not able to connect to the database for once then it throws an alert only once and waits for a successful connection.
    I would like to change the logic in this crontab in such a way that, it should keep on alerting us for all the unsuccessful connections and once or twice for successful connection.
    . /home/oracle/.bash_profile
    . /opt/oracle/cron/cron_email
    sidfile=/home/oracle/scripts/db-list.txt
    dboutfile=/home/oracle/scripts/dboutfile.tmp
    echo $ORACLE_HOME
    TNS_DIR=$ORACLE_HOME/network/admin
    ORA_BIN=$ORACLE_HOME/bin
    cat $sidfile | while read SIDNAME
    do
    $ORA_BIN/sqlplus -s system/******@$SIDNAME 2> /dev/null >> $dboutfile <<EOF
    @/home/oracle/scripts/db_up.sql
    EOF
    if [ $? -eq 0 ]
    then
    STATUS=1
    if [ -f /home/oracle/scripts/${SIDNAME}-down.txt ]
    then
    /bin/mail -s "Alert :Oracle database instance \"${SIDNAME}\" is up & connected..." [email protected] </dev/null
    rm -rf /home/oracle/scripts/${SIDNAME}-down.txt
    fi
    else
    if [ -f /home/oracle/scripts/${SIDNAME}-down.txt ]; then
    echo "";
    else
    touch /home/oracle/scripts/${SIDNAME}-down.txt
    echo ${SIDNAME} "not Connected ..."
    /bin/mail -s "Alert :Oracle database instance \"${SIDNAME}\" is down......" [email protected] </dev/null
    fi
    fi
    done
    Thank you.
    PTLDBA

  • What is the logic behind suggest due date in a planned order?

    I have observed that suggest due date of a planned order is not based on demand. What is the logic behind derivation of suggest due date?
    Some times pegging date is based on Sales Order request date but not all the times, how to interpret the pegging date of a planned order?
    Please confirm that suggest ship date is based on the suggest due date and In-transit time and lead time.

    HI,
    Planning engine calculates the Sugg Due Date based on some mathematical calculations and some Plan setups.
    It also depends on what option you have chosed in the plan, for Material availability i.e. at the start of the Job or at the start of operation.
    For buy item-it will minus the pre, post and processing lead time from the Material requirement date for making the job based on above setup.
    For make items, it will also consider Manufacturing lead time(based on the routing) and will show the Sugg due date
    Please mark this post as correct or helpful, if it clears your concern.
    Thanks,
    Avinash

  • What is the logic behind the list of default colors in the color tab of the score options in the project settings interface?

    I desperately want to know why each note is assigned it's particular color in the score tab of the projects settings interface...
    Was this done at random or is there some logic behind it all?  Einstein and Newton have completely different ideas about note/color association...their theorys can be easily found on the internet.  I've messed around with applying their ideas to the user pallette just for fun.  Now, I really want to know if the makers of Logic chose the colors they did for the factory defaults for a particular reason.  Please help if you can!

    hi,
    it's retrieve data from table /BIC/AT07_O00600
    and add to data package, so your records will be more than from source
    hope this helps.

  • What's the logic behind the prefixes in User Tips?

    I'm browsing through the User Tips, and maybe my memory is fuzzy, but I don't recall all those prefixes in the subject lines.
    e.g. kmosx, kmos, k.mac, kad, kaw, etc.
    Is there a logic behind it somewhere that would be useful for searching? e.g. put one in the search box and get all the User Tips on such-and-such topic?
    If so, can someone please sticky-post a glossary in the User Tips forum?
    Thanks.

    Hi, Marlinespike - These are Knowledge Base keywords. A glossary of these keywords is here:
    http://docs.info.apple.com/article.html?artnum=75178
    Tuttle
    1457/8165

  • Why did Apple design the iPad to permanently disable without ANY means to recover data just by virtue of someone trying to enter the wrong password? What is the logic behind this design decision?

    Daughter unknowingly attempts to access iPad by entering wrong passwords. This leads to the iPad being disabled. It contains home videos that have not been backed up. This is a common scenario that Apple has made no effort to solve. Why does this continue to be a problem? It is outrageous that a device should permanently disable like this for NO GOOD REASON. Apple - Please address this issue in iOS 8.2. This should not happen. It makes no logical sense for the iPad to do this. No sense whatsoever.

    See where it says Backup ? Turn it on, that's all it takes.

  • Can somebody explain the logic behind "no sequences"

    My timeline tabs get full of them every now and then, particularly when I change workspace setting.
    I'm sure I'm missing something but again, why does Premiere find this necessary?

    As you have probably guessed, the number of open timelines is saved automatically as part of the workspace. When you open a project that has fewer open timelines than the last one did, and you don't modify or reset the workspace, you end up with empty timeline tabs.
    I recommend that you submit a
    Feature Request
    and ask for workspaces to be saved as part of the project, or some similar mechanism, to make this issue go away.

  • What is the logic behind ?

    local classes can access final variables; true;
    local class can access all the variables of the super class, if the local class is extending another class; true;
    for example:
    void aMethod(final int x) {
    final int y = 10;
    class localClass extends classB{
    class ClassB {
    private int x;
    protected int y;
    int x;
    static int a;
    final static int b;
    BUT if we make aMethod as STATIC, then why is the localClass is allowing to access final variables even though they are non-static ?
    Any comments.

    I got the answer:
    Here it is:
    Local classes.
    1. defined inside the block
    2. can not have any access modifiers
    3. can not declare static members
    4. can access all the features of the enclosing class
    5. can access only final variables defined inside the method, inluding final method argument.
    This is because the class can outlive the method, but the method local variables go out of the scope - in case of final variables, compilers makes a copy of final variable to be used by the class (new meaning for final);
    Thanks those who responded.

  • What is the logic behind slider.isValueChanging?

    Hi
    I thought slider.isValueChanging is for knowing when the user is still dragging the slider thumb. So isValueChanging would be true when the user is dragging the slider thumb and would turn to false when the user releases the mouse and thus stops dragging the slider thumb.
    However I'm getting an issue where if the user drags and drops the thumb to the edges of the slider the isValueChanging will remain true even after releasing the mouse.
    So, does slider.isValueChanging work as I have described? I so is the mentioned issue a bug?
    Thanks in advance, best regards

    the mentioned issue a bug?The behaviour you describe would seem to be a bug to me.
    You might want to file it at http://javafx-jira.kenai.com

  • SELECT {data} FROM (SELECT...) query. Can anyone explain the logic to me? PLEASE!!!!

    I've seen an example of this but I don't understand the logic behind this concept. I would really appreciate if someone could help me out with this.

    Hi Shawn Jefferson
    ============================================
    EXAMPLE 1
    ============================================
    select 1 from (select * from dual)
    1
    1
    ============================================
    Please see the above example. the second select statement execute and return only one record. so the first select based on the result of the second statement.The first select execute and return only 1 record.
    ============================================
    EXAMPLE 2
    ============================================
    now see this
    select 1 from (select * from emp)
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    1
    14 records.
    it return the 14 records. because the second select statement I apply on table emp. and emp table return the 14 records . so first select statement execute 14 times.
    Regards
    ASIF RASHID

  • Please explain the logic.

    select * from
    from cust b
         LEFT OUTER JOIN
         cust a
         ON
         (a.sales_date+1=b.sales_date)
         WHERE TRIM(TO_CHAR(b.sales_date,'DAY')) IN ('SUNDAY','MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY')
         AND b.sales_Date BETWEEN TO_DATE(V_START_DATE,'DD-MON-YY') AND to_date(V_END_DATE,'DD-MON-YY')
         AND a.sales_Date BETWEEN TO_DATE(V_START_DATE,'DD-MON-YY')-1 AND to_date(V_END_DATE,'DD-MON-YY')
    Could someone explain the logic behind the query above?
    Thanks,
    Bhagat

    Bugs wrote:
    select * from
    from cust b
         LEFT OUTER JOIN
         cust a
         ON
         (a.sales_date+1=b.sales_date)
         WHERE TRIM(TO_CHAR(b.sales_date,'DAY')) IN ('SUNDAY','MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY')
         AND b.sales_Date BETWEEN TO_DATE(V_START_DATE,'DD-MON-YY') AND to_date(V_END_DATE,'DD-MON-YY')
         AND a.sales_Date BETWEEN TO_DATE(V_START_DATE,'DD-MON-YY')-1 AND to_date(V_END_DATE,'DD-MON-YY')
    Could someone explain the logic behind the query above?
    Thanks,
    BhagatDoes this query even run? It has syntax error. You have lot of post under your name. So by now you must be knowing the usage of {noformat}{noformat} tag. So please use them to format the code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Extending logic behind a checkbox in iRecruitment external candidate page.

    Hi All,
    We have a requirement to extend the logic behind the check box in Irecruitment external page (AplOtherInfoPG). The logic is buit in a AM (IrcCandidatePersonalAcountAM). Its a root AM for the page AplOtherInfoPG and its referred from many other pages too. I have extended this AM using following steps
    1. FTP all the files from $JAVA_TOP/oracle/apps/per/* to your PC and configure your PC for OA Framework development
    2. Create a new BC4J package in which the extension will reside.
    3. Note down the path and the properties of existing AM that we wish to extend
    4. Create a new AM, and specify the original AM being extended.
    5. Ensure that the properties of original AM are applicable for new AM too.
    6. Perform substitution. This will create a jpx file.
    7. Upload the jpx file into Database.
    8. Deploy the custom BC4J to $JAVA_TOP by FTP'ing all files.
    9. Bounce the server
    After this change I'm getting the error 'JBO-29000: Unexpected exception caught: java.lang.StackOverflowError, msg=null'. This error is appearing on all the pages where the same AM(IrcCandidatePersonalAcountAM) is referred. Its totally clueless.
    I have got an suggestion that extending an root AM is not recommanded in OAF. If So, how I should go about it.
    Please help me to achieve this requirement.
    Thanks,
    Guru

    Hi Guru,
    As you mentioned extending the rootAM is not advisable.
    As a workaround what you can try is
    1) Extend the controller in your page,
    and get the RootAM, ChildAM, Your VO(where you have the checkbox attribute is there) and then set the value what do you wanted.
    Use the below code to get your required AM and VO, please change the sample code according to your AM name...etc.
    // Get requested AM from Root am
    public OAApplicationModule getRequestedAM(OAPageContext pageContext, String requestedAMName)
    writeLog(pageContext,"Requested AM called to check the AM "+requestedAMName );
    String amName = "";
    String objectivesAMName = requestedAMName;//"ObjectivesAM";
    String nestedAMArray[] = pageContext.getRootApplicationModule().getApplicationModuleNames();
    pageContext.writeDiagnostics(this,"Root AM=>"+pageContext.getRootApplicationModule().getName() + " Child AMs=>"+ nestedAMArray.length,1);
    OAApplicationModule currentAM = null;
    currentAM = (OAApplicationModule)pageContext.getRootApplicationModule();
    for(int i = 0; i < nestedAMArray.length; i++)
    amName = nestedAMArray;
    pageContext.writeDiagnostics(this,"Nested AM Name=>"+amName + "and amName.indexOf(objectivesAMName) "+amName.indexOf(objectivesAMName),1);
    currentAM = (OAApplicationModule)pageContext.getRootApplicationModule().findApplicationModule(amName);
                        //Get the view names
                   String[] viewNames = currentAM.getViewObjectNames();
    for (int i =0 ;i<viewNames.length ;i++ )
    writeLog(pageContext,i +" Value "+viewNames[i]);
    if(!(amName.indexOf(objectivesAMName)==-1))
    pageContext.writeDiagnostics(this,"Found Handle to My Nested AM " + amName ,1);
    break;
    return currentAM;
    Get the VO from the AM
    OAViewObject objAssessmentVO = (OAViewObject)yourAM.findViewObject("yourVO");
    Get all the attribute from a VO with Attribute Names in Custom CO
    OAApplicationModule rootAM = pageContext.getRootApplicationModule();
    OAApplicationModule apprAM = (OAApplicationModule)rootAM.findApplicationModule("AppraisalsAM");
    String offlineStatus = (String)apprAM.invokeMethod("getOfflineStatus",new Serializable[]{appraisalId+""});
    OAViewObject appraisalVO = (OAViewObject)apprAM.findViewObject("AppraisalVO");
    if(appraisalVO !=null)
    AppraisalVORowImpl appraisalVORow = (AppraisalVORowImpl) appraisalVO.first();
    if(appraisalVORow !=null)
    int attrCount = appraisalVO.getAttributeCount();
    writeLog("XXRBG",pageContext,"Attrbuute count "+attrCount);
    String[] attributeNames = appraisalVORow.getAttributeNames();
    for (int i = 0 ;i< attributeNames.length ;i++ )
    writeLog("XXRBG",pageContext," Name "+attributeNames[i] +" = "+appraisalVORow.getAttribute(i));
    Thanks,
    With regards,
    Kali.
    OSSi.

  • Logic behind '*' in SQL

    How does *(star symbol) work in select statements of SQL? How will this symbol recognise that it should return all columns in the select statements. Is this symbol defined anywhere. Please explain the logic behind this.
    Is there any other function performed by *(star).
    Thanks & Regards,
    Mohan

    Some points from the documentation:
    * (asterisk):
    Specify the asterisk to select all columns from all tables, views, or materialized views listed in the FROM clause.
    If you are selecting from a table rather than from a view or a materialized view, then columns that have been marked as UNUSED by the ALTER TABLE SET UNUSED statement are not selected.
    table.* | view.* | materialized view.*:
    Specify the object name followed by a period and the asterisk to select all columns from the specified table, view, or materialized view. Oracle Database returns a set of columns in the order in which the columns were specified when the object was created. A query that selects rows from two or more tables, views, or materialized views is a join.
    You can use the schema qualifier to select from a table, view, or materialized view in a schema other than your own. If you omit schema, then the database assumes the table, view, or materialized view is in your own schema.
    «

Maybe you are looking for