How the County table script Fund?

Hi all

11.2.0.3

I want to generate the list of counties of table in this format:

table-nameCounty
COUNTRY100
DEPT10
EMP1000
JOBS50
JOB_HISTORY100
LOCATIONS200
REGIONS300

Can you help me the sql statement please.

Thank you

pK

Hello

Petra-K wrote:

Hi all

11.2.0.3

I want to generate the list of counties of table in this format:

table-name County
COUNTRY 100
DEPT 10
EMP 1000
JOBS 50
JOB_HISTORY 100
LOCATIONS 200
REGIONS 300

Can you help me with the script please.

Thank you

pK

These numbers are the number of rows in each table (in other words, the 'SELECT COUNT (*) FROM countries' output would be 100)?

If so, and if you're happy with an account may be estimated from the last time statistics were gathered, you can do something like this:

SELECT table_name
num_rows
From all_tables
Owner WHERE = 'SCOTT '.

;

If you want the exact number at run time, you need dynamic SQL statements.  Here's a way to do it:

SELECT table_name

, EXTRACTVALUE (XMLTYPE (dbms_xmlgen.getxml (' SELECT COUNT (*) AS num ")))

|| 'FROM ' | owner | '.' || table-name

)

)

, ' / LINES/LINES/NUM.

) AS num_rows

From all_tables

Owner WHERE = 'SCOTT '.

;

Whatever it is, you get results like:

TABLE_NAME, NUM_ROWS

------------------------------ ----------

DEPT                                    4

EMP                                    14

BONUS                                   0

SALGRADE 5

Tags: Database

