Can I reference a Summary Column in my sql query?

Basically the subject asks it all. I have a very complex report that has many data linked queries from the "main" query. One of these data linked queries has a sub-query within it that references the primary key of the main query. I can't data link (I can, but it's useless) using this field as it's a sub-query that needs the link, and that link specifically. I've tried to create a Summary Column that gives me the "First" (and only, so it's safe) in order to reference it in the SQL block, but no go. I'm thinking this isn't even possible? Anyone have any ideas? Right now I'm referencing it as I would in a PL/SQL block (:CS_PK), but it's just treated as a parameter that's never passed. Doesn't read the summary column. Hmmm... I'm stuck.

Hi all... this report is still not completed. I've tried the summary column, and created a formula column that sets the user parameter to the primary key that's needed elsewhere. The report runs, no errors, but my best guess is that it's simply not reading that formula column. Here's my formula column:
function CF_1FORMULA0024 return Number is
begin
if :tblassessmentinst is null then
:tblassessmentinst := :CA_ASSESS_INST;
elsif :tblassessmentinst is NOT null then
:tblassessmentinst := :CA_ASSESS_INST; -- this WAS :tblassessmentinst but not working with prod ver, so delay
else
:tblassessmentinst :=0;
end if;
return(:tblassessmentinst);
end;
For testing, I display both the :tblassessmentinst on the report, as well as this formula column. The formula column always displays the correct number, but the :tblassessment only displays 1 (of many) records that need to be displayed. It's like it's not refreshing the formula column for each record? Again, still super stumped, so throw any ideas my way please.
Thanks again,
TL

Similar Messages

  • Summary column in a union query....

    hi,
    i've a report. the datamodel is like ....
    select inv_total,inv_id from invoices
    union all
    select -pymt_total,pymt_id from payments
    union all
    select misc_total,misc_id from transactions
    where misc_code='D'
    union all
    select -misc_total,misc_id from transactions
    where misc_code='C'
    this will give me output for all the customers. i want to print total for
    inv_total+pymt_total+misc_total+misc_total which will reset at customer id.
    Can i create a summary column that will reset at customer id column? i'm using reports 3.0.8
    thanks
    ---himanshu

    1) Add customer_no to the SELECT as column3.
    2) Create 2 groups of the query: G1 with customer_no and G2 with the other 2 columns.
    3) Create a summary column (Use the toolbar on the left, the symbol has the Sigma sum symbol). Choose column 1 as the column to sum. Set it to re-set at G1 (I think default is Report).
    John Alexander www.SummitSoftwareDesign.com

  • How to show the VALUE as the Column Header using SQL query?

    Hi
    I have a requirement to show the picked value as the column header using SQL query.
    Example:
    ======
    SELECT EMPNO FROM EMP
    WHERE EMPNO=7934;
    Result Should be:
    7934
    7934

    I have a requirement to show the picked value as the column header using SQL query.In sql*plus you can do
    SQL> set verify on
    SQL> def e =  7934
    old: SELECT empno "&&e"  FROM emp  WHERE empno = &&e
    new: SELECT empno "7934"  FROM emp  WHERE empno = 7934
    SQL> SELECT empno "7934"  FROM emp  WHERE empno = 7934
          7934
          7934
    1 row selected.

  • SQL Query - The number of columns specified in "SQL Query" does not match t

    I am creating new UDM for tablespace alert, below is my query,however its failing with error
    SQL Query - The number of columns specified in "SQL Query" does not match the value specified in "SQL Query Output"
    I selected Metric type is number
    SQL Query Format : Two columns
    Query:
    SELECT d.tablespace_name,round(((a.bytes - NVL(f.bytes,0))*100/a.maxbytes),2)
    used_pct FROM sys.dba_tablespaces d,(select tablespace_name, sum(bytes) bytes, sum(greatest(maxbytes,bytes)) maxbytes from sys.dba_data_files group by tablespace_name) a,(select tablespace_name, sum(bytes) bytes from sys.dba_free_space group by tablespace_name) f
    WHERE d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = f.tablespace_name(+)
    AND NOT (d.extent_management = 'LOCAL' AND d.contents = 'TEMPORARY');
    Any clues why i am getting error.

    SQL> SELECT d.tablespace_name,round(((a.bytes - NVL(f.bytes,0))*100/a.maxbytes),2) used_pct
    2 FROM sys.dba_tablespaces d,(select tablespace_name, sum(bytes) bytes, sum(greatest(maxbytes,bytes)) maxbytes from sys.dba_data_files group by tablespace_name) a,(select tablespace_name, sum(bytes) bytes from sys.dba_free_space group by tablespace_name) f
    3 WHERE d.tablespace_name = a.tablespace_name(+) AND d.tablespace_name = f.tablespace_name(+)
    4 AND NOT (d.extent_management = 'LOCAL' AND d.contents = 'TEMPORARY');
    TABLESPACE_NAME USED_PCT
    MGMT_TABLESPACE .82
    SYSAUX 1.52
    UNDOTBS1 .32
    RMAN .02
    CORRUPT_TS 10.63
    USERS 0
    SYSTEM 2.26
    MGMT_ECM_DEPOT_TS .04
    MGMT_AD4J_TS 0

  • Returning operation, table and column from a sql query

    Hi,
    I am working on Oracle 10g and i have to do achieve something like this.
    i have to create procedure or functions which will accept a SQL query and will return following :
    1).  Operation like 'SELECT', 'INSERT', 'UPDATE', 'DELETE' etc.
    2).  Column names
    3).  Table involved.
    One way to achieve this would be through hard parsing of string which might be time consuming. So do we have any in-built oracle package or function for the same job ?
    Regards,
    Vikas Kumar

    Check for DBMS_SQL package and DESCRIBE_COLUMNS procedure in that package.
    You might need a combination of this package and Hard parsing of the input string.
    For operation you can trim any space and brackets using TRIM function and then you can extrcat first 6 characters using SUBSTR for Operation.
    I have not worked or used DBMS_SQL so wont be able to help you much on this.
    Here is the link for DBMS_SQL
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sql.htm#i1026120
    Regards
    Arun

  • Chart not getting columns from the SQL Query with InlineTransform(xsl)

    Hi All,
    I am using MII 12.0 . I tried to use the mii standard xsl for converting rows into columns by  Inline Transform in a SQL Query.
    while executing the Query it is giving me the correct output but i tried to load the same Query in a IChart there it is not showing me the available columns that i can able to see in simple executiion and chart is also not plotting it keeps on loading.
    Thanks in Advance.

    Hi LinoVaz,
    Some things to try for testing purposes -
    1. Don't do any Data Mapping of the query columns
    2. If a SQL Query, you may need to change the Server Scaling to use Global AutoScale.
    I found that when I mapped the inline-transformed query into a bar chart display template, and hit the Refresh button, only the first column name show in the Column Names area.  If I mapped it, I got only that column.  If I didn't map any columns, I got them all.
    Let me know if you find similar results.  I think this is likely a bug, so you may consider using a Business Logic Transaction and an XacuteQuery to accomplish the same result.
    Kind Regards,
    Diana Hoppe
    Edited by: Diana Hoppe on Mar 25, 2011 11:46 AM

  • How do you select a clob column in an SQL query report?

    I must be missing something fundamental as there is practically no help on this on the forum.
    All I want to do is ...
    select numcol,aclob_col from table
    in an SQL Query report.
    Sounds easy??? I get no data appearing in the clob column. Doesn't work in SQL Workshop either. What's the catch??
    regards
    Paul P

    Paul,
    It works when I try it. What version of Application Express, what is the table DDL, the exact query, and how much data is in the clob columns?
    Scott

  • Change column order updateable sql query report APEX 4

    Hi all,
    I have a master detail page. Detail is SQL Query (updateable report)
    I want to change the column order but seems not possiible anymore in A4.
    In A3... on the right side of the report attributes it was possible to move columns up or down.
    path is Home>>Application Builder>>Application nnn >>Page xx >>Report Attributes
    It seems that A4 the move up or down functionality is hidden or the region is to small with no horizontal scrollbar.
    Is there a work_aorund?
    This is also the case when the pages are displayed in icon view when showing all pages using.
    Home >> Application Builder >>Application
    Most right icons are hidden after the about and task regions.
    The work-around here is to display the pages in report or detail view
    Maybe a fix needed for APEX4?
    have nice weekend!
    Hugo Perfors
    Enthousiastic APEX developer

    Hi,
    It could be your browser settings. Try zooiming out in the browser View - Zoom - Zoom Out.
    Regards

  • Can you reference package variables in a pl/sql object type

    I'm trying to create an object type and I would like to use a type from a pacakge definition as one of the parameters for a method in the object. I read that types defined inside a PL/SQL package cannot be used as parameter. Does anyone have a workaround for this?

    You could move the type definition out from the package to a schema level object type. Then you should be able to use the schema level object type in both your package and the new object you wish to create.
    Below is a short example of what I mean:
    -- The way I interpreted your question
    CREATE OR REPLACE PACKAGE foo_pkg
    AS
    TYPE foo_obj IS RECORD (
    f1 NUMBER
    ,f2 VARCHAR2 (10)
    in_pkg_foo_obj foo_obj;
    END foo_pkg;
    SHOW errors
    CREATE OR REPLACE TYPE newFooObj IS OBJECT (
    f1 NUMBER
    ,f2 VARCHAR2 (3)
    ,f3 DATE
    ,MEMBER FUNCTION getAllFoos (inFoo IN foo_pkg.foo_obj)
    RETURN NUMBER
    SHOW errors
    CREATE OR REPLACE TYPE BODY newFooObj
    AS
    MEMBER FUNCTION getAllFoos (inFoo IN foo_pkg.foo_obj)
    RETURN NUMBER
    IS
    BEGIN
    RETURN 1;
    END;
    END;
    SHOW errors
    -- Clean up
    DROP PACKAGE foo_pkg;
    DROP TYPE newFooObj;
    -- Now try it with a schema level object type
    CREATE OR REPLACE TYPE foo_obj IS OBJECT (
    f1 NUMBER
    ,f2 VARCHAR2 (10)
    CREATE OR REPLACE PACKAGE foo_pkg
    AS
    in_pkg_foo_obj foo_obj;
    END foo_pkg;
    SHOW errors
    CREATE OR REPLACE TYPE newFooObj IS OBJECT (
    f1 NUMBER
    ,f2 VARCHAR2 (3)
    ,f3 DATE
    ,MEMBER FUNCTION getAllFoos (inFoo IN foo_obj)
    RETURN NUMBER
    SHOW errors
    CREATE OR REPLACE TYPE BODY newFooObj
    AS
    MEMBER FUNCTION getAllFoos (inFoo IN foo_obj)
    RETURN NUMBER
    IS
    BEGIN
    RETURN 1;
    END;
    END;
    SHOW errors
    DROP PACKAGE foo_pkg;
    DROP TYPE newFooObj;
    Bob

  • Can you generate a Schem Collection from an SQL Query

    Is there an Option that allows you to generate and XML Schema Collection in a Select Statement that will be loaded either to a table or an application.
    An example
    SELECT Column1, Column2, Column3
    FROM table
    FOR XML PATH('');
    An easy way to generate a template or a start without having to type from scratch?
    Antonio

    Hi Antonio,
    The FOR XML clause
    can generate the XML schema, you can reference the optional XMLSCHEMA.
    XMLSCHEMA [ ('TargetNameSpaceURI') ] 
    Returns inline XSD schema. You can optionally specify a target namespace URI when you specify this directive, which returns the specified namespace in the schema. For more information, see
    Generate an Inline XSD Schema.
    If you have any question, feel free to let me know.
    Best regards,
    Eric Zhang
    TechNet Community Support

  • Column order in SQL Query (PL/SQL function returning a query)

    Hi,
    when I define a PL/SQL function returning a query inside a region, I often find that the column order is arbitrarily changed.
    How do I enforce the column order ?
    Bye,
    Flavio

    I removed the 11th column called service_name from this dynamic query: and now the report says: report error:
    ORA-01403: no data found. I messed around with the Headiuns Type. It was set to Custom. I changed it to Column Names. There is no difference.
    I am not sure how to fix?
    declare topqry varchar2(32000);
    whereqry varchar2(32000);
    finalqry varchar2(32000);
    var_status varchar2(100);
    division_status varchar2(50);
    office_status varchar2(1000);
    user_status varchar2(1000);
    overdue_status varchar2(1000);
    begin
    if :P10_FALLBACK = 'All' then
    var_status:= ' and vp.status in (''FA'',''FBA'',''FBI'',''25%'',''50%'',''90%'',''Closed'') ';
    elsif :P10_FALLBACK = 'Active' then
    var_status:= ' and vp.status in (''FA'',''25%'',''50%'',''90%'',''FBA'') ';
    elsif :P10_FALLBACK = 'FB' then
    var_status:= ' and vp.status in (''FBA'',''FBI'') ';
    elsif :P10_FALLBACK = 'Closed' then
    var_status:= ' and vp.status in (''Closed'') ';
    elsif :P10_FALLBACK = 'Inactive' then
    var_status:= ' and vp.status in (''FBI'') ';
    end if;
    if :P10_DIVISION = 'All' then
    division_status:= ' and vp.vms_division in (''News'',''Ad Services'') ';
    elsif :P10_DIVISION = 'News' then
    division_status:= ' and vp.vms_division in (''News'') ';
    elsif :P10_DIVISION = 'Ad' then
    division_status:= ' and vp.vms_division in (''Ad Services'') ';
    end if;
    if :P10_OFFICE = '%' then
    office_status:= ' and OFFICE_ID in (select office
    from VMS_OFFICE_ACCESS
    where user_id = lower(:P0_user) ) ';
    else
    office_status:= ' and OFFICE_ID in :P10_OFFICE ';
    end if;
    if :P10_LIMIT_USER = '%' then
    user_status := ' and SALESPERSON in (select first_name || '' '' || last_name
    from VMS_PROSPECT_users u
    join vms_office_access o
    on u.office_id = OFFICE
    where o.user_id = lower(:P0_USER) ) ';
    else
    user_status:= ' and SALESPERSON in (:P10_LIMIT_USER ) ';
    end if;
    if :P10_SHOW_OVERDUE = 'Show' then
    overdue_status:= ' and target_close_date <= sysdate ';
    var_status:= ' and vp.status in (''25%'',''50%'',''90%'',''FBA'') ';
    else
    overdue_status:= ' and FIRST_APPOINTMENT between
    nvl(to_date(:P10_FIRST_APPT_START, ''mm/dd/yyyy''),FIRST_APPOINTMENT) and
    nvl(to_date(:P10_FIRST_APPT_END,''mm/dd/yyyy''),FIRST_APPOINTMENT) ';
    end if;
    topqry := 'SELECT OFFICE_ID ,vp.PROSPECT_ID ,ENTRY_DATE ,ACCOUNT , NEXT_CONTACT_DATE ,ACTION_STEP ,
    TARGET_CLOSE_DATE ,vp.STATUS ,SALESPERSON ,vp.SALES_TYPE ,service_name , FIRST_APPOINTMENT ,MODIFY_DATE ,EST_ANNUAL_REVENUE ,EST_INCREMENTAL_REVENUE ,
    pi.NOTES , pi.SALES_TYPE ,pi.STATUS ,Contact ,Origin_Source FROM VMS_PROSPECTING_ITEMS pi right outer join VMS_PROSPECTS vp on vp.PROSPECT_ID = pi.PROSPECT_ID left outer join VMS_SERVICES vs on vs.service_ID = pi.service_ID where 1 = 1 ';
    whereqry := ' and (not exists (select *
    from VMS_PROSPECTING_ITEMS i3
    where vp.prospect_id = i3.prospect_id)
    or exists (select *
    from VMS_PROSPECTING_ITEMS i2
    where i2.order_id = pi.order_id
    and active = ''Y'' )) and instr(upper(ACCOUNT),upper(nvl(:P10_ACCOUNT,ACCOUNT))) > 0 ';
    whereqry := whereqry || var_status || division_status || office_status || user_status || overdue_status;
    finalqry := topqry || whereqry;
    return finalqry ;
    end;

  • Summary Column inside the Cross Product

    Hai All,
    I have developed a matrix report in the RDF format. There is a summary column inside the cross product. When I create the generate XML from the RDF the summary column from cross product is not apppering in the generate XML file. How can we accomplish that summary column inside the RDF.
    Thanks in Advance

    http://winrichman.blogspot.com/search/label/BIP%20Vertical%20sum
    http://winrichman.blogspot.com/search/label/Cross-tab
    these links should help , you , if not, send me the xml and template and desired output.

  • Can't select char type columns using ODBC link to SQL Server 2K

    I have set up a db link using hsodbc from 8.1.7 to SQL Server 2000. I can select numeric and date columns from the
    SQL Server table with no problem. But any character datatype (nchar or nvchar) column name included in the query
    returns an ORA-00904 ("invalid column name"). I know the column names are valid for SQL Server and can access
    these columns via EXCEL using the same user id and data source that is used for the link. I don't have a clue as to why ORACLE can't "see" the character type columns. Following is the hs trace file (HS_FDS_TRACE_LEVEL = debug) generated for "select assay_name from bio_assay@sqlsrvl":
    FRIDAY SEP 05 2003 10:39:47.674
    (0) hoagprd(2); Entered.
    (0) [Generic Connectivity Using ODBC] version: 2.0.4.0.0010
    (0) connect string is:
    (0) YEAR2000_POLICY=-1;CTL_DEBUG=T;CONSUMER_API=1;SESSION_BEHAVIOR_FLAGS=4;PARSER_-
    (0) DEPTH=2000;EXEC_FLAGS =
    (0) 131080;defTdpName=SQLSRVL;binding=(SQLSRVL,ODBC,"LIBERTY");
    (0) ORACLE GENERIC GATEWAY Log File Started at 05-Sep-03 10:39:47
    (0) Class version: 65
    (0) hoagprd(2); Exited with retcode = 0.
    (0) hoainit(3); Entered.
    (0) hoainit(3); Exited with retcode = 0.
    (0) hoalgon(7); Entered. name = XXXXXXXXXXX.
    (0) Created new ODBC connection (28382608)
    (0) Silent DB Function!!
    (0) (Last message occurred 4 times)
    (0) hoalgon(7); Exited with retcode = 0.
    (0) hoaulcp(4); Entered.
    (0) hoaulcp(4); Exited with retcode = 0.
    (0) hoauldt(5); Entered.
    (0) hoauldt(5); Exited with retcode = 0.
    (0) hoabegn(9); Entered. formatID = 306206, hoagttid
    (0) =XXXXXXXXXXXXXXXXXXXXXXXX, hoagtbid = , tflag = 0, initial = 1
    (0) hoabegn(9); Exited with retcode = 0.
    (0) hoapars(15); Entered. stmtType = 0, id = 1.
    (0) nvOUT (P:\Src\QP\QP_SQTXT.C 55): SELECT * FROM "BIO_ASSAY"
    (0) odbc_rec: select * from "BIO_ASSAY"
    (0) Silent DB Function!!
    (0) nvOUT (P:\Src\QP\QPT2SEXE.C 929):
    (0) SELECT "T0000"."WH_ADDED_DATE" AS c00010, "T0000"."ASSAY_MODIFIED_TIME" AS c0009, "T0000"."ASSAY_CREATED_TIME" AS c0008, "T0000"."ASSAY_DATE_COMPLETED" AS c0007, "T0000"."ASSAY_DATE_PLANNED" AS c0006, "T0000"."ASSAY_DATE_STARTED" AS c0005, "T0000"."ASSAY_STATUS_NO" AS c0004, "T0000"."TIMEFRAME_KEY" AS c0003, "T0000"."TARGET_KEY" AS c0002, "T0000"."ENVIRONMENT_KEY" AS c0001, "T0000"."ASSAY_KEY" AS c0000 FROM "BIO_ASSAY" T0000
    (0) nvOUT (P:\Src\QP\QPT2SEXE.C 932):
    (0) <<<<<<<<<<<<<<<<<<< Execution Strategy Begin <<<<<<<<<<<<<<<<<<<<<<<<<<<<
    (0) Original SQL:
    (0) SELECT * FROM "BIO_ASSAY"
    (0)
    (0)
    (0) Accessing Database "SQLSRVL" with SQL:
    (0) SELECT "T0000"."WH_ADDED_DATE" AS c00010, "T0000"."ASSAY_MODIFIED_TIME" AS c0009, "T0000"."ASSAY_CREATED_TIME" AS c0008, "T0000"."ASSAY_DATE_COMPLETED" AS c0007, "T0000"."ASSAY_DATE_PLANNED" AS c0006, "T0000"."ASSAY_DATE_STARTED" AS c0005, "T0000"."ASSAY_STATUS_NO" AS c0004, "T0000"."TIMEFRAME_KEY" AS c0003, "T0000"."TARGET_KEY" AS c0002, "T0000"."ENVIRONMENT_KEY" AS c0001, "T0000"."ASSAY_KEY" AS c0000 FROM "BIO_ASSAY" T0000
    (0)
    (0)
    Execution Strategy End >>>>>>>>>>>>>>>>>>>>>>>>>>>>(0) hoapars(15); Exited with retcode = 0.
    (0) hoaopen(19); Entered. id = 1.
    (0) hoaopen(19); Exited with retcode = 0.
    (0) hoadscr(16); Entered. id = 1.
    (0) hoastmt(195); Array fetch size is: 1.
    (0) ------ hoadscr() -------:
    (0) hoadamsz: 11, hoadasiz: 11, hoadambr: 1, hoadabrc: 1
    (0) row 0 - hoadambl: 20, hoadadty: 134, hoadaprc: 19, hoadacst: 0
    (0) row 0 - hoadascl: 0, hoadanul: 0, hoadanml: 9, hoadanam: ASSAY_KEY, hoadabfl:
    (0) 20, hoadamod: 0
    (0) row 1 - hoadambl: 20, hoadadty: 134, hoadaprc: 19, hoadacst: 0
    (0) row 1 - hoadascl: 0, hoadanul: 0, hoadanml: 15, hoadanam: ENVIRONMENT_KEY,
    (0) hoadabfl: 20, hoadamod: 0
    (0) row 2 - hoadambl: 20, hoadadty: 134, hoadaprc: 19, hoadacst: 0
    (0) row 2 - hoadascl: 0, hoadanul: 1, hoadanml: 10, hoadanam: TARGET_KEY,
    (0) hoadabfl: 20, hoadamod: 0
    (0) row 3 - hoadambl: 20, hoadadty: 134, hoadaprc: 19, hoadacst: 0
    (0) row 3 - hoadascl: 0, hoadanul: 0, hoadanml: 13, hoadanam: TIMEFRAME_KEY,
    (0) hoadabfl: 20, hoadamod: 0
    (0) row 4 - hoadambl: 2, hoadadty: 7, hoadaprc: 5, hoadacst: 0
    (0) row 4 - hoadascl: 0, hoadanul: 1, hoadanml: 15, hoadanam: ASSAY_STATUS_NO,
    (0) hoadabfl: 2, hoadamod: 0
    (0) row 5 - hoadambl: 7, hoadadty: 167, hoadaprc: 0, hoadacst: 0
    (0) row 5 - hoadascl: 0, hoadanul: 1, hoadanml: 18, hoadanam: ASSAY_DATE_STARTED,
    (0) hoadabfl: 7, hoadamod: 0
    (0) row 6 - hoadambl: 7, hoadadty: 167, hoadaprc: 0, hoadacst: 0
    (0) row 6 - hoadascl: 0, hoadanul: 1, hoadanml: 18, hoadanam: ASSAY_DATE_PLANNED,
    (0) hoadabfl: 7, hoadamod: 0
    (0) row 7 - hoadambl: 7, hoadadty: 167, hoadaprc: 0, hoadacst: 0
    (0) row 7 - hoadascl: 0, hoadanul: 1, hoadanml: 20, hoadanam:
    (0) ASSAY_DATE_COMPLETED, hoadabfl: 7, hoadamod: 0
    (0) row 8 - hoadambl: 7, hoadadty: 167, hoadaprc: 0, hoadacst: 0
    (0) row 8 - hoadascl: 0, hoadanul: 0, hoadanml: 18, hoadanam: ASSAY_CREATED_TIME,
    (0) hoadabfl: 7, hoadamod: 0
    (0) row 9 - hoadambl: 7, hoadadty: 167, hoadaprc: 0, hoadacst: 0
    (0) row 9 - hoadascl: 0, hoadanul: 1, hoadanml: 19, hoadanam: ASSAY_MODIFIED_TIME,
    (0) hoadabfl: 7, hoadamod: 0
    (0) row 10 - hoadambl: 0, hoadadty: 0, hoadaprc: 0, hoadacst: 0
    (0) row 10 - hoadascl: 0, hoadanul: 0, hoadanml: 13, hoadanam: WH_ADDED_DATE,
    (0) hoadabfl: 0, hoadamod: 0
    (0) hoadscr(16); Exited with retcode = 0.
    Note, the query I entered doesn't appear and I never entered the query "select * from bio_assay" - it appears that this is
    automatically generated by the hsodbc process and raises other questions (like wouldn't this return a lot of unneeded
    data ?). It also appears that the "select * from bio_assay" gets translated somehow into a select statement listing each column - however, non of the columns listed are character type columns like assay_name.
    Does this make sense to anyone? Any ideas ? HELP !

    Remote view gives the same error. I think the problem has to do with nchar and nvchar fields. It seems that the hsodbc agent issues a "select * from bio_assay" at the beginning of the session (see above trace).
    0) odbc_rec: select * from "BIO_ASSAY"
    (0) Silent DB Function!!
    (0) nvOUT (P:\Src\QP\QPT2SEXE.C 929):
    (0) SELECT "T0000"."WH_ADDED_DATE" AS c00010, "T0000"."ASSAY_MODIFIED_TIME" AS c0009, "T0000"."ASSAY_CREATED_TIME" AS c0008, "T0000"."ASSAY_DATE_COMPLETED" AS c0007, "T0000"."ASSAY_DATE_PLANNED" AS c0006, "T0000"."ASSAY_DATE_STARTED" AS c0005, "T0000"."ASSAY_STATUS_NO" AS c0004, "T0000"."TIMEFRAME_KEY" AS c0003, "T0000"."TARGET_KEY" AS c0002, "T0000"."ENVIRONMENT_KEY" AS c0001, "T0000"."ASSAY_KEY" AS c0000 FROM "BIO_ASSAY" T0000
    Apparently, the list of fields that is returned from the "select *" does not include any of the nchar or nvchar type columns. After this initial "select *" the oracle server only looks at the initial list of columns and gives an "invalid column" error for any fields that are not in this initial list. So the question is: how do I make the hsodbc agent see the nchar/nvchar type fields and include them in the initial list ? I've tried setting the HS_NLS_LANGUAGE and HS_NLS_NCHAR parameters but these seem to have no effect.
    Any clue as to what's going on ?

  • Can we generate the output of SQL Query in XML format ..

    Hi Team,
    Can we generate an XML doc for an SQL Query.
    I've seen in SQL Server 2000.It is generating the output of an SQL Query in xml format.
    select * from emp for xml auto
    The output looks like
    <emp EMPNO="7369" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="20"/><emp EMPNO="7370" ENAME="SMITH" JOB="CLERK" MGR="7902" HIREDATE="1980-12-17T00:00:00" SAL="2800" DEPTNO="10"/>

    Just a little bit of short hand.
    Get the XML out of your database, via HTTP
    Of course the easiest method is just to return an XMLType from a stored procedure and let the calling routine figure out what to do with it. Instead
    of that way though, I'll show you how to do it via HTTP. It's all completely built into 10g and is super easy to use.
    CREATE OR REPLACE VIEW emps_and_depts AS
    SELECT e.employee_id AS "EmployeeId",
    e.last_name AS "Name",
    e.job_id AS "Job",
    e.manager_id AS "Manager",
    e.hire_date AS "HireDate",
    e.salary AS "Salary",
    e.commission_pct AS "Commission",
    XMLFOREST (
    d.department_id AS "DeptNo",
    d.department_name AS "DeptName",
    d.location_id AS "Location"
    ) AS "Dept"
    FROM employees e, departments d
    WHERE e.department_id = d.department_id
    Some people hear web and immediately start salivating about security issues. Let me address that quickly. Just because you have the HTTP and/or
    FTP servers running in the database, that does not mean you have a security problem. For one, I would hope your databases are behind a firewall.
    Second, with the correct architecture (DMZ, app servers, etc) you can make this data available outside the firewall fairly transparently and third,
    just because it's on the web does not mean the data MUST be available on the internet. This is a good way to make your data available on your
    intranet. If you are worried about people INSIDE your firewall, that still doesn't preclude web based access. Follow Oracle security guidelines.
    Before I show you how to get to your data, let's talk about URLs and URIs. A URL is a Uniform Resource Locater and URI is a Uniform Resource
    Identifier. A URL is the way you would identify a document on the net, i.e. http://www.oracle.com is a URL. A URI is a more generic form of a URL.
    Oracle supports three types of URI: HTTPURIType - basically a URL (which would be like the URL above), XDURIType - a pointer to an XDB resource
    (usually an XML document but can be other objects), and DBURIType - a pointer to database objects.
    It's the DBURIType that we're going to concentrate on here. The DBURIType let's us reference database objects using a file/folder paradigm. The
    format for a DBURI is /oradb/<schema>/<table>. Oradb is shorthand for the database; it is not the database name or SID. My database is named XE
    but I still use oradb in the DBURI. For example, the view we created above is in my XE database, is owned by HR (at least in my case) and is called
    EMPS_AND_DEPTS. This can be referenced as /oradb/HR/EMPS_AND_DEPTS.
    If the view had many rows and you wanted only one of them, you can restrict it by including a predicate. The documentation for XDB has a great
    write up on Using DBURIs.In our case, we are going to write out the entire document. Now that you understand that the DBURI is a pointer to
    objects in our instance, we can use that to access the data as a URL.
    The format for the URL call is http://<machinename>:<port>/<DBURI>
    In my case, my XE database is running on a machine called mach1 and is listening on port 8080. So to see the view we created above, I open my
    browser and navigate to: http//mach1:8080/oradb/HR/EMPS_AND_DEPTS
    The created URL will be as http//mach1:8080/oradb/PUBLIC/EMPS_AND_DEPTS
    If your database is set up correctly and listening on port 8080 (the default), your browser should ask you to login. Login as the user who created the
    view (in my case HR). You should now get an XML document displayed in your browser.
    And that's it. It doesn't get much simpler than that. If you get rid of the descriptive text above, it basically comes down to:
    Create a table or view
    Open your web browser
    Enter a URL
    Enter a user ID and password
    View your XML
    If you notice, Oracle formatted the data as XML for us. Our view returns scalar columns and an XML fragment called Dept. Oracle formatted the
    return results into an XML format.
    And as a side note, if you look closely, you'll see that my URL has PUBLIC where I said to put HR. PUBLIC is a synonym for all objects that your
    logged in user can see. That way, if your user has been granted select access on many schemas, you can use PUBLIC and see any of them.

  • Referencing columns of a subselect query?

    Hello,
    I have the next query
    select columnA1, columnA2
    from tableA
    where columnA1in (select columnB1 from tableB);
    TableB has a column (i.e. columnB2) that it has appear in the results of the select. How can I reference to this column in the query.
    I would want to do something like that:
    select columnA1, columnA2, columnB2
    from tableA
    where columnA1in (select columnB1 from tableB);
    but, it doesn't work.
    Thanks.

    This is the query:
    SELECT t.agg_id,
    b.sec_id, op.portfolio_id, b.leg_id, bv.session_id,
    t.result_id,
    -1, -1, -1, b.sec_cod, b.counterparty_id, b.product_id,
    op.operation_id, bv.flag_guarantee
    FROM t0par_rkv_security b,
    t0par_rkv_positions c,
    t0par_rkv_operations op,
    t0par_rkv_base_valuation bv,
    t0par_tmp_counterparty_struct t
    WHERE bv.session_id = 625
    AND bv.sec_id = b.sec_id
    AND bv.operation_id = op.operation_id
    AND op.operation_id = c.operation_id
    AND b.flag_validate = 1
    AND b.sec_id = c.sec_id
    AND c.POSITION <> 0
    AND op.position_lst_id = 224
    and b.counterparty_id=t.counterparty_id_hijo
    and t.result_id=976
    And this is the explain plan:
    select statement hint=choose
    nested loops
    nested loops
    nested loops
    nested loops
    table access by index rowid t0par_tmp_counterparty_struct
    index range scan idx_counterp_struc_result
    table access by index rowid t0par_rkv_base_valuation
    index range scan i1par_rkv_base_valuation1
    table access by index rowid t0par_rkv_operations
    index uique scan pkpar_rkv_operations
    table access by index rowid t0par_rkv_security
    index uique scan pkpar_rkv_security
    table access by index rowid t0par_rkv_positions
    and-equal
    index range scan xak1t0par_rkv_positions
    index range scan     iepar_rkv_positions_sec
    I think the tables are being consulted with the indexes. I don't know how optimize the query

