Filtered report SQL query in IRR
Hi guys,
There is simple IRR "Select * from emp" on my page.
End user put some filters on the report from Actions Menu. Can i somehow (on any button click, etc) get the new SQL which is saved by user now?
Thanks
Sunil Bhatia
See this:
http://www.deneskubicek.blogspot.de/2013/05/getting-interactive-report-query.html
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
https://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
Similar Messages
-
I recently posted this in the Gallery. If anyone has any modifications or enhancements please feel free to contribute! One thing that I'd like to be able to add to it is the ability to only display information for applications/packages that are
still published, so if anyone can figure out a crafty way to do it... Thanks!
http://gallery.technet.microsoft.com/App-V-Reporting-SQL-query-6695d3c3I recently posted this in the Gallery. If anyone has any modifications or enhancements please feel free to contribute! One thing that I'd like to be able to add to it is the ability to only display information for applications/packages that are
still published, so if anyone can figure out a crafty way to do it... Thanks!
http://gallery.technet.microsoft.com/App-V-Reporting-SQL-query-6695d3c3 -
Discoverer Report - SQL Query to retrieve list of parameters
Hi
We have around 100 Discoverer reports and I'm trying to find the list of parameters used in each report.
Is there any SQL query that I can use to find the parameters used for each report
or
should I open the reports one by one to fetch the list of parameters used.
I checked the tables in EUL4_US schema but no luck.
- Amarnath.Kgive this a try for starters. It looks at the custom folders defined in the business area, which is where any LOV's defined for you parameters would be. As far as looking at the workbooks themselves, no, there is no way to do that in sql.
select
decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom') Origin,
eb.ba_name business_area,
eo.OBJ_TYPE,
decode(eo.obj_type, 'SOBJ','From Database', 'CUO', 'Custom Query', 'COBJ', 'Complex Folder', eo.obj_type) obj_type_desc,
eo.OBJ_NAME folder,
eo.OBJ_DESCRIPTION folder_description,
decode(eo.sobj_ext_table, NULL, NULL, eo.obj_ext_owner || '.' || eo.sobj_ext_table) base_object,
decode(es.seg_obj_id, null, UPPER(trim(eo.obj_object_sql1)||trim(eo.obj_object_sql2)||trim(eo.obj_object_sql3))
, UPPER(trim(es.seg_chunk1) || trim(es.seg_chunk2) || trim(es.seg_chunk3) || trim(es.seg_chunk4))) SQL
from
eul4_us.EUL5_BAS eb,
eul4_us.EUL5_objs eo,
eul4_us.EUL5_BA_OBJ_LINKS ebol,
eul4_us.eul5_segments es
where
eb.BA_ID = ebol.BOL_BA_ID and
ebol.BOL_OBJ_ID = eo.OBJ_ID and
eo.obj_id = es.seg_obj_id (+) and
decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom') = 'Custom'
order by
/*decode(eb.ba_created_by,'ORACLE_APPS','Seeded','Custom'), */eb.ba_name, ebol.BOL_SEQUENCE, es.seg_sequence -
hi all,
i created links for an element but for some element links the costing and balancing codes were mistakenly given wrong and the element links are plenty so i am unable to find which is wrongly given.
can some 1 out there provide me with the sql query that will allow me to create a report to run and confirm all the links have costing and balancing codes for all the earnings or voluntary deduction elements.
Thank you for reading my issue. plz help!See if the below helps.
Change the business group id in the query below-
select ppf.payroll_name
,pj.name Job,hou.name HR_ORG,ppg.group_name People_Group
,pel.employment_category
,hra.location_code
,pet.element_name,pet.reporting_name,pec.classification_name
,pel.costable_type
,pel.link_to_all_payrolls_flag
,pcak1.concatenated_segments Element_Cost_Segments
,pcak1.segment1
,pcak1.segment2
,pcak1.segment3
,pcak1.segment4
,pcak1.segment5
,pcak1.segment6
,pcak1.segment7
,pcak1.segment8
,pcak2.concatenated_segments Balancing_Cost_Segments
,pcak2.segment1
,pcak2.segment2
,pcak2.segment3
,pcak2.segment4
,pcak2.segment5
,pcak2.segment6
,pcak2.segment7
,pcak2.segment8
from pay_element_links_f pel
,apps.PAY_COST_ALLOCATION_KEYFLEX pcak1
,apps.PAY_COST_ALLOCATION_KEYFLEX pcak2
,pay_element_types_f pet
,pay_payrolls_f ppf
,pay_element_classifications pec
,per_jobs pj
,hr_all_organization_units hou
,PAY_PEOPLE_GROUPS ppg
,hr_locations_all hra
where pel.element_type_id = pet.element_type_id
and ppf.payroll_id(+) = pel.payroll_id
and pcak1.cost_allocation_keyflex_id(+) = pel.cost_allocation_keyflex_id
and pcak2.cost_allocation_keyflex_id(+) = pel.balancing_keyflex_id
and pet.business_group_id = 0
and pet.classification_id = pec.classification_id
and pj.job_id(+) = pel.job_id
and hou.organization_id(+) = pel.organization_id
and ppg.people_group_id(+) = pel.people_group_id
and hra.location_id(+) = pel.location_id
and sysdate between pel.effective_start_date and pel.effective_end_date
and sysdate between pet.effective_start_date and pet.effective_end_date
and sysdate between ppf.effective_start_date(+) and ppf.effective_end_date(+)
order by ppf.payroll_name,pec.classification_namePlease close the thread, if your issue is resolved.
Cheers,
VB -
SCCM 2012 All Updates report sql query
Need build sql query for report about all MS Updates like SCCM configuration manager view in window by path:
\Software Library\Overview\Software Updates\All Software Updates.
But I can't find fields that can show "product" (OS that use this patch) and size of each patch in SCCM and WSUS databases. Can anybody help me?To get file size I create query for files in package:
SELECT distinct ui.Title, ui.InfoURL, ui.DatePosted,
cf.FileName, cast(cast(cf.FileSize as real)/1024/1024 as decimal(10,2)) as SizeMb, uds.AssignmentName, uds.StartTime
FROM CI_ContentFiles cf
INNER JOIN v_UpdateContents uc ON cf.Content_ID = uc.Content_ID
INNER JOIN v_UpdateInfo ui ON uc.CI_ID = ui.CI_ID
INNER JOIN vSMS_UpdateDeploymentSummary uds ON ui.CI_ID = uds.CI_ID
join CI_ContentPackages cp on cf.Content_ID=cp.Content_ID
join CI_Contents co on co.Content_ID = cp.Content_ID
Where PkgID='MKL00032'
order by ui.InfoURL -
Hi,
I am trying to call a procedure from a SQL report query. Please let me know if this is correct.
SELECT gb.period_name,
cc.segment1 uec,cc.segment2 dept, cc.segment3 other,
cc.segment4 acct,cc.segment5 subacct, cc.segment6 activity,
cc.segment7 cec, cc.segment8 subelement,cc.segment9 geo,
cc.segment10 usind,cc.segment11 affiliate,cc.segment12 mpc,
DECODE ( NVL (gb.begin_balance_dr_beq, 0)
- NVL (gb.begin_balance_cr_beq, 0),
0, ( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
NULL, ( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
NVL (gb.begin_balance_dr_beq, 0)
- NVL (gb.begin_balance_cr_beq, 0)
) AS Begining_balance_functional,
DECODE ( NVL (gb.period_net_dr_beq, 0)
- NVL (gb.period_net_cr_beq, 0),
0, ( NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0)
NULL, ( NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0)
NVL (gb.period_net_dr_beq, 0)
- NVL (gb.period_net_cr_beq, 0)
) AS period_to_date_functional,
(DECODE ( NVL (gb.begin_balance_dr_beq, 0)
- NVL (gb.begin_balance_cr_beq, 0),
0, ( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
NULL, ( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
NVL (gb.begin_balance_dr_beq, 0)
- NVL (gb.begin_balance_cr_beq, 0)
+ (DECODE ( NVL (gb.period_net_dr_beq, 0)
- NVL (gb.period_net_cr_beq, 0),
0, ( NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0)
NULL, ( NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0)
NVL (gb.period_net_dr_beq, 0)
- NVL (gb.period_net_cr_beq, 0)
) AS ending_balance_functional,
NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0) AS begining_balance_entered,
NVL (gb.period_net_dr, 0)
- NVL (gb.period_net_cr, 0) AS period_to_date_entered,
( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
+ (NVL (gb.period_net_dr, 0) - NVL (gb.period_net_cr, 0)
) AS ending_balance_entered,
gb.currency_code,gb.period_year, gb.period_num,
apps.afl_gl_acct.get_value_description('ALCOA UEC',cc.segment1) UEC_Description, apps.afl_gl_acct.get_value_description('ALCOA Cost Center',cc.segment2) Cost_center_Description,
apps.afl_gl_acct.get_value_description('ALCOA Other',cc.segment3) Other_Description,
apps.afl_gl_acct.get_value_description('ALCOA Account',cc.segment4) Account_Description,
apps.afl_gl_acct.get_value_description('ALCOA SubAccount',cc.segment5) SubAccount_Description,
apps.afl_gl_acct.get_value_description('ALCOA Activity',cc.segment6) Activity_Description,
apps.afl_gl_acct.get_value_description('ALCOA CEC',cc.segment7) CEC_Description,
apps.afl_gl_acct.get_value_description('ALCOA SubElement',cc.segment8) SubElement_Description,
apps.afl_gl_acct.get_value_description('ALCOA GEO',cc.segment9) GEO_Description,
apps.afl_gl_acct.get_value_description('ALCOA US Ind',cc.segment10) US_Ind_Description,
apps.afl_gl_acct.get_value_description('ALCOA Affiliate',cc.segment11) Affil_Description,
afl_gl_acct.get_value_description('ALCOA MPC',cc.segment12) MPC_Description
FROM GL.GL_BALANCES GB, GL.GL_CODE_COMBINATIONS CC,
GL.GL_Budget_Versions GBV, GL.GL_SETS_OF_BOOKS GSB
WHERE GB.CODE_COMBINATION_ID = CC.CODE_COMBINATION_ID
-- And CC.SEGMENT1 = (se
And GB.BUDGET_VERSION_ID = GBV.BUDGET_VERSION_ID (+)
And GSB.SET_OF_BOOKS_ID = GB.SET_OF_BOOKS_ID
and decode(gb.TRANSLATED_FLAG,'Y','Translated','Entered') =:p_currency_type
AND cc.segment1 =:p_uec
AND GSB.NAME = :p_sob_name
AND gb.PERIOD_NAME= :p_period
AND cc.segment2= nvl(:p_dept,cc.segment2)
AND cc.segment3=nvl(:p_other,cc.segment3)
AND cc.segment4= nvl(:p_acct,cc.segment4)
AND cc.segment5= nvl(:p_subacct,cc.segment5)
AND cc.segment6 = nvl(:p_activity,cc.segment6)
AND cc.segment7 = nvl(:p_cec,cc.segment7)
and cc.segment8= nvl(:p_subelement,cc.segment8)
and cc.segment9= nvl(:p_geo,cc.segment9)
and cc.segment10=nvl(:p_usind,cc.segment10)
and cc.segment11=nvl(:p_affil,cc.segment11)
and cc.segment12=nvl(:p_mpc,cc.segment12)
AND gb.ACTUAL_FLAG = 'A'
AND gb.CURRENCY_CODE = :p_currency;
I am not completely sure of the syntax.
Regards,
JAPlease let me know if this is correct.Does it compile? Does it run? Does it return the correct result.
Please bear in mind we do not have access to your data models so we cannot run it. Nor do we know your business requirements so we cannot assess whether it implements them correctly. And it is way too big a hunk o' code for us to go through it manually.
As a rule of thumb it is better to build a small query and get that working correctly before adding tables to it rather than building an incomprehensibly large monolith.
Cheers, APC
Blog : http://radiofreetooting.blogspot.com/ -
How to get report (SQL Query) generating Run Time
There is a Standard report of Payroll which show employee transfer information on the bases of location, grade job or organization, now to get actual query which is generated by run time in report builder including whether single column parameter or lexical parameter " because currently the query in not complicate but the parameter and lexical parameter is much more due to this not quite easy to under stand just copy past it into toad or pl/sql developer,
Kindly share your experience to get such kind of query in you working time.
thanksHere i try to explain contain of query.
Parameter
P_DEPTNO = 10
P_WHERE_CLAUSE := ' AND EMPNO IS NOT NULL AND SALARY > 100'
SELECT * FROM EMP
WHERE DEPTNO = P_DEPTNO
&P_WHERE_CLAUSE
REPROT WILL GENERATE QUERY AT RUN TIME IS LIKE THAT
SELECT * FROM EMP
WHERE DEPTNO = 10
AND EMPNO IS NOT NULL AND SALARY > 100
Now i want to get this query out(Run time) by doing any oracle database feature or sth similar.
thanks -
Dear Guys,
I have tried for aging report query , but still my expected results is not come. Please go through below the table and script data for your reference. Please wirte a query for aging report.
USE [SAMPLES]
GO
/****** Object: Table [dbo].[NEW_DCB_REPORT] Script Date: 02/12/2015 01:19:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[NEW_DCB_REPORT](
[MFDB_LedgerNumber] [int] IDENTITY(1,1) NOT NULL,
[MFDB_TxnDate] [datetime] NOT NULL,
[MFDB_StateId] [int] NOT NULL,
[MFDB_RegionId] [int] NOT NULL,
[MFDB_BranchId] [int] NOT NULL,
[MFDB_SHGId] [int] NOT NULL,
[MFDB_SHGName] [varchar](75) NOT NULL,
[MFDB_ShgMemberId] [int] NOT NULL,
[MFDB_MemberName] [varchar](50) NOT NULL,
[MFDB_VillageId] [int] NOT NULL,
[MFDB_LoanNumber] [int] NOT NULL,
[MFDB_LoanAmount] [int] NOT NULL,
[MFDB_DisbursedDate] [datetime] NOT NULL,
[MFDB_DemandDate] [datetime] NULL,
[MFDB_CollectionDate] [datetime] NULL,
[MFDB_InstallmentNumber] [int] NOT NULL,
[MFDB_ArrearPrincipal] [numeric](18, 2) NOT NULL,
[MFDB_ArrearInterest] [numeric](18, 2) NOT NULL,
[MFDB_DemandPrincipal] [numeric](18, 2) NOT NULL,
[MFDB_DemandInterest] [numeric](18, 2) NOT NULL,
[MFDB_TotDemandPrincipal] [numeric](18, 2) NOT NULL,
[MFDB_TotDemandInterest] [numeric](18, 2) NOT NULL,
[MFDB_AdvOBPrincipal] [numeric](18, 2) NOT NULL,
[MFDB_AdvOBInterest] [numeric](18, 2) NOT NULL,
[MFDB_CollectedPrincipal] [numeric](18, 2) NOT NULL,
[MFDB_CollectedInterest] [numeric](18, 2) NOT NULL,
[MFDB_AdvCBPrincipal] [numeric](18, 2) NOT NULL,
[MFDB_AdvCBInterest] [numeric](18, 2) NOT NULL,
[MFDB_BalancePrincipal] [numeric](18, 2) NOT NULL,
[MFDB_BalanceInterest] [numeric](18, 2) NOT NULL,
[MFDB_OS_Pri] [numeric](18, 2) NOT NULL,
[MFDB_OS_Int] [numeric](18, 2) NOT NULL,
[MFDB_RepaymentPercentage] [int] NOT NULL,
[MFDB_LoanSchemeId] [int] NOT NULL,
[MFDB_LActivityId] [int] NOT NULL,
[MFDB_LActSpecId] [int] NOT NULL,
[MFDB_FundAgencyId] [int] NOT NULL,
[MFDB_LSourceId] [int] NOT NULL,
[MFDB_Months] [varchar](15) NOT NULL,
[MFDB_PanchayatId] [int] NOT NULL,
[MFDB_PanchayatName] [varchar](100) NOT NULL,
[MFDB_VillageName] [varchar](100) NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
USE [SAMPLES];
SET NOCOUNT ON;
SET XACT_ABORT ON;
GO
SET IDENTITY_INSERT [dbo].[NEW_DCB_REPORT] ON;
BEGIN TRANSACTION;
INSERT INTO [dbo].[NEW_DCB_REPORT]([MFDB_LedgerNumber], [MFDB_TxnDate], [MFDB_StateId], [MFDB_RegionId], [MFDB_BranchId], [MFDB_SHGId], [MFDB_SHGName], [MFDB_ShgMemberId], [MFDB_MemberName], [MFDB_VillageId], [MFDB_LoanNumber], [MFDB_LoanAmount], [MFDB_DisbursedDate], [MFDB_DemandDate], [MFDB_CollectionDate], [MFDB_InstallmentNumber], [MFDB_ArrearPrincipal], [MFDB_ArrearInterest], [MFDB_DemandPrincipal], [MFDB_DemandInterest], [MFDB_TotDemandPrincipal], [MFDB_TotDemandInterest], [MFDB_AdvOBPrincipal], [MFDB_AdvOBInterest], [MFDB_CollectedPrincipal], [MFDB_CollectedInterest], [MFDB_AdvCBPrincipal], [MFDB_AdvCBInterest], [MFDB_BalancePrincipal], [MFDB_BalanceInterest], [MFDB_OS_Pri], [MFDB_OS_Int], [MFDB_RepaymentPercentage], [MFDB_LoanSchemeId], [MFDB_LActivityId], [MFDB_LActSpecId], [MFDB_FundAgencyId], [MFDB_LSourceId], [MFDB_Months], [MFDB_PanchayatId], [MFDB_PanchayatName], [MFDB_VillageName])
SELECT 18, '20140422 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', NULL, NULL, 0, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 10000.00, 1051.00, 0, 3, 4, 77, 3, 2, N'Apr - 14', 2927, N'PALI', N'PALI' UNION ALL
SELECT 162, '20140521 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', '20140521 00:00:00.000', NULL, 1, 0.00, 0.00, 0.00, 150.00, 0.00, 150.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 150.00, 10000.00, 1051.00, 0, 3, 4, 77, 3, 2, N'May - 14', 2927, N'PALI', N'PALI' UNION ALL
SELECT 13932, '20140621 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', '20140621 00:00:00.000', NULL, 2, 0.00, 150.00, 909.00, 150.00, 909.00, 300.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 909.00, 300.00, 10000.00, 1051.00, 0, 3, 4, 77, 3, 2, N'Jun - 14', 2927, N'PALI', N'PALI' UNION ALL
SELECT 32505, '20140721 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', '20140721 00:00:00.000', NULL, 3, 909.00, 300.00, 909.00, 136.00, 1818.00, 436.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 1818.00, 436.00, 10000.00, 1051.00, 0, 3, 4, 77, 3, 2, N'Jul - 14', 2927, N'PALI', N'PALI' UNION ALL
SELECT 62524, '20140821 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', '20140821 00:00:00.000', NULL, 4, 1818.00, 436.00, 909.00, 123.00, 2727.00, 559.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 2727.00, 559.00, 10000.00, 1051.00, 0, 3, 4, 77, 3, 2, N'Aug - 14', 2927, N'PALI', N'PALI' UNION ALL
SELECT 100871, '20140921 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', '20140921 00:00:00.000', NULL, 5, 2727.00, 559.00, 909.00, 109.00, 3636.00, 668.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 3636.00, 668.00, 10000.00, 1051.00, 0, 3, 4, 77, 3, 2, N'Sep - 14', 2927, N'PALI', N'PALI' UNION ALL
SELECT 153679, '20141021 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', '20141021 00:00:00.000', NULL, 6, 3636.00, 668.00, 909.00, 96.00, 4545.00, 764.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 4545.00, 764.00, 10000.00, 1051.00, 0, 3, 4, 77, 3, 2, N'Oct - 14', 2927, N'PALI', N'PALI' UNION ALL
SELECT 203840, '20141119 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', NULL, '20141119 00:00:00.000', 2, 4545.00, 764.00, 0.00, 0.00, 4545.00, 764.00, 0.00, 0.00, 10000.00, 150.00, 5455.00, 0.00, 0.00, 614.00, 0.00, 901.00, 0, 3, 4, 77, 3, 2, N'Nov - 14', 2927, N'PALI', N'PALI' UNION ALL
SELECT 291259, '20141221 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', '20141221 00:00:00.000', NULL, 8, 0.00, 614.00, 909.00, 68.00, 909.00, 682.00, 5455.00, 0.00, 0.00, 0.00, 4546.00, 0.00, 0.00, 682.00, 0.00, 901.00, 0, 3, 4, 77, 3, 2, N'Dec - 14', 2927, N'PALI', N'PALI' UNION ALL
SELECT 363176, '20150121 00:00:00.000', 6, 16, 67, 5514, N'MAHALAXMI-5514', 66735, N'SUNITA', 4624, 1, 10000, '20140422 00:00:00.000', '20150121 00:00:00.000', NULL, 9, 0.00, 682.00, 909.00, 55.00, 909.00, 737.00, 4546.00, 0.00, 0.00, 0.00, 3637.00, 0.00, 0.00, 737.00, 0.00, 901.00, 0, 3, 4, 77, 3, 2, N'Jan - 15', 2927, N'PALI', N'PALI'
COMMIT;
RAISERROR (N'[dbo].[NEW_DCB_REPORT]: Insert Batch: 1.....Done!', 10, 1) WITH NOWAIT;
GO
SET IDENTITY_INSERT [dbo].[NEW_DCB_REPORT] OFF;
I expected results as below:
Report As On Date: 30-10-2014
S.No. SHG NAME MEMBER NAME <=30 31-60 61-90 91-120 91-180 181-365 365 - 689 Above 2 Yrs
1 MAHALAXMI-5514 SUNITA 0 909 1818 2727 3636 4545 0 0
Report As On Date:
30-10-2014
S.No.
SHG NAME
MEMBER NAME
<=30
31-60
61-90
91-120
91-180
181-365
365 - 689
Above 2 Yrs
1
MAHALAXMI-5514
SUNITA
0
909
1818
2727
3636
4545
0
0Thanks for your replay, I have checked your query it seems nearly ok, Please find my script which i tried above for the same.
DECLARE @i_AsOnDate AS DATETIME = '2014-09-30'
;WITH CA1 AS
SELECT ROW_NUMBER() OVER(Order By DR.MFDB_SHGName,DR.MFDB_MemberName)
AS SerialNumber,
DR.MFDB_SHGId
AS ShgId,
DR.MFDB_SHGName
AS ShgName,
DR.MFDB_ShgMemberId
AS MemId,
DR.MFDB_MemberName
AS MemName,
ISNULL((SELECT CAST(SUM(LD.MFDB_StdPrincipal) AS BIGINT )
FROM MFDB_LOAN_DISBURSEMENT LD
WHERE LD.MFDB_SHGId
= DR.MFDB_SHGId
AND LD.MFDB_ShgMemberId
= DR.MFDB_ShgMemberId
AND LD.MFDB_LoanNumber
= DR.MFDB_LoanNumber
AND LD.MFDB_ApprovalStatus = 1
AND DATEDIFF(DAY,@i_AsOnDate,LD.MFDB_CollectionDate) > 0 ),0)
AS YETDUE,
ISNULL((SELECT TOP 1 CAST(ND.MFDB_BalancePrincipal AS BIGINT )
FROM dbo.MFDB_NEW_DCB_REPORT ND
WHERE ND.MFDB_SHGId
= DR.MFDB_SHGId
AND ND.MFDB_ShgMemberId
= DR.MFDB_ShgMemberId
AND ND.MFDB_LoanNumber
= DR.MFDB_LoanNumber
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) >= 0
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) <= 30
ORDER BY ND.MFDB_LedgerNumber DESC),0)
AS '0-30',
ISNULL((SELECT TOP 1 CAST(ND.MFDB_BalancePrincipal AS BIGINT )
FROM dbo.MFDB_NEW_DCB_REPORT ND
WHERE ND.MFDB_SHGId
= DR.MFDB_SHGId
AND ND.MFDB_ShgMemberId
= DR.MFDB_ShgMemberId
AND ND.MFDB_LoanNumber
= DR.MFDB_LoanNumber
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) <= 60
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) > 30
ORDER BY ND.MFDB_LedgerNumber DESC),0)
AS '31-60',
ISNULL((SELECT TOP 1 CAST(ND.MFDB_BalancePrincipal AS BIGINT )
FROM dbo.MFDB_NEW_DCB_REPORT ND
WHERE ND.MFDB_SHGId
= DR.MFDB_SHGId
AND ND.MFDB_ShgMemberId
= DR.MFDB_ShgMemberId
AND ND.MFDB_LoanNumber
= DR.MFDB_LoanNumber
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) <= 90
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) > 60
ORDER BY ND.MFDB_LedgerNumber DESC),0)
AS '61-90',
ISNULL((SELECT TOP 1 CAST(ND.MFDB_BalancePrincipal AS BIGINT )
FROM dbo.MFDB_NEW_DCB_REPORT ND
WHERE ND.MFDB_SHGId
= DR.MFDB_SHGId
AND ND.MFDB_ShgMemberId
= DR.MFDB_ShgMemberId
AND ND.MFDB_LoanNumber
= DR.MFDB_LoanNumber
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) <= 120
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) > 90
ORDER BY ND.MFDB_LedgerNumber DESC),0)
AS '91-120',
ISNULL((SELECT TOP 1 CAST(ND.MFDB_BalancePrincipal AS BIGINT )
FROM dbo.MFDB_NEW_DCB_REPORT ND
WHERE ND.MFDB_SHGId
= DR.MFDB_SHGId
AND ND.MFDB_ShgMemberId
= DR.MFDB_ShgMemberId
AND ND.MFDB_LoanNumber
= DR.MFDB_LoanNumber
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) <= 180
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) > 120
ORDER BY ND.MFDB_LedgerNumber DESC),0)
AS '121-180',
ISNULL((SELECT TOP 1 CAST(ND.MFDB_BalancePrincipal AS BIGINT )
FROM dbo.MFDB_NEW_DCB_REPORT ND
WHERE ND.MFDB_SHGId
= DR.MFDB_SHGId
AND ND.MFDB_ShgMemberId
= DR.MFDB_ShgMemberId
AND ND.MFDB_LoanNumber
= DR.MFDB_LoanNumber
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) <= 365
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) > 180
ORDER BY ND.MFDB_LedgerNumber DESC),0)
AS '181-365',
ISNULL((SELECT TOP 1 CAST(ND.MFDB_BalancePrincipal AS BIGINT )
FROM dbo.MFDB_NEW_DCB_REPORT ND
WHERE ND.MFDB_SHGId
= DR.MFDB_SHGId
AND ND.MFDB_ShgMemberId
= DR.MFDB_ShgMemberId
AND ND.MFDB_LoanNumber
= DR.MFDB_LoanNumber
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) <= 689
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) > 365
ORDER BY ND.MFDB_LedgerNumber DESC),0)
AS '366-689',
ISNULL((SELECT TOP 1 CAST(ND.MFDB_BalancePrincipal AS BIGINT )
FROM dbo.MFDB_NEW_DCB_REPORT ND
WHERE ND.MFDB_SHGId
= DR.MFDB_SHGId
AND ND.MFDB_ShgMemberId
= DR.MFDB_ShgMemberId
AND ND.MFDB_LoanNumber
= DR.MFDB_LoanNumber
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) <= 730
AND DATEDIFF(Day,ND.MFDB_TxnDate,@i_AsOnDate) > 689
ORDER BY ND.MFDB_LedgerNumber DESC),0)
AS 'Above_2_Yrs'
FROM DBO.MFDB_NEW_DCB_REPORT DR
WHERE DR.MFDB_BranchId
= 67
AND DR.MFDB_SHGId
IN (5514)
AND DR.MFDB_ShgMemberId = 66735
AND DATEDIFF(DAY,MFDB_TxnDate,@i_AsOnDate) >= 0
SELECT * FROM CA1
results after the execution of the script:
SerialNumber
ShgId
ShgName
MemId
MemName
YETDUE
0-30
31-60
61-90
91-120
121-180
181-365
366-689
Above_2_Yrs
3
5514
MAHALAXMI-5514
SUNITA
10000
3636
2727
1818
909
0
0
0
0
2
5514
MAHALAXMI-5514
SUNITA
10000
3636
2727
1818
909
0
0
0
0
6
5514
MAHALAXMI-5514
SUNITA
10000
3636
2727
1818
909
0
0
0
0
4
5514
MAHALAXMI-5514
SUNITA
10000
3636
2727
1818
909
0
0
0
0
1
5514
MAHALAXMI-5514
SUNITA
10000
3636
2727
1818
909
0
0
0
0
5
5514
MAHALAXMI-5514
SUNITA
10000
3636
2727
1818
909
0
0
0
0
But I expected results is:
s.n
ShgId
ShgName
MemId
MemName
YETDUE
0-30
31-60
61-90
91-120
121-180
181-365
366-689
Above_2_Yrs
1
5514
MAHALAXMI-5514
66735
SUNITA
10000
909
1818
2727
3636
0
0
0
I want only one record per member with aging .. please advice me for further action. -
Hi!
I want to create a report with the script i copied at the bottom of this message. For some reason i get the following error:
Error: Unable to describe SQL statement. Please correct it (WWV-13010)
(WWV-)
ORA-01001: invalid cursor (WWV-11230)
ORA-00937: not a single-group group function (WWV-11230)
Critical Error in wwerr_api_error.get_errors! SQL Error Message: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-01001: invalid cursor (WWV-)
Does anybody have a clue where this is coming from? It seems to me that there are no diffucult un-SQL like things in the script.
Thanks in advance!
SELECT rse.name||', '||rse.initials||' '||rse.prefix "Medewerker"
,dpt.name "Afdeling"
,sum(round(act.duration *24,2)) "Aantal uren"
,count(distinct(sht.begin_date)) "Aantal dagen"
,count(distinct(ill.begin_time)) "Aantal keer"
FROM ros.ros_departments@ROSPROD dpt
,ros.ros_scenarios@ROSPROD sco
,ros.ros_activity_types@ROSPROD aty
,ros.ros_activities@ROSPROD act
,ros.ros_duties@ROSPROD dty
,ros.ros_illnesses@ROSPROD ill
,ros.ros_shifts@ROSPROD sht
,ros.ros_resources@ROSPROD rse
WHERE rse.id = sht.rse_id
AND sht.name = 'Z'
AND sht.begin_date <= sysdate
AND ill.rse_id = rse.id
AND trunc(sht.begin_date) BETWEEN trunc(ill.begin_time) AND trunc(nvl(ill.end_time,sysdate))
AND dty.id = sht.dty_id
AND decode(sign(dty.begin_time)
,-1, sht.begin_date + 1
,sht.begin_date)
>= to_date('10-01-2000 00:00','dd-mm-yyyy hh24:mi')
AND decode(sign(dty.begin_time)
,-1,sht.begin_date + 1
,sht.begin_date)
<= to_date('10-01-2001 23:59','dd-mm-yyyy hh24:mi')
AND sht.begin_date >= to_date('10-01-2000 00:00','dd-mm-yyyy hh24:mi') - 1
AND sht.begin_date <= to_date('10-01-2001 23:59','dd-mm-yyyy hh24:mi') + 1
AND act.dty_id = dty.id
AND aty.id = act.ate_id
AND aty.name = 'Ziek'
AND sco.sce_rsr_id = sht.sce_id
AND sco.status = 'PUBLISHED' -- <> 'TRIAL' en 'PLAN'
AND dpt.id = sco.dpt_id
AND dpt.name NOT IN ('BEEK/VKL', 'BEEK/VLA','EELDE/VKL','EELDE/VLA','ROTTERDAM/VKL','ROTTERDAM/VLA','SIM','STO','RCN','XSurvey')
AND rse.name = :MDWPARAM
AND dpt.name = :AFDPARAM
GROUP BY rse.name||', '||rse.initials||' '||rse.prefix ,dpt.name
ORDER BY 2,1Hi,
Please run this sql statement in the SQL session. This way you will get the line number where the problem is happening.
The error seems to be because the column in the select is not in the group by clause.
Thanks,
Sharmila -
How to modify a SQL query?
Hi all,
I am using Crystal Reports version 10. I have a number of reports that have been written by a software vendor wherby the name of the database they were connected to when the report was written is coded into the FROM command of the reports SQL query, eg "GCUK_2" in the of the SQL snippet below.
SELECT "Clients"."NAME", "Quotes"."QUOTE_ID", "Quote_Items"."UPRICE", "Quote_Items"."QTY", "Quote_Items"."UOM", "Quote_Items"."QUSAGE_ID", "Report_Control"."QUSAGEID", "Quote_Items"."STANDARD", "Quote_Items"."SECT_FLAG", "Quote_Items"."DISPORDER", "Quotes"."DESCRIPT", "Report_Control"."SECT_NAME", "Quote_Items"."CNT", "Category_and_Type"."TYPEDESC", "Quote_Items"."DESCRIPT", "Report_Control"."DISP_SORT"
FROM ((("GCUK_2"."schedwin"."QTE_CTRL" "Report_Control" INNER JOIN "GCUK_2"."schedwin"."QUSAGE" "Quote_Items" ON "Report_Control"."QUSAGEID"="Quote_Items"."QUSAGE_ID") LEFT OUTER JOIN "GCUK_2"."schedwin"."QUOTES" "Quotes" ON
I have tried setting the Datasource Location, but it doesn't change the query at all. I have read on another forum that you can generate another SQL query using the Database Expert, Current Connections, then right click the Add Command for the database you want to create a SQL command. Is this the only way to update the database names in the query?
Thanks,
Scott.Hi Sourashree,
Thanks for that. All the reports were created by the vendor using tables as opposed to the command object. I would have thought that changing the datasource would automatically cause Crystal to rewrite the SQL query syntax, but this doesn't appear to be the case.
Yes, I've noticed that modifying the record selection will change the sql query. The only way I can see to change the database name in the query is to change to the desired databsource and then remove and re-insert the tables, which will then update the query with the correct name. However, this seems to be a convoluted way of changing the db name in the query. -
SQL query (pl/sql function body returning query) performance issue
I create my report in building my sql instruction with ( SQL Query pl/sql function body returning sql query );
My report take more than 20 seconds however if i did a cut and paste with the sql code in TOAD the same sql take 1 second.
To try to discover the source of the problem; i take the sql generated by the function and i create another report ( sql query ) this new report take 2 seconds.
My query is very big 25,000 characters with database link.
What is the difference between SQL-quey and sql-query(pl/sql function body returning sql query)
Thanks
MarcMarc,
Firstly...don't compare the timings from Toad, since often Toad only fetches the first few records for you (i.e. it pages them).
Secondly....the database link could be a factor here, but without seeing your query it's too hard to say.
Can you post the query somewhere (on a webserver say)? -
How to add a parameter to sql query in report
Hi
How to add a parameter to sql query in report.
Parameter is from Visual studio
example:
select * from tab1 where dl=parameter???
I have VS 2008 prof CR XI R2, mysqlHello,
If you have this API available then you can modify the record selection formulae in code to add filtering:
string recordSelectionFormula = "{T_INV_RPT_ADDR.IND_PROMUS} = {?P_PROMUS?} AND {T_INV_RPT_POINT.INVOICE_DATE} = DATE(2008, 05, 31) AND {T_INV_RPT_POINT.CHECKOUT_DATE} = date(2008, 04,29)";
CrystalDecisions.CrystalReports.Engine.ReportDocument.RecordSelectionFormula = recordSelectionFormula;
You have to format and follow the rules as in the Designer so not too much work to get this to work.
CR for .NET may not have the ability so you will need to upgrade to a Developer version of Crystal Reports.
Thank you
Don -
Determining the parameters passed in a Discoverer Report through SQL query
Hi,
I want to know the parameters passed in a Discoverer Report through a SQL query.
i.e if we pass the Report name (Workbook Name) then we get the paramaters used .
Is there any way we can do this.
Any help will be really appreciated.
Thanx in advance
AnkurHi
You can indeed get the parameters from the EUL5_QPP_STATS table, although they are extremely difficult to get at.
Look at this script:
SELECT
QS.QS_DOC_OWNER USER_NAME,
QS.QS_DOC_NAME WORKBOOK,
QS.QS_DOC_DETAILS WORKSHEET,
TRUNC(QS.QS_CREATED_DATE) DOC_DATE,
*(LENGTH(TO_CHAR(EUL5_GET_ITEM_NAME(QS.QS_ID)))+1)/9 ITEMS,*
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),1, 6)) ITEM1,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),10, 6)) ITEM2,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),19, 6)) ITEM3,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),28, 6)) ITEM4,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),37, 6)) ITEM5,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),46, 6)) ITEM6,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),55, 6)) ITEM7,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),64, 6)) ITEM8,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),73, 6)) ITEM9,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),82, 6)) ITEM10,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),91, 6)) ITEM11,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),100,6)) ITEM12,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),109,6)) ITEM13,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),118,6)) ITEM14,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),127,6)) ITEM15,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),136,6)) ITEM16,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),145,6)) ITEM17,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),154,6)) ITEM18,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),163,6)) ITEM19,
EUL5_GET_ITEM(SUBSTR(EUL5_GET_ITEM_NAME(QS.QS_ID),172,6)) ITEM20
FROM
EUL5_QPP_STATS QS--,
-- APPS.FND_USER USR
WHERE
-- QS.QS_DOC_OWNER = '#' || USR.USER_ID AND
*(LENGTH(TO_CHAR(EUL5_GET_ITEM_NAME(QS.QS_ID)))+1)/9 < 21*
AND QS.QS_CREATED_DATE > '01-JAN-2007'
What this does is return the first 20 items used in a worksheet. It does this by passing 6 characters at a time out of a cusror made up by concatenating QS_DBMP0 to QS_DBMP7 to get the Dimensions and then again by concatenating QS_MBMP0 to QS_MBMP7 to get the Measures. Having got that cursor it then takes each 6 characters and passes them to a nibble algorithm to decode the actual item. The code is extremely difficult to follow.
I mention this because other fields in the same table are QS_JBMP0 to QS_JBMP7 which I believe are Joins, and QS_FBMP0 to QS_FBMP7 which look like Filters (aka parameters) being used. I think the QS stands for Query Statistics and BMP for bitmap. Somewhere in the EUL5.SQL script is the key to unlocking this.
Good luck. The reason I say this will become apparent when you look inside EUL5.SQL.
Best wsihes
Mcihael -
Discoverer Report showing Null VS Show SQL query showing results !!!
I created a simple Cross Tab Discoverer report from a custom SQL which has a calculation for balances. The output is giving all null values even though there are balances. The output doesn't seem right. So I copied the query from Tools-->Show SQL and ran the query in the TOAD where I'm showing balances for the report. I don't understand why it is not showing in the discoverer. Please help.
Thanks
Edited by: PA1B on Jan 27, 2010 11:40 AMSorry for late reply.
Below is the Show SQL query. I don't think the query is application dependent. C_1 is my calculation.
SELECT o279709.SEGMENT3 as E279727,
o279709.SEGMENT4 as E279728,
CASE WHEN o279709.CURRENCY_CODE = 'USD' AND o279709.TRANSLATED_FLAG <> 'Y' THEN SUM(o279709.ENDING_BAL) ELSE 0 END as C_1,
GROUPING_ID(o279709.CURRENCY_CODE,o279709.SEGMENT3,o279709.SEGMENT4,o279709.TRANSLATED_FLAG) as GID
FROM ( --Foriegn Entity USD Balances
SELECT B.SEGMENT1,
B.SEGMENT2,
B.SEGMENT3,
(select distinct substr(cat.COMPILED_VALUE_ATTRIBUTES,5,1) from apps.fnd_flex_values cat
where FLEX_VALUE_SET_ID = (select bat.FLEX_VALUE_SET_ID from apps.fnd_id_flex_structures_vl aat, apps.fnd_id_flex_segments_vl bat
where bat.id_flex_code = 'GL#' and
bat.id_flex_code = aat.id_flex_code and
aat.APPLICATION_ID = bat.APPLICATION_ID and
aat.APPLICATION_ID = 101 and
bat.SEGMENT_NAME = 'Prime Account' and
aat.id_flex_num = bat.id_flex_num
and bat.id_flex_num in (select distinct chart_of_accounts_id from apps.gl_code_combinations gat
where gat.code_combination_id = A.code_combination_id))
and cat.flex_value = b.segment3) ACCT_TYPE ,
B.SEGMENT4,
B.SEGMENT5,
B.SEGMENT6,
B.SEGMENT7,
B.SEGMENT8,
B.SEGMENT9,
B.SEGMENT10,
B.SEGMENT11,
B.SEGMENT12,
B.SEGMENT13,
C.NAME,
A.SET_OF_BOOKS_ID,
A.CURRENCY_CODE,A.TRANSLATED_FLAG,
SUM(NVL(A.BEGIN_BALANCE_DR,0) - NVL(A.BEGIN_BALANCE_CR,0)) BEG_BAL,
SUM(NVL(A.PERIOD_NET_DR,0)) DEBITS,
SUM( NVL(A.PERIOD_NET_CR,0)) CREDITS ,
A.PERIOD_NAME,
SUM(NVL(A.BEGIN_BALANCE_DR,0) - NVL(A.BEGIN_BALANCE_CR,0))+ SUM(NVL(A.PERIOD_NET_DR,0) - NVL(A.PERIOD_NET_CR,0)) ENDING_BAL
FROM APPS.GL_BALANCES A ,
APPS.GL_CODE_COMBINATIONS B,
APPS.GL_SETS_OF_BOOKS C
WHERE A.CODE_COMBINATION_ID = B.CODE_COMBINATION_ID
--AND A.PERIOD_NAME = 'SEP-09'
AND C.SET_OF_BOOKS_ID = A.SET_OF_BOOKS_ID
--AND A.TRANSLATED_FLAG <> 'Y'
--AND B.SEGMENT1 = '83101'
--AND B.SEGMENT3 = '14602'
--AND A.SET_OF_BOOKS_ID = 77
--AND A.CURRENCY_CODE = 'USD'
GROUP BY A.CODE_COMBINATION_ID,
B.SEGMENT1,
B.SEGMENT2,
B.SEGMENT3,
B.SEGMENT4,
B.SEGMENT5,
B.SEGMENT6,
B.SEGMENT7,
B.SEGMENT8,
B.SEGMENT9,
B.SEGMENT10,
B.SEGMENT11,
B.SEGMENT12,
B.SEGMENT13,
A.CURRENCY_CODE,
A.TRANSLATED_FLAG,
C.NAME,A.PERIOD_NAME,
A.SET_OF_BOOKS_ID
) o279709
WHERE (o279709.PERIOD_NAME = 'DEC-09')
AND (o279709.SET_OF_BOOKS_ID <> 72)
AND (o279709.SEGMENT12 = '000')
AND (o279709.SEGMENT3 IN ('10101','10301','10502','12001'))
AND (o279709.SEGMENT1 IN ('82901','82902','82903','83001','83003','83201'))
GROUP BY GROUPING SETS(( o279709.CURRENCY_CODE,o279709.SEGMENT3,o279709.SEGMENT4,o279709.TRANSLATED_FLAG ),( o279709.SEGMENT3,o279709.SEGMENT4 ),( o279709.SEGMENT3 ))
HAVING (GROUP_ID()=0)
ORDER BY GID DESC;
Thanks,
PA1
Edited by: PA1B on Jan 29, 2010 12:50 PM -
Report- Pl/sql function returning sql query parsing page items as text?
Hi Team,
I am facing a strange issue .
I have four page items namely
1)JOB_CODE
2)MIN_EXP
3) MAX_EXP
4) SOURCES1
I have a report of the type "Pl/sql function returning sql query"
declare
v_sql varchar2(4000);
begin
if (:JOB_CODE IS NOT NULL and :MIN_EXP IS NOT NULL and :MAX_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
v_sql:= 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = :JOB_CODE and v_experience_years >= :MIN_EXP and v_experience_years <= :MAX_EXP and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
elsif (:JOB_CODE IS NULL and :MIN_EXP IS NOT NULL and :MAX_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
v_sql := 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where v_experience_years >= :MIN_EXP and v_experience_years <= :MAX_EXP and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
elsif (:MIN_EXP IS NULL and :JOB_CODE IS NOT NULL and :MAX_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
v_sql := 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where v_experience_years <= :MAX_EXP and V_REQUIREMENT = :JOB_CODE and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
elsif (:MAX_EXP is null and :JOB_CODE IS NOT NULL and :MIN_EXP IS NOT NULL and :SOURCES1 IS NOT NULL) then
v_sql := 'select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = :JOB_CODE and v_experience_years >= :MIN_EXP and source like ' || '''' || '%'|| ':SOURCES1' || '%' || '''';
end if;
insert into query_list values (v_sql);
insert into debug values (:JOB_CODE , :MIN_EXP , :MAX_EXP , :SOURCES1);
return v_sql;
end;
Please not that I am insertin the query into a table called Query_list and the page item values into the table called Debug thru the pl/sql function which returns teh query.
Now I select the data from the debug tables.
select unique(query) from query_list;
select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = :JOB_CODE and v_experience_years >= :MIN_EXP and v_experience_years <= :MAX_EXP and source like '%:SOURCES1%'
select * from debug;
JOBCODE MINEX MAXEX SOURCE
21 1 10 donkeyHire
And if I run the query in sql I get some records returned
select v_candidate_id, v_fname,v_current_employer,v_Experience_years from candidature where V_REQUIREMENT = 21 and v_experience_years >= 1 and v_experience_years <= and source like 'donkeyHire'
V_CANDIDATE_ID V_FNAME V_CURRENT_EMPLOYER V_EXPERIENCE_YEARS
2 Vengu Andale Tech 4
But the record does not show up in the report!
does this type of report parse page items as text?
Why is it so?
Waiting for an early reply.
Thanks,
venkatVenkat - You don't want to put ':SOURCES1' in quotes like that.
Scott
Maybe you are looking for
-
How do I add an Address Book Server account to iPhone 3G iOS 3.1.3
Heya, I have an iPhone 3G that is running version 3.1.3 of the iPhone OS and I need to add an Address Book Server account (that is being run on Snow Leopard Server to the phone but the only option I have is LDAP. My understanding is that Address Book
-
Problem in KDF Logical Database !!
Hii Friends, We need to modify Tcode F.42 and add a field Business Place(BUPLA) on Selection Screen. This is the main requirement. So i make a copy of this program and KDF logical database. I am adding a field BUPLA in ZKDF custom logical database. B
-
Maximum number of column in Composite Primary Key
Hi I have read that composite primary key can contain maximum of 32 columns (Oracle 9i). However I am able to create a primary key on 33 columns. It fails to create primary key on 34 columns. Below are the queries. DROP TABLE XYZ; CREATE TABLE XYZ (
-
Can't read notes while recording voiceover
It seems Keynote only allows me to record while viewing the slideshow in "play" mode. I need to record it while looking at my notes on screen. Can it do that?
-
Hi I have a webapplication deployed in one server connecting to 2 different databases. Some customizations has to be done to make it appear different like the text appearing in webpages. there is one place where i have to use a different jsp dependin