Setting of the names of columns in the query in PivotChart

Hi all

I have columns for the wrong parameter names in a PivotChart query and I was wondering if someone could help me please understand me what I need to do.

Help me help you, I have set up an example scenario in my hosted account. Here's the info to connect to my site hosted at [http://apex.oracle.com]
Workspace: MYHOSTACCT
Username : DEVUSER1
Password : MYDEVACCT
And here's my test request info:
ID     : 42804
Name   : dynamic query test
Page   : 1
Table 1: PROJECT_LIST         (Alias = PL...  Listing of Projects)
Table 2: FISCAL_YEAR          (Alias = FY...  Lookup table for Fiscal Years)
Table 3: PROJECT_FY           (Alias = PF...  Intersection table containing project fiscal years)
Table 4: PROJECT_FY_HEADCOUNT (Alias = PFH... Intersection table containing headcount per project and fiscal year)
Please forgive the excessive for this example standardization, as I wanted to keep the table structure similar to my actual application, that has a lot more going on.

In my example, I have in the region to "Select the criteria", where the user specifies the project and the range of exercise that he or she would like to report. Click on the search button, and the report refers staff of revolving project for the range of the financial year.

I've got it works using a query hardcoded, which is displayed in the region of the "hard-coded query." In this query, I have basically come back every year and to lay down the conditions on each column that determines if this column should be displayed or not according to the selected user. While this works, it is not ideal, because there could be several years more to take into account, and is not very dynamic. Any time an exercise is added to the table of FISCAL_YEAR, I update this page.

So, after reading all the forums pivot OTN SQL and thread pivot "ask Tom", I was able to create a second region labeled "Dynamic motion" in which I created a dynamic query to return the same results. It of a much more intuitive solution and works very well; However, the column names are generic in the report.

I had to put the query to analyze at runtime, because the list of column selection is dynamic, which violates the rules of SQL. Can someone help me please how can I specify my column names in the area of dynamic query to get the values of column even I receive in the region of hardcoded to understand?

Please let me know if you need more information and thanks a lot in advance!

Mark

Take a look at your request now. I added a function in your workspace, change the headers to be pl/sql base, added an element hidden to contain the query you create and pass in the service to get your item headers...

Thank you

Tony Miller
Webster, TX

On the road of life... He has "windshield", and there are "bugs".
(splat!)
"Squeegees wanted."

If you answer this question, please mark the thread as closed and give points where won...

Tags: Database

