Using dynamic values in the IN clause
hey guys ,
is it possible to use dynamic values for comparing in the IN clause while writting query in views, in adf bc .
Thanks to Jobinesh http://jobinesh.blogspot.com/2010/12/using-oraclejbodomainarray-with.html
Timo
Similar Messages
-
Populating dynamic values in the combobox with XML form Builder.
I am trying to populate dynamic value in the combobox with xml form builder. I see the document saying create property group and document property Id with respecitive values. I am able to create the property group with system admin -> System config
-> KM -> CM -> Global services -> property Metadata -> groups with new button. and I am trying to create document property Id with value. I am not able to find the way to give value in the property. I am using EP 7.0 Sp 14. Please let me know how to sovel itHi
You can create new property metadata with System Admin > System Config > KM > CM > Global services > Property Metadata > Properties > New. Specify the values for this metadata as the ones you need to have in the combo box. Use allowed values parameter of the matadata to sepcify the values. Each metadata property will have unique property ID and you can map this property ID to your combo box in xml forms.
Give it a try.
Regards,
Yoga -
How to use Special value set with Column clause to display addtional column
hi
can anyone tell me
How to use Special value set with Column clause to display addtional column
how can i use FND POPID and with COLUMN clause ?Dear Yaseen,
To get the value in formula cumulative,after you have created the formula for that particular key figure,go to edit and click on tab "calculations".
In that select overall result as 'count all values not equal to zero' and single result as 'count all values not equal to zero' .
And mark the cumulative check box underneath.
I hope you get the desired result and please do me favour .
Sumit goomber -
How to assign a dynamic value to the value property of a button ?
Hi Folks,
I have a need, can i know how to assign a dynamic value to the value property of a button. Scenario is like follows...
This is a struts based web application
1. I have a file which consists of login user details (user name and his previlages) for a web application.
2. I got those user details, into a List.
3. When a user logged into the web app, in the home page there are few buttons. The type and number of buttons shown depends on the type of user/ user. (Buttons have different combination and the number of buttons available are not constant, they will vary from user to user).
4. for each button, there will be a different action. I can pass the value of a button to an action class, but here button must have a dynamic value.
Here is my test code:
<%
if (List != null)
for (int i = 0; i <List.length; i++)
%>
<html:submit property="rduname" value= "<%=List%>" onclick="return submitRdu('<%=List[i] %>');"/>
<%
%>
But my problem is how to assign a dynamic value to the value property of the button ( i know 'value= "<%=List[i]%>" ' will not work, just wanted show you guys).
Thanks in advance,
UV
Edited by: UV_Dev on Oct 9, 2008 2:15 PMLet me try i know am not good at JSP but do we need double quotes here
value= <%=List%>i think JSTL should help you about the dynamic thing -
Problems with query with more than 20 values in the select clause
I have a region based on a function returning a SQL query. It needs to have more than 20 values in the select clause. When I run the page I get a no data found error in the region. I managed to reproduce this behavior with just the following as the select returned by the function:
select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21
from dual
I am running the 1.3.9.00.15 release of Marvel on 9.2.0.2 of the db on Solaris.Hello Raju,
I will email you the connection settings when I return to the office.
One thing I should have mentioned: The sql string is returned from a package in the db, so the query region text I originally posted isn't quite correct.
it is something like:
declare
begin
return my_pkg.my_fnc;
end;
the stored package is nothing more than:
package my_pks is
funtion my_fnc(i_test_param in varchar2) is
begin
return 'select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20, 21 from dual';
end;
end;
Sorry for the inaccurate info in the first post, but I am away from the server in question right now. -
Query Tuning - using CASE statement in the WHERE clause - Duplicate Post
Duplicate Post by mistake.
Please check
Query Tuning - using CASE statement in the WHERE clause
Edited by: Chaitanya on Jun 9, 2011 2:45 AM
Edited by: Chaitanya on Jun 9, 2011 2:46 AMDuplicate Post by mistake.
Please check
Query Tuning - using CASE statement in the WHERE clause
Edited by: Chaitanya on Jun 9, 2011 2:45 AM
Edited by: Chaitanya on Jun 9, 2011 2:46 AM -
Using item values in the query
Hi,
Is there a way I can use item values in the query...?
as an example, something like this
select a.*, :P20_CUST_NAME as CUSTOMER_NAME
from
table TEMP a;
haven't tried it yet but want to get the feedback first before making an attempt...
ThanksYes, as long as that item has a value in session state..
Thank you,
Tony Miller
Webster, TX -
Using multiple values in a where clause, for values only known at runtime
Dear all
I am creating a PL/SQL program which returns multiple rows of data but only where it meets a set id values that a user has previously chosen. The id values are stored in an associative array and are chosen by a user in the preceding procedure at run time.
I know all the table and column names in advance. The only things I don't know are the exact number of ids selected from the id column and what their values will be. This will only be known at runtime. When the procedure is run by the user it prints multiple rows of data to a web browser.
I have been reading the following posting, which I understand to a large extent, Query for multiple value search But I cannot seem to figure out how I would apply it to my work as I am dealing with multiple rows and a cursor.
The code as I have currently written it is wrong because I get an error not found message in my web browser. I think the var_user_chosen_map_list_ids in the for cursor loop could be the problem. I am using the variable_user_chosen_map_list_ids to store all the id values from my associatative array as a string. Which I modified from the code that vidyadhars posted in the other thread.
Should I be creating a OPEN FOR ref cursor and if so where would I put my associative array into it? At the moment I take the value, turning it into a string and IN part in the WHERE clause holds the string, allowing the WHERE clause to read all the values from it. I would expect the where clause to read everything in the string as 1 complete string of VARCHAR2 data but this would not be the case if this part of the code at least was correct. The code is as follows:
--Global variable section contains:
var_user_chosen_map_list_ids VARCHAR2(32767);
PROCEDURE PROCMAPSEARCH (par_user_chosen_map_list_ids PKG_ARR_MAPS.ARR_MAP_LIST)
IS
CURSOR cur_map_search (par_user_chosen_map_list_ids IN NUMBER)
IS
SELECT MI.map_date
MT.map_title,
FROM map_info MI,
map_title MT,
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_publication_id IN
(var_user_chosen_map_list_ids);
var_map_list_to_compare VARCHAR2(32767) := '';
var_exe_imm_map VARCHAR2(32767);
BEGIN
FOR rec_user_chosen_map_list_ids IN 1 .. par_user_chosen_map_list_ids.count
LOOP
var_user_chosen_map_list_ids := var_user_chosen_map_list_ids ||
'''' ||
par_user_chosen_map_list_ids(rec_user_chosen_map_list_ids) ||
END LOOP;
var_user_chosen_map_list_ids := substr(var_user_chosen_map_list_ids,
1,
length(var_user_chosen_map_list_ids)-1);
var_exe_imm_map := 'FOR rec_search_entered_details IN cur_map_search
LOOP
htp.print('Map date: ' || cur_map_search.map_date || ' Map title: ' || cur_map_search.map_title)
END LOOP;';
END PROCMAPSEARCH;EXECUTE IMMEDIATE var_exe_imm_map;
I would be grateful of any comments or advice.
Kind regards
TimI would like to thank everyone for their kind help.
I have now successfully converted my code for use with dynamic SQL. Part of my problem was getting the concept confused a little, especially as I could get everything work in a static cursor, including variables, as long as they did not contain multiple values. I have learnt that dynamic sql runs the complete select statement at runtime. However even with this I was getting concepts confused. For example I was including variables and the terminator; inside my select string, where as these should be outside it. For example the following is wrong:
TABLE (sys.dbms_debug_vc2coll(par_user_chosen_map_list_ids))....
AND MI.map_publication_id = column_value;';Where as the following is correct:
TABLE (sys.dbms_debug_vc2coll('||par_user_chosen_map_list_ids||'))....
AND MI.map_publication_id = column_value';PL/SQL is inserting the values and then running the select statement, as opposed to running the select statement with the variables and then accessing the values stored in those variables. Once I resolved that it worked. My revised code is as follows:
--Global variable section contains:
var_user_chosen_map_list_ids VARCHAR2(32767);
var_details VARCHAR(32767);
PROCEDURE PROCMAPSEARCH (par_user_chosen_map_list_ids PKG_ARR_MAPS.ARR_MAP_LIST)
IS
BEGIN
FOR rec_user_chosen_map_list_ids IN 1 .. par_user_chosen_map_list_ids.count
LOOP
var_user_chosen_map_list_ids := var_user_chosen_map_list_ids ||
'''' ||
par_user_chosen_map_list_ids(rec_user_chosen_map_list_ids) ||
END LOOP;
var_user_chosen_map_list_ids := substr(var_user_chosen_map_list_ids,
1,
length(var_user_chosen_map_list_ids)-1);
var_details := FUNCMAPDATAFIND (var_user_chosen_map_list_ids);
htp.print(var_details);
END PROCMAPSEARCH;
FUNCTION FUNCMAPDETAILS (par_user_chosen_map_list_ids IN VARCHAR2(32767)
RETURN VARCHAR2
AS
TYPE cur_type_map_search IS REF CURSOR;
cur_map_search cur_type_map_search;
var_map_date NUMBER(4);
var_map_title VARCHAR2(32767);
begin:
OPEN cur_map_search FOR
'SELECT MI.map_date,
MT.map_title
FROM map_info MI,
map_title MT,
TABLE (sys.dbms_debug_vc2coll(' || par_user_chosen_map_list_ids || '))
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_publication_id = column_value';
LOOP
FETCH cur_map_compare INTO
var_map_date,
var_map_title;
var_details := var_details || 'Map date: '||
var_map_date ||
'Map title: ' ||
var_map_title;
EXIT WHEN cur_map_compare%NOTFOUND;
END LOOP;
RETURN var_details;
END FUNCMAPDETAILS;Kind regards
Tim -
Using dynamic value in procedure on column
I want a PL/sql procedure to select the data from the column dynamically into a variable .
My friend suggested its not possible in PL/sql ,its only possible in sql .
What i want is when i execute the PL/sql procedure the a_1 must get the value of the data in the table,i do not want to use execute immediate in pl/sql.
I create a table A
create table A (a1 number,a2 number,a3 number);
insert into a values (1,2,3);
then i create a procedure
create or replace
procedure test_a (var IN number)
as
a_1 number;
i number;
z varchar2(5);
begin
if var=1
then
i:=1;
elsif var = 2
then
i:=2;
z:='A2';
end if;
SELECT 'a'||i into a_1 from a;
end;
Edited by: user536416 on May 13, 2010 4:03 AMI prefer reference cursors over execute immediate if I must do dynamic SQL (and have learned not to do it unless necessary - among other things dynamic SQL is hard to debug and maintain).
The advantages to ref cursors are
* execute immedate will only retrieve one row, ref cursors as many as you want
* easier for me to build the query first, then execute it (though you can do this with execute immediate too) for debugging
You can buiid the query dynamcially but have to be careful to make sure the select list matches the INTO clause on the fetch statements. Although the queries in the example below are hard coded I could have done something like
v_command_c := 'select '||var1||', '||var2||' from '''||table_name||'''';
open refcur for v_command_c;To randomize your column selection use something like the above with IF logic and a randomizer, possibly the DBMS_RANDOM package or a time extraction.
Something like
SET SCAN OFF
SET SERVEROUTPUT ON
DECLARE
--define composite data types
--reference cursor type - structure
TYPE RefCursorType IS REF CURSOR;
--collection (index-by table) type - structure
TYPE TablesTableType IS TABLE OF user_tables.table_name%TYPE
INDEX BY BINARY_INTEGER;
--define ref cursors to be used in BEGIN section
UserTablesCursor RefCursorType;
UserViewCursor RefCursorType;
--define actual index-by tables to be used in BEGIN section
NamesTable TablesTableType;
ViewsTable TablesTableType;
--define internal procedures to be used in this script
PROCEDURE ListItems(RefCursor IN RefCursorType,
DataTable IN OUT TablesTableType
) IS
Counter INTEGER := 1;
TableName user_tables.table_name%TYPE;
BEGIN
FETCH RefCursor INTO DataTable(Counter);
Counter := Counter + 1;
WHILE RefCursor%FOUND LOOP
FETCH RefCursor INTO DataTable(Counter);
Counter := Counter + 1;
END LOOP;
END; --ListItems;
PROCEDURE WriteItems(DataTable IN TablesTableType) IS
BEGIN
FOR i IN 1..DataTable.count LOOP
dbms_output.put_line(DataTable(i));
END LOOP;
END; --WriteItems;
BEGIN
OPEN UserTablesCursor FOR
SELECT table_name
FROM user_tables;
ListItems(UserTablesCursor,NamesTable);
CLOSE UserTablesCursor;
dbms_output.put_line('user_tables');
dbms_output.put_line('--------------');
WriteItems(NamesTable);
--second defintion & set of calls
dbms_output.put_Line(CHR(13));
OPEN UserTablesCursor FOR
SELECT view_name
FROM user_views;
ListItems(UserTablesCursor,ViewsTable);
CLOSE UserTablesCursor;
dbms_output.put_line('user_views');
dbms_output.put_line('--------------');
WriteItems(ViewsTable);
END;
/Edited by: riedelme on May 13, 2010 5:44 AM -
Using a String in the "IN" clause
Hello folks,
I am trying to output results from a table based on a String which I was planning on using in the "IN" clause. When I run the query through the PL/SQL procedure, I get no results.
In the PL/SQL program, I have a variable p_string where I am appending the ID's in a loop. So, when I print the string, I am seeing '1001','1002','1003' but when I do the following I get nothing.
select * from test_tb
where ID IN (p_string);
Is this because there is an extra quote at the beginning and end of the string and the string is actually ''1001','1002','1003''?
create table test_tb(ID varchar2(4), description varchar2(20));
INSERT INTO TEST_TB (ID, DESCRIPTION) VALUES ('1001', 'Testing 1001');
INSERT INTO TEST_TB (ID, DESCRIPTION) VALUES ('1002', 'Testing 1002');
INSERT INTO TEST_TB (ID, DESCRIPTION) VALUES ('1003', 'Testing 1003');
INSERT INTO TEST_TB (ID, DESCRIPTION) VALUES ('1004', 'Testing 1004');
INSERT INTO TEST_TB (ID, DESCRIPTION) VALUES ('1005', 'Testing 1005');
ThanksThanks for the link, Greg.
I was able to find another link which worked for me as I am not too familiar with Collections. I used Regular Expressions instead.
https://blogs.oracle.com/aramamoo/entry/how_to_split_comma_separated_string_and_pass_to_in_clause_of_select_statement -
Query Tuning - using CASE statement in the WHERE clause
Hi All,
My query has been modified to use a CASE statement in the WHERE clause to consider data from certain columns based on a parameter value. This modified query is doing a full table scan and running endlessly. Please suggest what may be done to improve its performance:
Query:
SELECT LAST_DAY(TRUNC(TO_TIMESTAMP(os.requestdatetime, 'yyyymmddhh24:mi:ss.ff4'))) AS summary_date,
os.acctnum,
os.avieworigin_refid,
COUNT(1) cnt_articleview,
SUM(NVL(autocompletedterm,0)) cnt_autocompletedterm
FROM TABLE1 os
WHERE os.acctnum IS NOT NULL
AND os.avieworigin_refid IS NOT NULL
AND os.requestdatetime IS NOT NULL
AND UPPER(os.success_ind) = 'S'
AND CASE WHEN
Param_ValueToCheck = 'FULL' AND get_date_timestamp(os.requestdatetime) BETWEEN
TO_DATE('01-MAY-2011 00:00:00','DD-MON-YYYY HH24:MI:SS') AND
TO_DATE('31-MAY-2011 00:00:00','DD-MON-YYYY HH24:MI:SS')
THEN 1
WHEN
Param_ValueToCheck = 'INCR' AND os.entry_createddate BETWEEN
TO_DATE('01-MAY-2011 00:00:00','DD-MON-YYYY HH24:MI:SS') AND
TO_DATE('31-MAY-2011 00:00:00','DD-MON-YYYY HH24:MI:SS')
THEN 1
END = 1
AND CASE WHEN
Param_ValueToCheck = 'FULL' AND os.entry_CreatedDate BETWEEN
TO_DATE('01-APR-2011 00:00:00','DD-MON-YYYY HH24:MI:SS') AND
TO_DATE('07-JUN-2011 00:00:00','DD-MON-YYYY HH24:MI:SS')
THEN 1
WHEN
Param_ValueToCheck = 'INCR' THEN 1
END = 1
GROUP BY LAST_DAY(TRUNC(TO_TIMESTAMP(os.requestdatetime, 'yyyymmddhh24:mi:ss.ff4'))), os.acctnum,os.avieworigin_refid;Table Description:
(Number of rows : approx > 600,000,000)
Name Null Type
ARTICLEID NOT NULL NUMBER(20)
USERKEY NUMBER(10)
AVIEWORIGIN_REFID VARCHAR2(10)
SUCCESS_IND VARCHAR2(2)
ENTRY_CREATEDDATE DATE
CREATED_BY VARCHAR2(10)
FILENUMBER NUMBER(10)
LINENUMBER NUMBER(10)
ACCTNUM VARCHAR2(10)
AUTOCOMPLETEDTERM NUMBER(2)
REQUESTDATETIME VARCHAR2(19)Explain Plan
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 2224314832
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 590 | 33040 | 2501K (1)| 08:20:15 | | |
| 1 | HASH GROUP BY | | 590 | 33040 | 2501K (1)| 08:20:15 | | |
| 2 | PARTITION RANGE ALL| | 590 | 33040 | 2501K (1)| 08:20:15 | 1 |1048575|
|* 3 | TABLE ACCESS FULL | TABLE1 | 590 | 33040 | 2501K (1)| 08:20:15 | 1 |1048575|
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
3 - filter(UPPER("OS"."SUCCESS_IND")='S' AND CASE WHEN ('FULL'='FULL' AND
"OS"."ENTRY_CREATEDDATE">=TO_DATE(' 2011-04-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
"OS"."ENTRY_CREATEDDATE"<=TO_DATE(' 2011-06-07 00:00:00', 'syyyy-mm-dd hh24:mi:ss')) THEN 1 WHEN
'FULL'='INCR' THEN 1 END =1 AND "OS"."REQUESTDATETIME" IS NOT NULL AND CASE WHEN ('FULL'='FULL'
AND "ODS"."GET_DATE_TIMESTAMP"("REQUESTDATETIME")>=TO_DATE(' 2011-05-01 00:00:00', 'syyyy-mm-dd
hh24:mi:ss') AND "ODS"."GET_DATE_TIMESTAMP"("REQUESTDATETIME")<=TO_DATE(' 2011-05-31 00:00:00',
'syyyy-mm-dd hh24:mi:ss')) THEN 1 WHEN ('FULL'='INCR' AND "OS"."ENTRY_CREATEDDATE">=TO_DATE('
2011-05-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "OS"."ENTRY_CREATEDDATE"<=TO_DATE('
PLAN_TABLE_OUTPUT
2011-05-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss')) THEN 1 END =1 AND "OS"."ACCTNUM" IS NOT NULL AND
"OS"."AVIEWORIGIN_REFID" IS NOT NULL)Edited by: Chaitanya on Jun 9, 2011 2:44 AM
Edited by: Chaitanya on Jun 9, 2011 2:47 AMHi Dom,
Modified Query:
SELECT LAST_DAY(TRUNC(TO_TIMESTAMP(os.requestdatetime, 'yyyymmddhh24:mi:ss.ff4'))) AS summary_date,
os.acctnum,
os.avieworigin_refid,
COUNT(1) cnt_articleview,
SUM(NVL(autocompletedterm,0)) cnt_autocompletedterm
FROM TABLE1 os
WHERE os.acctnum IS NOT NULL
AND os.avieworigin_refid IS NOT NULL
AND os.requestdatetime IS NOT NULL
AND UPPER(os.success_ind) = 'S'
AND (('FULL' = 'FULL'
AND (get_date_timestamp(os.requestdatetime) BETWEEN TO_DATE('01-MAY-2011 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND TO_DATE('31-MAY-2011 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND os.entry_CreatedDate BETWEEN TO_DATE('01-APR-2011 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND TO_DATE('07-JUN-2011 00:00:00','DD-MON-YYYY HH24:MI:SS')
OR ('FULL' = 'INCR'
AND os.entry_createddate BETWEEN TO_DATE('01-MAY-2011 00:00:00','DD-MON-YYYY HH24:MI:SS')
AND TO_DATE('31-MAY-2011 00:00:00','DD-MON-YYYY HH24:MI:SS') ))
GROUP BY LAST_DAY(TRUNC(TO_TIMESTAMP(os.requestdatetime, 'yyyymmddhh24:mi:ss.ff4'))), os.acctnum,os.avieworigin_refid;Execute Plan:
PLAN_TABLE_OUTPUT
Plan hash value: 3615447714
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 25125 | 1374K| | 407K (1)| 01:21:36 | | |
| 1 | HASH GROUP BY | | 25125 | 1374K| 3768K| 407K (1)| 01:21:36 | | |
| 2 | PARTITION RANGE ITERATOR| | 25125 | 1374K| | 407K (1)| 01:21:32 | 29 | 31 |
|* 3 | TABLE ACCESS FULL | TABLE1 | 25125 | 1374K| | 407K (1)| 01:21:32 | 29 | 31 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
3 - filter("OS"."ENTRY_CREATEDDATE">=TO_DATE(' 2011-04-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
UPPER("OS"."SUCCESS_IND")='S' AND "OS"."REQUESTDATETIME" IS NOT NULL AND
"ODS"."GET_DATE_TIMESTAMP"("REQUESTDATETIME")>=TO_DATE(' 2011-05-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
"ODS"."GET_DATE_TIMESTAMP"("REQUESTDATETIME")<=TO_DATE(' 2011-05-31 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
"OS"."ACCTNUM" IS NOT NULL AND "OS"."AVIEWORIGIN_REFID" IS NOT NULL AND "OS"."ENTRY_CREATEDDATE"<=TO_DATE('
2011-06-07 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))Edited by: Chaitanya on Jun 9, 2011 4:51 AM -
Another question - using dynamic value body tag????
Can this be done?
I need to send an ASP dynamic value to my 'open browser
window' pop up.
Something like:
<body
onload="MM_openBrWindow('subscribe_pop.asp?email="&<%(Recordset1.Fields.Item("emailaddres s").Value)%>','','location=yes,width=400,height=200')">
Any ideas?
Thanks
AndyChange what you have to this -
<body onload="@@(onload)@@">
The downside to this method is that your popup link WILL NOT
BE MANAGED. If
you change the name of the page or the location of the page,
you will have
to change the value of this Template parameter, and then save
it to
propagate through the site. Then, of course, you will have to
upload your
local files again.
You do know that this popup will be blocked by modern
browsers, right?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"Andy" <[email protected]> wrote in message
news:[email protected]...
> Morning Dooza - Sorry it's me again ;-)
>
> Well i've part way through this but seem to have created
another problem.
> When i used the 'make attribute editable' the code
generated on the page
> that launches the pop up was:
> -----------
> <!-- InstanceEndEditable --><!--
InstanceBeginEditable name="head" -->
> <!-- InstanceEndEditable --><!-- InstanceParam
name="onload" type="text"
>
value="P7_initPM(0,0,1,-20,10);MM_openBrWindow('subscribe_pop.asp?custemail=<%=(Customers RS.Fields.Item("CustomerEmail").Value)%>','','location=yes,width=400,height=200')"
> -->
> </head>
>
> <body onload="P7_initPM(0,0,1,-20,10)">
> --------
>
> It didn't put the 'MM_openBrWindow' code in the Body
Tag, only in the
> 'InstanceParam name'
> I opened the page up in note pad and added it manually
and all the code
> worked as it should.
>
> The problem now is that when i change the template, my
page isn't updated
> at all.
>
> Before i used 'make attribute editable' my Body Tag
contained just the
> <body onload="P7_initPM(0,0,1,-20,10)">
>
> Any ideas??
>
> Thanks
> Andy
>
>
>
>
> "Dooza" <[email protected]> wrote in message
> news:[email protected]...
>> Andy wrote:
>>> Hi Dooza
>>>
>>> I'm still not getting the value passed to the
pop up :-(
>>>
>>> I followed the steps below and the page passing
the email address is
>>> producing the correct email.
>>> The subscriber page is still giving the Either
BOF or EOF is True error.
>>>
>>> I tried the subscriber page (local url) using
subscribe_pop.asp?ID=516
>>>
>>> 516 is my email address. The recordset on the
subscribe_pop.asp page
>>> pulls the email address based on the ID.
>>>
>>> For some reason this code just isn't sending the
value.
>>>
>>>
>>>
"P7_initPM(0,0,1,-20,10);MM_openBrWindow('subscribe_pop.asp?ID=<%=(CustomersRS.Fields.Ite m("CustomerEmail").Value)%>','','location=yes,width=400,height=200')"
>>>
>>> Really scratching my head now
>>
>> When you view the page in your browser that launches
the pop up, what
>> does the source look like for the body tag?
>>
>> Hang on, your passing the email address as the ID?
Are you sure you want
>> to do that? Don't you want to pass the ID? Maybe
thats where you are
>> going wrong?
>>
>> Dooza
>> --
>> Posting Guidelines
>>
http://www.adobe.com/support/forums/guidelines.html
>> How To Ask Smart Questions
>>
http://www.catb.org/esr/faqs/smart-questions.html
>
> -
Using if logic in the where clause of a select statement
I have a select clause. And in the select clause there is a variable all_off_trt that can be 'Y' or 'N'.
In the where clause I want to make it so that if a form variable is checked and all_off_trt is 'Y' then
exclude it else if the form variable isn't checked then select it no matter what all_off_trt is.
Is there any way to include either and if statement or a case statement within the where clause to acheive this? If not is there another way of doing it?
Basically I am looking for a case statement like this
case
when all_off_trt = 'Y' and mail_para.code = 'Y' then false
else true
end
Message was edited by:
Tugnutt7Ok, so that really doesn't solve my problem. I have 3 different fields that I need to do that with. Each combining in a select statement to print an email list, as well as other thing limiting the where clause.
This is currently what I have, tested and working 100%.
cursor email_cur is
select unique p.email,s.all_off_trt,s.all_deceased,s.no_enroll
from participant p, trialcom t, ethics s
where p.status='A'
and p.surname=t.surname
and p.initials=t.initials
and s.trial_cd = t.tricom
and s.centre = t.centre
and p.email is not null
and (t.centre in (select code from mail_parameters where user_name=user and mail_para='CENTRE')
or 'XX' in (select code from mail_parameters where user_name=user and mail_para='CENTRE'))
and (t.tricom in (select code from mail_parameters where user_name=user and mail_para='TRIAL')
or 'XX' in (select code from mail_parameters where user_name=user and mail_para='TRIAL'))
and (t.role in (select code from mail_parameters where user_name=user and mail_para='ROLE')
or 'XX' in (select code from mail_parameters where user_name=user and mail_para='ROLE'))
and (p.country in (select code from mail_parameters where user_name=user and mail_para='COUNTRY')
or 'XX' in (select code from mail_parameters where user_name=user and mail_para='COUNTRY'))
and (t.represent in (select code from mail_parameters where user_name=user and mail_para='REPRESENT')
or 'XX' in (select code from mail_parameters where user_name=user and mail_para='REPRESENT'));
This is in a program unit that runs when a button is clicked. At the end of that I need to add on the 3 case statements that help further narrow down the selection of emails to be printed. Then it prints the emails selected from this statement into a file. So it has to be done right in the select statement. The three table variables are the all_off_trt, all_deceased, and no_enroll. The form has 3 checkboxes. One for each, that when checked (giving the variable associated with the checkboxes a value of 'Y') excludes all emails that have a 'Y' in the coresponding table variable. -
Trouble using a function in the where clause
Hello,
I am using a function found at ask.tom.oracle.com which converts a long data type to a character. The function is returning an error when it is placed in the where clause. The sql statement , error message and the function from ask tom are shown below. Does anyone know how to fix this?
<pre>
SELECT A.FLDPHYSICAL,
A.FLDEXPOSURE,
A.FLDDATEDUE,
A.FLDDATELAST,
A.FLDEMPLOYEE,
B.FLDBDATE,
B.FLDMAILSTOP,
B.FLDREC_NUM,
B.FLDLNAME,
B.FLDMI,
B.FLDFNAME,
B.FLDBDATE,
B.FLDDEPT,
B.FLDSTATUS,
B.FLDSSN,
B.FLDHOMEPHON,
B.FLDWORKPHON,
B.FLDID,
B.FLDDIVISION
FROM REQEXAM A,
EMPLOYEE B,
EMPLOYEE_MEMO C
WHERE A.FLDEMPLOYEE = B.FLDREC_NUM
AND b.flduserstr = c.fldrec_num
AND OHM_PKG.GET_LONG('EMPLOYEE_MEMO', 'FLDDATA', C.ROWID) LIKE '%CDL YES%'
AND A.FLDDATEDUE > '01/01/1900'
AND A.FLDPHYSICAL ='CDP'
ORDER BY B.FLDDIVISION,
B.FLDLNAME,
B.FLDFNAME,
B.FLDMI,
A.FLDDATEDUE
The error message
Error at Command Line:26 Column:4
Error report:
SQL Error: ORA-00904: "OHM_PKG"."GET_LONG": invalid identifier
00904. 00000 - "%s: invalid identifier"
create or replace
PACKAGE OHM_PKG AS
/* TODO enter package declarations (types, exceptions, methods etc) here */
function getlong( p_tname in varchar2,p_cname in varchar2,p_rowid in rowid ) return varchar2;
END OHM_PKG;
create or replace
PACKAGE BODY OHM_PKG AS
function getlong( p_tname in varchar2,p_cname in varchar2,p_rowid in rowid ) return varchar2 as
l_cursor integer default dbms_sql.open_cursor;
l_n number;
l_long_val varchar2(4000);
l_long_len number;
l_buflen number := 4000;
l_curpos number := 0;
begin
dbms_sql.parse( l_cursor,
'select ' || p_cname || ' from ' || p_tname ||
' where rowid = :x',
dbms_sql.native );
dbms_sql.bind_variable( l_cursor, ':x', p_rowid );
dbms_sql.define_column_long(l_cursor, 1);
l_n := dbms_sql.execute(l_cursor);
if (dbms_sql.fetch_rows(l_cursor)>0)
then
dbms_sql.column_value_long(l_cursor, 1, l_buflen, l_curpos ,
l_long_val, l_long_len );
end if;
dbms_sql.close_cursor(l_cursor);
return l_long_val;
end getlong;
END OHM_PKG;
</prev>Remove the '_' from the function's name as below:
AND OHM_PKG.GETLONG('EMPLOYEE_MEMO', 'FLDDATA', C.ROWID) LIKE '%CDL YES%' -
How to pass the values to the WHERE-Clause in JClient ADF?
Hi all,
my JDeveloper Version is 10.1.2.0.0 (Build 1811)
I need something like this:
A Form with a Filter-Panel, and the Table-Panel EMP.
In Filter:
1. DEPTNO as ComboBox with values from the DEPT table (not static values). The ComboBox should contain all deptno's from DEPT and one NULL value too, so the user can be able to select this NULL-value and get all employees from all depatments.
2. TextField Job - not the database field - not required. The user should be able to enter in this field any JOB and get the Employees for selected deptno (or for all departments by selecting NULL-value) in combobox with the needed job. When the user does not enter anything in the TextField then he should get all Employees from the department from combobox.
In Table-Panel:
JTable for EMP.
What I try to do:
1. Create an Application Workspace with "Java Application [default]" as Application Template.
2. For Model-Package: New -> Business Components -> Business Components from Tables
3. On the "Entity Objects from Tables"-page of wizard I shuttle DEPT and EMP from available to selected.
4. On the "Updatable View Objects from Entity Objects"-page I shuttle the both view objects from availabe to selected.
5. On the "Read-Only View Objects from Tables"-page I do not select anything
6. Create the AppModule on the "Appication Module"-page.
7. Test the AppModule -> all is OK.
8. Create the next ViewObject "DeptNew" with read-only access and Query: "SELECT DEPTNO FROM DEPT".
9. Then I create a new attribute "JOB" for this ViewObject with Type String and Updatable: Always.
10. Create a VeiwLink "DeptNewLink", on the "View Objects"-page: Cardinality -> 1 to 1.
11. Source Attribute: DeptNew DeptNo -> Destination Attribute EmpView Deptno and click on Add
12. Source Attribute: DeptNew Job -> Destination Attribute EmpView Job and click on Add.
13. Edit the AppModule to add my DeptNew and DeptNewLink.
When I test the AppModule and double click on the DeptNewLink then I can enter the 20 in the DEPTNO and CLERK in the JOB and see the result in the Table.
Now I create the Master-Detail Form (at first without combobox) with wizard:
1. As Master I select the DeptNew1, as Detail EmpView3.
2. "Selected Attributes for Master" - Deptno, job.
3. "Selected Attributes for Detail" - all attributes.
Now I test my form in Query Mode:
Enter 20 to the DEPTNO field and enter CLERK to the JOB field. After Execute Query I get:
"JBO-27122: SQL-Fehler bei Vorbereitung der Anweisung. Anweisung: SELECT * FROM (select deptno from dept) QRSLT WHERE ( ( (DEPTNO = 20) AND (VIEW_ATTR LIKE 'CLERK') ) )"
Why VIEW_ATTR how to change it to JOB?
What have I done false?
Please help me to create the combobox with the above listed requirements.
RegardsI'd go about this a little differently (probably not the best way):
1. Create view object lk_department (lookup). In the query add a union with something like "select null as ID, 'All' as name' from dual;". This adds a null value that they can select by leaving the combo box on "All". Add a 'order by id" so the null value is the first one. When creating the combo box you want it set to navigation mode, so select the whole viewobject from the data palette rather a specific field.
2. Create a jTextField for the "Jobs" field.
3. Create an application module method that does something like:
public void filterEmployees(String job){
ViewObject vo_departments = findViewObject("lk_departments");
ViewObject vo_employees = findViewObject("employees");
String wc = "1 = 1 ";
String wc = " and job like '%"+job+"%'"
if (vo_departments.getCurrentRow().getAttribute("Id") != null) {wc += "and department_id = "+vo_departments.getCurrentRow().getAttribute("Id");}
vo_employees.setWhereClause(wc);
vo_employees.executeQuery();
this.sync;
4. In your Jclient app, you just need to call the method of your appmodule and insert the string from the textbox, using code similar to this:
AppModule b = (AppModule)panelBinding.getApplicationModule();
b.filterEmployees(jTextField.getText());
I didn't test this code, but that's how I go about the same thing.
Maybe you are looking for
-
I have an X1 Carbon. Usually when i raise or decrease the screen brightness i had an on screen indicator showing me how much i decreased ot increasing either of the obove.. Now, when i do the same actions nothing apears.. can any one give me a hand?
-
ABAP program to run in Background job
Hi, We have a custumized program (SO Creation) calling some functions (like: WS_QUERY, WS_UPLOAD, WS_DOWNLOAD, CREATE_TEXT and CALL TRANSACTION VA01) and can only run thru dialog process (foreground). Is it possible to convert it to something that c
-
Obsolete function module in ECC 6.0 - BAPI_COSTESTIMATE_CREATE_SPLIT
Hi Guys, The above function module obsoleted in ECC 6.0, I need related function module in ECC 6.0. Could you please suggest me, which is the related function module in ECC 6.0? Please take a high priority. Advance thanks guys. Thanks, Gourisankar.
-
How to utilize index in selection statement
hi how to utilize index in selection statement and how is it reduces performance whether another alternative is there to reduce performance . thanks
-
Cut and paste from text field not working in early access JRE 1.90-ea-b38
I noticed that cut and paste no longer works with JRE 1.9 on Windows 7 professional. Anyone else having that problem? I haven't posted a bug reports since the Sun days, is there still a place to post bugs?