Display checkbox for VARCHAR2(1) column
Hi, I'm getting all of my stupid questions out this week...
I have a table with a VARCHAR2(1) column that I restrict to 'Y' or NULL to make a boolean/flag column.
How do I get JDeveloper/ADF to treat this as a boolean column and display a checkbox?
In Oracle Designer you could flag the field as boolean and the value 'Y' as checked. Not sure how to do this in JDeveloper.
Gordon,
All stupid questions are welcome if they are properly specified ;)
In your case Create an EO/VO. Attach it to a AM. A Data Control will be created. YOu can then use the attribute in your page and dispaly it as a selectBooleanCheckBox.
Google for how to create EO/VO/AM and Data Control.
Similar Messages
-
With out selecting the Row, display Dropdown for a perticular column
Hi,
i have a requirement to display dropdown to perticular column in a Tableview.
is it posible.....?
Regards,
BrahmajiHi,
The value of the TextEdit inside a Tableview, can be got by using the same method that you use it outside the tableview.
If you know the id of the Textview, then you could get the data inside the textview easily.
All the form fileds will be stored in form_fields table that is stored in the request object.
This also implies that the textedit value will also be stored inside the form_fields array.
The textedit value can be read from this internal table using the below syntax.
The syntax for reading the textedit value is below...
data: lv_string type string,
lv_te_iid type string.
lv_te = 'te1'.
lv_string = request->get_form_field( NAME = lv_te ).
The id of the textedit should be assigned by you, during the factory method. Say for example te_1_1 i.e. te_<row_number>_<column_no>
Later in the event handler based on the no. of questions, you could loop and form the id of the text_edit and get the value of the text edit and store the value of the textEdit in the internal table based on the row index.
Hope it helps.!
Regards,
Maheswaran
Edited by: Maheswaran B on Nov 6, 2009 10:00 PM
Edited by: Maheswaran B on Nov 6, 2009 10:02 PM -
Checkbox for only addrow column - Urgent
Hi,
I have a requirement to add check box against the columns which are added when on click of add row button.
The rows which are previously added and saved shouldnt have this check box.
Unsaved or newly added rows should have this check box. How to add this feature.
please help.Hi,
You can use switcher region for this requirement. Using this, you can disable or enable the check conditionally.
Refer below link to implement switcher region:
http://www.learningapps.info/2012/06/oaf-switcher-region-how-to-use-it.html
--Sushant -
How to display total for a column in updateble report
How can I display total on a report column?
the query is
select htmldb_item.checkbox(1,invoice_id) invoice_id,
htmldb_item.DISPLAY_AND_SAVE(2,invoice_no,15)invoice_no,
htmldb_item.DISPLAY_AND_SAVE(3,to_char(invoice_date, 'DD-MON-YYYY'),20) invoice_date,
htmldb_item.DISPLAY_AND_SAVE(4,net_amount,15) NET_AMOUNT,
htmldb_item.text(5,net_amount,null,10) amount_adj,
htmldb_item.text(6,net_amount,null,10) actual_amt
from INVOICE
where OWNER_TYPE = 'CUSTOMER'
and OWNER_ID = :P57_CUSTOMER_NAME
group by invoice_id,invoice_no, invoice_date,net_amount
In the report column attributes the sum column is checked for the sal field
When I run the report, I get a Sub-total of 0 and a Report Total of 0. What am I doing wrong?
thanksSunil,
Which column is the sal column? I canât see any numeric columns in your query. If you use htmldb_item calls in your query column, then this makes them strings and you canât build sums on string columns. If you want to build sums in an updateable report / tabular form, then donât use the htmldb_item API. Instead use the built-in display types on the report column attributes page. Using the built-in display types is the better options in most cases anyway and they do allow you to calculate sums even if the column is a text field or display and save type field.
Regards,
Marc -
Strange behaviour in alv output display for a date column!
hi friends,
my alv output list display contains a column for budat (posting date), if this field has no value, then it displays a blank cell (space) in the output in my user login...but when the same report is run in another user login, even though the value of the column is null, it displays 00000000 (8 zeroes) rather than displaying a blank cell...i have set the field catalog property NO_ZERO = 'X'; is this property has anything to do with authorization to achieve its funcionality? am not sure...this is strange, as it is the same report, same field catalog that is being used..need some inputs on this
thanks in advance
SathishThere are 2 solutions for an adhoc solution you can change the field to a char10 field, this will solve your immediate problem of the 0 display. For a permanent solution you can check the user profile setting for the date for you as well as the concerned user.
Hope That Helps
Anirban M. -
Display one or more rows for a particular column in alv grid display
Hi,
My requirement in the report is to display users for a particular workitem id.If a workitem is in the inbox of one or more users(approvers) i have to display all the user names in one field in alv grid output (output-approver id).There are other fields which display details of the workitem also.
Is there a way to populate multiple rows for a single column or creating one more internal table for users in the alv output table.
Please suggest.
regards,
Sravanthi ChilalALV only can show flat internal table data.
you should set a sort on the field which you want to show only once.
Then on the output of the ALV, the field with the same value will show only once. -
How to display a Sum field for a formula column?
Hi,
I need to display a sum for a formula column at the end of report. for example: my formu_col=col_1-col_2
col_1 col_2 formu_col
3 1 2
6 5 1
total:sum(col_1) sum(col_2) sum(formu_col)
now i have sum(col_1) and sum(col_2), but i don't have sum(formu_col)
thanksHi
You may add a summary column in the same data group that you have sum(col_1) and sum(col_2). In that properties of the new column point the source as formu_col.
Hope this helps.
Fouwaaz -
How to insert the checkbox as a separate column in alv grid display
Hi
How to insert the checkboxes as a separate column in alv grid display with using the reuse_alv_fieldcatlog_mege.
example
matnr maktx ersda checkbox
10 books 28/03/2009 checkbox
Thanks
chinnuHi,
Check the following code.
TYPE-POOLS: slis.
TYPES:
BEGIN OF ty_output,
chk TYPE c,
number TYPE i,
name(20) TYPE c,
END OF ty_output.
DATA: gt_output TYPE STANDARD TABLE OF ty_output,
gs_output TYPE ty_output.
DATA: wa_layout TYPE slis_layout_alv.
DATA: it_fieldcatalog TYPE slis_t_fieldcat_alv,
After you populate the data, build the field catlog like shown below.
wa_fieldcatalog TYPE slis_fieldcat_alv.
wa_fieldcatalog-fieldname = 'CHK'.
wa_fieldcatalog-outputlen = '3'.
wa_fieldcatalog-col_pos = '1'.
wa_fieldcatalog-seltext_m = 'CHK'.
wa_fieldcatalog-checkbox = 'X'.
wa_fieldcatalog-edit = 'X'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
wa_fieldcatalog-fieldname = 'NUMBER'.
wa_fieldcatalog-outputlen = '10'.
wa_fieldcatalog-col_pos = '2'.
wa_fieldcatalog-seltext_m = 'NUMBER'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
wa_fieldcatalog-fieldname = 'NAME'.
wa_fieldcatalog-outputlen = '10'.
wa_fieldcatalog-col_pos = '3'.
wa_fieldcatalog-seltext_m = 'NAME'.
APPEND wa_fieldcatalog TO it_fieldcatalog.
CLEAR wa_fieldcatalog.
wa_layout-box_fieldname = 'CHK' .
wa_layout-box_tabname = 'GT_OUTPUT' .
Now call the FM
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMMAND_GRID'
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = wa_layout
it_fieldcat = it_fieldcatalog
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
* IT_SORT =
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* IS_PRINT =
* IS_REPREP_ID =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* I_HTML_HEIGHT_TOP =
* I_HTML_HEIGHT_END =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_output
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Range check for numeric values in varchar2 type column
SQL oracle 10g windows XP
I have a table which has column of type varchar2 e.g
create table osa_gms_mailbox(reg_address varchar2(60),bin_address varchar2(60));
let us insert some sample rows:
insert into osa_gms_mailbox values ('8000','8000');
insert into osa_gms_mailbox values ('9000','9000');
insert into osa_gms_mailbox values ('[email protected]','[email protected]');
If i try to run the query :
select reg_address from (
select reg_address from osa_gms_mailbox
MINUS
select reg_address from osa_gms_mailbox where
regexp_like(reg_address,'^[a-z]+|[A-Z]+$')) temp
where to_number(temp.reg_address) between 1000 and 10000;
or
select reg_address from (
select reg_address from osa_gms_mailbox
MINUS
select reg_address from osa_gms_mailbox where
regexp_like(reg_address,'^[a-z]+|[A-Z]+$'))
where to_number(reg_address) between 1000 and 10000;
it gives ORA-01722: invalid number .
how can i get the numeric comparision done for varchar2 field and exclude the rows which have atleast one alphabet (a-z,A-Z)
ThanksHi
Please check this sample , it may useful to you
/*Creating a Table*/
Create Table CHECKVARCHAR( CheckValue Varchar2(20) );
/* Inserting values in to the column with numbers and Strings */
Insert into CHECKVARCHAR Values ( 1000 );
Insert into CHECKVARCHAR values ( 2000 );
Insert into CHCEKVARCHAR values ( 10000 );
Insert into CHECKVARCHAR values ( 'Abc' );
Insert into CHECKVARCHAR values ( 'zyx' );
/*Here is the Query to avoid Invalid Number */
Select * from
( Select CheckValue
from Checkvarchar
where Ascii( Substr( CheckValue,1,1 ) ) not between 65 and 122 )
where CheckValue between 1000 and 10000; -
Reports - Passing checkbox values and conditional column visibility
Although I've been using Oracle databases for many years, I've to admit I'm rather new to APEX. I'm building a first prototype project to convince our project leaders and managers of the usefulness of the product for future projects (as for visual Database interfaces where the accent is on forms and reporting, it will often be faster and less expensive to build an APEX application instead of a full blown Java or C# webapp).
I'm however encountering some problems.
Let me start with a quick description. I've the following parent/child structures:
Provinces > Cities > Intersections > Loops > Loop Detections.
I basically want to make a report on the loop detections. Now, considering we'll have many thousands of detections a day, I made kind of a drilldown structure. You first choose your province, then the city, then the intersection and finally the loop. I didn't use lists to make the selection. Instead I made a (classic) report for each part as this allows me to give detailed information for each part. In each report, I made a link on the identifier. For example, when I select a province (by clicking on the link), I pass the province identifier to the cities report and use it in the query to limit my report to those cities for the given province. I repeat these step for the different parts, which in the end, gives me the loop detections for the selected loop. The good news is all this works fine. The person who'll be using this application however made a suggestion and asked if it would not be possible to select different loops and as such get the detections for several loops (the rest of the application stays the same). This however means I cannot use the column link anymore. Now, I was thinking in the direction of a checkbox. The column link is still there, but the user would also have the possibility to select several items in the report. I managad to add a checkbox to the report, linked to the loop identifier column. That's not exactly difficult. I cannot figure out however, how I can pass the selected identifiers to the next report (detections for the selected loops) and use it in the underlaying query of this report. The problem is, I don't know how to pass the checked values to the next page and how to use these values in the report query of that page. I suppose this must be possible, but I couldn't figure out how. I tried playing around with APEX_APPLICATION.G_Fxx and such. Remember I'm a newbie and this seems to fall under more advanced features.
I've uploaded images of the 2 concerning report pages for illustration:
http://img96.imageshack.us/img96/1497/apex01.jpg
http://img140.imageshack.us/img140/9868/apex02.jpg
A second point that's bothering me is the following. In the loop detection report I show a colum link (I picked an icon instead of the column value) for each row. I also have a column that shows the number of detections for the given loop (and day). Now, for some loops, there are no detections for that given day. As such, there's no point in selecting this loop, as the result will be an empty report. However, I still want to show the loop in the loop selection report, as it's still present (it's not as if it suddenly disappeared). Sure, no big problem and most users probably have sufficient intelligence to figure this out. However, it would be nice if I could make the icon (colum link) visible only for those loops that have detections, or in other words, for those records where number_of_detections (underlaying column COUNT) is greater than 0. I couldn't figure out a way to do this either. The Conditional Display option for a column didn't really offer me a solution here.
Before I forget, I'm using APEX 4.0.1 on an Oracle XE database.
Any tips or suggestions would be welcome! :)
Thanks.
ErwinHi,
You mean something like in this sample
https://apex.oracle.com/pls/otn/f?p=40323:55
You can store checked values to collection and use it then in another report where clause
See e.g. this post for how you can store checked rows to collection
Re: Need help with APEX_Collection
In sample DEPT report query is
SELECT
CASE WHEN EXISTS(SELECT 1 FROM emp e WHERE e.deptno = d.deptno) THEN
APEX_ITEM.CHECKBOX(1,c.c002,'onclick="saveDeptChk(this,'||c.seq_id||')"','true')
END AS row_selector,
c.c002 AS checked,
d.DEPTNO,
d.DNAME,
d.LOC
FROM dept d,
apex_collections c
WHERE c.collection_name = 'DEPT_CHK_COLLECTION'
AND d.deptno = c.c001And EMP report
SELECT e.EMPNO,
e.ENAME,
e.JOB,
e.MGR,
e.HIREDATE,
e.SAL,
e.COMM,
e.DEPTNO
FROM emp e,
apex_collections c
WHERE c.collection_name = 'DEPT_CHK_COLLECTION'
AND c.c002 = 'true'
AND e.deptno = c.c001Regards,
Jari -
Advice on creating VARCHAR2(4000) columns
Hi there
I've a question regarding table(s) design. Following is a table, which has about 10,000 rows.
As you can see there are two VARCHAR2(2000) columns.
All rows have these columns with data which are always "full" (avglength = 2000).
CREATE TABLE L_PROC
NUM NUMBER(9) NOT NULL,
TEC VARCHAR2(10 BYTE) NOT NULL,
ATE DATE NOT NULL,
PRO NUMBER(4) NOT NULL,
NPR NUMBER(7) NOT NULL,
DOC NUMBER(2) DEFAULT 0 NOT NULL,
COC NUMBER(2) DEFAULT 0 NOT NULL,
FOC NUMBER(2) DEFAULT 0 NOT NULL,
SIT CHAR(1 BYTE) NOT NULL,
EST CHAR(1 BYTE) DEFAULT 'A' NOT NULL,
DEN DATE NOT NULL,
SOL NUMBER(9) NOT NULL,
LOC VARCHAR2(80 BYTE),
CEE NUMBER(3),
CTE VARCHAR2(10 BYTE),
DEC NUMBER(2) DEFAULT null,
DIA VARCHAR2(2000 BYTE),
RES VARCHAR2(2000 BYTE),
OUT VARCHAR2(80 BYTE),
NTS VARCHAR2(80 BYTE),
ETS VARCHAR2(40 BYTE),
DAL TIMESTAMP(6) NOT NULL
When record is created in table, DIA is always filled. Then RES will be updated later.
Now end-users ask for modification which consists in alter these two column to VARCHAR2(4000).
I'm thinking on create these two columns in a separated table (perhaps using blob or clob), but I'd like to have some advice on this.
I'm a bit worried about chained rows.
Can you help me on this ? What solution do you think is better ?
Thank you in advance.
Best Regards,
HelenaReplying to Maurice questions:
do you mostly access your table via index or full table scan?
mostly via index
how many rows do you access when you execute a select against this table?
using users criteria the first step is to perform a select count(*) using that criteria; table data is displayed to the user if the result of count(*) is <= 100 rows
how often do you query the RES and DIA columns?
never queried, but always displayed; that means never used in WHERE clauses
how often are inserts and updates executed against this table?
about 100/day inserts and the same number of updates (which are performed by another user later)
which is you DB block size?
16 KB
which is the average sizes of the columns RES and DIA?
1900 (will probably increase +1000 chars)
do you have currently any kind of performance bottleneck (IO/CPU)?
not yet...
Helena -
No Checkbox For Head of Organizational Unit
Dear Experts,
I customized one relation which copied from A003/B003 and add in evaluation path.
I can use the relation and create a position in PPOME.
However, there is no checkbox for Head of Organizational Unit.
Are there anything I didn't do in IMG?
Thanks in advance.Hello,
In order to display the tab strip "basic data" in the detail area of transaction PPOME various infotypes come into play, e.g. infotype 1000,1001 with subtypes B007, A008, A012, and infotype 1002 and 1007, just to mention some of them.
All of these infotypes and subtypes may carry different validity dates,and usually these dates are taken into account when calculating the periods displayed in the right part of the detail screen.
But with infotype 1001, subtype A012 (managing relationship) it has been decided to handle the periods in a different way. Since those relationships may also point from the current position to a completely different organizational unit, very complex situations may occur. This is the reason why in certain cases, where the periods calculated from the validity dates of the other infotypes/subtypes do not match the validity period or taget org unit of the A012 relationship, the checkbox "manages org unit" may be checked but is grayed out.
There are more exact ways to view and maintain the managing relationship: In the overview area, you can jump to the view "Managerial assignment" where you can directly maintain relationship A012, using the relationship validity display of our "column framework" (click on the right button "column comfiguration" and activate "Link period").
Hope this help
Sarah -
Oracle SP for comparing 80 column values across 8 table pairs in 2 diff DBs
Hi All,
I have an Oracle SP for comparing 80 column values across 8 table pairs in 2 diff DBs.
However, it is taking hell lot of time around 6hours to process 10,000 records.
Can anyone suggest how to fine-tune this?
Thanks guys.Tables prefixed with X are the temp tables to store data of DB-A.
The report will be originally based on DB-B, so DB Links will not be required for @PROD1.WORLD tables.
This is a test region, so I have pointed to @PROD1.WORLD to test with Prod Data.
SEC_COMPARE_CONFIG is the config table containing the table_name to be reported, corresponding temp tables to store the data and the columns on which it is to be reported.
There are in total 8 tables- 90 rows and 8 temp tables.
SPOKE_TO_HUB_SEC_MTCH_TBL records the securities on which it is to be reported.
HIST_DATA_COMPARE_TBL is the final results table.
Here is the entire code:
CREATE OR REPLACE PACKAGE SECURITY_COMPARE AS
PROCEDURE PROCESS_RECORDS (IN_EFFECTIVE_DATE IN DATE,
IN_PRIMARY_ASSET_ID IN VARCHAR2 DEFAULT NULL);
PROCEDURE IDENTIFY_SECURITIES ( P_EFFECTIVE_DATE IN DATE,
P_PRIMARY_ASSET_ID IN VARCHAR2 DEFAULT NULL);
PROCEDURE RETREIVE_RECORDS_FROM_SPOKE;
PROCEDURE COMPARE_RECORDS(p_err_msg OUT VARCHAR2);
PROCEDURE INSERT_DATA_TO_TABLE ( v_target_table VARCHAR2, v_sql_to_run VARCHAR2, v_commit_after NUMBER);
END SECURITY_COMPARE;
CREATE OR REPLACE PACKAGE BODY SECURITY_COMPARE AS
/*Declared String for recording Dynamic SQL's*/
LC_SQL VARCHAR2 (20000);
PROCEDURE PROCESS_RECORDS(IN_EFFECTIVE_DATE IN DATE,
IN_PRIMARY_ASSET_ID IN VARCHAR2 DEFAULT NULL)
AS
L_EFF_DATE DATE;
L_PRIMARY_ASSET_ID VARCHAR2(100);
k_err_msg VARCHAR2(100); --Error message displayed in case of NO discretionary records found.
BEGIN
L_EFF_DATE := IN_EFFECTIVE_DATE;
L_PRIMARY_ASSET_ID := IN_PRIMARY_ASSET_ID;
IDENTIFY_SECURITIES(L_EFF_DATE,L_PRIMARY_ASSET_ID); --Calling the Identify_Securities procedure to identify the securities older by 90 days from report effective date
RETREIVE_RECORDS_FROM_SPOKE(); --Retreiving the historic records from the security tables into temporary tables.
COMPARE_RECORDS(p_err_msg=>k_err_msg); --Compare the records and report the discrepencies into HIST_DATA_COMPARE_TBL table
END PROCESS_RECORDS;
PROCEDURE IDENTIFY_SECURITIES(P_EFFECTIVE_DATE IN DATE,
P_PRIMARY_ASSET_ID IN VARCHAR2 DEFAULT NULL)
AS
P_EFF_DATE DATE; --Effective Date of the report
P_PRIMARY_ID VARCHAR2(100); --Primary AssetID which is used to search based on specific security
v_target_table VARCHAR2(500); --Variable indicating the Target table for inserting the data
v_sql_to_run VARCHAR2(5000); --Variable to store the Dynamic SQL to be executed
v_commit_after NUMBER; --Variable to define after how many records is COMMIT to be done
BEGIN
LC_SQL :='';
P_EFF_DATE := P_EFFECTIVE_DATE;
P_PRIMARY_ID := P_PRIMARY_ASSET_ID;
/*Deleting Old Entries from SPOKE_TO_HUB_SEC_MTCH_TBL table*/
LC_SQL := 'TRUNCATE TABLE SPOKE_TO_HUB_SEC_MTCH_TBL';
EXECUTE IMMEDIATE LC_SQL;
IF(P_PRIMARY_ID is NULL) --In case records do not need to be identified on basis of specific security
THEN
/*Identify Securities older by 90days from report effective date*/
v_target_table := ' SPOKE_TO_HUB_SEC_MTCH_TBL';
v_sql_to_run := 'WITH T AS ('||
' SELECT R.PRIMARY_ASSET_ID PRIMARY_ASSET_ID_R,'||
' R.SECURITY_ALIAS SECURITY_ALIAS_R,'||
' R.LAST_HELD_DATE LAST_HELD_DATE_R,'||
' R.PREV_HELD_DATE PREV_HELD_DATE_R,'||
' Q.PRIMARY_ASSET_ID PRIMARY_ASSET_ID_Q,'||
' Q.SECURITY_ALIAS SECURITY_ALIAS_Q,'||
' COUNT(*) OVER(PARTITION BY Q.PRIMARY_ASSET_ID) CNT'||
' FROM [email protected] R,'||
' [email protected] Q'||
' WHERE SYS_OP_MAP_NONNULL(R.last_held_date) <> '||q'!'FF'!'||
' and ceil(R.last_held_date-to_date('||''''||P_EFF_DATE||''''||')) >= 0'||
' and ceil(R.last_held_date-to_date('||''''||P_EFF_DATE||''''||')) <= 60'||
' and R.PRIMARY_ASSET_ID=Q.PRIMARY_ASSET_ID'||
' )'||
' SELECT PRIMARY_ASSET_ID_R,'||
' SECURITY_ALIAS_R,'||
' LAST_HELD_DATE_R,'||
' PREV_HELD_DATE_R,'||
' PRIMARY_ASSET_ID_Q,'||
' SECURITY_ALIAS_Q'||
' FROM T'||
' WHERE CNT =1';
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
ELSE
v_target_table := ' SPOKE_TO_HUB_SEC_MTCH_TBL';
v_sql_to_run := 'WITH T AS ('||
' SELECT R.PRIMARY_ASSET_ID PRIMARY_ASSET_ID_R,'||
' R.SECURITY_ALIAS SECURITY_ALIAS_R,'||
' R.LAST_HELD_DATE LAST_HELD_DATE_R,'||
' R.PREV_HELD_DATE PREV_HELD_DATE_R,'||
' Q.PRIMARY_ASSET_ID PRIMARY_ASSET_ID_Q,'||
' Q.SECURITY_ALIAS SECURITY_ALIAS_Q,'||
' COUNT(*) OVER(PARTITION BY Q.PRIMARY_ASSET_ID) CNT'||
' FROM [email protected] R,'||
' [email protected] Q'||
' where R.PRIMARY_ASSET_ID='||''''||P_PRIMARY_ID||''''||
' and R.PRIMARY_ASSET_ID=Q.PRIMARY_ASSET_ID'||
' )'||
' SELECT PRIMARY_ASSET_ID_R,'||
' SECURITY_ALIAS_R,'||
' LAST_HELD_DATE_R,'||
' PREV_HELD_DATE_R,'||
' PRIMARY_ASSET_ID_Q,'||
' SECURITY_ALIAS_Q'||
' FROM T'||
' WHERE CNT =1';
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
END IF;
LC_SQL := 'TRUNCATE TABLE HIST_DATA_COMPARE_TBL';
EXECUTE IMMEDIATE LC_SQL;
END IDENTIFY_SECURITIES;
PROCEDURE RETREIVE_RECORDS_FROM_SPOKE
AS
v_target_table VARCHAR2(500);
v_sql_to_run VARCHAR2(5000);
v_commit_after NUMBER;
BEGIN
LC_SQL :='';
LC_SQL:= 'TRUNCATE TABLE X_SECMASTER_HISTORY_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_SEC_MASTER_DTL_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_SECMASTER_DTL_EXT_HST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_EQUITY_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_EQUITY_DETAIL_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_FIXED_INCOME_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_FIXED_INCOME_DTL_EXT_TBL';
EXECUTE IMMEDIATE LC_SQL;
LC_SQL:= 'TRUNCATE TABLE X_DERIVATIVES_HIST_TBL';
EXECUTE IMMEDIATE LC_SQL;
/*SECMASTER_HISTORY*/
v_target_table := 'X_SECMASTER_HISTORY_TBL';
v_sql_to_run := ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*SECURITY_MASTER_DETAIL_HIST*/
v_target_table := 'X_SEC_MASTER_DTL_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*SECMASTER_DETAIL_EXT_HIST*/
v_target_table := 'X_SECMASTER_DTL_EXT_HST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*EQUITY_HIST*/
v_target_table := 'X_EQUITY_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*EQUITY_DETAIL_HIST*/
v_target_table := 'X_EQUITY_DETAIL_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*FIXED_INCOME_HIST*/
v_target_table := 'X_FIXED_INCOME_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*FIXED_INCOME_DETAIL_EXT_HIST*/
v_target_table := 'X_FIXED_INCOME_DTL_EXT_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
/*DERIVATIVES_HIST*/
v_target_table := 'X_DERIVATIVES_HIST_TBL';
v_sql_to_run:= ' SELECT /*+DRIVING_SITE(K)*/ K.* FROM [email protected] K '||
' INNER JOIN SPOKE_TO_HUB_SEC_MTCH_TBL I'||
' ON K.SECURITY_ALIAS = I.SPOKE_SEC'||
' AND K.SRC_INTFC_INST = 140 '||
' and K.EFFECTIVE_DATE =(SELECT /*+DRIVING_SITE(H)*/ MAX (H.EFFECTIVE_DATE) FROM [email protected] H WHERE'||
' H.SECURITY_ALIAS = K.SECURITY_ALIAS AND H.SRC_INTFC_INST = K.SRC_INTFC_INST)' ;
v_commit_after := 0;
INSERT_DATA_TO_TABLE(v_target_table,v_sql_to_run,v_commit_after);
END RETREIVE_RECORDS_FROM_SPOKE;
PROCEDURE COMPARE_RECORDS(p_err_msg OUT VARCHAR2)
AS
l_count NUMBER;
l_err_msg VARCHAR2(100);
TYPE T_SECURITIES is TABLE of HIST_DATA_COMPARE_TBL%rowtype;
ttype T_SECURITIES;
CURSOR C1
IS
SELECT TABLE_NAME, TEMP_TABLE, COLUMN_NAME from SEC_COMPARE_CONFIG
where column_name='EFFECTIVE_DATE';
CURSOR C2
IS
SELECT * FROM SEC_COMPARE_CONFIG where id <=82;
C_REC SEC_COMPARE_CONFIG%rowtype;
BEGIN
LC_SQL :='';
p_err_msg :='';
FOR C_REC in C1
loop
LC_SQL:= ' SELECT /*+DRIVING_SITE(B)*/ /*+PARALLEL(A,100)*/ B.SECURITY_ALIAS, to_char(C.SPOKE_PAID), A.SECURITY_ALIAS,to_char(C.HUB_PAID),'||''''||C_REC.TABLE_NAME||''''||','||q'!'EFFECTIVE_DATE'!'||','||
' NVL((cast(B.'||C_REC.COLUMN_NAME||' as VARCHAR2(100))),'||q'!'No Records Found'!'||'),'||
' NVL((cast(A.'||C_REC.COLUMN_NAME||' as VARCHAR2(100))),'||q'!'No Records Found'!'||')'||
' FROM '||C_REC.TEMP_TABLE||' A, SECURITYDBO.'||C_REC.TABLE_NAME ||'@PROD1.WORLD B,'||
' SPOKE_TO_HUB_SEC_MTCH_TBL C'||
' WHERE A.SRC_INTFC_INST=140'||
' AND B.SRC_INTFC_INST=140'||
' AND A.SECURITY_ALIAS=C.spoke_sec'||
' and b.security_alias=C.HUB_SEC'||
' AND a.effective_date <> (select max(h.effective_date) from SECURITYDBO.'||C_REC.TABLE_NAME||'@PROD1.WORLD H'||
' where h.security_alias=c.hub_sec and h.src_intfc_inst=140 )';
EXECUTE IMMEDIATE LC_SQL BULK COLLECT into ttype;
FORALL x in ttype.First..ttype.Last
insert into HIST_DATA_COMPARE_TBL values ttype(x);
commit;
end loop;
For C_REC in C2
loop
LC_SQL:= ' SELECT /*+DRIVING_SITE(B)*/ /*+PARALLEL(A,100)*/ B.SECURITY_ALIAS, to_char(C.SPOKE_PAID), A.SECURITY_ALIAS,to_char(C.HUB_PAID),'||''''||C_REC.TABLE_NAME||''''||','||''''||C_REC.COLUMN_NAME||''''||','||
' NVL((cast(B.'||C_REC.COLUMN_NAME||' as VARCHAR2(100))),'||q'!'No Records Found'!'||'),'||
' NVL((cast(A.'||C_REC.COLUMN_NAME||' as VARCHAR2(100))),'||q'!'No Records Found'!'||')'||
' FROM '||C_REC.TEMP_TABLE||' A, SECURITYDBO.'||C_REC.TABLE_NAME ||'@PROD1.WORLD B,'||
' SPOKE_TO_HUB_SEC_MTCH_TBL C'||
' WHERE A.SRC_INTFC_INST=140'||
' AND B.SRC_INTFC_INST=140'||
' AND A.SECURITY_ALIAS=C.spoke_sec'||
' and b.security_alias=C.HUB_SEC'||
' and b.effective_date=a.effective_date'||
' AND NVL((cast(A.'||C_REC.column_name||' as VARCHAR2(100))),'||q'!'No Records Found'!'||') <>'||
' NVL((cast(B.'||C_REC.column_name||' as VARCHAR2(100))),'||q'!'No Records Found'!'||')';
EXECUTE IMMEDIATE LC_SQL BULK COLLECT into ttype;
FORALL x in ttype.First..ttype.Last
insert into HIST_DATA_COMPARE_TBL values ttype(x);
commit;
end loop;
BEGIN
select count(*) into l_count from HIST_DATA_COMPARE_TBL;
if(l_count=0) then
l_err_msg :='No records found';
end if;
END;
END COMPARE_RECORDS;
NAME: INSERT_DATA_TO_TABLE
DESCRIPTION: This procedure will insert the records into the target table based based on the data fetched using the sql to run variable.
It also records the commit_after variable which defines that after how many records the insert needs to be committed.
PROCEDURE INSERT_DATA_TO_TABLE ( v_target_table VARCHAR2,
v_sql_to_run VARCHAR2,
v_commit_after NUMBER) IS
v_limit_sql1 VARCHAR2(300) := ' ';
v_limit_sql2 VARCHAR2(900) := ' ';
v_plsql_to_run VARCHAR2(32767);
BEGIN
IF NVL(v_commit_after,0) <> 0 THEN
v_limit_sql1:= ' LIMIT ' || TO_CHAR(v_commit_after) ;
v_limit_sql2:= ' IF MOD(v_number_of_rows, ' || TO_CHAR(v_commit_after) || ' ) = 0 THEN ' ||
' COMMIT; ' ||
' END IF; ' ;
END IF;
v_plsql_to_run:= ' ' ||
'DECLARE ' ||
' v_number_of_rows number:=0; ' ||
' ' ||
' TYPE MyType IS REF CURSOR; ' ||
' CV MyType; ' ||
' TYPE RecTyp IS TABLE OF ' || v_target_table || '%ROWTYPE; ' ||
' rec RecTyp; ' ||
' ' ||
'BEGIN ' ||
' ' ||
'OPEN CV FOR ' ||
' ' || REPLACE( v_sql_to_run, ';', ' ' ) || ' ; ' ||
' LOOP ' ||
' FETCH CV BULK COLLECT INTO rec ' || v_limit_sql1 || '; ' ||
' FORALL i IN 1..rec.COUNT ' ||
' INSERT /*+ APPEND */ INTO ' || v_target_table || ' VALUES rec(i); ' ||
' v_number_of_rows := v_number_of_rows + SQL%ROWCOUNT; ' ||
' ' || v_limit_sql2 || ' ' ||
' EXIT WHEN CV%NOTFOUND; ' ||
' ' ||
' END LOOP; ' ||
' COMMIT; ' ||
' CLOSE CV; ' ||
'END; ';
EXECUTE IMMEDIATE v_plsql_to_run;
COMMIT;
END INSERT_DATA_TO_TABLE;
END SECURITY_COMPARE; -
Display two heading in single column using ALV report
Hi Experts,
I got a requirement for displaying 2 rows heading in a single column report. Is it possible that I can perform this task using ALV. How to get this 2 rows in ALV.
This is a criteria that need to be output in ALV REPORT.
MATERIAL CODE--MATERIAL NUMBERSTORAGE LOC----SLOC1 SLOC2
--DATE--DATE1 DATE2
123445--TEST MATERIAL22--
3
As mentioned above storage loc and date will be changing with respect to data dynamically and under this double heading qty will be displayed.
Just want to know how to get double heading. It is clear that how to display dynamically but unaware of double heading using fieldcatalog.
Regards,
YahyaHi Yahya,
Please pass row position in fieldcatalogue for the respective columns.
E.g MOVE '2' to w_fieldcat-row_pos. " This will display the field in 2nd row.
Thanks,
Rupali -
Multiple Display Types in a single column
I have a situation where I have to display a bunch of attributes for a customer. Each attribute can have a different type, Text, Dropdown, Date etc and that information is stored in a table.
I was able to use apex_item to display the different display types based on the type of attribute.
So the layout of the form has 2 columns, column 1 is the name of the attribute and column 2 is the value of the attribute (displayed as the various types of date, text, dropdown etc) However, I am having an issue with the Date popups. When I select a date it always goes into whatever date is listed first. No sorting is going on in the select or the report.
I'm guessing my issue has to do with displaying different display types in the same column? If that is true, how should I change my approach to this problem? I want all the attributes on a single page, so is my only option to have each attribute in a different region?
Thanks,
-- JohnnieDenes,
OK thanks for the heads up, let me try to clarify.
My problem is that I have multiple date popups on the same form. When I pick a date for any of the date popups, it always updates the first date popup field on the form. I stated there was no sorting at all because this thread indicated that sorting could cause this issue:
DATE_POPUP
Another hit for this issue was here:
Re: HTMLDB_ITME.DATE_POPUP problems
This suggested that having multiple data types in the same column (which is what I am doing) is not supported, but this is an old thread.
My form will be a manual tabular form. I need to display a list of attributes, however some are freeform text, some are SQL LOV dropdowns, and some are date popups. Right now they are all displayed in the same column. Could this be causing my date popup issue? If so what alternatives do I have?
Screenshot of my form here: http://johnniebillings.googlepages.com/outlook.jpg
Hope that clears up the issue I am having.
-- Johnnie
Maybe you are looking for
-
hi Can anyone tell me why the click action is not working when the link button is placed in datagrid. <mx:DataGridColumn dataField="edit" headerText=""> <mx:itemRenderer> <mx:Component> <mx:LinkButton label="edit" click = "click1();"> </mx:LinkButton
-
Query related to selection of BOM (Production BOM or Sales Order BOM)
Hello All Am having a scenario wherein the FG is having 5 components out of these 5, two are subassembly and 3 are raw materials, 3 of these components are customer specific i.e. 1 suby assly and 2 raw materials are customer order specific, n
-
CS3 Crashing When Opened on Mac 10.5.8 (Crash Report included)
When I open my CS3 it immediatley crashes...here is the crash report Process: Adobe Photoshop CS3 [554] Path: /Applications/Adobe Photoshop CS3/Adobe Photoshop CS3.app/Contents/MacOS/Adobe Photoshop CS3 Identifier: com.adobe.P
-
Hide column in webreports (without table interface)
Hi, I want to hide columns in my webreport only(!) with the context menu. The idea is to set a statement like "remove drill down" --> <SAP_BW_UR CMD='Expand' DATA_PROVIDER='View1'IOBJNM='0COUNTRY' > The problem is that I don't which InfoObject is sel
-
How to export string in CDATA with the jaxb xml writer?
How to export string in CDATA with the jaxb xml writer? It read CDATA no problem but it is lost on write.