How to obtain IR report dynamic SQL in Apex 4.0
Hello,
I have 2 regions on the same page
Interactive Report –
Chart (Flash Chart) – This is a sub region of the above
Now the requirement is when user applies a filter to the interactive report I would like to apply the same filter criteria to the flash chart so that data representation in flash chart matches with the IR report content. I am fairly new to the Apex, apologies if used any apex terminology in correctly
Appreciate if you can point me in the right direction
Thank you
-Raj
Hello , I did some research how to achieve this , one way is to get the IR report dynamic sql using APEX_IR.GET_REPORT package and apply the same sql for the chart so that the chart representation will match with the IR report data, But the challenge is as i am using the APEX 4.0.0.00.46 version, the APEX_IR package is not available in that version , Any other way we can achieve this in Apex 4.0??
Thanks
-raj
Similar Messages
-
How to obtain URL in PL/SQL
How do I obtain the URL of the page I'm sitting on within PL/SQL? I have a dynamic page with PL/SQL code and I need to obtain the URL how would I go about that?
Is this a PSP (PL/SQL Server Page)?
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
How to create interactive reports in SQL Server 2008 R2?
Dear,
I want to create a interactive dashboard in that there is 4 parts and on the selection of one values in one part, detailed value of other part of the report has been changed?
I've tried through Bookmark but this loads complete data in other part of the report. but i just want to load the information of selected record.
Please help to provide the solution for the same.
Thanks in advance.Hi Anurag,
I have an idea , for your scenario you can use subreport and pass parameter to that subrreport from first part to change the value based on the selection of value from first part.
Suppose in first part you are showing aggregate values department wise and in second part you want to show details of that department which selected by user from the first part so you can create a separate part to show details of department with parameter
department which will filter your report according to department and use this report in second part as sub report and for department parameter map it to the first part so if user will select on values of any department then that department name will be passed
in the parameter of sub report and your sub report will show details of that department.
so in first part go to textbox property and go to action tab and then pass parameter.
some examples to set parameter from main report into sub report:
https://www.katieandemil.com/ssrs-create-subreport-with-parameter-example-tutorial-ssrs-2008-r2?tab=article
http://blog.aditi.com/enterprise_social/how-to-pass-multi-value-parameters-to-sub-reports-in-ssrs/
Thanks!!
Live life with joy and happiness! Avanish -
How create tabular form using dynamic sql
I have 50 tables and I need create application for support all these tables, I don't want to create 50 tubular regions.
I want create list of tables; user pick one of them and I want generate dynamic tabular form for suppot.
Is it possible?
Thanks MaryHi Mary,
It is possible, but you would have to control everything manually. Have a look at: [http://apex.oracle.com/pls/otn/f?p=33642:252] - I've included instructions explaining how this has been created
Andy -
How to do store with dynamic sql to return a cursor
i need to do a store that returns a cursor, but the expression of the cursor are genereted dynamicly. how can i do that?
something like this:
sql_stmt := 'SELECT * FROM ' || INTABLE || ' WHERE '|| inWhereClause;
EXECUTE IMMEDIATE sql_stmt into C1;
where c1 is a ref cursor( OUT variable of procedure)
it is possible or not?
Pedro CardosoThe syntax is something like
sql_stmt := 'Select * from '|| InTable||' WHERE '|| InWhereClause ;
OPEN C1 for Sql_Stmt ; -
How to get rowcount on dynamic sql?
Gurus, experts, and just plain people who are smarter than me. I've googled and googled and I while there are examples of how to do this, there is some complication that doesn't apply to me!
I have a PLSQL function that depends upon knowing the number of rows returned in order to figure out what to set a variable to.
E.g.:
v_sql := 'select element_id from '||v_lsidt||'_base where element_id = '||chr(39)||v_osid||chr(39);
EXECUTE IMMEDIATE v_sql
IF SQL%ROWCOUNT > 0 THEN
ELSE
END IF
Unfortunately, it seems like the rowcount is always coming back as so the code doesn't pass through the IF block. Can someone explain to me what I'm doing wrong?
Thank you.
PS - I realize this may be a common question so I apologize in advance if the answer was in plain sight and I failed to recognize it lol.ErrolDC wrote:
Gurus, experts, and just plain people who are smarter than me. I've googled and googled and I while there are examples of how to do this, there is some complication that doesn't apply to me!
I have a PLSQL function that depends upon knowing the number of rows returned in order to figure out what to set a variable to.
E.g.:
v_sql := 'select element_id from '||v_lsidt||'_base where element_id = '||chr(39)||v_osid||chr(39);
EXECUTE IMMEDIATE v_sql
IF SQL%ROWCOUNT > 0 THEN
ELSE
END IF
Unfortunately, it seems like the rowcount is always coming back as so the code doesn't pass through the IF block. Can someone explain to me what I'm doing wrong?
Thank you.
PS - I realize this may be a common question so I apologize in advance if the answer was in plain sight and I failed to recognize it lol.when all else fails Read The Fine Manual
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/returninginto_clause.htm#CJAGFGDE -
If table testrh2 has the following columns and data
col1 --> NULL
col2 --> 2
and table testrh has the following columsn and data
col1 --> NULL
How could I write a dynamic SQL statement to join on the nulls? I've written the following block as a starting point.
declare
cursor c1 is select col1 from isis.testrh;
lval varchar2(1000);
lval2 varchar2(1000);
begin
for r1 in c1 loop
lval := 'select col2 from isis.testrh2 where col1 = '||r1.col1;
execute immediate lval into lval2;
dbms_output.put_line(lval2);
end loop;
end;You can't compare null values with '=' in Oracle SQL.
Null can only be compared with <column> is null .
You can see it when you try these two queries:
select * from dual where null is null; -- you will see one row
select * from dual where null=null; -- you will see no rowsThat's why you have to write something like
(<column1>=<column1> or (<column1> is null and <column2> is null))This should also work with null:
decode(<column1>,<column2>,1,0)=1By the way, why do you use dynamic sql?
lval := 'select col2 from isis.testrh2 where col1 = '||r1.col1;
I think you could replace your two lines ( lval:= ... AND execute immediate) by this:
begin
select col2
into lval
from isis.testrh2
where decode(col1,r1.col1,1,0)=1;
dbms_output.put_line('lval='||lval);
exception
when no_data_found then
dbms_output.put_line('no data found'); -- or whatever you want
end;Edited by: hartmutm on 02.10.2010 23:54 -
How to download the report data in xml format
Hi All,
how to download the report data (sql/interactive) in xml format...
Thanks,
VinothYou will want to do something like this:
http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
except customize it for xml.
hth,
John -
How to rename C00n generic column names in a Dynamic SQL report
I have a an interface whereby the user can select 1 to 60 (upper limit) columns out of 90 possible columns (using a shuttle) from one table before running a report.
To construct the SQL that will eventually execute, I'm using a "PLSQL function body returning SQL query" with dynamic SQL. The only problem is that I have to use "Generic Column Names" option to be able to compile the code and end up with c001 to c060 as the column names.
How can I use the names of the selected columns as the report headings rather than c001, C002... etc?
I do not know beforehand which columns, or how many columns or the order of the selected columns.
I know Denes K has a demo called Pick Columns but I can't access his code. I have a hunch though that he may be just using conditions to hide/show the apropriate columns.
thanks in advance
PaulPHi Paul
I would change the Heading Type in the Report Details screen to PLSQL and use the shuttle item to return the column values. e.g.
RETURN :p1_shuttle;
I'm assuming the shuttle already has a colon separated list of the column headings in the correct order?
I hope that helps
Shunt -
Erratic Report Region Behavior with Dynamic SQL Queries
I'm running HTMLDB v 1.5.1.00.12 and I've noticed some odd behavior with report regions using dynamic SQL queries. Every so often, our testers will run a page containing a dynamic sql report region and get the following error, (despite the fact the query was working only moments ago and no other developer has touched it):
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
or sometimes
failed to parse SQL query:ORA-01403: no data found
The only solution I've found so far is to:
1) Make a copy of the failed report region.
2) Disable or delete the original failed report region.
The new copy of the report region runs without issue.
My search of the forums turned up the following two threads, but neither provided me with a clear explanation of the cause, and how to avoid it:
ORA-06502:PL/SQL: numeric or value error: character string buffer too small
Re: Import Export Error (ORA-06502)
The columns being returned are below the 4000 character limit, and the rows being returned are far less than 32k in size.
Could this have anything to do with the way HTMLDB is internally storing the PL/SQL used to generate the dynamic SQL Query? Is there any known issue related to this with that version of HTMLDB?
This problem occurs without any discernable pattern or consistency, making it hard to determine where I should focus my efforts in tracking down the cause.Hi all,
My report seems to be behaving correctly once i set it to "Use Generic Column Names (parse query at runtime only)" :)
Cheers,
Joel -
PLSQL processing of a dynamic sql report
Hi there,
I have a problem processing a dynamic sql report, specifically in referencing the PL/SQL column headings I have.
Basically I have a report that generates one row for each project a person belongs to, and then using htmldb_item.text creates one field for each day of the week (sysdate - sysdate+6) so that people can enter their hours worked. The idea is they then press a submit button and the hours are entered into a project table something like (date_worked, project_id, hours_worked), one row for each entry.
So I have:
for i in 1..HTMLDB_APPLICATION.G_F01.count
loop
... err... here I want to insert into the table the values(column_header, project_id, HTMLDB_APPLICATION.G_F01(i)).. but I don't know how to access that column_header value.
Is this possible and if so, how?
Many thanks,
Tosh.that gives me the values of the text fields, but what
I'd like to insert is the value of the column
header... so for example:Yes, I understood what you meant. I did have a differect project_id for each INSERT in my SQL above. I guess that should have been day_id
Since you are generating the tabular form SQL manually, you know which htmldb_item.text index corresponds to which column (which represents day_id in your case). So, use this to write 6 INSERT statements, one for each day. day_id would be a number going from 0 thru 6 where 0 represents Sunday and 6 represents Saturday.
Bottom line: This is like generating/updating a calendar, your column headings are always fixed (Sun thru Saturday), just the date they represent would change. -
How to do a report based on dynamic apex checkbox item value
Hi All,
First of all I would like to thank for taking your time to read this.
I have created a report region with a dynamic checkbox. Now I would like the user to tick few of these checkboxes and click on another link which will take the values of these checkboxes and run an sql statement. I know how to include a standard page_item's value ('where :=P#_ITEM') but I am totally lost on how to do this with dynamic checkboxes. I have been going through many threads here but all of them talk about deleting and updating the displayed records.
Could you please help?
Thanks, Naushad.Hi David,
I have not created any checkboxes in the page, below the sql for generating the checkboxes. Now I would like to run another sql to on some other tables where the values of these checkboxes will be used in the 'where' clause:
***SELECT DISTINCT Q1.LOAD_NBR, T.DESTINATION, apex_item.checkbox(1,q1.load_nbr, 'UNCHECKED')"SELECT_LOAD"***
***FROM TERMINALS T,***
***(SELECT DISTINCT C.LOAD_NBR, SUBSTR(C.PKT_CTRL_NBR,1,3) AS "SHOP"***
***FROM CARTON_HDR@WMSR C, PKT_HDR_INTRNL@WMSR P***
***WHERE C.PKT_CTRL_NBR = P.PKT_CTRL_NBR AND C.MOD_DATE_TIME > (SYSDATE)-1 AND P.STAT_CODE >39 AND P.PKT_CTRL_NBR NOT LIKE '0%' AND C.STAT_CODE <> 99)Q1***
***WHERE Q1.SHOP = T.SHOP_NO*** -
How to determine column length semantics through ANSI Dynamic SQL ?
I am looking for a way to determine the length semantics used for a column through ANSI Dynamic SQL.
I have a database with NLS_CHARACTERSET=AL32UTF8.
In this database I have the following table:
T1(C1 varchar2(10 char), C2 varchar2(40 byte))
When I describe this table in SQL*Plus, I get:
C1 VARCHAR2(10 CHAR)
C2 VARCHAR2(40)
In my Pro*C program (mode=ansi), I get the select statement on input, use PREPARE method to prepare it and then use the GET DESCRIPTOR method to obtain colum information for output:
GET DESCRIPTOR 'output_descriptor' VALUE :col_num
:name = NAME, :type = TYPE,
:length = LENGTH, :octet_length = OCTET_LENGTH
For both C1 and C2 I get the following:
:type=12
:length=40
:octet_length=40
So, even if I know that my database is AL32UTF8, there doesn't seem to be a way for me to determine whether char or byte length semantics were used in C1 and C2 column definitions.
Does anybody know how I can obtain this information through ANSI Dynamic SQL?
Note: the use of system views such as ALL_TAB_COLUMNS is not an option, since we wish to obtain this information even for columns in a complex select statements which may involve multiple tables.
Note: I believe OCI provides the information that we need through OCI_ATTR_DATA_SIZE (which is in bytes) and OCI_ATTR_CHAR_SIZE (which is in chars). However, switching to OCI is something we would like to avoid at this point.Yes, I was wondering which forum would be the best for my question. I see similar questions in various forums, Call Interface, SQL and PL/SQL and Database - General. Unfortunately there is no Pro*C or Dynamic SQL forum which would be my first choice for posting this question.
Anyway I now posted the same question (same subject) in the Call Interface forum, so hopefully I'll get some answers there.
Thank you for the suggestion. -
Can we use Dynamic SQL in Oracle Reports ?
Hi ,
Can we use Dynamic SQL in Oracle Reports ?
If yes please give some examples .
Thanx
sriniI believe the built-in package SRW.Do_Sql is what you are looking for
Example from the document:
/* Suppose you want to create a "table of contents" by getting the
** first character of a columns value, and page number on which its
** field fires to print. Assume that you want to put the "table of
contents"
** into a table named SHIP. You could write the following construct:
DECLARE
PAGE_NO NUMBER;
PAGE_FOR INDEX NUMBER;
SORT_CHAR CHAR(1);
CMD_LINE CHAR(200);
BEGIN
SORT_CHAR := :SORT_NAME ;
IF :CALLED = Y THEN
SRW.GET_PAGE_NUM(PAGE_FOR_INDEX);
SRW.USER_EXIT(RWECOP PAGE_FOR_INDEX
P_START_PAGENO);
SRW.MESSAGE(2,TO_CHAR(:P_START_PAGENO));
END IF;
SRW.GET_PAGE_NUM(PAGE_NO);
CMD_LINE := INSERT INTO SHIP VALUES
(||SORT_CHAR||,||TO_CHAR(PAGE_NO)||);
SRW.MESSAGE(2,CMD_LINE);
SRW.DO_SQL(CMD_LINE);
COMMIT;
EXCEPTION
WHEN DUP_VAL_ON_INDEX THEN
NULL;
WHEN SRW.DO_SQL_FAILURE THEN
SRW.MESSAGE(1,FAILED TO INSERT ROW INTO SHIP TABLE);
WHEN OTHERS THEN
COMMIT;
END; -
Can anybody please send me a small program on How to Use Dynamic SQL.
How to execute and run give details.
Thanks
nullYou can certainly use the INTO (and USING) clauses of EXECUTE IMMEDIATE to pass in and return data, i.e.
EXECUTE IMMEDIATE sqlStmt
USING variable1, variable2
INTO output1, output2The more complex the statement, however, the more appropriate DBMS_SQL is. DBMS_SQL also has the potential to allow you to use bind variables rather than reparsing the statement many times.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC
Maybe you are looking for
-
I have i tunes on the computer with over 1000 songs on it and i also have loaded i tunes on my laptop as i want to get rid of the computer but the library on the laptop is not showing the same songs how can i transfer the songs from the computer to t
-
Itunes 7 and Multi Disk Backup Erroneous Message
iTunes 7 Backup feature gives a completely erroneous message when it completes the 1st of multiple (DVD) disks (tried and it did this twice). Message says backup failed but provides options to "retry", "cancel" or "next". First time I just cancelled.
-
Can Labview DAQ work on a self-trigg​ering basis?
Currently I have the following setup: We shoot electrons through a diamond (which is attached to a electronics board via electrodes), then the electrons pass through a scintillator. We use the scintillator/phototube as the trigger pulse right now, b
-
Public Radio Stations now Missing from Itunes?
All of a sudden Public radio vanished from my iTunes 9 Radio selections. It was there when I first opened Radio in iTunes 9, but when I clicked on it it dissappeared. I really need my KCRW!!!
-
IPhoto to install on my 10.7.5-MacBook?
I bought iPhoto from my Mavericks-mac, now I want to install on my 10.7.5-MacBook but only see "not supported" iPhoto. What to do, thanks