Query to get the units of capital fixed for the period?
Hi all
I'm building a report in capital in Oracle Apps R12.
Since a few days I'm fighting with units of query. I'm not able to get the correct units for the period.
An asset can have several scenarios such as partial retirement, full retirement, transfer, partial transfer, camera settings full reintegration... etc.
So anyone who has an idea about this?
Each kindly do the needful.
Station pl in Navision Financials
Tags: Oracle Applications
Similar Questions
-
SQL query to get the NULL records after the last matching flag
I have a xx1 table with id and flag columns. So I want the data in this table, after the last flag matched. I want that data to id 7 in the rooms. Even if the id 2,3,5 are null flag 'Y' was at 6. ID so I need a query to get the data of the xx1 table after the last correspondence flag (from 7 to 9 id).
SQL > create table xx1
2 (identification number,
3 flag varchar2 (10));
Table created.
SQL > insert into xx1 values (1, 'Y');
1 line of creation.
SQL > insert into values xx1 (2, null);
1 line of creation.
SQL > insert into values xx1 (3, null);
1 line of creation.
SQL > insert into xx1 values (4, 'Y');
1 line of creation.
SQL > insert into values xx1 (5, null);
1 line of creation.
SQL > insert into xx1 values (6, 'Y');
1 line of creation.
SQL > insert into values xx1 (7, null);
1 line of creation.
SQL > insert into values xx1 (8, null);
1 line of creation.
SQL > insert into values xx1 (9, null);
1 line of creation.
SQL > select * from xx1.
FLAG OF THE ID
---------- ----------
1. IS
2
3
4. IS
5
6. IS
7
8
9
9 selected lines.
SQL >
Hello
user11164339 wrote:
Hi Frank - when I run the query, I don't see the results data.
I get
FLAG OF THE ID
----- ----------
7
8
9
What you do differently?
-
IOM sql Query to get the status of the failed task
Hello world
We have an obligation as we need to get the status of a particular task (say Create User in OID - Completed\Rejected status resource) for the particular user. We are able to get the status of the provisioed of resources to the user but not the status of the special mission which is trigerred for the user.can someone put some light on it. We must have the SQL query to do this.
Thanks in advance.
Kind regards
MKNHello
Use this query to get the status of the task, also check the coomentsSELECT USR. USR_LOGIN, OSI. SCH_KEY, ANN. SCH_STATUS, STA. STA_BUCKET OF
OSI, CHS, STA, MIL, TOS, PKG, OUEDRAOGO, USR, OBJ, OST
WHERE OSI.MIL_KEY = MIL.MIL_KEY
AND ANN. SCH_KEY = OSI. SCH_KEY
AND STA. STA_STATUS = SCH. SCH_STATUS
AND TOS. PKG_KEY = PKG. PKG_KEY
AND MIL. TOS_KEY = TOS. TOS_KEY
AND OUÉDRAOGO. USR_KEY = USR. USR_KEY
AND OUÉDRAOGO. OST_KEY = OST. OST_KEY
AND OST. OBJ_KEY = OBJ. OBJ_KEY
AND OSI. ORC_KEY = OUEDRAOGO. ORC_KEY
AND OBJ. OBJ_NAME = "User AD".
AND OST. OST_STATUS = "Provisioning" - filter accordinglly
AND STA. STA_BUCKET = 'pending' - filter accordinglly
AND PKG. PKG_NAME = "AD User" - filter accordinglly
AND MIL.MIL_NAME = 'System' - filter accordinglly Validation
;
Thank you
Kuldeep -
Query to get the data of the column and the metadata in the same set of results.
Is it possible to build a query to get the values of the columns in a table and also be able to get some metadata (data type, data_length, data_precision, data_scale) for columns in the same set of results.If I use a join, have a common value to join on the two tables?
you use a cross join, not requiring common values.
create table T (n number, d date, v varchar2(30)); insert into T values (1,sysdate,'ABC'); commit; select C.column_name, c.data_type, c.data_length, case c.column_id when 1 then to_char(T.N) when 2 then to_char(T.D) when 3 then T.V end VALUE from USER_TAB_COLUMNS C, T where C.table_name='T' order by c.column_id;
-
How to write a simple select query to get the data of the table as an XML.
How to write a simple select query to get the data of the table as an XML. In the query, I'm just adding items below which i need be there in the XML document
I have need to add the root tag as well in the beginning and the end of < root > < / root > this xml file. Please advice if this is possible with the select queryselect '<test_tag>'||EMP_NAME||'</test_tag>','<date>'||sysdate||'</date>' from temp_table where id_num BETWEEN 1 AND 10;
without using XMLGEN, XMLQUERY or any other packages built and function?I need to URL escapes with the UTF-8 code points that we have already achieved using the utl_http package. Please help how to do that without using the utl_http package.
What is wrong with him?
At present, the only way I can think of to avoid a call to UTL_HTTP. SET_BODY_CHARSET is to write your own little wrapper.
In this way, you can specify the Boolean parameter or omit it if you choose to use named parameters:SQL> create or replace function my_url_escape (url in varchar2) 2 return varchar2 3 deterministic 4 is 5 begin 6 return utl_url.escape(url, false, 'AL32UTF8'); 7 end; 8 / Function created SQL> select my_url_escape('http://some.uri.com/param?lang=fr&text=contrôle') from dual; MY_URL_ESCAPE('HTTP://SOME.URI -------------------------------------------------------------------------------- http://some.uri.com/param?lang=fr&text=contr%C3%B4le
-
Query to get the flex field values description.
Hello
Entering invoices-> all the Distributions screen 'Special Mentions for the India' is here. Here we enter the value for the field TDS - tax. I want to get the list of values for TDS - tax in a query.
Can you please help me.
Thank you
Nanga.
where 'jtc.tax_type =' TDS
and jtc.section_type = 'TDS_SECTION. '
and org_id =: inv_sum_folder.org_id
and jtc.section_code in
(
Select section_code
of jai_ap_tds_th_vsite_v
where vendor_id =: inv_sum_folder.vendor_id
and vendor_site_id =: inv_sum_folder.vendor_site_id
)
order of jtc.tax_id
-
Need help with the query to get the County
Hello
Oracle 10 g 2 10.2.0.3 - 64 bit
I want back the number of accounts with two different types of funds (say A and B). Some accounts hold only one of the two funds, and some support both. I want to get the counts like this:
- account held funds - has only
- accounts holding funds-B only
- accounts holding the Fund-A and B funds
Here is what I started with but need assistance to meet the requirement above:
select count(distinct acct.bkoff_acct_no ) accounts_holding_fund_A from xe_account acct, xec_tal_investment_mandate iman, xec_tal_asset_allocation alloc, xe_benchmark bmark, xe_benchmark_usage bu, xe_object_description xod, xec_asset_class cls where iman.mandate_status_cd='A' and cls.asset_class_cd = alloc.asset_class_cd and iman.mandate_id = alloc.mandate_id and acct.account_id = iman.object_id and iman.object_type_cd = 'ACCT' and iman.mandate_id = xod.object_id and xod.field_nm='XEC_TAL_INVESTMENT_MANDATE.COMMENT_TXT' and xod.language_cd = 'E' and acct.acct_status_cd = 'O' and bu.object_type_cd(+) = 'TMAA' and bu.object_id(+) = alloc.asset_allocation_id and bmark.benchmark_id(+) = bu.benchmark_id and alloc.resp_txt like '%fund-A%'
And suppose that the Fund-B has resp_txt like ' % of Fund-B»
Please suggest.
Concerning
Hello
Here is another way, it is easier to adapt to different jobs and different numbers of jobs:
WITH got_distinct_jobs AS
(
SELECT DISTINCT deptno, job
FROM scott.emp
WHERE job IN ("ANALYST", "CLERKS") - or what
)
got_job_list AS
(
SELECT LISTAGG (job, ",") THE Group (ORDER BY work) AS job_list
OF got_distinct_jobs
GROUP BY deptno
)
SELECT job_list
COUNT (*) AS num_departments
OF got_job_list
GROUP BY job_list
;
This shows all the combinations of the jobs listed in the WHERE clause of got_distinct_jobs. You don't need to change anything else in the query. There may be any number of jobs.
Output:
JOB_LIST NUM_DEPARTMENTS
------------------------------ ---------------
CLERK 2
ANALYST, CLERK 1
-
Analysis of query and get the list of used tables
Hi all
I need to parse the sql query (simple & complex as well) and for a list of the tables used in the query.
And need to validate the fact that list the tables against a whitelist that is kept in the file.
I tried to write my own parser, because there are many ways to write complex queries, I'm unable to cover all scenarios.
I need help, is there other ways to get the list of tables used in a query?
Thank you
Manon...
In general you would add a condition 1 = 2 just to restrict the display of the entire table. Then should not be causing any noticeable performance degradation. You can even use ROWNUM< 2.="" that="" will="" do="" a="" count="" stopkey.="" which="" could="" be="">
SQL > select * from emp where rownum<>
no selected line
SQL > select * from table (dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
SQL_ID, 97f4bd002xfy0, number of children 0
-------------------------------------
Select * from emp where rownum<>Hash value of plan: 4269703525
---------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | | | 2 (100) | |
|* 1 | COUNT STOPKEY | | | | | |
| 2. TABLE ACCESS FULL | EMP | 1. 38. 2 (0) | 00:00:01 |
---------------------------------------------------------------------------Information of predicates (identified by the operation identity card):
---------------------------------------------------1 Filter (ROWNUM<>
19 selected lines.
But its always good to bench mark it yourself.
-
Query to get the difference between 2 totals of 2 different queries
I wanted to know if it is possible to get the difference between 2 totals of 2 different queries. Let me explain with an example:
1 application ofst - sum (homepass) Select table 1
2th query: select sum (homepass) from table2
Is it possible to display the difference as -
Select sum (homepass) in table 1 - sum (homepass) from table2
I know that the above query would give syntax error, but is there a better way or something to get the above done task from a single query.
Hopefully, my question is clear.
Please get back with the answer to my query.
Concerning
You can always do something like
SELECT a.cnt - b.cnt FROM (SELECT sum(homepass) cnt from table1) a, (SELECT sum(homepass) cnt from table2) b
I'd be somewhat dubious, although on a data model that had two tables with the same name of the column where it really made sense to subtract one amount from each other. This would strongly imply that there should be a single table with an additional column TYPE eventually.
Justin
-
I'm looking for only column compare to my same target table as a table source.
My query:
Select case when column_name_s is null and column_name_t is not null
then "alter table GRADE_CONVERSION drop | column_name_t | ';'
When column_name_s is not null and column_name_t is null
then "alter table GRADE_CONVERSION add | column_name_s | ' ' || data_type_s | « ; »
else 'alter table modify GRADE_CONVERSION | column_name_t | ' ' || data_type_t | « ; »
alterations of the end
from (select s.column_name column_name_s, t.column_name column_name_t,
s.data_type data_type_s, t.data_type data_type_t
(select column_name, column_id, data_type
of all_tab_cols@database
where owner = 'erhan.
and table_name = "GRADE_CONVERSION."
+ 1
full outer join
(select column_name, column_id, data_type
of all_tab_cols@database
where owner = 'sarigul.
and table_name = "GRADE_CONVERSION."
+ 6
on s.column_name = t.column_name
)
Tables:
Target table: table GRADE_CONVERSION in sarigul@database
LETTER_GRADE VARCHAR2 (2) GRADE_POINT NUMBER (3.2) MAX_GRADE NUMBER (3) MIN_GRADE NUMBER (3) Table source: Table GRADE_CONVERSION in erhan@database
LETTER_GRADE VARCHAR2 (2) GRADE_POINT NUMBER (3.2) MAX_GRADE NUMBER (3) MIN_GRADE NUMBER (3) CREATED_BY VARCHAR2 (30) CREATED_DATE DATE MODIFIED_BY VARCHAR2 (30) MODIFIED_DATE DATE want to see output that is similar to this * (please ignore the names of column here it's just a clear example :))
ALTER table Target_table change BOOK_ID Varchar2 (4);
ALTER table Target_table I addSBN_10 Varchar2(13), null;
ALTER table drop TITLE Target_table;
Erhan_toronto wrote:
1.I used src.nullable src_nullable and tgt.nullable tgt_nullable but only show Yes as below: but want to see the result as not null or null
ALTER table TEST_TARGET change the NUMBER of MAX_GRADE (3, 2) Yes
Ok. So it's all about the Yes and the no decoding to Default Null or Not Null, isn't it?
So, to test, change one of the table of sample for NOT NULL columns in the source table, and then run the following query:
with src as ( select src.table_name src_table_name, src.column_name src_col_name, src.data_type src_data_type, src.data_length src_data_len, src.data_precision src_data_precision, src.data_scale src_data_scale, src.nullable src_nullable from user_tab_columns src where table_name = 'TEST_SOURCE' ), tgt as ( select tgt.table_name tgt_table_name, tgt.column_name tgt_col_name, tgt.data_type tgt_data_type, tgt.data_length tgt_data_len, tgt.data_precision tgt_data_precision, tgt.data_scale tgt_data_scale, tgt.nullable tgt_nullable from user_tab_columns tgt where table_name = 'TEST_TARGET' ), col_details as ( select src.src_table_name, nvl(tgt.tgt_table_name, first_value(tgt_table_name) over(order by tgt_table_name nulls last)) tgt_table_name, src.src_col_name, src.src_data_type, src.src_data_len, src.src_data_precision, src.src_data_scale, src.src_nullable, tgt.tgt_col_name, tgt.tgt_data_type, tgt.tgt_data_len, tgt.tgt_data_precision, tgt.tgt_data_scale, tgt.tgt_nullable from src left outer join tgt on ( src.src_col_name = tgt.tgt_col_name ) ) select * from ( select case when tgt_data_type != src_data_type or tgt_data_len != src_data_len or tgt_data_precision != src_data_precision or tgt_data_scale != src_data_scale or src_nullable != tgt_nullable then 'alter table ' || tgt_table_name || ' modify ' || tgt_col_name || ' ' || src_data_type || ' (' || case when src_data_type in ('DATE') then null else case when src_data_type in ('VARCHAR', 'VARCHAR2') then nvl(to_char(src_data_len), ' ') || ') ' else decode(nvl(src_data_precision, -1), -1, null, nvl(to_char(src_data_precision), ' ') || ', ' || nvl(to_char(src_data_scale), ' ') || ')') end end || decode(src_nullable, 'NO', ' NOT NULL', ' DEFAULT NULL') when tgt_col_name is null then 'alter table ' || tgt_table_name || ' add ' || src_col_name || ' ' || src_data_type || case when src_data_type in ('DATE') then null else case when src_data_type in ('VARCHAR', 'VARCHAR2') then nvl(to_char(src_data_len), ' ') || ') ' else decode(nvl(src_data_precision, -1), -1, null, nvl(to_char(src_data_precision), ' ') || ', ' || nvl(to_char(src_data_scale), ' ') || ')') end end || decode(src_nullable, 'NO', ' NOT NULL', ' DEFAULT NULL') end alter_statement from col_details ) where alter_statement is not null;
Erhan_toronto wrote:
2. when I run below under user sarigul and erhan I get the result as OWNER, TABLE_NAME, COLUMN_NAME DATA_TYPE... I have a link between two users. They have access to two tables.
- Select * from all_tab_columns
where owner = 'erhan' and table_name = "TEST_SOURCE."
- Select * from all_tab_columns
where owner = 'sarigul' and table_name = "TEST_TARGET."
Alright. This means that you both users are on the same database. Only change, you will have to do in the above query is so change user_tab_columns to all_tab_columns and add the OWNER predicate respectively with the clause.
-
Query to get the total counts in the given scenario
Hello
I use Oracle 10 g
I have a table with the following data
AgId Trm CD S
-------------------------------------------------
A 1000 100010, 12 - JAN
A 1000 100019, 20 - MAR
1000 100019 D 20-JUL
-------------------------------------------------
1001 100011 25-JAN HAS
1001 100011 D 20 - FEB
A 1001 100011, 23 - MAR
1001 100012 A 31 - JAN
-------------------------------------------------
1002 100013 A 14 - FEB
D 1002 100013 05 - APR
1002 100015 02-MAY HAS
-------------------------------------------------
A 1003 100014, 03 - MAR
1003 100014 D 25 - MAR
-------------------------------------------------
1004 100016 HAS 22 - MAY
1004 100017 21 - JUN HAS
A 1004 100018, 01 - JULY
-------------------------------------------------
1005 100020 D 21-MAY
1005 100020 HAS 21-JUL
1005 100020 D 11 - AUG
Here the overall status of AgId '1000' is A as it is to have at least 1 active Trm
Similarly, the status of AgId '1001' is A
status of AgId '1002' is A
But, the AgId '1003' is D its CRT is disconnected after activation (according to the date column 'CD')
Then, the status of AgId '1004' is A
and finally AgId '1005' is new D as its CRT disabled, active and disabled finally
Therefore, taking into account these criteria can someone give me a query to get (not AgId, who are 'Assets') and similarly 'disabled '.
-
SQL query to get the number of days monthwise
Hello
I'm new to sql, can someone please tell me query to find the number of days between the two dates months wise.
say
FIRSTDATE last date
21/03/2011-25/06/2011
March April May June
9 22 23 18Hello
Welcome to the forum!
Here's one way:
WITH all_dates AS ( SELECT start_date + LEVEL - 1 AS a_date FROM ( SELECT TO_DATE ('21/03/2011', 'DD/MM/YYYY') AS start_date , TO_DATE ('25/06/2011', 'DD/MM/YYYY') AS end_date FROM dual ) CONNECT BY LEVEL <= end_date + 1 - start_date ) SELECT TO_CHAR ( TRUNC (a_date, 'MONTH') , 'fmMonth YYYY' ) AS month , COUNT (*) AS num_days FROM all_dates WHERE a_date - TRUNC (a_date, 'IW') < 5 GROUP BY TRUNC (a_date, 'MONTH') ORDER BY TRUNC (a_date, 'MONTH') ;
What is a 'working day '? I guess you mean every day except Saturday or Sunday, but the query aboveare sometimes figures less than you have asked:
MONTH NUM_DAYS --------------- ---------- March 2011 9 April 2011 21 May 2011 22 June 2011 18
Are a few days working on Saturday or Sunday? How do you get the 22 working days in April 2011 and 23 in may?
SQL is good at obtaining results with a variable number of rows, but you have to say exactly the desired number of columns when you write the query.
If you really need the output of the way you said, with any number of columns, then watch in swing or a grouping of the chain . See the FAQ forum
https://forums.Oracle.com/forums/Ann.jspa?annID=1535
"4. How can I convert rows to columns. -
query to get the required files for recovery...
I'm on 11.2.0.1 catalog trgt db and restoration and I wanted to find can query outwhat I ran to get the backup files that I need...
Say so I want to restore my database to 11-Jan-2012 14:00 hours...
So what query do I need to run to find out what are the backup files I need? The reason for this is... backup are on tape and tape drives are send off site after the backup is done... so we have to find these are the necessary backup for restoring file and lie on this band... until they ask to get this info?
query should return the necessary backup files (say backup of level 0, level 1 backup peiece, archive etc etc log backup items)...user12857022 wrote:
I'm on 11.2.0.1 catalog trgt db and restoration and I wanted to find can query outwhat I ran to get the backup files that I need...Say so I want to restore my database to 11-Jan-2012 14:00 hours...
So what query do I need to run to find out what are the backup files I need? The reason for this is... backup are on tape and tape drives are send off site after the backup is done... so we have to find these are the necessary backup for restoring file and lie on this band... until they ask to get this info?query should return the necessary backup files (say backup of level 0, level 1 backup peiece, archive etc etc log backup items)...
Of RMAN
run
{
until -
query to get the maximum integer value of varchar columns
I have the following values in the column of type Varchar.
USR_LOGIN (VARCHAR2)
-----------------------------
50
52
53
55
57
123
111
145
XELSYSADM
TESTUSER
USER123
12TESTUSER
But I need to get the result as 145.
Can you help me with the sql query?Maybe it's
SQL> with t as ( select '50' usr_login from dual union all select '52' from dual union all select '53' from dual union all select '55' from dual union all select '57' from dual union all select '123' from dual union all select '111' from dual union all select '145' from dual union all select 'XELSYSADM' from dual union all select 'TESTUSER' from dual union all select 'USER123' from dual union all select '12TESTUSER' from dual ) -- -- select max(to_number(regexp_substr(usr_login, '\d+'))) usr_login from t / USR_LOGIN --------------- 145 1 row selected.
-
Hello everyone,
How can I create a query having 2 date and 2 variable of the type:
Thanks in advancefrom 1 date 05/06/2004 to 2 date 15/06/2004 yes for 2 days no for 1 day that is, i wish get the date with yes for 2 days and not for 1 day, this is, that I want 05/06/2004 sabato 06/06/2004 domenica 08/06/2004 martedì 09/06/2004 mercoledi 11/06/2004 venerdi 12/06/2004 sabato 14/06/2004 lunedi 15/06/2004 martedi
Hello
The WHERE clause controls the lines will appear.
If your needs change, change the WHERE clause to reflect their.For example:
DEFINE from_date = "TO_DATE ('05/06/2004', 'DD/MM/YYYY')" DEFINE to_date = "TO_DATE ('15/06/2004', 'DD/MM/YYYY')" DEFINE yes_cnt = 3 DEFINE no_cnt = 2 SELECT &from_date + LEVEL - 1 AS dt FROM dual WHERE MOD ( LEVEL , &yes_cnt + &no_cnt ) BETWEEN 1 AND &yes_cnt CONNECT BY LEVEL <= 1 + &to_date - &from_date ORDER BY dt;
This will work as long as you want the first & yes_cnt lines to display (assuming that there are many) and the following lines & no_cnt don't step to display, and then another & yes_cnt lines to display and the other & no_cnt lines not to display and so on.
I guess & yes_cnt is a positive integer and that & no_cnt is a non-negative integer. (I.e. & no_cnt can be 0)
Maybe you are looking for
-
After buying an opportunity 2012/13 Macbook Air I can access is the app store. I changed my password but still no luck. Message says it can't recognize my Macbook.
-
Satellite L755 - 17Q - breaks of each network card in 5 minutes
5-minute breaks my network card.I then troubleshoot my network card and apparently it gets 'fixed', however in another 5 minutes it will be broken again. Here is the report of troubleshooting:+ http://pastebin.com/FVUKXpmX+(Sorry for making a pastebi
-
Satellite A500 - display driver failed
Hello Recently, my three year old Toshiba A500 (0400E PSAM3A) has started to display the message "Display Driver failed" and the screen became all BEHLULI and weird. I'm sure it's the graphics card, open the computer self and he cleaned it with an ai
-
Update for hp pavilion g6-1d73us WiFi adapter
I have a HP Pavilion g6-1d73us running Windows 7 Home Premium with Intel Core i3 2.30 GHz, 4 GB RAM, 64-bit OS and want to upgrade my wireless WiFi 802.11ac 802.11n wifi adapter so I can also change my modem & router to the new, faster standard. The
-
Satellite L500 - 1-7 - FAN runs at 50%
Recently, I noticed that the fan of my new laptop Toshiba Satellite (Windows 7 64 bit, Pentium T4300) is constantly running at about 50% (according to the Toshiba PC Health Monitor), even if there are 0% CPU usage. Is this normal?Or do I have to chan