Maybe you are looking for

  • Nothing will download off the creative cloud app (Photoshop, Illustrator, etc...)

    Hey. I'm trying to download Photoshop and Illustrator from the creative cloud app. I can't seem  to get either of them to download after purchasing the monthly student package. Photoshop seems to download fine until it stops at either 42/51/52% and w

  • IPhone and iPhoto '09

    Whenever my wife or I connect our iPhone 3G S' to either of MacBooks, iPhoto '09 automatically opens up showing our iPhones in the Device bar on the side asking if we want to import any photos we may have. Is there a way to turn this feature off? Tha

  • Is there any process flow diagram for TFS 2013 ?

    Hello, I require to know the reference link of lfow chart to manage work in TFS that indicates following details : Define sprints and backlog items Creating tasks and complete them. I want to know whats the flow chart that indicates the states of upd

  • Why am I unable to import CR2 files into Lightroom ?

    When I try to import a CR2 file I receive a response that the files are not recognized by the raw format support in Lightroom. I have downloaded the latest version. I'm using a Canon 7D Mark II

  • PLD - Marketing Documents with multi-language

    Hi all, I was making layouts in PLD what i want is to show all the texts in english or in a foreign language and base on the BP's language. So not the item description.. Is this possible? Thanks in advance, Chief Edited by: Rui Pereira on Jan 27, 200