Index On In query columns

Hi Alll,
I have one query...can we have Index on: example:
SELECT col1, col2
FROM (SELECT Col1 as A, Col2 as B
          FROM tb) t1,
        (SELECT *
          FROM ts) t2
WHERE t1.col1 = t2.col2Question can we have a virtual on Index on t1's column i.e. t1.A and t1.B

Hi,
you can have index on COL1 and COL2 on table tb. I think Virtual index are undocumented feature used by Oracle.
thanks
This likk will give you more info.
http://www.dba-oracle.com/oracle_news/2005_6_29_inside_virtual_indexes.htm
Edited by: Himanshu Kandpal on Jul 29, 2009 7:23 AM added the link

Similar Messages

  • Index usage depends on columns selected

    Hi, somehow cannot understand why index is not used, please help.
    in Oracle Database 11g Release 11.2.0.3.0 - 64bit Production
    1.     Included only indexed column and got a perfect plan
    explain plan for2 select s.x_cnt
    3 from reported_summary s
    4 where s.x_cnt>0;
    PLAN_TABLE_OUTPUT
    Plan hash value: 2674489506
    | Id | Operation | Name | Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 306 (8)|
    |* 1 | INDEX FAST FULL SCAN| S_NUI01 | 306 (8)|
    Predicate Information (identified by operation id):
    1 - filter("s"."x_CNT">0)
    2.     Included some other column and got TABLE ACCESS FULL
    explain plan for2 select s.x_cnt,s.ru_id
    3 from reported_summary s
    4 where s.x_cnt>0;
    PLAN_TABLE_OUTPUT
    Plan hash value: 2142873335
    | Id | Operation | Name | Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 2421 (3)|
    |* 1 | TABLE ACCESS FULL| REPORTED_SUMMARY | 2421 (3)|
    Predicate Information (identified by operation id):
    1 - filter("s"."x_CNT">0)
    3.     Included all other columns and got TABLE ACCESS FULL as well
    explain plan for2 select s.x_cnt,s.*
    3 from reported_summary s
    4 where s.x_cnt>0;
    PLAN_TABLE_OUTPUT
    Plan hash value: 2142873335
    | Id | Operation | Name | Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 2421 (3)|
    |* 1 | TABLE ACCESS FULL| REPORTED_SUMMARY | 2421 (3)|
    Predicate Information (identified by operation id):
    1 - filter("s"."x_CNT">0)
    Thanks a lot

    Thanks all, just to clarify
    "select s.x_cnt from reported_summary s..." is using index;
    "select 'Y' y from reported_summary s..." is using index;
    "select <any ohter column> from reported_summary s..." is causing TABLE ACCESS FULL;
    no differences in where clause, no order by at all
    the index script is
    CREATE INDEX S_NUI01 ON REPORTED_SUMMARY (OFFSET_CNT) TABLESPACE X_INDEXES;
    jgarry, thanks for the answer, the only problem that I have clone of the database (32 bit) with same CBO parameters
    where it does not behave this way:
    explain plan for2 select s.offset_cnt
    3 from reported_summary s
    4 where s.offset_cnt>0;
    PLAN_TABLE_OUTPUT
    Plan hash value: 2359470296
    | Id | Operation | Name | Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 9 (0)|
    |* 1 | INDEX RANGE SCAN| S_NUI01 | 9 (0)|
    Predicate Information (identified by operation id):
    1 - access("s"."OFFSET_CNT">0)
    explain plan for2 select s.offset_cnt,s.ru_id
    3 from reported_summary s
    4 where s.offset_cnt>0;
    PLAN_TABLE_OUTPUT
    Plan hash value: 3732627180
    | Id | Operation | Name | Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 67 (0)|
    | 1 | TABLE ACCESS BY INDEX ROWID| REPORTED_SUMMARY | 67 (0)|
    |* 2 | INDEX RANGE SCAN | S_NUI01 | 9 (0)|
    Predicate Information (identified by operation id):
    2 - access("s"."OFFSET_CNT">0)
    Thanks again.

  • Index creation on Blob column

    I am new to InterMedia. I am trying to create an index on a blob column. I am getting a error -
    Can you please suggest me the solution of this problem.
    Thanks.......
    The following statement(s) failed to execute successfully.
    CREATE INDEX temp.ind1 ON temp.student(MOL) INDEXTYPE IS CTXSYS.CONTEXT PARAMETERS('')
    ORA-29855: error occurered in the execution of ODCINDEXCREATE routine
    ORA-20000: interMedia Text error:
    DRG-50704: Net8 listener is not running or cannot start external procedures
    ORA-28575: unable to open RPC connection to external procedure agent
    ORA-06512: at "CTXSYS.DRUE", line 122
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 34
    ORA-06512: at line 1
    null

    Listner problems probably. Please check the FAQ at http://technet.oracle.com/products/text/

  • How to enforce index in oracle query

    Hi all
    how to enforce index in oracle query
    Regards

    Use INDEX hint to force Optimizer to use the specfied index.
    You really need to investigate why Optimizer doesn't choose the index. Remember, INDEX SCAN are not always GOOD.
    Jaffar

  • How to get the index of a h:column element?

    Hi!
    I'd like to know how to get the index of a <h:column> element.
    Here is the code of what I'm trying to do:
    <h:column>
         <a:commandLink
              value="#{familyAction.familyDocsByPrj}"
              action="#{homeAction.search(ROW_INDEX)}"
              reRender="rightAppPanel" />
    </h:column>When clicking a row, I'd like to make a "search" depending on the selected row.
    Does anybode know how to do that?
    Thanks a lot :)

    Thanks a lot for all your answers! :)
    I finally got to do something with my little knowledge =P
    I created a new class containing all the data needed for the dataTable (including a "String id").
    And that's what I get:
    <h:column>
         <a:commandLink
              value="#{familyAction.familyDocsByPrj.name}"
              action="#{homeAction.search(familyAction.familydocsByPrj.id)}"
              reRender="rightAppPanel" />
    </h:column>

  • BEx Query Columns come back in different Order after drill?

    I have a strange effect when I work with BEx Queries in Xcelsius.
    On default, I open and display the Bex Query "A". Columns are in order like defined in BEx Designer (Column1, Column2, Column3.....)
    I want to do a drill, and so in Xcelsius BEx Connection settings I set the Filter on Field "X" in the XLS and in "Query Usage" I addionally apply the setting "Refresh when Trigger Cell "X" changes".
    Starting the report works fine. But when I do the drill and the Query refreshes, the BEx Query Columns come back in different order?!?
    It looks as if Column 2 and Column 3 are exchanged.
    How can I fix that?
    Thx,
    B. Wegner

    After some testing....
    This issue is independent from the filter value. But it only seems to occure when a second BEx Query connection is defined.
    The BEx Query Data Columns come back in different order after
    - Refresh on Trigger
    - Refresh after XY Seconds
    Any Ideas?
    Edited by: B.Wegner on Nov 16, 2010 3:42 PM

  • How to re-index a modified query?

    Hi community,
    Due to a change to a BO I had also to adjust a already created query used to support an advanced search pane.
    Now every time I open my OWL, the OWL is empty and a message is raised saying "The index is temporary not available;index=.c016:1fs:jdx_zby003542_iptfrmv1yxsig7".
    Even though the message uses the word "temporary" this problem did not solve itself over time so I ask here:
    Is it possible/how can I force the re-indexing of a query?
    Best regards,
    Ludger

    Hi everyone
    This issue still persists in spite of my second message - i am pretty helpless.
    First I thought a clean solves the issue but it only prevents the "index temporary not available" message as long as no BO is present.
    As soon as a new BO is created, the situation occurs again.
    What can I do?

  • How to create a concatenated index with a long column (Urgent!!)

    We have a situation where we need to create a concatenated unique
    index with one of the columns as a "long" datatype. Oracle does
    not allow a lot of things with long columns.
    Does anyone know if this is possible or if there is a way to get
    around it.
    All help is appreciated!!!!

    From the Oracle SQL Reference ...
    "You cannot create an index on columns or attributes whose
    type is user-defined, LONG, LONG RAW, LOB, or REF,
    except that Oracle supports an index on REF type columns
    or attributes that have been defined with a SCOPE clause."
    Doesn't mention CLOB or BLOB types, so perhaps you
    should consider using one of those types instead. I have a
    feeling that the LONG type is now deprecated.

  • Aggregates in Query Columns of a Web Database

    What Aggregates expressions are not allowed in Query Columns context of a web database

    Hi,
    As this post is more related to SQL, I suggest you post a question in SQL forum.
    More experts will help you find the solution and you will get more information from there.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver
    Best regards,
    Zhengyu Guo
    Zhengyu Guo
    TechNet Community Support

  • Getting error "Column is not indexed " when executing query on ORACLE 10g

    Hi all,
    When executing the below query im getting the error "ORA-20000:Column is not indexed"
    query:
    select xmlelement("nexml:result",xmlattributes('http://namespaces.nextance.com/nex/xml' as "xmlns:nexml"),xmlelement("nexml:value",count(*))).getClobVal()
    from "permission"
    where ( ((contains(object_value,'(searchDocument) inpath(/permission/action)') > 0)) and ((existsNode(object_value,'/permission[resource/resourcekey/@type[. = "document"]]') = 1)) and ((contains(object_value,'(GeneralUser) inpath(/permission/principal/@name)') > 0)) and ((existsNode(object_value,'/permission[principal/@type[. = "group"]]') = 1)) and ((existsNode(object_value,'/permission[type[. = "allow"]]') = 1)) and ((contains(object_value,'(nexip) inpath(/permission/resource/resourcekey/field/@value)') > 0) or (contains(object_value,'(Corporate) inpath(/permission/resource/resourcekey/field/@value)') > 0) or (contains(object_value,'(ProcurementAgreement) inpath(/permission/resource/resourcekey/field/@value)') > 0) or (contains(object_value,'(Procurement) inpath(/permission/resource/resourcekey/field/@value)') > 0) or (contains(object_value,'(SalesAgreement) inpath(/permission/resource/resourcekey/field/@value)') > 0)) )
    Then after checking some forum, i replaced "contains" with "ora:contains" and executed the query. Now im not getting the first error but got a new error "invalid relational operator"
    So please help me in resolving the errors?
    Thanks in advance.

    Anil kumar wrote:
    Hi,
    Thanks for your reply. Could you please explain your solution in detail?Hi,
    I just have a try...
    create table t (id int,my_lob clob)
    begin
    insert into t values(101,'Oracle redwood shores USA');
    insert into t values (102,'HP palo alto USA');
    insert into t values(103,'Capgemini  FRANCE');;
    end;
    create index my_idx on t(my_lob) indextype is ctxsys.context
    select *
    from t
    where contains(my_lob,'USA',1)>0
    Output
    ID      MY_LOB
    101     Oracle redwood shores USA
    102     HP palo alto USA Hope it helps,
    CKLP

  • How to make sql to use index/make to query to perform better

    Hi,
    I have 2 sql query which results the same.
    But both has difference in SQL trace.
    create table test_table
    (u_id number(10),
    u_no number(4),
    s_id number(10),
    s_no number(4),
    o_id number(10),
    o_no number(4),
    constraint pk_test primary key(u_id, u_no));
    insert into test_table(u_id, u_no, s_id, s_no, o_id, o_no)
    values (2007030301, 1, 1001, 1, 2001, 1);
    insert into test_table(u_id, u_no, s_id, s_no, o_id, o_no)
    values (2007030302, 1, 1001, 1, 2001, 2);
    insert into test_table(u_id, u_no, s_id, s_no, o_id, o_no)
    values (2007030303, 1, 1001, 1, 2001, 3);
    insert into test_table(u_id, u_no, s_id, s_no, o_id, o_no)
    values (2007030304, 1, 1001, 1, 2001, 4);
    insert into test_table(u_id, u_no, s_id, s_no, o_id, o_no)
    values (2007030305, 1, 1002, 1, 1001, 2);
    insert into test_table(u_id, u_no, s_id, s_no, o_id, o_no)
    values (2007030306, 1, 1002, 1, 1002, 1);
    commit;
    CREATE INDEX idx_test_s_id ON test_table(s_id, s_no);
    set autotrace on
    select s_id, s_no, o_id, o_no
    from test_table
    where s_id <> o_id
    and s_no <> o_no
    union all
    select o_id, o_no, s_id, s_no
    from test_table
    where s_id <> o_id
    and s_no <> o_no;
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=6 Card=8 Bytes=416)
    1 0 UNION-ALL
    2 1 TABLE ACCESS (FULL) OF 'TEST_TABLE' (TABLE) (Cost=3 Card=4 Bytes=208)
    3 1 TABLE ACCESS (FULL) OF 'TEST_TABLE' (TABLE) (Cost=3 Card=4 Bytes=208)
    Statistics
    223 recursive calls
    2 db block gets
    84 consistent gets
    0 physical reads
    0 redo size
    701 bytes sent via SQL*Net to client
    508 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    5 sorts (memory)
    0 sorts (disk)
    8 rows processed
    -- i didnt understand why the above query is not using the index idx_test_s_id.
    -- But still it is faster
    select s_id, s_no, o_id, o_no
    from test_table
    where (u_id, u_no) in
    (select u_id, u_no from test_table
    minus
    select u_id, u_no from test_table
    where s_id = o_id
    or s_no = o_no)
    union all
    select o_id, o_no, s_id, s_no
    from test_table
    where (u_id, u_no) in
    (select u_id, u_no from test_table
    minus
    select u_id, u_no from test_table
    where s_id = o_id
    or s_no = o_no);
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=16 Card=2 Bytes=156)
    1 0 UNION-ALL
    2 1 FILTER
    3 2 TABLE ACCESS (FULL) OF 'TEST_TABLE' (TABLE) (Cost=3 Card=6 Bytes=468)
    4 2 MINUS
    5 4 INDEX (UNIQUE SCAN) OF 'PK_TEST' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=26)
    6 4 TABLE ACCESS (BY INDEX ROWID) OF 'TEST_TABLE' (TABLE) (Cost=2 Card=1 Bytes=78)
    7 6 INDEX (UNIQUE SCAN) OF 'PK_TEST' (INDEX (UNIQUE)) (Cost=1 Card=1)
    8 1 FILTER
    9 8 TABLE ACCESS (FULL) OF 'TEST_TABLE' (TABLE) (Cost=3 Card=6 Bytes=468)
    10 8 MINUS
    11 10 INDEX (UNIQUE SCAN) OF 'PK_TEST' (INDEX (UNIQUE)) (Cost=1 Card=1 Bytes=26)
    12 10 TABLE ACCESS (BY INDEX ROWID) OF 'TEST_TABLE' (TABLE) (Cost=2 Card=1 Bytes=78)
    13 12 INDEX (UNIQUE SCAN) OF 'PK_TEST' (INDEX (UNIQUE)) (Cost=1 Card=1)
    Statistics
    53 recursive calls
    8 db block gets
    187 consistent gets
    0 physical reads
    0 redo size
    701 bytes sent via SQL*Net to client
    508 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    4 sorts (memory)
    0 sorts (disk)
    8 rows processed
    -- The above query is using index PK_TEST. But still it has FULL SCAN to the
    -- table two times it has the more cost.
    1st query --> SELECT STATEMENT Optimizer=ALL_ROWS (Cost=6 Card=8 Bytes=416)
    2nd query --> SELECT STATEMENT Optimizer=ALL_ROWS (Cost=16 Card=2 Bytes=156)
    My queries are:
    1) performance wise which query is better?
    2) how do i make the 1st query to use an index
    3) is there any other method to get the same result by using any index
    Appreciate your immediate help.
    Best regards
    Muthu

    Hi William
    Nice...it works.. I have added "o_id" and "o_no" are in part of the index
    and now the query uses the index
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=8 Bytes=416)
    1 0 UNION-ALL
    2 1 INDEX (FULL SCAN) OF 'IDX_TEST_S_ID' (INDEX) (Cost=1 Card=4 Bytes=208)
    3 1 INDEX (FULL SCAN) OF 'IDX_TEST_S_ID' (INDEX) (Cost=1 Card=4 Bytes=208)
    Statistics
    7 recursive calls
    0 db block gets
    21 consistent gets
    0 physical reads
    0 redo size
    701 bytes sent via SQL*Net to client
    507 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    8 rows processed
    But my questions are:
    1) In a where clause, if "<>" condition is used, then, whether the system will use the index. Because I have observed in several situations even though the column in where clause is indexed, since the where condition is "like" or "is null/is not null"
    then the index is not used. Same as like this, i assumed, if we use <> then indexes will not be used. Is it true?
    2) Now, after adding "o_id" and "o_no" columns to the index, the Execution plan is:
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=8 Bytes=416)
    1 0 UNION-ALL
    2 1 INDEX (FULL SCAN) OF 'IDX_TEST_S_ID' (INDEX) (Cost=1 Card=4 Bytes=208)
    3 1 INDEX (FULL SCAN) OF 'IDX_TEST_S_ID' (INDEX) (Cost=1 Card=4 Bytes=208)
    Before it was :
    Execution Plan
    0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=6 Card=8 Bytes=416)
    1 0 UNION-ALL
    2 1 TABLE ACCESS (FULL) OF 'TEST_TABLE' (TABLE) (Cost=3 Card=4 Bytes=208)
    3 1 TABLE ACCESS (FULL) OF 'TEST_TABLE' (TABLE) (Cost=3 Card=4 Bytes=208)
    Difference only in Cost (reduced), not in Card, Bytes.
    Can you explain, how can i decide which makes the performace better (Cost / Card / Bytes). Full Scan / Range Scan?
    On statistics also:
    Before:
    Statistics
    52 recursive calls
    0 db block gets
    43 consistent gets
    0 physical reads
    0 redo size
    701 bytes sent via SQL*Net to client
    507 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    8 rows processed
    After:
    Statistics
    7 recursive calls
    0 db block gets
    21 consistent gets
    0 physical reads
    0 redo size
    701 bytes sent via SQL*Net to client
    507 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    8 rows processed
    Difference in recursive calls & consistent gets.
    Which one shows the query with better performance?
    Please explain..
    Regards
    Muthu

  • Index ignored in query??

    This is probably a basic question about indexes, thanks for your insights.
    I have a table VOUCHER with some columns including a TICKETNO column for which there is a primary key index, defined as follows:
    CREATE UNIQUE INDEX VOUCHER_PK ON VOUCHER (TICKETNO)
    The table contain approximately 20 million records.
    We are using Oracle 9i RAC on HP-UX 11.11
    I am running the following query, which runs for 20 minutes and then fails:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning and Real Application Clusters options
    JServer Release 9.2.0.8.0 - Production
    SQL> select count(*) from VOUCHER
    2 where TICKETNO between 100000 and 100100
    3
    SQL> /
    select count(*) from VOUCHER
    ERROR at line 1:
    ORA-01555: snapshot too old: rollback segment number 741 with name
    "_SYSSMU741$" too small
    I am confused... Why counting 100 records with an indexed column takes so long and fail?

    Thanks for the feedback. I am going to run the ANALYZE suggestion tonight.
    Here are the results of the queries asked for:
    SELECT Table_Name, Status FROM User_Indexes WHERE Index_Name = 'VOUCHER_PK';
    OWNER TABLE_NAME STATUS
    SMVDBA VOUCHER VALID
    SELECT Column_Name FROM User_Ind_Columns WHERE Index_Name = 'VOUCHER_PK';
    COLUMN_NAME
    TICKETNO
    SELECT Last_Analyzed FROM User_Indexes WHERE Index_Name = 'VOUCHER_PK';
    LAST_ANAL
    SELECT Last_Analyzed FROM User_Tables WHERE Table_Name = 'VOUCHER';
    LAST_ANAL
    21-FEB-08
    EXPLAIN PLAN FOR
    select count(*) from VOUCHER
    where TICKETNO between 100000 and 100100;
    Explained
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY('', '', 'ALL'));
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | | | |
    | 1 | SORT AGGREGATE | | | | |
    | 2 | TABLE ACCESS FULL | VOUCHER | | | |
    Note: rule based optimization, PLAN_TABLE' is old version
    10 rows selected.
    EXPLAIN PLAN FOR
    select /*+ INDEX(V VOUCHER_PK) */ count(*) from VOUCHER V
    where TICKETNO between 100000 and 100100;
    Explained.
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY('', '', 'ALL'));
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 1 | 18 | 5 |
    | 1 | SORT AGGREGATE | | 1 | 18 | |
    | 2 | INDEX FAST FULL SCAN| VOUCHER_PK | 83788 | 1472K| 5 |
    Note: cpu costing is off, PLAN_TABLE' is old version
    10 rows selected.

  • Use of Indexes in select query

    Hello,
    This is on a 9i install.
    There is an index called form_id_idx on the form_id column.
    Why does this query use the index (autotrace indicates range scan on the index):
    select count(*) from table_name where form_id=123456;
    but this query does NOT use the index (autotrace indicates full table scan):
    select accepted from table_name where form_id=123456;
    This second query runs much faster when I use a hint on the index. Any help/suggestions?
    Thanks.

    The first query does NOT have to go to the Table it all. It can read the index to count the number of rows for "form_id=123456". An Index Range Scan would be fast.
    The second query has to go to the table to get the values for the "accepted" column for all the rows that have "form_id=123456". Remember that every get can require a read of 2 or more blocks -- at least one, probably 2 or 3, from the index and 1 from the table. If the number of rows is likely to be large then the number of block get operations would be high. In such cases, Oracle computes that it is faster to do a small set of multiblock reads to read the whole table (Table FullScan).
    Therefore, the optimzer weighs :
    a. how many rows it thinks will satisfy "form_id=123456"
    b. how many index + table block gets it would have to execute (all as single block read calls to the OS)
    versus
    x. how many multiblock read calls it thinks it has to execute to read the whole table
    If the available statistics on number of rows, cardinality or density and the size of the table indicate that operation "x" would be cheaper then operations "a" + "b", Oracle would prefer the latter.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • How to create index on a varchar column that represent date?

    Hello there,
    I have a column in my table that is a VARCHAR2 and represent a datetime like '2010-08-23 19:00:00' I want to create an index on it and with an specific large like '2010-08-23 19' so i can filter per HOURS.
    Any one knows the sentence for this?
    Thanx in advance

    Vladimir Zakharychev wrote:
    I'd highly recommend you heed the advice given: store dates as DATE, numbers as NUMBER, strings as VARCHAR2. I can't imagine any valid reason for storing dates like that (except the undisputable "because I want it that way.") You are likely to see all sorts of inefficiencies with your current design (it will not sort correctly, for example, because it will sort strings, not dates, and the rules for sorting them are different.) The function-based index you created will only work if your query will use that same exact function you created the index on.Not to mention that there is no way the database can enforce the "date" data to actually be a valid date . . . and there will come a time that the application *will not" enforce it ...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • The query column CANDIDATE ID appears in cfdump but not cfoutput query=queryname

    I've done this a thousand times.  I have a stored proc that returns data.  I give the resultset a name.  I output it with cfoutput query =queryname.  Now it's failing for every column in the query.  But if I do a cfdump with the queryname as a var, I get the data -- with the exact column names in my cfoutput.
    CF9, SQL Server.

    To debug, you could attempt to dump the result-set with cfoutput, as follows:
    <cfoutput query="queryName">
        <cfloop list="#queryName.ColumnList#" index="column">
            #queryName[column][currentRow]#
        </cfloop>
        <br>
    </cfoutput>
    Otherwise, could you show us your code? Many more eyes may spot something you overlook.

Maybe you are looking for