Selection from DDL enters same selection in more DDLs

Hello,
I have a table with 6 columns and 5 rows. Each cell is a DDL. If the user selects rawValue == 3 in a cell in a row, the remaining cells in the row need to be set to rawValue 3 automatically.
Any help with the script for this would be appreciated.
Thanks,
MDawn

Hi,
You can put code in the calculate event of the row, something like;
if (DropDownList1.rawValue == "3")
    DropDownList2.rawValue = "3";
    DropDownList3.rawValue = "3";
Bruce

Similar Messages

  • Is select from view faster then select from table..???

    Hello Gurus,
    I want to query some data from two tables, both of table have many columns (attributes) and many rows...
    I use several where clauses to retrieve data from those tables..
    witch one is faster, I create a view or I just "select" from those tables???
    Regards.
    Nia...

    riedelme wrote:
    3360 wrote:
    riedelme wrote:
    Selecting through a view almost never helps performance and frequently hurts.Views do not affect performance.
    Views are simply queries and like queries there are fast and slow ones.I disagree.
    First of all, to use a view you are executing a query to get a result set, then accessing the data from that result set - a built-in extra step to perform to get data.First of all that entire explanation of how views work is not correct. The optimizer will rewrite the query to make the view go away if possible.
    SQL> create or replace view v as select * from dual;
    View created.
    SQL> explain plan for select * from dual where dummy = 'X';
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 272002086
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"='X')
    13 rows selected.
    SQL> explain plan for select * from v where dummy = 'X';
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 272002086
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     2 |     2   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| DUAL |     1 |     2 |     2   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("DUMMY"='X')
    13 rows selected.Exactly the same.
    >
    Second, when accessing the data from the view the result sets don't have indexes for fast lookups and efficient joins on later steps.This is also known as just making stuff up and is not how the database works. care to share any references at all for any of this?
    >
    Third, the systems I've seen that use views extensively - I am looking at one now - tend to perform joins on views using the same tables with the same data over and over. This is a design issue and not specifically a problem with views but they lend themselves to this misuse much too easilyCorrect as I said a view is just a query, and just like queries there are good fast views and bad slow views
    >
    I'll concede that the problem is not specifically with views themselves but as I just said they lend themselves to misuse. Tuning views of views and views joined to views is difficultYes, queries can be misused as can almost all SQL functions and functionality.
    As I said - Views are simply queries and like queries there are fast and slow ones.
    Nothing that you have posted that is accurate changes that.

  • Get Selections From ALV on Multiple Selection Mode

    Hi,
    How can i get values of selected rows from ALV that has selection '0..n' (multiple selection) ?
    Can somebody help me pls?
    Thanks.

    Hi Nurullah,
    Steps to make multiple rows selectable in ALV:
    1) Create the selection property of the node that you are binding to the DATA node as o..n
    2) Un-check the, "Initialization Lead Selection" checkbox for the node which you are using to bind to the DATA node
    3) In the WDDOINIT method specify the ALV's selection mode as MULTI_NO_LEAD. It is important that you set the selection mode to MULTI_NO_LEAD or else in the end you would be capturing 1 row lesser than the total number of rows the user has selected. This is because 1 of the rows would have the LeadSelection property & our logic wouldnt be reading the data for that row. Check the example code fragment as shown below:
    DATA lo_value TYPE REF TO cl_salv_wd_config_table.
      lo_value = lo_interfacecontroller->get_model( ).
      CALL METHOD lo_value->if_salv_wd_table_settings~set_selection_mode
        EXPORTING
          value = cl_wd_table=>e_selection_mode-MULTI_NO_LEAD.
    Steps to get the multiple rows selected by the user
    In order to get the multiple rows which were selected by the user you will just have to call the get_selected_elements method of if_wd_context_node. So as you can see its no different from how you would get the multiple rows selected by the user in a table ui element. First get the reference of the node which you have used to bind to the ALV & then call this method on it. Check the example code fragment below:
    METHOD get_selected_rows .
      DATA: temp TYPE string.
      DATA: lr_node TYPE REF TO if_wd_context_node,
                wa_temp  TYPE REF TO if_wd_context_element,
                ls_node1 TYPE wd_this->element_node_flighttab,
                lt_node1 TYPE wd_this->elements_node_flighttab.
      lr_node = wd_context->get_child_node( name = 'NODE_FLIGHTTAB' ).
    " This would now contain the references of all the selected rows
      lt_temp = lr_node->get_selected_elements( ).
        LOOP AT lt_temp INTO wa_temp.
    " Use the references to get the exact row data
          CALL METHOD wa_temp->get_static_attributes
            IMPORTING
              static_attributes = ls_node1.
          APPEND ls_node1 TO lt_node1.
          CLEAR ls_node1.
        ENDLOOP.
    ENDMETHOD.
    Hope this helps resolve your problem.
    Regards,
    Uday

  • Flyout panel populating selections from state to state selections

    I am looking at having states that offer selections. Once each selection in each state is selected such as a radio button that selection would populate in a flyout panel that would be in each state. You would then go onto the next state and make your next selection. It would then add onto that flyout panel in addition to the selection in the previous state. I would need to have what is populated in the flyout panel to have the ability to be able to copy and paste. In addition I would need to create a reset button that would go to the primary state and clear whats in the flyout panel. I know thats a lot to ask but I like the ease of use in catalyst. I know this might require some use of action script and would be wondering if it would be better to use Flex3

    From what you are describing I think you will be able to accomplish a lot of this in Catalyst, but you will probably need Flash Builder to populate the flyout based on use selections. Give Catalyst a whirl, and if you run into problems or have specific questions, please post them on the forum.
    Ty

  • Nodes unavailable for selection from the OUI Node Selection screen

    After successfully installing the grid infrastructure, The second node is not available fr selection while installing the database software.I am installing Release 11.2.0.1 on OEL 5.8 running on Esxi. These are two nodes And am using /etc/hosts file for IP resolution. cluster services are online on both nodes. I have even restarted them as per the docs but still can't see the node.

    I have two users, grid and oracle. These are the environments
    Oracle:
    Node1:
    [oracle@OELRacNode1 ~]$ env|grep ORA
    ORACLE_BASE=/u01/app/oracle
    [oracle@OELRacNode1 ~]$
    Node2:
    [oracle@OELRacNode2 ~]$ env|grep ORA
    ORACLE_BASE=/u01/app/oracle
    [oracle@OELRacNode2 ~]$
    This means I haven't set $ORACLE_HOME for the user oracle on both nodes before running the runInstaller for the database software.
    User grid:
    Node1:
    [grid@OELRacNode1 ~]$ env|grep ORA
    ORACLE_BASE=/u01/app/11.2.0/grid
    [grid@OELRacNode1 ~]$
    Node2:
    [grid@OELRacNode2 ~]$ env|grep ORA
    ORACLE_BASE=/u01/app/11.2.0/grid
    [grid@OELRacNode2 ~]$
    Password-less ssh has been set for the user grid:
    [grid@OELRacNode2 ~]$ ssh grid@OELRacNode1
    Last login: Mon Aug  5 12:41:29 2013 from 192.168.1.74
    [grid@OELRacNode1 ~]$
    [grid@OELRacNode1 ~]$ ssh grid@OELRacNode2
    Last login: Mon Aug  5 12:42:39 2013 from 192.168.1.74
    [grid@OELRacNode2 ~]$
    From primary (Node1):
    [grid@OELRacNode1 bin]$ ./crsctl check cluster -all
    oelracnode1:
    CRS-4537: Cluster Ready Services is online
    CRS-4529: Cluster Synchronization Services is online
    CRS-4533: Event Manager is online
    oelracnode2:
    CRS-4537: Cluster Ready Services is online
    CRS-4529: Cluster Synchronization Services is online
    CRS-4533: Event Manager is online
    [grid@OELRacNode1 bin]$ ./olsnodes
    oelracnode1
    [grid@OELRacNode1 bin]$
    [grid@OELRacNode1 bin]$
    From secondary (Node2):
    [grid@OELRacNode2 11.2.0]$ cd grid/bin/
    [grid@OELRacNode2 bin]$ ./crsctl check cluster -all
    oelracnode1:
    CRS-4537: Cluster Ready Services is online
    CRS-4529: Cluster Synchronization Services is online
    CRS-4533: Event Manager is online
    oelracnode2:
    CRS-4537: Cluster Ready Services is online
    CRS-4529: Cluster Synchronization Services is online
    CRS-4533: Event Manager is online
    [grid@OELRacNode2 bin]$
    [grid@OELRacNode2 bin]$ ./olsnodes
    oelracnode2
    [grid@OELRacNode2 bin]$
    I installed the grid infrastructure as grid
    I am installing rdbms as oracle.

  • Select * from Table where field1 = (select max(field1) from Table2)  counterpart

    Post Author: JuneCruz
    CA Forum: Data Connectivity and SQL
    These is my table  with 3 fields NFstCol, NsndCol, and NtrdCol
    NFstCol NSndCol NTrdCol -
    1      One      12      One      13      One      14      Two      15      Two      16      Two      17      One      28      One      29      One      210    One      311    One      312    One      316    Two      217    Two      218    Two      219    Four    NULL20    Four    NULL21    Four    NULL
    Now I want to display the records all records that have the maximum ntrdcol group by nsndcolso the output should be.          NfstCol     NtrdColOne         10         3         11         3         12         3
    Two          16         2         17         2         18         2
    Four           19        null          20        null          21        null
    Can this be done without using view and command as source for the database.thanks.

    Post Author: JuneCruz
    CA Forum: Data Connectivity and SQL
    Hi Jagan, all;
       Thanks for the reply.  It works.  Now Im grouping again my reports based on status.
        my records would be.
             FstCol              NsndCol             Status
            1                   One              Inactive        2                   One              Active        3                   One              Active
      My  first group would be Status , then by NsndCol
      However my report shows             Active             FstCol    NsndCol             3            One       Inactive             1            One
      but I want only record number 3 having 3 as the max id for One, I just want to ignore about the Status but I need to group my records based on status  also
                 FstCol    NsndCol             3            One
    Thanks,

  • Is selecting from a view more efficient than selecting from multiple tables

    Hi heres the problem
    Lets say i created a view from 2 tables (person and info). both have a ID column
    create view table_view (age,name,status,id) as
    select a.age, a.name, b.status, b.id
    from person a, info.b
    where a.id=b.idif i want to select a given range of values from these 2 tables which of the following queries would be more effective.
    select a.age, a.name, b.status, b.id
    from person a, info.b
    where a.id=b.id
    and a.id <1000
    select age, name, status, id
    from table_view
    where  id <1000

    Bear in mind that this concept of views storing the SQL text is something relative to Oracle databases and not necessarily other RDBMS products. For example, Ingres databases create "views" as tables of data on the database and therefore there is a difference between selecting from the view and selecting from the base tables.
    Oracle also has "materialized views" which differ from normal "views" because they are actually created, effectively, as tables of data and will not use the indexes of the base tables.
    In Oracle, you cannot create indexes against "views" but you can create indexes against "materialized views".

  • Select from many tables of the same type

    Hi everybody!
    My problem is the next:
    I have many tables with big account of data (millions regs), so I did something like that:
    The regs dated 1999 are in the table XXX_1999, those dated 2000 - in XXX_2000, and so on.
    Now, if I want to make query from date1 to date2 (could be some years of difference), I don't know the number of tables I have to query in execution time.
    I want to make a procedure that returns 1 recordset (or cursor) with all the data in it without using temporary tables.
    Is it possible and how?
    Thanks

    SQL> r
      1  declare
      2    c_CRLF constant varchar2(2) := chr(13)||chr(10);
      3
      4    v_date1 date := to_date('15.03.2001', 'DD.MM.YYYY');
      5    v_date2 date := to_date('17.08.2003', 'DD.MM.YYYY');
      6
      7    cursor c_years is
      8      select to_number(to_char(v_date1, 'YYYY')) + rownum-1 year
      9      from user_tables
    10      where rownum <= to_number(to_char(v_date2, 'YYYY')) -to_number(to_char(v_date1, 'YYYY')) +1;
    11
    12    v_stmnt varchar2(2000);
    13  begin
    14    for rec in c_years loop
    15      if c_years%ROWCOUNT > 1 then
    16        v_stmnt := v_stmnt || c_CRLF ||'UNION ALL' || c_CRLF;
    17      end if;
    18      v_stmnt := v_stmnt || 'select * from XXX_'||rec.year;
    19    end loop;
    20    dbms_output.put_line(v_stmnt);
    21* end;
    select * from XXX_2001
    UNION ALL
    select * from XXX_2002
    UNION ALL
    select * from XXX_2003
    PL/SQL procedure successfully completed.
    SQL>You will need to add some bounds checking to avoid "table or view does not exist'
    if date1 < 2001 -> date1=2001
    if date2 > current year -> date2=current year
    Message was edited by:
    Jens Petersen

  • Oracle 8i, selecting from Stored Procedudure

    Hi
    In InterBase it is possible to create a Stored Procedure with some input parameters and then select from it.
    for example:
    select * from my_stored_procedure (my_parameter);
    Is it possile to do something similar in Oracle 8i?
    Where to find examples on creating and using stored procedures like this?
    I am new to Oracle and have been browsing documentation CD and otn.oracle.com websites, however is seemes like finding a needle in a haystack.
    I would appreciate any samples or links.
    Thanks,
    Raigo

    As far as I know, this is not possible directly the same way as in IB. You can resort to using REF CURSORs though:
    create or replace package p
    as
    type t_rc is ref cursor; -- weak ref cursor
    function f( cond in number ) return t_rc;
    end;
    create or replace package body p
    as
    function f ( cond in number ) return t_rc
    is
    rv t_rc;
    begin
    open rv for 'select * from some_table where id = :cond' using in cond;
    -- just return open cursor
    return rv;
    end;
    end;
    then you can use it this way:
    declare
    c p.t_rc;
    r some_table%rowtype;
    begin
    c := p.f(100);
    loop
    fetch c into r;
    exit when c%notfound;
    -- process row r here
    end loop;
    end;
    You can also use SELECT FROM TABLE( CAST (function(...) AS collection_type)) syntax - browse Object-Relational Features guide, SQL Reference and Application Development - Fundamentals for more info and examples on this.

  • SSMS is not listing table and views objects though the objects are listed when I execute TSql string "SELECT * FROM sys.Tables"

    I have a db, call it xyz.mdb
    It suddenly is that SSMS is not listing the table objects nor the Views.  SELECT * FROM sys.Tables and SELECT * FROM sys.Views work very fine.  But when I click on the tables node, on Objects Explorer, Only the Systems Tables and File Tables folders
    show. 
    Other DBs on same SQL instance do not show same problem.  They are all working very fine.
    I have backed up and restored this db on other computers and the behaviour is the same.  Incidentally right-clicking the db and clicking Properties throws up this error message.
    -------------------------------------------------------------------------Error!
    Cannot show requested dialog.
    Property Size is not available for Database '[Pliny E DB - NOA 2014]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights.  (Microsoft.SqlServer.Smo)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.PropertyCannotBeRetrievedExceptionText&EvtID=Size&LinkId=20476
    --------------------------------------------------------------------------------End>
    When I try to Refrresh the Tables node on Object Explorer, I get this other:
    ------------------------------Error!
    SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0x9090d9b7; actual: 0x909001b4). It occurred during a read of page (1:1173) in database ID 21 at offset 0x0000000092a000 in file 'c:\Databases\Clients\NOA\Pliny E DB -
    NOA 2014.mdf'.  Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check
    (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (Microsoft SQL Server, Error: 824)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=824&LinkId=20476
    ------------------------------End>
    The Help link of course is not valid any more.
    Many thanks
    Vie
    @Abuja
    Vie

    Your database is corrupted and you need to run.
    DBCC CHECKDB
    You already have a backup so do it...
    This link will provide you with more information:
    http://msdn.microsoft.com/en-us/library/ms176064.aspx

  • Which is fast ? Select * from tableName or Select Column1,Column2 .... From tableName ? and Why ?

    Which is fast ? Select * from tableName or Select Column1,Column2 .... From tableName ? and Why ?
    select * from Sales.[SalesOrderHeader]
    select SalesOrderNumber,RevisionNumber,rowguid from Sales.[SalesOrderHeader]
    As you can see both the query execution plan and subtree cost is same. So how selecting the particular columns optimize the query ?

    Which is fast ? Select * from tableName or Select Column1,Column2 .... From tableName ? and Why ?
    select * from Sales.[SalesOrderHeader]
    select SalesOrderNumber,RevisionNumber,rowguid from Sales.[SalesOrderHeader]
    As you can see both the query execution plan and subtree cost is same. So how selecting the particular columns optimize the query ?
    Yes, selecting specific columns is always better than select *.
    If you always need few columns in result, then just use SELECT col1, col2 FROM YourTable. If you SELECT * FROM YourTable; that is extra useless overhead.
    If in future if someone adds Image/BLOB/Text type columns in your table, using SELECT * will worsen the performace for sure.
    Let's say if you have SP and you use INSERT INTO DestTable SELECT * FROM TABLE which runs fine BUT again if someone adds few more columns then your SP will fail saying provided columns don't match.
    -Vaibhav Chaudhari

  • SELECTing from a large table vs small table

    I posted a question few months back about teh comparison between INSERTing to a large table vs small table ( fewer number of rows ), in terms of time taken.
    The general consensus seemed to be that it would be teh same, except for teh time taken to update the index ( which will be negligible ).
    1. But now, following teh same logic, I m confused why SELECTINg from a large table should be more time taking ("expensive" ) than SELECTing from a small table.
    ( SELECTing using an index )
    My understanding of how Oracle works internally is this :
    It will first locate the ROWID from teh B-Tree that stores the index.
    ( This operation is O(log N ) based on B-Tree )
    ROWID essentially contains teh file pointer offset of teh location of the data in teh disk.
    And Oracle simply reads teh data from teh location it deduced from ROWID.
    But then the only variable I see is searching teh B-Tree, which should take O(log N ) time for comparison ( N - number of rows )
    Am I correct above.
    2. Also I read that tables are partitioned for performance reasons. I read about various partiotion mechanisms. But cannot figure out how it can result in performance improvement.
    Can somebody please help

    user597961 wrote:
    I posted a question few months back about teh comparison between INSERTing to a large table vs small table ( fewer number of rows ), in terms of time taken.
    The general consensus seemed to be that it would be teh same, except for teh time taken to update the index ( which will be negligible ).
    1. But now, following teh same logic, I m confused why SELECTINg from a large table should be more time taking ("expensive" ) than SELECTing from a small table.
    ( SELECTing using an index )
    My understanding of how Oracle works internally is this :
    It will first locate the ROWID from teh B-Tree that stores the index.
    ( This operation is O(log N ) based on B-Tree )
    ROWID essentially contains teh file pointer offset of teh location of the data in teh disk.
    And Oracle simply reads teh data from teh location it deduced from ROWID.
    But then the only variable I see is searching teh B-Tree, which should take O(log N ) time for comparison ( N - number of rows )
    Am I correct above.
    2. Also I read that tables are partitioned for performance reasons. I read about various partiotion mechanisms. But cannot figure out how it can result in performance improvement.
    Can somebody please helpIt's not going to be that simple. Before your first step (locate ROWID from index), it will first evaluate various access plans - potentially thousands of them - and choose the one that it thinks will be best. This evaluation will be based on the number of rows it anticipates having to retrieve, whether or not all of the requested data can be retrived from the index alone (without even going to the data segment), etc. etc etc. For each consideration it makes, you start with "all else being equal". Then figure there will be dozens, if not hundreds or thousands of these "all else being equal". Then once the plan is selected and the rubber meets the road, we have to contend with the fact "all else is hardly ever equal".

  • Can not select from my own MV. Please help.

    Hello Gurus,
    I have created a MV with following clauses
    CREATE or REPLACE MATERIALIZED VIEW "OWNER_NAME1"."MV_Name1"
    BUILD IMMEDIATE
    USING INDEX
    REFRESH COMPLETE
    AS
    SELECT column1, column2 .... from table1,table2
    where .....
    I have logged in to DB with the 'owner_name1' schema itself which is the owner of the MV.
    But, when I try to select from the above MV. It gives error "Ora-00942 table or view does not exist"
    I can see the same under 'user_objects' view as an object of owner_name1 schema.
    Could you please help me in understanding where I have gone wrong?
    DB - Oracle 9i on unix platform.
    Thanks in advance!
    Abhijit.

    Oh! I missed to mention the exact steps followed by me which created error for me,
    viz.
    1) I have 2 Database and their users as follows
    bq. i) DB1 in local server - 'localUser'
    bq. ii) DB2 in remote server - 'RemoteUser1' and 'RemoteUser2'
    2) 'RemoteUser2' user in DB2 has 'select' privilage on table 'RemoteTable1' of 'RemoteUser1' ( both are remote DB's users ! )
    i.e. select * from RemoteUser1.RemoteTable1; --works okay when logged into RemoteUser2. no synonyms are created hence using schema_name.table_name convention.
    3) Logged in to 'localUser' in DB1.
    4) Created a DB link 'local_to_remote2' in 'localUser' schema ( in DB1) to 'RemoteUser2' schema (in DB2)
    i.e.
    create database link local_to_remote2 connect to RemoteUser2 identified by password using 'connection_string';
    DBLink was created successfully.
    5) I could select from the tables of 'RemoteUser2' using DB Link. (by logging in to 'localUser')
    i.e. select * from RemoteUser1.RemoteTable1@local_to_remote2 ; --- gives me expected output. no issues!
    6) Now, I created below MV in 'localUser' ( no need to tell in 'DB1' )
    the exact syntax I used is as follows,
    CREATE or REPLACE MATERIALIZED VIEW "localUser"."MV_Name1"
    BUILD IMMEDIATE
    USING INDEX
    REFRESH COMPLETE
    AS
    SELECT column1, column2
    From RemoteUser1.RemoteTable1@local_to_remote2
    where condition1
    and condition2;
    The MV was created successfully, and I could see it as an 'Valid' object of 'localUser' schema.
    i.e. select * from user_objects where object_name ='MV_NAME1' and status ='VALID' --- tells that above create MV is an object of owner 'localUser'
    But, when I try to select from the said MV. it gives me error "Ora-00942 table or view does not exist"
    i.e. select * from MV_Name1; ---- neither this
    select * from localUser.MV_Name1; ---- nor this works :(
    Even when I try to drop the same MV it gives me same error. :(
    Could you please suggest me anything so that I will be able to select from MY OWN MV ?
    Please help Gurus.

  • Html form for select * from table a

    Hi all,
    I m looking for report on header/footer part from one apex pages
    which will display context from table a, like sql statement
    select * from table a, written in html.
    Is any examples in java script/html select from tables
    (and same insert into table A (...) select * from table b)
    thanks,
    Gordan

    Hello Gordan,
    Do you want to show the whole report or just some data of it?
    If it's for ex just the name and address you could create two items and have a process or computation to fill it with your select statement.
    If it's the whole report, just create the report and put it in for ex. Region 1. In your page template you can specify that Region 1 needs to come into the footer.
    Regards,
    Dimitri
    -- http://dgielis.blogspot.com/
    -- http://apex-evangelists.com/
    -- http://apexblogs.info/

  • Creating and selecting from a dynamic table

    Hi,
    Iam trying to create a table dynamically and selecting from it in same plsql block, but am getting "table doesnot exist" error. however if i just create a table dynamically and then do a select on it seperately it works..
    below is sample code for the same,
    working
    Line: -----
    DECLARE
    loc VARCHAR2(20):='bglr';
    l_cnt pls_integer;
    BEGIN
    -- create an employee information table
    EXECUTE IMMEDIATE
    'CREATE TABLE ' || 'emp_bglr' ||
    empno NUMBER(4) NOT NULL,
    ename VARCHAR2(10),
    job VARCHAR2(9),
    sal NUMBER(7,2),
    deptno NUMBER(2)
    end;
    select count(*) from emp_bglr ...works and return me 0 rows
    Line: -----
    but when i include select in plsql block ..it throws "Table does not exists" error...(iam running below plsql block after dropping the created table)
    not working
    Line: -----
    DECLARE
    loc VARCHAR2(20):='bglr';
    l_cnt pls_integer;
    BEGIN
    -- create an employee information table
    EXECUTE IMMEDIATE
    'CREATE TABLE ' || 'emp_bglr' ||
    empno NUMBER(4) NOT NULL,
    ename VARCHAR2(10),
    job VARCHAR2(9),
    sal NUMBER(7,2),
    deptno NUMBER(2)
    --COMMIT;
    END;
    Select count(*) into l_cnt from emp_bglr;
    dbms_output.put_line('cnt is '||l_cnt);
    end;
    Line: -----

    Becuase your code is first checked for syntax/object existance during compilation and throws an error saying the table does not exist.
    Try this:
    SQL> ed
    Wrote file afiedt.buf
      1   DECLARE
      2   loc VARCHAR2(20):='bglr';
      3   l_cnt pls_integer;
      4   BEGIN
      5   -- create an employee information table
      6   EXECUTE IMMEDIATE 'CREATE TABLE emp_bglr(
      7   empno NUMBER(4) NOT NULL,
      8   ename VARCHAR2(10),
      9   job VARCHAR2(9),
    10   sal NUMBER(7,2),
    11   deptno NUMBER(2)
    12   )';
    14  Select count(*) into l_cnt from all_objects where object_name = 'EMP_BGLR';
    15  dbms_output.put_line('tab cnt is '||l_cnt);
    16  IF (l_cnt = 1) THEN
    17  l_cnt := 0;
    18  EXECUTE IMMEDIATE 'SELECT count(*) from apps.emp_bglr' into l_cnt;
    19  dbms_output.put_line('data cnt is '||l_cnt);
    20  END IF;
    21* end;
    SQL> /
    tab cnt is 1
    data cnt is 0
    PL/SQL procedure successfully completed.
    SQL> Edited by: AP on Aug 5, 2010 5:51 AM
    Edited by: AP on Aug 5, 2010 5:52 AM

Maybe you are looking for

  • Accessing time capsule with osx server and vpn

    i have apple server and a time capsule that i use as harddisk. Now I want to access the time capsule by VPN. I cannot make an accesspoint of my time capsule. When I turn off file sharing on the time capsule and turn it on on the server then i cannot

  • No login screen in normal mode boots fine in safe mode

    I have got a compaq persaio f700 went to turn it on to normal mode  nothing I can hear the login alert but nothing however I can boot it up in safe mode with no trouble . when I go into device manager i find a yellow triangle next to coprocessor. How

  • Help needed: Creating web link in JDialog Box

    I'm in need of this urgently, any help would be much appreciated. I'm currently display some information in a JDialog box when an item is clicked in a JApplet. I need to display a weblink within the dialog box. Thanks anyone

  • Domain Controller Logon Users Count

    Hi Guys,  I am trying to retrieve a list or numbers of users that are authenticated against a particular Domain Controller. I ran the following command but no luck. 3.21 Finding the Number of Logon Attempts Made Against a Domain Controller Problem Yo

  • Having trouble with aspect ratio when going to iDVD

    I have a movie I am trying to put into iDvd6. I export to qtime , self-contained, with chapter markers. When it is played in idvd it is squeezed. The people are tall and thin. It is all shot, edited, transfered in 4:3 ratio. I have checked if all set