Dynamic Link in SQL Query Report
Andy,
I refromatted the message since it was all garbled, I didn't realize it came out like that the first time.
1) I am not sure what you meant by the "#" in your message until I did the substitution of #'s for < > I didn't have that in my URL.
2) Since the whole statement is enclosed in single quotes to be inside of a decode statement I think this is an issue with the javascript and it's double quotes or is it?
3) I took care of the passing values for items, even if I can just get the link to work some what I would be happy I can worry abou those values later..
Hello I have a a link that is generated in a report
sql based on an SQL query and I would like to turn it
into a popup instead of a direct link. But I seem to
be having some problems going from a link to a popup
link...
<b> I replaced the brackets < > with "#" </b>
This statement works;
SELECT decode(create_date, NULL, NULL, '#a
href="f?p=&APP_ID.:71:&SESSION.::NO:100:P71_EQUIPMENT_
ID,P71_CONTAINER_TYPE_ID:' || equipment_id || ',' ||
container_type_id || '"/#' || create_date ||'#/#>' )
AS "HIST_NOTE",
</br>
</br>
but I would like to turn make it a popup instead of a
direct link, I think the problem has something to do
with the parenthesis (double and single mixed) any
ideas?
</br>
</br>
I tried doubling them up (using three single ticks
for double parens inside of single ticks and
everything
</br>
</br>
<b> I replaced the brackets < > with "#" </b>
decode(create_date,
NULL,
NULL,
'#a href="javascript:popupPage('f?p=&APP_ID.:71:&SESSION.::NO:100:P71_EQUIPMENT_ID,P71_CONTAINER_TYPE_ID:' || equipment_id || ',' || container_type_id || '"/#' || create_date ||'#/a#')" ' AS "HIST_NOTE",
</br>
</br>
Any ideas?
The error I usually get mostly complains about "ORA-00907: missing right parenthesis"....
I put an example up on apex.oracle.com if you want to debug it there (it of course does not work right now)
http://apex.oracle.com/pls/otn/f?p=18490:5
guest/apex123
Thanks
Justin
Message was edited by:
Justin P
Denes,
I was able to get it working based on one of your examples, it gets ugly when you embed the popup javascript into the link as you know. You have some really great examples, I hadn't been to your page in awhile.
Here is my end result (this is embedded in a decode statement so single ticks would go around the entire example below)
<a href="javascript:popUp2('''
|| 'f?p=&APP_ID.:71:&SESSION.::NO:100:'
|| 'P71_EQUIPMENT_ID,P71_CONTAINER_TYPE_ID:'
|| equipment_id || ',' || '&F110_CONTAINER_TYPE_IP.'
|| ''', 900, 600);">'
|| create_date
|| '</a>
Thanks to all that helped me out here,
Justin
Similar Messages
-
SQL Query Report (Customize link)
I have an SQL query report with bind variables so that users can choose conditions for the query. If I don't have any conditions, the report is empty. How do I get it to display all the records. I tried typing * but it didn't work.
Basically I want it to act like the Query Wizard's Customize feature. The report give me all the records. I can query one field or all the fields.
In the SQL report's Customize feature, I have to enter a value for all the bind variables I have. What if I just want to query one field. What do I put in the others to indicate that I want all. I hope this makes some sort of sense and that someone out there knows what I'm blabbing about.Hi,
I h've same type of requirement in most of my reports in the application and I h've solved this in the sql of the report itself. Let's see a example report from the table scott.emp with a sql like
Select EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
DEPTNO
From scott.emp
Where EMPNO = nvl(:v_empno,EMPNO)
and DEPTNO = nvl(:v_deptno,DEPTNO)
where :v_empno and :v_deptno are bind variables to this report and if there is no arguements passed to these arguements all the records will be retrieved from the table ..likeley if value for any one of these arguements is passed then this sql will return only those records which meet that condition.
Hope this helps
-Krishnamurthy -
Hi I have a sql query report that is taking very long to render.The query on sql developer comes back in less than a second.Any ideas on what could be wrong?
Hi
When posting code on the forum, put {noformat}{noformat} (with the curly brackets and the word code in lowercase) above and below your code like this...
{noformat}{noformat}
SELECT *
FROM emp
{noformat}{noformat}
It will then appear like this, preserving formatting...SELECT *
FROM emp
Next, how many rows are returned in total, it may be that you have SQL Developer set up to fetch only the first x number of rows?
Why have you put a CHOOSE hint in there?
Is it a classic report or an interactive report?
It looks like you're going over a database link, you really need to provide an explain plan (formatted as I have detailed above), a DRIVING_SITE hint may help you but it's impossible to know without seeing the plan...
Cheers
Ben -
SQL Query report region that only queries on first load
Hello all,
Is there any way in which you can prevent a SQL Query report region from quering data after every refresh?
I would like to make a report that queries on the first load, but then I would like to change the individual values, and reload to show the change, but every time I reload the page the columns are queried and the original values are displayed once again...
any ideas?
-MuxChet,
I created a header process to create the HTMLDB_COLLECTION. It is something like:
HTMLDB_COLLECTION.CREATE_COLLECTION_FROM_QUERY(
p_collection_name => 'Course_Data',
p_query => 'SELECT DISTINCT COURSE_ID, HTMLDB_ITEM.CHECKBOX(14,COURSE_ID) as "checker", TITLE, SUBJECT, COURSE_NUMB, SECTION, ENROLLED, null as "temp_term", null as "temp_title", null as "temp_crse_id", null as "temp_subj", null as "temp_crse_numb", null as "temp_sect", FROM DB_TBL_A, DB_TBL_B, DB_TBL_C, DB_TBL_D, DB_TBL_E, DB_TBL_F WHERE ...');
The names were changed, for obvious reasons.
I then created an SQL Report Region to see if it would work. The SQL is:
SELECT c001, c002, c003
FROM htmldb_collections
WHERE collection_name = 'COURSE_DATA'
When I run the page it says:
ORA-20104: create_collection_from_query Error:ORA-20104: create_collection_from_query ExecErr:ORA-01008: not all variables bound
Any idea why this is happening?
I'm new to HTMLDB_COLLECTIONS, so I may be doing something wrong
-Mux -
Setting a Default Value in SQL Query Report
Hello:
We are using a SQL Query Report to provide a mass update to a table. We are using the apex.collection and having it display a number of records in a SQL Query Report for mass update. We have 14 columns in the report, for which the first 11 are populated via the collection. The remaining 3 are open for input but the individual making the updates. We've were able to provide a default value for 2 of the remaining 3 columns using a named LOV's - however the fourth column we would like to default a sysdate - but we are not successful.
We've attempted many things but none seem to work, including adding that column to the collection and assigning it a default sysdate value. We've also tried changing the settings in the report attributes --> Tabular Form Elements by setting the Display as to: Datepicker, Default type to PL/SQL Expression and setting the default to sysdate. We've also tried caputuring a date on the previous page and loading it onto the report page and trying to default the date column to a page item default.
I'd appreciate any help.
Thanks
FYI - we are using version 3.2use as default
to_char(sysdate, 'dd/mm/yyy') where the format is your application or item date format -
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 PPaul,
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 -
Apex - SQL query report.
Hi,
Apex - 4.0 and Oracle -11g
I m having a SQL Query report.
Query
SELECT htmldb_item.hidden(1,id) id,
htmldb_item.select_list_from_query_xl(2,name,'SELECT name ,
deptid
FROM emp
WHERE name like ''E%''') name,
htmldb_item.select_list_from_query_xl(3,deptname,'SELECT deptname from dept where deptid = ???') deptname
FROM tabel
My problem, in the report when the Select list for 'name' has been choosen , then it should retrieve the deptname based on the 'name'.
Is it possible ?you want select list value should affected in SQL report? i mean redirect and set value to SQL report?
-
Fail to create SQL query report because of ORA-00923
Hi expert,
I would like to SQL query report using the following query:
select min(identified_date) first_identified,
max(actual_COMPLETE) last_closed,
count(id) total_issues,
sum(decode(status,'Open',1,0)) open_issues,
sum(decode(status,'Pending',1,0)) pending_issues,
sum(decode(status,'Resolved',1,0)) closed_issues,
sum(decode(status,'Will Not Resolve',1,0)) not_resolve_issues,
sum(decode(status,
'Open',decode(priority,null,1,0),
0)) open_no_prior,
sum(decode(status,
'Open',decode(priority,1,1,0),
0)) open_prior_1,
sum(decode(status,
'Open',decode(priority,'2',1,0),
0)) open_prior_2
sum(decode(status,
'Open',decode(priority,3,1,0),
0)) open_prior_3,
sum(decode(status,
'Open',decode(priority,'4',1,0),
0)) open_prior_4,
sum(decode(status,
'Open',decode(priority,5,1,0),
0)) open_prior_5
from SOFTPROJ_issues
where project_id = :P83_PROJECT
However, I got the following error during the steps of creation:
1 error has occurred
Query cannot be parsed, please check the syntax of your query. (ORA-00923: FROM¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿)
I wonder why if it is getting the error because I could create the report with the following query without problems:
select min(identified_date) first_identified,
max(actual_COMPLETE) last_closed,
count(id) total_issues,
sum(decode(status,'Open',1,0)) open_issues,
sum(decode(status,'Pending',1,0)) pending_issues,
sum(decode(status,'Resolved',1,0)) closed_issues,
sum(decode(status,'Will Not Resolve',1,0)) not_resolve_issues,
sum(decode(status,
'Open',decode(priority,null,1,0),
0)) open_no_prior,
sum(decode(status,
'Open',decode(priority,1,1,0),
0)) open_prior_1,
sum(decode(status,
'Open',decode(priority,3,1,0),
0)) open_prior_3,
sum(decode(status,
'Open',decode(priority,5,1,0),
0)) open_prior_5
from SOFTPROJ_issues
where project_id = :P83_PROJECT
1 error has occurred
Query cannot be parsed, please check the syntax of your query. (ORA-00923: FROM¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿)
The difference is to add the followings only:
sum(decode(status,
'Open',decode(priority,'2',1,0),
0)) open_prior_2
sum(decode(status,
'Open',decode(priority,'4',1,0),
0)) open_prior_4,
Does anyone have any idea to resolve the issue?
Thanks in advance,
RuiBy putting a comma after open_prior_2:
sum(decode(status,
'Open',decode(priority,'2',1,0),
0)) open_prior_2,Sima -
Showing column value as counter in sql query - report
I created a classic report with search bar based on an sql query. I would like to show the "notes" column in this query using some sort of counter and as a hyperlink to another section on the page (same idea as footnotes in a book). So if I have 10 rows and 5 have "notes". I should show 1,2,3,4,5 in the notes column for those rows and the number gets displayed as a link to another section listing the notes 1 through 5.
I was thinking of creating a hidden page item as the counter with value of 0 and then in my query doing counter+1 but i'm not sure how to do this or if i can do that...
If anyone can help or have any other ideas I would really appreciate it!!
Thanks,
HindyWell, I'm doing this in VB and the subquery is dynamic. I'm passing an ADO recordset to a routine that sets up a listview to display the results. The number of columns selected can vary. My idea was to size the columns appropriately based on the size of the data. Within the display routine I could:
sql = "SELECT "
for i = 0 to oRS.Fields.Count - 1
sql = sql & "MAX(LENGTH(" & i & ")), "
next 'i
sql = sql & "FROM (" & oRS.Source & ")" -
ORA-06502 on 'SQL query' report with sort in 'Report Attributes'
Hi All,
We get the next error if we set sorting on a column in a 'Report' based on a 'SQL query'. Removing the sort, error disappeares:
failed to parse SQL query:
ORA-06502: PL/SQL: numeric or value error: NULL index table key value
Any suggestions?
ErikErik,
Thanks, this explains it. By specifying the request as part of your URL you run into the recently uncovered issue. The request you're setting is REMFROMLIST and ADD2LIST. You probably either have links that include those requests or you have branches where you specify them. Either way, in order to get reports sorting to work, you'll have to make sure that the request strings are not part of your URL. This is a work-around and the upcoming HTML DB patch release will solve this issue.
One way of avoiding this is to have computations on the previous pages that set a napplication level or page level item to the REMFROMLIST and ADD2LIST values and then you can use those items for your conditions that are currently evaluating those strings.
Hope this helps and sorry for the inconvenience,
Marc -
Conditional display of a column link in sql updateable report
Hi There,
I've attempted to look thru the Apex forum about using an Authorization Scheme in an SQL Query (Updateble Report) where I can conditionaly enable (display) a column link based upon a value in the report but alas I cannot find a solution.
What I have is a SQL Query (updateable report). What I want to achieve is dependant on the value of one of the columns in the report query conditionaly display a column link for the row being displayed. For example if the report dispayed the data from emp, dept only display a column link for rows where the deptno = 100 otherwise don't display the column link. Is this possible to achieve?
I've tried to define in the authorizatuon scheme in the where clause of an SQL Statement to reference the report column as #deptno# but this doesn't work.
TIABoketi,
I was unsuccessful yesterday in demoing what I believe you want to achieve. It appears that an authorization scheme will not process row by row within a standard report so as to allow a conditional display of a link or any other column attribute. You can conditionally display a column by the use of a page item but this method appears to be all or nothing.
I was successful when I coded the return of the empno via a Case statement but the Link still appeared even though there was no value (empno) to link with. So essence the link to you to a blank for with no PK to read the database by.
SELECT CASE WHEN deptno = 10 THEN empno ELSE NULL END empno,
ename,
job,
hiredate,
sal,
comm,
deptno,
phone_nbr
FROM empJeff -
Displaying a radio group in SQL QUERY report region
Good morning everyone,
I have a report in which a column - ORDER STATUS, will come in with a value of 1, 2 or 3...being order unfilled, order partially filled, or order filled, respectively.
I would like to display the order status as a radio group on the report so that it will be easy to run down the column of radio buttons to see what is filled, etc.
I've gone to the manual and checked the doco on HTMLDB_ITEM.RADIOGROUP. But the example given there is actually for CHECKBOX (is this an error?!?).
I went to the forums and found nothing suitable.
My region is an SQL QUERY. Can I display the STATUS as a radio group in the SELECT ?
This is the question.
Thankyou in anticipation. TC. 23/11/2004Tony,
There may be better solutions, but here's what I was thinking: create table orders (id number, status number, customer varchar(30))
insert into orders (id,status,customer) values(1,1,'ACME')
insert into orders (id,status,customer) values(2,2,'BENSON')
insert into orders (id,status,customer) values(3,3,'CLARKE')
commit
Query Source
select
id "ORDER NUMBER",
decode(status,
1,htmldb_item.RADIOGROUP(1,status,'1','unfilled')||htmldb_item.RADIOGROUP(2,status,'2','partial','"disabled=true"')||htmldb_item.RADIOGROUP(3,status,'3','filled','"disabled=true"'),
2,htmldb_item.RADIOGROUP(1,status,'1','unfilled','"disabled=true"')||htmldb_item.RADIOGROUP(2,status,'2','partial')||htmldb_item.RADIOGROUP(3,status,'3','filled','"disabled=true"'),
3,htmldb_item.RADIOGROUP(1,status,'1','unfilled','"disabled=true"')||htmldb_item.RADIOGROUP(2,status,'2','partial','"disabled=true"')||htmldb_item.RADIOGROUP(3,status,'3','filled'))
"STATUS",
customer "Customer Name"
from orders;Scott -
SQL Query (report region) without full page reset
Hello,
I have a page with several items, some of them with default values, and a report region, performing SQL query based on one of the items text field (always submits page when Enter pressed). When the page submits, the HTML DB engine performs and display the query, but at the same time, reset the other page items to their default values.
Is it possible to run the query without the HTML DB reset the item values to their default state?
Thanks,
Arie.Hi Peter,
Well, this is not exactly the case. I have an Item File Browse which defined as "Only when current value in session state is null", and a HTML text region, which contain Iframe, with default src tag (which I'm changing, using JavaScript, prior to the running of the SQL query). After running the query in a report region both the item and the Iframe reset to their original state.
Any Ideas on how to prevent that?
Thanks,
Arie. -
Hi,
I have a region as the type
"SQL Query (PL/SQL function body returning SQL query)".
The query works fine for reports if I query two columns. Select 1, 2 from table.
For some reason if the returning query has more than three columns (select 1, 2, 3 from table), I get an error:
"report error:
ORA-01403: no data found"
Any help would be great. Thanks.Hi,
I've been trying all sorts of things on a test report and the only way that I get extra columns is by including derived columns in the report. Otherwise, even with custom headings, adding or removing columns in the report's PL/SQL adjusts the columns as I would expect.
Are your extra columns derived or can your report return a varying number of columns?
Andy -
Column Headings on PL/SQL returning SQL Query report- using br
Hi,
I would like to create a report region based upon a function returning a SQL query. As a dem oI have created the following:
create or replace function xxjk_retsql return varchar2
as
begin
return 'select i "column header" from wwv_flow_dual100';
end;I want to be able to insert a line break in the column header so it wraps over two lines. I tried this:
create or replace function xxjk_retsql return varchar2
as
begin
return 'select i "column<br>header" from wwv_flow_dual100';
end;however when the region is rendered, it appears to strip out the HTML tag. I also tried another tag, <i></i>, as a test and this is stripped out also.
Is there a way to include a break in a column header in this manner?
Thank-you,There is an option Strip HTML and it is turned on by default. Try changing that to see what happes.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------------------
Maybe you are looking for
-
I installed 5.7, ran ok for a while. Then it gave the error message that the preview cache was bad. A few times I have gotten this message and it restarts and repairs it. But now it couldn't. Renamed the Lightroom 5 catalog with the name "Lightroom 5
-
Purchasing external HD and use with Time Machine
I've got an eMac, 1GB RAM, 1 MHZ processor (+/-), 40GB hard drive. Am considering purchasing Leopard upgrade and external FireWire HD. Existing internal HD is near capacity. Would like to move some files to external HD, such as iPhoto and iTunes. Wou
-
i just noticed that my itunes has disappeared from my computer. The icon on the desktop is gone, I looked through "all programs" and it is not listed and I went to add/remove hardware and it is not listed there either. When i hook up my ipod nothing
-
Vendor Received PO in wrong mail id
Hello MM Gurus, My Vendors are wondering why the purchase orders go to wrong e-mail address please let me know what are all the things I need to check. Also let me know any configuration settings are required to send the PO to vendors. Please share y
-
Importing Between Projects Takes FOREVERRRR
All I'm doing is copying a 3-minute clip from one project to another via the copy/paste options. It's been about 15 minutes and all I see is a dialog box that says Importing Files...Preparing. Trying to cancel the import or Force Quit iMovie has no e