I want GL Query
i want to write query for General ledger in sql 2005 , plz help me for code
Hi,
Please refer thread http://scn.sap.com/thread/3601284
Thanks & Regards,
Nagarajan
Similar Messages
-
I want to query sql server database from oracle
i want to query sql server database from oracle
can anyone help me in this regardFirst of all - you are in the wrong forum.
Look either for the Database general or search for Transparant / Heterogenous Gateways.
cu
Andreas -
I want to query oracle database from sql server can anyone tell steps 2 fo
i want to query oracle database from sql server can anyone tell steps 2 followed
i tried with linked servers but it is throwing errors can anyone hepl in this regard
The operation could not be performed because the OLE DB provider 'MSDAORA' was unable to begin a distributed transaction.
OLE DB error trace [OLE/DB Provider 'MSDAORA' ITransactionJoin::JoinTransaction returned 0x8004d01b].First of all - you are in the wrong forum.
Look either for the Database general or search for Transparant / Heterogenous Gateways.
cu
Andreas -
I want to query oracle database from sql server can anyone tell steps 2 fol
i want to query oracle database from sql server can anyone tell steps 2 followed
i tried with linked servers but it is throwing errors can anyone hepl in this regard
The operation could not be performed because the OLE DB provider 'MSDAORA' was unable to begin a distributed transaction.
OLE DB error trace [OLE/DB Provider 'MSDAORA' ITransactionJoin::JoinTransaction returned 0x8004d01b].First of all - you are in the wrong forum.
Look either for the Database general or search for Transparant / Heterogenous Gateways.
cu
Andreas -
don't use break i want singal query.
**This EMP table.**
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7,369 SMITH CLERK 7,902 12/17/0080 800.00 NULL 20
7,499 ALLEN SALESMAN 7,698 2/20/0081 1,600.00 300.00 30
7,521 WARD SALESMAN 7,698 2/22/0081 1,250.00 500.00 30
7,566 JONES MANAGER 7,839 4/2/0081 2,975.00 NULL 20
7,654 MARTIN SALESMAN 7,698 9/28/0081 1,250.00 1,400.00 30
7,698 BLAKE MANAGER 7,839 5/1/0081 2,850.00 NULL 30
7,782 CLARK MANAGER 7,839 6/9/0081 2,450.00 NULL 10
7,788 SCOTT ANALYST 7,566 4/19/0087 3,000.00 NULL 20
7,839 KING PRESIDENT NULL 11/17/0081 5,000.00 NULL 10
7,844 TURNER SALESMAN 7,698 9/8/0081 1,500.00 NULL 30
7,876 ADAMS CLERK 7,788 5/23/0087 1,100.00 NULL 20
7,900 JAMES CLERK 7,698 12/3/0081 950.00 NULL 30
7,902 FORD ANALYST 7,566 12/3/0081 3,000.00 NULL 20
7,934 MILLER CLERK 7,782 1/23/0082 1,300.00 NULL 10
**I want result**
DEPARTMENT EMPNO ENAME no of emplyee
10 7839 KING 3
7782 CLARK
7934 MILLER
20 7369 SMITH 5
7902 FORD
7876 ADAMS
7788 SCOTT
7566 JONES
30 7499 ALLEN 6
7521 WARD
7654 MARTIN
7900 JAMES
7844 TURNER
7698 BLAKE
Edited by: apalani06032009 on Jul 2, 2009 5:29 AMHi,
SQL> break on count
SQL> select deptno,empno,ename,count(*) over(partition by deptno) count from emp;
DEPTNO EMPNO ENAME COUNT
10 7782 CLARK 3
10 7839 KING
10 7934 MILLER
20 7566 JONES 5
20 7902 FORD
20 7876 ADAMS
20 7369 SMITH
20 7788 SCOTT
30 7521 WARD 6
30 7844 TURNER
30 7499 ALLEN
30 7900 JAMES
30 7698 BLAKE
30 7654 MARTIN
14 rows selected.Regards -
I want SQL query to check if any of our important concurrent programs
I want a sql query to check if any of our important concurrent programs are currently scheduled or not
SinghP wrote:
I want a sql query to check if any of our important concurrent programs are currently scheduled or notThat's nice,
What scheduling tool are you using? are you referring to dbms_job?
what version of Oracle are you using? are you using some custom job management system that involves writing to user created tables in your database? -
Want a query to see only the changes data of a specific no.
here are the table sturcucture and data for the table:
create table import_lc (
LC_NO varchar2(20),
AMEND_NO varchar2(2),
USANCE_PERIOD number,
AMT_FCY number,
AMT_LCY number,
SHIPMENT_PERIOD number,
EXPIRY_DATE date,
EXPIRY_PLACE varchar2(50));
Insert into FE_IMPORT_LC
(LC_NO, AMEND_NO, USANCE_PERIOD, AMT_FCY, AMT_LCY, SHIPMENT_PERIOD, EXPIRY_DATE,
EXPIRY_PLACE)
Values
('1', '1', 90, 10000, 500000, 15, TO_DATE('02/13/2008 00:00:00', 'MM/DD/YYYY
HH24:MI:SS'), 'DHAKA');
Insert into FE_IMPORT_LC
(LC_NO, AMEND_NO, USANCE_PERIOD, AMT_FCY, AMT_LCY, SHIPMENT_PERIOD, EXPIRY_DATE,
EXPIRY_PLACE)
Values
('1', '2', 90, 10000, 500000, 30, TO_DATE('03/13/2008 00:00:00', 'MM/DD/YYYY
HH24:MI:SS'), 'DHAKA');
Insert into FE_IMPORT_LC
(LC_NO, AMEND_NO, USANCE_PERIOD, AMT_FCY, AMT_LCY, SHIPMENT_PERIOD, EXPIRY_DATE,
EXPIRY_PLACE)
Values
('2', '1', 90, 15000, 800000, 30, TO_DATE('01/19/2008 00:00:00', 'MM/DD/YYYY
HH24:MI:SS'), 'DHAKA');
Insert into FE_IMPORT_LC
(LC_NO, AMEND_NO, USANCE_PERIOD, AMT_FCY, AMT_LCY, SHIPMENT_PERIOD, EXPIRY_DATE,
EXPIRY_PLACE)
Values
('2', '2', 120, 20000, 1000000, 30, TO_DATE('01/19/2008 00:00:00', 'MM/DD/YYYY
HH24:MI:SS'), 'DHAKA');
COMMIT;
NOW, if u see the table data, u see,
for lc_no=1; only the shipment_period and expiry_date has been changed with the
amend_no.
NOW, if u see the table data, u see,
for lc_no=2; only the amt_fcy and amt_lcy has been changed with the amend_no.
there could be many more columns like these where the data can change with the
amend_no but the lc_no will be the same.
now, i want to make a query by which i can see only the changes column value for a
particular lc_no and maximum amend_no for that lc_no.
& result data should be from the maximum amend_no for that lc_no.
like:
for lc_no = 1 ;
SHIPMENT_PERIOD EXPIRY_DATE
30 13-03-2008
And for lc_no = 2 ;
USANCE_PERIOD AMT_FCY AMT_LCY
120 20000 1000000I'm not sure that I completely understand your requirement, but here's something that should, at the very least, get you started. If you don't know what the LAG function does, look it up in the documentation.
SELECT lc_no,
amend_no,
usance_period,
amt_fcy,
amt_lcy,
shipment_period,
expiry_date,
expiry_place
FROM (SELECT lc_no,
amend_no,
CASE
WHEN usance_period <> LAG (usance_period) OVER (PARTITION BY lc_no ORDER BY amend_no) THEN usance_period
END usance_period,
CASE
WHEN amt_fcy <> LAG (amt_fcy) OVER (PARTITION BY lc_no ORDER BY amend_no) THEN amt_fcy
END amt_fcy,
CASE
WHEN amt_lcy <> LAG (amt_lcy) OVER (PARTITION BY lc_no ORDER BY amend_no) THEN amt_lcy
END amt_lcy,
CASE
WHEN shipment_period <> LAG (shipment_period) OVER (PARTITION BY lc_no ORDER BY amend_no) THEN shipment_period
END shipment_period,
CASE
WHEN expiry_date <> LAG (expiry_date) OVER (PARTITION BY lc_no ORDER BY amend_no) THEN expiry_date
END expiry_date,
CASE
WHEN expiry_place <> LAG (expiry_place) OVER (PARTITION BY lc_no ORDER BY amend_no) THEN expiry_place
END expiry_place,
rn
FROM (SELECT lc_no,
amend_no,
usance_period,
amt_fcy,
amt_lcy,
shipment_period,
expiry_date,
expiry_place,
ROW_NUMBER () OVER (PARTITION BY lc_no ORDER BY amend_no DESC) rn
FROM fe_import_lc)
WHERE rn <= 2)
WHERE rn = 1 -
I want sql query for this output
hi guys
could u tell how can i write sql query for this out put
i have one table like this
ID ACCOUTID TAX
1 1 A
2 1 B
3 2 C
4 2 D
5 3 E
7 NULL F
8 NULL G
MY OUT PUT MUST BE LIKE THIS
ID AID TAX
2 1 A
4 2 D
7 NULL F
8 NULL G
HERE IN THIS OUTPUT I SHOULD HAVE
MAXIMAM ID VALUE FOR A REPEATED AID VALUES
AND
THE ROWS AID VALUES IS NULL ALSO MUST PAPULATED IN THE OUTPUT.
I KNOW ONE SOLUTION LIKE THIS
SELECT MAX(ID),AID,TAX
FROM TABLE T
GROUP BY AID,TAX
UNION ALL
SELECT ID, AIC,TAX
FROM TABLE T
WHERE AID IS NULL;
BUT I WANT SAME RESULT WITH OUT USING LOGICAL OPERATORS.
COULD U PLZ TELL A SOL.Will this help:
SQL> with t as
2 (
3 select 1 ID, 1 ACCOUTID, 'A' TAX from dual union all
4 select 2, 1, 'B' from dual union all
5 select 3, 2, 'C' from dual union all
6 select 4, 2, 'D' from dual union all
7 select 5, 3, 'E' from dual union all
8 select 7, NULL, 'F' from dual union all
9 select 8, NULL, 'G' from dual
10 )
11 --
12 select id, ACCOUTID AID, Tax
13 from
14 (
15 select t.*
16 ,count(1) over (partition by t.ACCOUTID) cn
17 ,row_number() over (partition by t.ACCOUTID order by id desc) rn
18 from t
19 )
20 where cn > 1
21 and (rn = 1 or ACCOUTID is null)
22 /
ID AID T
2 1 B
4 2 D
8 G
7 F
-- If I leave out the OR condition then you'll get this:
SQL> ed
Wrote file afiedt.buf
1 with t as
2 (
3 select 1 ID, 1 ACCOUTID, 'A' TAX from dual union all
4 select 2, 1, 'B' from dual union all
5 select 3, 2, 'C' from dual union all
6 select 4, 2, 'D' from dual union all
7 select 5, 3, 'E' from dual union all
8 select 7, NULL, 'F' from dual union all
9 select 8, NULL, 'G' from dual
10 )
11 --
12 select id, ACCOUTID AID, Tax
13 from
14 (
15 select t.*
16 ,count(1) over (partition by t.ACCOUTID) cn
17 ,row_number() over (partition by t.ACCOUTID order by id desc) rn
18 from t
19 )
20 where cn > 1
21* and rn = 1
SQL> /
ID AID T
2 1 B
4 2 D
8 G
--which follows the description you've given, but not the output -
Wants Combain query of GRPO -Return- AP Invoice
Dear All,
Pls. help me for this query.
A) GRPO :
Vendor code
Vendor name
Doc Num
Doc status
Posting date
Total Before discount
Tax
Freight
Total Payment Due
B) IF GOODS RETURNS ARE DONE THEN:
Doc Num
Doc status
Posting date
Total Before discount
Tax
Freight
Total Payment Due
C) IF AFTER GRPO ,AP INVOICE DONE THEN:
Doc Num
Vendor referance Number.
Doc status
Posting date
Total Before discount
Tax
Freight
Total Payment Due
(A) ,(B),(C) should in a single query.
If possible pls. send me query.
Regards.
Mahesh.Try this one:
SELECT DISTINCt T1.CARDCODE, T1.CARDNAME , T1.DOCNUM GRPO#,T1.DocStatus 'GRPO Status', T1.DOCDATE 'GRPO Date', T1.DocTotal 'GRPO Total', T3.DOCNUM Return#,T3.DocStatus 'Return Status', T3.DOCDATE 'Return Date', T3.DocTotal 'Return Total',T5.DOCNUM Invoice#,T5.DocStatus 'Invoice Status', T5.DOCDATE 'Invoice Date', (T5.DocTotal-T5.VatSum-T5.TotalExpns-T5.DiscSum) 'Total Before Discount', T5.VatSum 'Tax', T5.TotalExpns 'Freight', (T5.DocTotal - T5.PaidToDate) 'Total Payment Due'
FROM DBO.PDN1 T0
INNER JOIN DBO.OPDN T1 ON T1.DOCENTRY = T0.DOCENTRY
LEFT JOIN DBO.RPD1 T2 ON T2.BASEENTRY = T1.DOCENTRY
LEFT JOIN DBO.ORPD T3 ON T2.DOCENTRY = T3.DOCENTRY
LEFT JOIN DBO.PCH1 T4 ON T4.BASEENTRY = T1.DOCENTRY
LEFT JOIN DBO.OPCH T5 ON T5.DOCENTRY = T4.DOCENTRY
WHERE T1.DOCNUM like '[%0\]%'
Thanks,
Gordon -
Want to query a set of unique values for concat columns
Hi,
I have Table1 with unique constraint on col2 and col3.
Have to optimize the following query as it does a FTS
select * from table1
where col2||col3 in (col1val1 || col2val1, col1val2 || col2val2, ....)
Please advise, Thanks In Advance.select * from table1
where col2||col3 in (col1val1 || col2val1, col1val2
|| col2val2, ....)How about
select * from table1
where col2, col3 in (select col1val1, col2val1 from dual union all
select col1val2, col2val2 from dual union all...
) -
Want A query (Its Urgent)
Hi,I have a table as below..
AFPFTRAN
code date type amt
12 10-04-05 T 1
13 11-05-05 F 2
12 10-05-05 T 3
13 05-04-05 F 4
12 12-04-05 T 5
13 15-05-05 F 7
I want details as below:
date
Apr May ---
code T F T F ---
12 6 0 3 0
13 0 4 0 9
I want to get sum(amt) of T,F in particular month for particular emp.
Hope...I'm clear now...
Pls Its urgentuse something like following
select code, sum(decode(to_char(date, 'MM'), '01', decode(type, 'T', AMT, 0), 0)) Mon01_Type_T, sum(decode(to_char(date, 'MM', '02', decode(type, 'F', AMT, 0), 0)) Mon01_Type_F, .......(for all months and type)
from Your_table_name
group by code
I hope it will work the way you want,
Regards -
can anyone please send select query for
join statement with for all entries commandhi
good
go through this
SELECT likpvbeln likplifex likpbldat likpwadat likpwadat_ist likpkodat likp~lfart
likpkunnr likpvstel lipsposnv lipslfimg lipsvrkme lipslgmng lips~meins
lipswerks lipslgort lipscharg lipsvbelv lipsposnr lipsmatnr
lipsvbeln LIPSVGBEL LIPSVGPOS vbupkosta vbupwbsta vbupposnr vbup~vbeln
VBAKIHREZ VBAKVBELN VBAP~VBELN
INTO CORRESPONDING FIELDS OF TABLE it_itab
FROM ( likp
INNER JOIN lips
ON lipsvbeln = likpvbeln
INNER JOIN vbup
ON vbupposnr = lipsposnr
and VBUPVBELN = LIPSVBELN )
left outer join VBAK
on VBAKVBELN = LIPSVGBEL
inner join VBAP
on VBAPVBELN = VBAKVBELN )
WHERE likp~vbeln IN so_vbeln
AND likp~lifex IN so_lifex
AND likp~lfart IN so_lfart
AND likp~kunnr IN so_kunnr
AND likp~vstel IN so_vstel
AND likp~bldat IN so_bldat
AND likp~wadat_ist IN so_wadat
AND vbup~kosta IN so_kosta
AND vbup~wbsta IN so_wbsta
AND LIPS~LFIMG NE 0.
SELECT VBELN IHREZ INTO TABLE T_VBAK
FROM VBAK
FOR ALL ENTRIES IN IT_ITAB
WHERE VBELN = IT_ITAB-VGBEL.
thanks
mrutyun^ -
Hi i wanted a query to write a text in a deidentified form.
So the requirement is if the variable is given as 3 , so for example the text is "This is a secret message". It should be like
T S A C T S G
H I S R M S E
I S E E E A J
So as you see it is written in 3 row form T in the first row then H in another row
So the deidentifier text will be "TSACTSGHOSRMSEISEEEAJ"
Can any one help me out to write a function or a procedure for this i would really appericate it.
Thanks.Hello there,
Please refer to the below links:
[http://wwwimages.adobe.com/www.adobe.com/enterprise/partners/pdfs/solution_in_detail_interactive_forms.pdf|http://wwwimages.adobe.com/www.adobe.com/enterprise/partners/pdfs/solution_in_detail_interactive_forms.pdf]
[http://www.sdn.sap.com/irj/scn/interactiveforms-elearning|http://www.sdn.sap.com/irj/scn/interactiveforms-elearning]
Please reply if this helps.
Best Reagrds,
Vinarma. -
SCCM query not returning the results I want
I would like to use a query that will query my systems that have a particular piece of software (Flash), but I do not want it to include servers that are in a particular group.
Explanation: I have about 20 servers with Flash installed that require it. About half of them I can update regularly, the other half I can't. So, I have an AD group for each - the ones I can patch, and the ones I can't. I want the query
to look for systems with "Adobe Flash" in the display name, but exclude the servers in both of these groups. That way I can create a collection of computers that have Flash installed where it shouldn't be and can keep an eye on where it is
being installed.
The query looks like this in the criteria tab;
Add/Remove Programs.Display Name is like "%Adobe Flash%"
and
System Resource.System Group Name is not equal to "LAB\FlashPatchGroup"
The query language looks like this;
select distinct SMS_R_System.Name, SMS_R_System.description, SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName, SMS_G_System_ADD_REMOVE_PROGRAMS.Version from SMS_R_System inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID
= SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%Adobe Flash%" and SMS_R_System.SystemGroupName != "LAB\\FlashPatchGroup"
The problem I am having is that when I run the query, it is pulling everything with Flash, including the ones in the AD group. Anyone see a problem with the way I'm doing this?Hi Jorgen,
Thank you for that - very helpful because I actually knew nothing about sub-select queries. So now the overall logic makes sense, but unfortunately the only examples I've been able to find don't cover exactly what I want to do.
The overall examples I have found work like this;
- Create a query to find computers with a particular application installed
- Create a subselect query that says find users that are NOT subject to the preceeding query
What I need to do, however, is this;
- A query finds computers with a particular piece of software installed
- It compares the computer to 2 Active Directory groups I have created.
- The query produces all computers with that particular piece of software that is NOT in the AD groups I have created. This way I can easily identify servers that have Flash installed that shouldn't.
Any ideas? I have been trying to follow the subselect queries to do something similar but I just cannot make it work. I've tried to create a subselect query that says "Add/Remove Programs Display Name contains "%Adobe Flash%" but is not in (subselect
query)" and it just doesn't like it.
Regards
Juice -
Dynamic query...but I want to maintain performance.
Say I have a simple PL/SQL PROC like this...
PROCEDURE some_proc(p_id IN NUMBER)
IS
v_fn VARCHAR2(100);
BEGIN
SELECT first_name INTO v_fn
FROM tblEmployees
WHERE id = p_id;
dbms_output.put_line('Name is: ' || v_fn);
END;
Now let's say I want to accept another param in the proc which dictates the order...
Looking at the example below, what would be the best way to dynamically allow the query to change depending on what the user passes in the p_order_col parameter? For example, let's say the user passes "last_name" as the parameter...I would want the query to be:
SELECT first_name
FROM tblEmployees
WHERE id = p_id
ORDER BY last_name;
PROCEDURE some_proc(p_id IN NUMBER, p_order_col IN VARCHAR2)
IS
v_fn VARCHAR2(100);
BEGIN
SELECT first_name INTO v_fn
FROM tblEmployees
WHERE id = p_id;
dbms_output.put_line('Name is: ' || v_fn);
END;
Bear in mind I want to make sure that this query maximizes efficiency. I am wondering if by making the order by clause dynamic, it will make too many Hard Parses and not make use of binding. What I am really looking for here is some sort of DBA/performance expert advice on the right way to do this and not fill up the SGA by doing it the wrong way. I don't simply want to know how to do it...looking for the right way. I was thinking that maybe I could use dbms_sql package and open a cursor, then call .parse to my dynamic query string, then .bind_variable for the p_id. Is that the right start?Thank you for the quick reply. Theoretically it could be any number of columns. I tried to use a simple example, but in reality it would have to be dynamic for a few reasons...
1) My example is not so simple...to explain it here would take a lot of time...however tblEmployees is a huge query in reality...I was just trying to simplify for my post.
2) I need to order by on possibly multiple rows and that order needs to be dynamic.
I like your decode suggestions, but unfortunately I can't use it here.
Would doing something like this still allow me to make use of binds? Granted, I realize every query which has a different order by clause would qualify as a different query.
v_cursor INTEGER;
v_emp_name VARCHAR2(100);
v_cursor := dbms_sql.open_cursor;
dbms_sql.parse(v_cursor,'SELECT first_name AS emp_name FROM tblEmployees WHERE id = :p_id ORDER BY ' || p_order_col,dbms_sql.native);
dbms_sql.bind_variable(v_cursor, ':p_id', p_id);
dms_sql.define_column(v_cursor,1,v_emp_name);
v_rows := dbms_sql.execute(v_cursor);
LOOP
IF dbms_sql.fetch_rows(v_cursor) = 0 THEN
EXIT;
END IF;
dbms_sql.column_value(v_cursor,1,v_emp_name);
END LOOP;
dbms_sql.close(v_cursor);
dbms_output.put_line('Name: ' || v_emp_name);
Maybe you are looking for
-
SSRS report - A single selection dropdown list converted to text box
Hello everyone, We created a single selection dropdown parameter (City parameter) on a report. The data in this parameter is populated using MDX query. Also, it is filtered based on selection of another single selection dropdown list (Country paramet
-
Fullscreen gaming not possible? How to stretch games?
Hello, you got an idea how to make games run in stretched view instead of black bars on the left and right side of the screen? I think this is called "GPU scaling", but unfortunately I haven't found such an option in the catalyst center yet. Thanks!
-
How do you solve popping noise??
Does anyone have a solution, or can suggest a course of action to address the popping noise that occurs when my macbook Pro's speaker turns on, say when launching a song from itunes. It is not super annoying yet. But it would be nice to solve. Is thi
-
hi there , (flash cs5.5 iphone) i created my-band apps.(profile , photo , music , bio) i add tab facebook rss how i can import rss or comments from facebook / twitter band page?
-
Want to change the Ram on Macbook Pro?
I have MacBook Pro 15 Inch Mid 2010 The current memory is: 4 GB 1067 MHz DDR3, I want to change the Ram to 16 GB rather than 4 GB, I need an advice for the best one on Amazon?