Similar Questions

  • How the nested table that is stored in the database?

    How the nested table that is stored in the database?
    The nested table column is stored with the table main or separate in the database?

    A nested table is a table that is stored in the structure of another table. It is used to support the columns that contain multivalued attributes.

    If you want to use the same type in multiple places, create them on a global scale and these will be discussed under 'Types'.

  • How the repeating table inside a control valve?

    Hello

    Does anyone know how to make the repeating table inside a control valve in LabWindow CVI? I see that there is option for a Panel to scale content in resizing, but not available for a tab control. Any ideas?

    Thank you very much!

    Weiming

    I don't know, I understand what you're trying to do, but you can set ATTR_SCALE_CONTENTS_ON_RESIZE on each tab panel.

    GetPanelHandleFromTabPage (panelHandle, PANEL_TAB, 0, & tabPanel);
    SetPanelAttribute (tabPanel, ATTR_SCALE_CONTENTS_ON_RESIZE, 1);

  • How the referential table

    Lets say, my default scheme is 'ABC', in which some tables have referential relationship to a parent of a different scheme "XYZ" table
    I would like to see these tables parent also listed in the object browser, how? any ideas please.

    ~ Prabha

    Define a view of the table in the other schema and create a synonym for the view, then you should be able to see the synonym/view.

    Thank you

    Tony Miller
    Webster, TX

  • How the County onClicks button?

    Can someone please tell me how to count the onClicks of a button, so that the same button

    1 click = change model bg color to black.

    2nd click = changes color gray bg comp.

    The 3rd click =changes color white bg comp.


    How can I associate with onClicks?

    ________________

    myPanel.bgClr = myPanel.add ('button', [70,80,90,110], 'bg');  change of clr BG

    myPanel.bgClr.onClick = function() {}

    for black

    app.project.activeItem.bgcolor = [0,0,0];

    for gray

    app.project.activeItem.bgcolor = [0.5,0.5,0.5];


    for white

    app.project.activeItem.bgcolor = [1,1,1];


    }

    You can create a variable count is beyond the scope of the function (if retained) and check that.

    Note: You must check the activeItem is valid at the beginning of the feature click otherwise you will get an error if not.

    var clickCount = 0;

    myPanel.bgClr = myPanel.add ('button', [70,80,90,110], 'bg');  change of clr BG

    myPanel.bgClr.onClick = function() {}

    activeItem var = app.project.activeItem;

    If (activeItem! = null & activeItem instanceof CompItem) {}

    If (clickCount == 0) {}

    for black

    activeItem.bgcolor = [0,0,0];

    } Else if (clickCount == 1) {}

    for gray

    activeItem.bgcolor = [0.5,0.5,0.5];

    } else {}

    for white

    activeItem.bgcolor = [1,1,1];

    }

    clickCount ++;

    If (clickCount == 3) clickCount = 0;

    } else {}

    Alert ("you must select a model");

    }

    };

  • Get the number of rows in the oracle table

    Hi all
    I want to get the total number of rows in the sql to the appmodule table.
    After you apply the criteria to view some on the view object. If he try with getallrowsinrange the number of rows found within the viewobject was but I want a total number of rows in the sql table.

    How can I get that

    I use jdev 11.1.1.5

    Thanks in advance

    I threw something together, quick and dirty, don't hesitate to optimize.

    Assuming you want the County table, I put the code in a subclass of EntityDefImpl since it is representing a table in the middle tier.

    public class EmpDefImpl
          extends EntityDefImpl {
      /**
       * This is the default constructor (do not remove).
       */
      public EmpDefImpl( ) {}
    
      //~ Methods ****************************************************************************
    
      public long getTableRowCount( DBTransaction transaction ) {
        String query = getQuery( );
        String countQuery = String.format( "SELECT COUNT(*) FROM (%s)", query );
        long count = 0;
    
        ViewObject vo = transaction.createViewObjectFromQueryStmt( countQuery );
    
        try {
          vo.executeQuery( );
    
          Row row = vo.first( );
          Number number = (Number)row.getAttribute( 0 );
          count = number.longValue( );
        } finally {
          vo.remove( );
        }
    
        return count;
      }
    }
    

    Depending on your card type, you may not get an oracle.jbo.domain.Number, but something else, so the cast may need correction.

    Usage example:

    public class EmpEditViewImpl extends ViewObjectImpl {
      public EmpEditViewImpl() {
      }
    
      protected void executeQueryForCollection( Object object, Object[] object2, int i ) {
        super.executeQueryForCollection( object, object2, i );
    
        EmpDefImpl def = ( EmpDefImpl )getEntityDef( 0 );
        long tableRowCount = def.getTableRowCount( getDBTransaction() ) );
    
        // Do something with it
      }
    }
    

    As you can see, the code is fairly generic. Also, you might be able to put this in a base extension ADF class.

    Sascha

    Published by: Sascha Herrmann on June 7, 2012 14:39

  • FDM 11.1.2.1 mapping table scripts does not accept as vba functions ' lef

    OK, in fdm 11.1.2.1 in the UD2 of IMPORTS column, I have something like "award::purpose:type" and in the mapping table script, I try to use the 'left' and 'middle' works to break the UD2 columns (delimited by ': '), then the mapping to a result to VALIDATE.

    Why simple VBA functions do not work in mapping scripts (where you have '#Script' in the column 'target Custom2')

    to simplify things, I would like the following to work (and it errors on the first line to the "left" function)
    ##########################################
    One_Award = Left (varvalues (21), 5)
    Result = One_Award
    ##########################################

    Thank you.

    Published by: 866191 on June 26, 2012 08:15

    VarValues (21) always contains the empty string values. This could be the cause of your problem. If findCol1 is set to-1, that this will cause the error you get.

  • the external tables LKM: order of columns of evil?

    I experience unexpected behavior with an external table Oracle LKM.

    The table $ CAN (external) that is created has the columns in the right order. I know they are correct in the model. Because the external table is not defined in law, the IKM does not load anything.

    This is the beginning of the create table script:

    create the table ETL_USER. C$ _0SCSW_SOM_NBME
    (
    C1_SCHOOL_ID VARCHAR2 (6).
    C2_TEST_DATE VARCHAR2 (10),
    C3_SCORE NUMBER 4,
    C7_ORDER_NUMBER VARCHAR2 (8).
    C6_EXAM VARCHAR2 (50).
    C5_ID VARCHAR2 (9).
    C4_EXAMINEE VARCHAR2 (50)
    )

    You can even see c# _ fields are in the wrong order.

    What is happening with this? :-)
    John

    In the integration Interfaces try to set columns on the staging area maps

  • Transformation of Scripts that run only on the selected Tables

    I'm relatively new to Data Modeler, but found almost everything to be very intuitive. I'm now doing use custom transformation scripts to dynamically add custom DDL elements. I wrote a transformation script that adds a sequence at the end of my DDL trigger successfully, and I'm happy with the results. The problem I run into is that we have two different categories of tables that require slightly different sequence triggers, but as my model is set to the level of database, my transformation scripts are applied to all arrays regardless they come what schema. Do you have any suggestions on how to limit the tables which proceeds by a transformation script? I thought to add if statements to check what schema tables are coming from, but if I have a situation where I have two different tables that require two different processing scripts, but they are in the same pattern, how can that I manage that? Ideally, I'd like to just pick a table and apply a transformation script for this table individually. Is this possible?

    I work in a relational model with Data Modeler 4.0.

    to dynamically add items customized to DDL

    you need to check the custom of DDL in DM 4.1 features - "tools > rules and design transformations > Table DDL transformations"-DM 4.1 comes with example to generate tables of the newspaper and associated trigger.

    . I wrote successfully in a transformation script that adds a sequence at the end of my DDL trigger

    Data Modeler can generate the sequence and relaxation for you - you need to define the column as 'auto increment' / identity and set in preferences, you want "trigger" put in place. 4.1 DM added support for z/OS, DB2 LUW DB2 and MS SQL Server 2012.

    Do you have any suggestions on how to limit the tables which proceeds by a transformation script? I thought to add if the instructions to check the schema, the tables are coming, but if I have a situation where I have two different tables that require two different processing scripts, but they are in the same schema

    Well you need to sort it out on yourself - you can use classification types, dynamic properties user defined properties (in DM 4.1) or put paintings in various subviews or use the search feature (4.0.3 DM / DM 4.1 comes for example how to use the search results to create subview).

    Ideally, I'd like to just pick a table and apply a transformation script for this table individually. Is this possible?

    Here is an example of how get selected tables:

    appv = model.getAppView();
    dpv = appv.getCurrentDPV();
    //check there is a diagram selected and it belongs to the same model
    if(dpv!=null && dpv.getDesignPart() == model){
     tvs = dpv.getSelectedTopViews();
     for(var i=0;i
    

    Philippe

  • Put the active table in respect of the development when the script was interrupted by a dialog box

    I adapted a script which browse tables in a file of Fm and asks the user if he wants the current to be reformatted or not active table

    I have not find a clean way to the table that is currently selected in the variable "tbl" or visible on the screen when the scripts sends a dialog box.

    The workaround I found is to launch a format on the table before sending the guest, in this case the table processing is apparent when the prompt arises.

    But I would like to have the visible table and avoid doing all the treatments on the table until the user has had a chance to respond to the prompt.

    I guess that there must be a method to draw the attention of the active window on an item that is selected in a variable?

    function ApplyTableFormat (doc)
    {
    If (doc.) ObjectValid())
    {
    var tbl is doc. SelectedTbl
    var tbltitle;
    var tblTextItem;
    While (tbl. ObjectValid())
    {
    tbltitle = "";
    tblTextItem = tbl. FirstPgf.GetText (Constants.FTI_String);
    for (var i = 0; i < tblTextItem.length; i ++)
    {
    tbltitle += tblTextItem [i] .sdata;
    }

    / * How my "tbl" visible in the window active doc? */
    If (Alert ("format:" + tbl.)) "Tbltitle + FirstPgf.PgfNumber + '? \nClick Cancel to abort. ((', Constants.FF_ALERT_CANCEL_DEFAULT))
    return;
    / * Insert here the table formatting code * /.

    TBL = tbl. NextTblInDoc;
    }
    }
    on the other
    {
    Alert ('no active doc', Constants.FF_ALERT_CONTINUE_WARN)
    return
    }
    }

    There is a document feature that allows to scroll the window to a location of particular text:

    doc. ScrollToText (textRange);

    You might be able to do something like this:

    doc. ScrollToText (new TextRange (tbl. TextLoc, tbl. TextLoc));

    -Rick

  • How to design the table from the answer to the question table.

    Hi all

    I am creating an application for student review online.

    There are two types of questions, the only choice of response and multi choice answers.

    My question is less than
    create table question_master
    (
    exam_id number references exam_master(exam_id),
    marks_of_each_question number,
    type_of_question char(1),-- single choice answer/multiple choices answer
    q1 varchar2(2000),
    q2 varchar2(2000),
    q3 varchar2(2000),
    q4 varchar2(2000))
    my table to answer (I'm not satisfied with who is below
    create table answers_of_questions
    (
    answer_id number primary key,
    question_ID number referenes question_master(question_id),
    answer varchar2(4000) not null,
    is_answer_correct char(1),--y/n,
    student_selection char(1),--y/n   student select it or not
    ....
    ...
    now, I'm perfectly how to create the RESPONSE table to contain the answers.
    the only choice is good, but several checkboxes choices, what to do?
    How to design the table from the answer?

    do I have to create 2 tables to contain the answers?
    Note: the QUESTIONS and ANSWERS, all will be entered by the teacher. students will make a choice and I will store this choice in another table
    may be called STUDENT_SELECTED_ANSWERS or something like that.
    If anyone has some reference to the script retail scheme review online, kindly share with me.

    Kind regards.

    Kind regards.

    If you need to have answers in another table:

    Student (student_id, name, etc...)
    Review (exam_id, exam_name, etc...)
    Question (question_id, exam_id, question_text)

    Response (question_id, a_text, b_text, c_text, d_text, a, b, c, d).<-- one-to-one="" with="" question="" table,="" a-d="" flags="" used="" to="" indicate="">
    OR
    Response (question_id, answer_id, answer_text, OK)<-- many-to-one="" with="" question="" table,="" correct="" flag="" used="" to="" indicate="" correctness="" for="" this="" single="">

    Student_Answer (student_id, question_id, a, b, c and d)
    OR
    Student_Answer (question_id, student_id, answer_id)<-- creation="" of="" a="" question_id+answer_id="" in="" this="" table="" implies="" the="" student="" checked/selected="" it="" as="" an="">

    To what extent you want to standardize, it is up to you.

  • Tips for the custom transformation script change the Associations of FK table

    Hello

    I try to write a transformation script that will scroll through tables in a large model and change some
    FK associations to change the remote table at CF. By the way, the reason is that our logic model
    the logical entities that represent many areas of codes of small research. However, our relational and physical model has a
    utility single physical filing table of codes that contains all areas of these codes. Therefore, a part of the transformation
    our logic model for the relational model is to swing all FK associations for these areas of research codes
    in the table of common code. Then the paintings representing the research areas can be removed from hard.

    In any case, I'm looking at the

    oracle.dbtools.crest.model.design.relational.FKIndexAssociation

    or the

    oracle.dbtools.crest.model.design.relational.Index

    to see if one of them can be manipulated to perform the transformation I want to accomplish.

    When I perform the equivalent process manually via the property sheets there are several ways to address this problem.

    (a) the method more jolise seems to change the FK in place by clicking on the FK in the relational schema and changing
    the property called ' PK / UK Index'. Change that to the pharmacokinetics of utility code repository table that replaces the original
    table (which represents the research field). A side effect of this translates into CF mapping
    columns being nulled out. They must be remapped to original columns (which are kept).
    So in two stages, the existing FK is detached from the original, attached table to the new table, and then
    FK columns are reused in place for new CF mapping.

    (b) the brute force method is to remove the original FK and then create a completely new FK to the new table. There are
    several dialog boxes that allow you to keep the original FK columns and use them in the new FK.

    I realize, this is a somewhat complex transformation, but I would like a few algorithmic advice on which path to take
    to try to achieve. In particular, there is a script that is equivalent to that of the first process above?

    I don't even know if the CF which is represented on the relational schema is represented by the FKIndexAssociation or Index
    class in the script object model. In other words, I have to loop through the tables in the relational model what would be my
    starting point:

    FKS = table.getFKAssociationsList ();

    or

    fkIndexes = table.getAllInds_FKeyInds ();

    or something else. The names of the properties in the user interface are always with the properties of scripts not so
    It's a little difficult to understand such things.

    Once I have access to the object that is equivalent to the FK in the property/diagram worksheet, which
    is the best way to handle via script. How can I change the end of parent and away from CF to point to the new table.
    Or if I have to delete the original CF and then re-create - is there a way to save the original FK columns and reuse them
    While creating the new FK?

    ********************

    Another question. What is the best way to remove tables from a relational model. I note that there is a remove() undocumented (?)
    a method that is available on the Table. It's probably a superclass to remove other things as well.

    When I try to use this method in a loop the script throws up to dialog boxes that are similar to dialog boxes that are displayed during the execution of a removal
    manually through the user interface. Is it possible to intercept and answer dialogs programmatically?
    So for example if I get a window of dialogue as

    You want to remove generated columns of FK 'FOO' in the table 'BAR '?

    is it possible to intercept this dialog in the script and then answer Yes or no it via the script?

    ***************

    If it is too difficult to perform this type of transformation with the help of script
    is to do the transformation on the generated DDL file. But it would be cleaner to
    to do the transformation in the relational model DM if possible.

    All advice appreciated.

    Rgds, BP

    When I try to use this method in a loop the script throws up to dialog boxes that are similar to dialog boxes that are displayed during the execution of a removal
    manually through the user interface. Is it possible to intercept and answer dialogs programmatically?
    So for example if I get a window of dialogue as

    You want to remove generated columns of FK 'FOO' in the table 'BAR '?

    is it possible to intercept this dialog in the script and then answer Yes or no it via the script?

    It's in the preferences - "Data Modeler > model > relational > remove FK column strategy."

    I don't even know if the CF which is represented on the relational schema is represented by the FKIndexAssociation or Index

    Is a pair of two - FKIndexAssociation, that's what you see the pattern, but it is hidden in the table index - isFK() returns true for this type of index and you can take FK with getFKAssociation()

    Once access to the object that is equivalent to the CF in the property/diagram worksheet

    table.getFKAssociations () - returns an array of the foreign keys;
    You can get to them from the relational model:
    model.getFKIndexAssociationSet () .toArray () - FK all model

    How can I change the end of parent and away from CF to point to the new table.
    Or if I have to delete the original CF and then re-create - is there a way to save the original FK columns and reuse them
    While creating the new FK?

    There should be no problem if you use the same number of columns with the same data type and order:

    get the current FK columns
    columns = fk.getColumns ();
    newRefKey is the new key question; referred and child columns must match the data type and the order in the keys - you do not ask how to get
    fk.changeKeyObject (newRefKey, columns);

    function setting in preferences, you will get the question on the columns of FK.

    Therefore, a part of the transformation
    our logic model for the relational model is to swing all FK associations for these areas of research codes
    in the table of common code. Then the paintings representing the research areas can be removed from hard.

    You can create the hierarchy of entities with the root attribute (and PK identifier) KP holding entity and entity - your look-up - empty child relationships will be these entities of the child. With the help of the transformation of the "unique Table" you will get what you are trying to achieve now with script.

    Philippe

  • By the numbers, how do the list tables on the side?

    By the numbers, how do the list tables on the side? It used to be on the side, now it is on the top which is a huge pain.

    This changed in the transition from Numbers2.x too 3.x.

    Unless you explicitly removed numbers 2.x, it is always installed and usable on your computer.  You can locate it in the folder "/ Applications/iWork ' 09.

    You should be aware, that numbers 2.x cannot open files saved numbers 3.x - you can export files from Numers3.x back to Numbers2.x by using the item of menu numbers 3.x "file > export to > number ' 09»

  • EXC in ev handl: TypeError: this.oRoot.enable is not a function that is popping up when I befor I open my browser in a box pop up under the heading JAVA SCRIPT EXE. That is - what, how can I get rid of him?

    TypeError: this.oRoot.enable is not a function

    This is popping up when I befor I open my browser,in a pop up box under the heading JAVA SCRIPT EXE. What is it, how do I get rid of it?
    

    For me, this happened from disabling, but do not uninstall McAfee site Advisor. Recommend site completely uninstalled and the problem disappeared completely. I had turned off before site Advisor, but it seems after a update to McAfee, he was back and then turn it off again caused this problem.

    Go to "uninstall a program" or "add/remove programs" in control panel. Find McAfee in your list (McAfee total protection for me). Click it and then click "Uninstall/Change" (right there in XP, up above in Vista or 7). I don't remember exactly what you see after that, but at one screen I was given the choice to uninstall the McAfee total protection and/or the Site Adviser. You can just check the Site Adviser and just uninstall the Site Adviser while retaining the rest of the McAfee protection.
    

    Good luck!

  • How to extract 1 ASA and put them in the new table

    Hello

    Can someone tell me how to extract a table and put in the new table. (eg. I have a table with no 1 to 1000, I would extract only 1, 30, 60, 90,...)  ?

    Please advise me.

    Thank you

    concerning


Maybe you are looking for