Similar Questions

  • How does whitespace or null values or characters set effect set in the query?

    Hi all

    I have a question about client side Oracle database tools. I have Oracle 11g installed on the server and I use PL/SQL developer tool to retrieve information from the server and then I copy paste this query in PL SQL Developer my company built in box of function of the application that executes the same query as client tools and the results.

    When I write the request by spaces of the Tools client-side IE the PL/SQL developer tool and copy paste at my request of builtin company gives slow down me execution, but if I remove the white of the query space by copying the application of PL/SQL developer(client side tool) to Notepad first and then copy back at my request and gives me a faster execution.

    For example:

    Original Request: with whitespace

    Select

    *

    Of

    Double

    Ask without spaces faster tracks:

    Select * twice;

    I want to the reason behind this slow execution and also if you could explain in detail would be great that I am no expert oracle.

    Also, I wanted to know that character set parameters from the client side tools slow running query? As I copy the request of PL/SQL developer tool

    Thank you

    HP

    HP, I have has been suggest you determine if the difference in performance is due to how the application prepares and processes SQL or if the difference is in Oracle.  If you can duplicate the issue in Oracle using SQLPLus then you can use the Oracle tools such as autotrace, SQL, trace etc... to determine how Oracle handles each request.  On the other hand if the time of execution in SQLPLus is the same then you know that the problem lies in the application.  Depending on whether you have access to the source you can or will not be able to track down the issue and resolve it.  Otherwise always paste the capture into the plan text and edit it to remove the unnecessary lines before copying them the text into your application tool.

    - -

    HTH - Mark D Powell.

  • SQL query takes too long to run (1 h 25 min)... pls help how to set up the query.

    Hello

    Could someone please help how to tune the query as its takes a long time to retrieve the results.

    Select

    col1,

    col2,

    col3,

    COL4,

    col5,

    col6,

    col7,

    COL8,

    col9,

    col10,

    Col11,

    col12,

    Sum (volume1),

    Sum (volume2),

    Sum (volume3),

    Sum (volume4),

    Sum (volume5),

    Sum (volume6),

    Sum (volume7),

    Sum (volume8),

    Sum (volume9),

    Sum (volume10),

    Sum (volume11),

    Sum (volume12),

    Sum (volume13),

    Sum (volume14),

    Sum (volume15),

    Sum (volume16),

    Sum (volume17),

    Sum (Volume18),

    Sum (volume19),

    Sum (volume20),

    Sum (rate1),

    Sum (rate2),

    Sum (rate3),

    Sum (rate4),

    Sum (rate5),

    Sum (rate6),

    Sum (rate7),

    Sum (rate8),

    Sum (rate9),

    Sum (rate10),

    Sum (rate11),

    Sum (rate12),

    Sum (rate13),

    Sum (rate14),

    Sum (rate15),

    Sum (rate16),

    Sum (rate17),

    Sum (rate18)

    Sum (rate19),

    Sum (rate20)

    Of

    Table 1 - 13, 25, 99, 400 records

    Table2 - 13, 45, 1000 records

    Table 3 - 4, 50, 000 records

    Table 4 - 1,00,000 records

    table5 - 30 000 records

    where tabl1.col1 = table2.col2,

    Table1.Col1 = table3.col1.

    table2.col2 = table3.col2...

    Group

    Sum (volume1),

    Sum (volume2),

    Sum (volume3),

    Sum (volume4),

    Sum (volume5),

    Sum (volume6),

    Sum (volume7),

    Sum (volume8),

    Sum (volume9),

    Sum (volume10),

    Sum (volume11),

    Sum (volume12),

    Sum (volume13),

    Sum (volume14),

    Sum (volume15),

    Sum (volume16),

    Sum (volume17),

    Sum (Volume18),

    Sum (volume19),

    Sum (volume20),

    Sum (rate1),

    Sum (rate2),

    Sum (rate3),

    Sum (rate4),

    Sum (rate5),

    Sum (rate6),

    Sum (rate7),

    Sum (rate8),

    Sum (rate9),

    Sum (rate10),

    Sum (rate11),

    Sum (rate12),

    Sum (rate13),

    Sum (rate14),

    Sum (rate15),

    Sum (rate16),

    Sum (rate17),

    Sum (rate18)

    Sum (rate19),

    Sum (rate20)

    Thank you

    Prasad.

    > Could someone please help how to tune the query as its takes a long time to retrieve the results.

    The query you posted is obviously fake.

    If you ask to give us a request that you do not post and we cannot see.

    For real?

  • new to 4.02, no grid or column names in the query results

    It is a bit strange, I have SQL Developer 4.02 just installed, and I don't see grid or column names in the query results.  Don't see anything useful in tools > Preferences, what don't get me?

    The worksheet gives you a couple of different ways to run a query...

    1. instruction execute sheet icon toolbar (large green arrow, or Ctrl + Enter).

    This produces a results tab of the query with the data displayed in a grid.

    2. worksheet icon toolbar Execute the Script (the small tip of the green arrow on lined paper, or F5).

    This produces a tab out of the Script with the data displayed on the printer.

    If execution of the statement to Execute the Script, using some SQL * most orders will remove the column headers:

    1. set the position

    2. set the pagesize 0 (or 1 or 2).

    Pagesize and linesize default is - 1.  By default, the spreadsheet is free for formatting output script as he wishes.  If you have not changed these settings in the spreadsheet, then see if you point to a startup script in Tools > Preferences > Database > name of the connection startup script file

    Kind regards

    Gary

    SQL DeveloperTeam

  • How to dynamically change the names of columns LOV

    Hello

    I use JDeveloper 11.1.1.4

    I have only one requirement, while I need to change the names of columns in the list of values dynamically.

    How can I achieve it.

    Please help me.

    Kind regards

    John.

    Hello

    > But I want to change the column names 'ID' and 'Name' dynamically.

    Based on what? Condition? If Yes, have you tried to set the text for the label as an expression? If not based on the condition, you can also expose the VO to Java Impl and need a way to get the attribute and change its label.

    Arun-

  • Regular expression TO validate the name of column

    Hi all

    I want to write a regular expression to validate the name of column names.i.e enterted must follow the convention of valid column name
    contain only A - Z, a-z, 0-9, _, $, and #.

    Please someone help me to do this.
    Padma

    Hey padma.

    Regular expression TO validate the name of column

    to set jaspx for example in the Validation number:

    **

    If your use na na... chain mention you model as etc. from A to z...

    otherwise if the two method nt answer using java Scrpit na... it's better ground for you.

    If however hepatitis is any querys na msg me... If possible I try best,.

    Thnks,
    Suresh V

    Published by: V Suresh on April 2, 2012 16:55

  • How to remove the names of columns in SQL-report

    What I want is only data, without no column name.

    COLUMN LDATE
    SELECT SYSDATE LDATE
    FROM DUAL;

    LDATE
    --------
    07.11.11

    This example does not work. There are still LDATE above column. Any idea?

    It's all in the SQL * more manual...

    SQL> set heading off
    SQL> select * from emp;
    
          7369 SMITH      CLERK           7902 17-DEC-1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-1981 00:00:00       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-1981 00:00:00       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-1981 00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-1987 00:00:00       3000                    20
          7839 KING       PRESIDENT            17-NOV-1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-1981 00:00:00       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-1987 00:00:00       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-1981 00:00:00        950                    30
          7902 FORD       ANALYST         7566 03-DEC-1981 00:00:00       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-1982 00:00:00       1300                    10
    
    14 rows selected.
    
  • return the names of columns which line values are not null.

    Hi I m a new db admin guy, and I need a sql script that should return the names of columns of the given table. and the returned column must be the value (fyi - if the column contains the value null column name would not come to the o/p of sql).
    Exmple:
    name of the table - A
    fresh status s.no name brand
    1 null aa 45P
    paid 2 null bb 30
    3 cc paid 35P

    (FYI - 1) if I give the table name (A) and s. n. (2) o/p should be - name, mark.
    (2) if I give the status of tablename (A) and s. n (1) the o/p should be - name, brand.

    Thank you
    Krishna.

    Published by: user13294228 on June 14, 2010 22:54

    BTW,
    The previous solution is for all values of the column, if you want a specific line, you can add it in where clause.
    I mean in your example, it you look like:

    SET serveroutput on;
    
    DECLARE
       l_cnt          NUMBER;
       l_str          VARCHAR2 (255) := '';
       l_table_name   VARCHAR2 (255) := 'YOUR_TABLE_NAME';
       l_col_cond     VARCHAR2 (255) := 'S_NO';
       l_val          NUMBER         := 1;
    
       CURSOR c_col
       IS
          SELECT column_name
            FROM user_tab_columns
           WHERE table_name = l_table_name;
    BEGIN
       FOR i IN c_col
       LOOP
          EXECUTE IMMEDIATE    'SELECT COUNT ('
                            || i.column_name
                            || ') FROM '
                            || l_table_name
                            || ' WHERE '
                            || l_col_cond
                            || ' = '
                            || l_val
                       INTO l_cnt;
    
          l_str := l_str || CASE
                      WHEN l_cnt = 0
                         THEN ''
                      ELSE i.column_name
                   END || ',';
       END LOOP;
    
       l_str := SUBSTR (l_str, 1, LENGTH (l_str) - 1);
       DBMS_OUTPUT.put_line (l_str);
    END;
    

    Saad,

    Published by: S.Nayef on June 15, 2010 11:54

  • ALTER Table of the default Oracle and the length of name of column Type

    Hi all

    I want to increase the length of the table names and the names of the columns in Oracle.

    By default, it is set like this:

    SQL > dba_tab_columns desc;

    TABLE_NAME NOT NULL VARCHAR2 (30)
    COLUMN_NAME NOT NULL VARCHAR2 (30)
    ...

    Is it possible to change the VARCHAR2 (30) to VARCHAR2 (100)?

    Published by: sukrandere on 12:21 10.Mar.2010

    Table names and column are all two identifiers
    According to the documentation, the maximum length of an identifier is 30 characters.
    It is hard coded in the database software and you can't change it.
    Or do you need to change.

    ---------------
    Sybrand Bakker
    Senior Oracle DBA

  • A list of the names of columns in addition to the OMB

    I have to add several operators to approximately 120 maps and trying to learn more about OMB in the hope that it might be able to save time (and my Visual/mental health ;-) acuity. However, each map works on different tables, each with its own unique set of columns. This list of columns must be added to a GROUP OF property of an aggregator.

    Is there a way to get a list of the names of table columns in the OMB, so I can get this GROUP BY list? So far, I couldn't find one.

    I use 10.2.0.1

    Thank you

    Hello

    Set tab_cols [OMBRETRIEVE 'EMP' GET COLUMNS]

    or such a thing on a map...
    define the atts [OMBRETRIEVE '$mapName' OPERATOR '$lastOperator' GROUP 'OUTGRP1' GETTING ATTRIBUTES of MAP]
    foreach att $atts {}
    the value of EO [OMBRETRIEVE MAPPING '$mapName' OPERATOR '$lastOperator' GROUP 'OUTGRP1' ATTRIBUTE '$att' GET PROPERTY (EXPRESSION)]
    ...

    Could be interesting furtively to the SQL to map the Accelerator for the OMB snippets too.
    http://blogs.Oracle.com/warehousebuilder/2007/06/sql_and_owb_accelerated_map_co_1.html
    http://blogs.Oracle.com/warehousebuilder/2007/08/sql_and_owb_accelerated_map_co.html

    There is MDL on the second post in the main activity to start tasks, there is the OMB to be part of this.

    See you soon
    David

  • Anyway, to remove the column names in the result of the query of SQLPLUS

    Hello

    I am using sqlplus to run a script that returns results with the column names.

    Anyway is to omit the names of columns in the result of the sqlplus query?

    I would like to have only results with their column names in the output.

    Thanks in advance!

    Hello

    Maybe your LINES (IZE) is not defined?

    SCOTT>set lines 130
    SCOTT>select status, machine, module
      2    from v$session
      3   where upper(username) = 'SCOTT';
    
    STATUS   MACHINE                                                          MODULE
    -------- ---------------------------------------------------------------- ------------------------------------------------
    INACTIVE PFAE3\VPC4894-03                                                 TOAD 9.7.2.5
    ACTIVE   PFAE3\VPC4894-03                                                 SQL*Plus
    
    2 rows selected.
    
    SCOTT>
    

    As an alternative to the linesize parameter, you can format the columns:

    SCOTT>set lines 80
    SCOTT>col status for a8
    SCOTT>col machine for a30
    SCOTT>col module for a30
    SCOTT>select status, machine, module
      2    from v$session
      3   where upper(username) = 'SCOTT';
    
    STATUS   MACHINE                        MODULE
    -------- ------------------------------ ------------------------------
    INACTIVE PFAE3\VPC4894-03               TOAD 9.7.2.5
    ACTIVE   PFAE3\VPC4894-03               SQL*Plus
    
    2 rows selected.
    
    SCOTT>
    

    Concerning
    Peter

  • How to extract the names of columns in dynamic SQL

    Hi all

    Is it possible to extract all the names of columns in a dynamic query?

    In my case according to the user selections that my query will get changed (number of the column, column name and tables that everything can vary).

    So now, is it possible to retrieve all the column names of the dynamic query generated?

    I am using Oracle 11g (11.2.0.4)

    Thank you

    Shaz

    Re: Dynamic Extraction on dynamic Sql

  • How to write information to complete file including the names of columns in the ftp adapter using the Ombudsman?

    Hi all

    I have a requirement like the reading of the data from the DB table and put it in a location of ftp server using mediator.also file in the ftp location must be in .csv format.

    I am able to get the data from the file in .csv format.

    But here, my requirement is I want the data from the file with the names of columns (i.e. header information).

    Can someone help me in this problem.

    Thanks in advance,

    Divya.

    Hello

    I am able to get the information to complete file with column names.

    I added a code in the ftpadapter xsd file.

    nxsd:version = "NXSD".

    nxsd:stream = "chars".

    nxsd: encoding = "US-ASCII".

    nxsd:hasHeader = 'true '.

    nxsd:headerLines = "1".

    nxsd:headerLinesTerminatedBy = "${eol}.

    nxsd:outboundHeader = "empno, ename, sal, location, status ${eol} '"

    By adding the code above, I'm able to get the full file header information.

    Thank you

  • ORE: the names of columns not valid cost.matrix

    I'm trying to use the method odmDT with application costs customized as follows:

    > dt.mod = ore.odmDT (default ~.,credit_train,max.depth=20,cost.matrix=matrix(c(0,1,4,0),nrow=2)

    but I get the error:

    Error in ore.odmDT (default ~., credit_train, max.depth = 20, cost.matrix = error_cost):

    ORE: the names of columns not valid cost.matrix

    I can't find any documentation anywhere on how exactly this cost matrix must be specified.

    Any help would be appreciated

    The value for cost.matrix currently requires a data structure object. The following examples using the NARROW data successfully pass a frame of data for the value of cost.matrix:

    R > NARROW.costs.gender<- data.frame(actual_target_value="">

    PREDICTED_TARGET_VALUE = c("M","M","F","F"),

    COST = c (0.25, 0.75, 0.0, 0.0))

    R > NARROW.costs.class<- data.frame(actual_target_value="">

    PREDICTED_TARGET_VALUE = c (0,0,1,1),

    COST = c (0.25, 0.75, 0.0, 0.0))

    R > dt.mod1<- ore.odmdt(gender="" ~="" .,="" narrow,="" cost.matrix="">

    Summary (DT. MOD1)

    R > dt.mod2<- ore.odmdt(class="" ~="" .,="" narrow,="" cost.matrix="">

    Summary (DT. MOD2)

    I filed a bug so this behavior can be evaluated for a future release of Oracle Enterprise R.

  • The value of name of column

    Hi gurus

    I'm stuck on 1 Scenario and need your help. I have the following table:

    Create table

    drop table age_rate;

    CREATE TABLE age_rate
    (
    age_0_4 number 4,
    age_5_20 number 4,
    age_21_34 number 4,
    age_35_44 number 4
    );

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

    Insertion

    INSERT INTO age_rate

    SELECT 45, 50, 60, 90 double UNION ALL

    SELECT 45, 50, 60, 88 OF double UNION ALL

    SELECT the 40, 50, 60, 90 double UNION ALL

    SELECT 5, 50, 60 and 88 DOUBLE;

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

    Query on table

    SELECT * from age_rate;

    The query result

    age_0_4 age_5_20 age_21_34 age_35_44

    45                          50                     60                     90

    45                          50                     60                     88

    40                          50                     60                     90

    5                            50                     60                     88

    Power required

    Rate Min_age Max_age

    -The lower is age band 0_4

    45            0           4

    45            0           4

    40            0           4

    5              0           4

    -The lower is age band 5_20

    50            5           20

    50            5           20

    50            5           20

    50            5           20

    -The lower is age band 21_34

    60 21 34

    60 21 34

    60 21 34

    60 21 34

    -The lower is age band 35_44

    90 35 44

    88 35 44

    90 35 44

    88 35 44

    Rules

    -I have all the data in the rows each column online create separate lines and add 2 columns automatically Min_age and Max_age and insert the value on these columns based on the name of the column for example if the column name as age_0_4 then insert 0 in min_age and 4 in max_age means values for Min_age and Max_age extracted from the base of the column name. I don't know if it's possible or not, but I appreciate if someone can give me the solution for this problem... Do you like answers. Thank you


    Hello

    I'm not 100% sure what you want.  Do you want 16 production lines at a time, which is 4 lines of output for each line that is actually in the table?

    This looks like a job for the UNPIVOT operator:

    SELECTION rate

    min_age

    Case min_age

    WHEN 0 THEN 4

    WHEN 5 THEN 20

    WHEN 21 AND 34

    WHEN 35 THEN 44

    END AS max_age

    Of age_rate

    UNPIVOT (rate

    FOR min_age IN (age_0_4 0)

    age_5_20 AS 5

    age_21_34 AS 21

    age_35_44 AS 35

    )

    )

    ORDER BY min_age

    ;

Maybe you are looking for

  • Alt/option key disables the keyboard entries

    Hi- It seems that if I press the ALT (option) 5 times quickly, it disables my keyboard. It seems also occur that if I hold down the option for an extended period of time, often while I use Photoshop. It stops completely from all entries to the keyboa

  • recovery of the backup for ipad files

    How can I display files that have been backed up if I did more than 1 backup in the same day? Thank you

  • I have a Photosmart 6510, which will not print in black.

    My photosmart 6510 does not print in black, after that I installed all the new HP ink cartridges. I am running Windows Vista 32-bit. I tried all the basic tests & troubleshooting but who still have the problem. It allows to print from the photo tray

  • XP Professional

    Windows xp professional operating systems, Windows Security Center says "Virus Protection is OFF", M/S Security Essentials says its aid "WE and Uptodate" Please

  • data transfer from windows 7 to windows 10 laptop

    I need to transfer files from my old laptop to windows 7 windows again laptop 10. What is the best way to achieve this?