Distinct rows from CRM Server
Hi,
How can I get "Distinct" rows from CRM Server using Bdoc?
As we use in sql server, select distinct empid from employee...
Thanks
Mateen
Hi,
In the BDoc modellor SBDM, there is an option for 'Select Distinct'. I guess you can try selecting the same.
Best Regards,
Anusha
Similar Messages
-
Display distinct rows from Oracle table without using "DISTINCT" keyword.
How to retrieve distinct rows from oracle table without using 'DISTINCT' keyword in SQL?
Thanks in advance.
MihirWelcome to the forum.
Besides GROUP BY you can use UNIQUE instead of DISTINCT as well, but that's probably not wanted here ;) , and the ROW_NUMBER() analytic:
SQL> create table t as
2 select 1 col1 from dual union all
3 select 1 from dual union all
4 select 2 from dual union all
5 select 3 from dual union all
6 select 4 from dual union all
7 select 4 from dual;
Table created
SQL> select col1 from t;
COL1
1
1
2
3
4
4
6 rows selected
SQL> select distinct col1 from t;
COL1
1
2
3
4
SQL> select unique col1 from t;
COL1
1
2
3
4
SQL> select col1 from t group by col1;
COL1
1
2
3
4
SQL> select col1
2 from ( select col1
3 , row_number() over (partition by col1 order by col1) rn
4 from t
5 )
6 where rn=1;
COL1
1
2
3
4 -
Distinct rows from two tables linked by a third one
Hi,
I need to write an SQL sentence to bring a group of DISTINCT rows, each row in a form of: A.X, A.Y, C.IDBOLETA. Tables A and C are linked through the table C, as follow:
Table A: INDUSTRIAGEO
NIT VARCHAR2(20) NOT NULL,
CORRELAIGEO NUMERIC(2) NOT NULL,
NOMBREAGENCIA VARCHAR2(255) NOT NULL,
DIRECCION VARCHAR2(255),
X NUMERIC(12,8) NOT NULL,
Y NUMERIC(12,8) NOT NULL,
CONSTRAINT PKGEOINDUST PRIMARY KEY(NIT, CORRELAIGEO),
CONSTRAINT FKGEOINDUST FOREIGN KEY(NIT) REFERENCES INDUSTRIA(NIT)
Table B: ANALISIS
IDANALISIS NUMERIC(12) NOT NULL,
NIT VARCHAR2(20) NOT NULL,
CORRELAIGEO NUMERIC(2) NOT NULL,
FECHA DATE NOT NULL,
IDINSPECTOR NUMERIC(4) NOT NULL,
CONSTRAINT PKANALISIS PRIMARY KEY(IDANALISIS),
CONSTRAINT FKANALGEOI FOREIGN KEY(NIT, CORRELAIGEO) REFERENCES INDUSTRIAGEO(NIT, CORRELAIGEO),
CONSTRAINT FKANALINSP FOREIGN KEY(IDINSPECTOR) REFERENCES INSPECTOR(IDINSPECTOR)
Table C: ANALISISBOLETA
IDANALISIS NUMERIC(12) NOT NULL,
CORRELAANALISIS NUMERIC(2) NOT NULL,
IDBOLETA NUMERIC(12) NOT NULL,
IDCATEGORIAINDUSTRIA NUMERIC(3) NOT NULL,
CONSTRAINT PKANALBOLE PRIMARY KEY (IDANALISIS, CORRELAANALISIS),
CONSTRAINT UKANALBOLE UNIQUE (IDBOLETA),
CONSTRAINT FKANALBOLE FOREIGN KEY(IDANALISIS) REFERENCES COPS.ANALISIS(IDANALISIS),
CONSTRAINT FKANALCATI FOREIGN KEY(IDCATEGORIAINDUSTRIA) REFERENCES COPS.CATEGORIAINDUSTRIA(IDCATEGORIAINDUSTRIA)
Thanks for your help!!!
MarioPerhaps
select distinct a.x,a.y,c.idboleta
from industriaego a,
cops.analisis b,
analisisboleta c
where a.nit = b.nit
and a.correlaigeo = b.correlaigeo
and b.idanalisis = c.idanalisisRegards
Etbin
Edited by: Etbin on 4.5.2010 21:42
the copy/paste elf did it again: b.correlaigeo instead of b.a.correlaigeo (as in the OP's comment below) -
Client GWI - not able to download a gwi profile from crm server
hey there,
I´m faced with an issue about client based GW Integration and with the gwi profile download.
The thing is, I´ve two separate crm systems. Last week i´ve implemented it with my notebook for the first system and it works fine - i mean the gwi profile download.
but this week, i tried to implement it on the second system. i cannot use my notebook, but I´m armed with a workstation.
so I did the same things as I did last week (notes, settings and so on). I used the official gwi pdf files to do so.
But I´m not able to download the gwi profile from the second system/server. (either SAP_DEFAULT nor my z-profile)
do you have any ideas? that would be great!
if you need more information, i will provide it here.
thanks in advance!
/*************EDIT
Solved the issue!
There was a Link problem...I had to change the Link manually, which is used after you klick on "Edit Sync Options" under personalization.
END***************/
Edited by: Marcus Findeisen on Aug 16, 2011 3:21 PMhey danny,
greyed out problem:
go to spro and profile definition. scroll horizontal in order to change display mode from show to edit
link problem:
we had problems with the connection over, i dont know, services or other systems between end user computer and sap maschine. we couldn´t use the original sap server link. we had to use another one. so I enhanced the component to integrate this speciall linkn.
hope i could help u. -
Select Distinct rows from multiple tables
Table 1 is a List of Vendors - VID, PID, VName, VAddress, VPhone
Table 2 is a list of Products - PID, PName, PPrice, PWeight, PColor
I need to produce a list of unique PID's showing the following fields - PID, VName, PName, PColor
So, Here is my failed attempt:
SELECT P.PID, V.VName, P.PName, P.PColor
FROM Products P INNER JOIN Vendors V ON P.PID = V.PID
GROUP BY P.PIDIf you post DDL, sample data and your desired output based on that sample data, someone can probably create a query that does what you want.
And I have to tell you that Table 1 is not a list of vendors unless you have a system where a vendor provides one and only one product - something that is unusual. If your system is one where a vendor should provide any number of products (and if a product
can be provided by any number of vendors), you have some fundamental schema issues to correct.
Lastly, there are sticky posts at the top of the forum that provide suggestions for posting questions. Please have a look - help your readers help you by providing sufficient information. Phrases such as "failed" or "does not work"
do not provide any useful detail. And one good rule of thumb - any time you feel you need to use (or say) distinct in a query is an indication that something somewhere is wrong. It could be a schema issue, a misunderstanding of the schema or the
goal, an incorrect query, etc. There are few instances where distinct is needed in a well-defined and implemented system, IMO. -
Count distinct rows from an internal table
Hi,
i have an internal table containing pairs of entries like
1 1
1 2
1 3
2 1
2 2
What i want to do is to determine the value of rowcount from first column ( here it would be 2 and not 5 ) - to me it seems like a DISTINCT. Any suggestions for that ?
ClemensHi clemens,
1. One of the ways is to use COLLECT.
2. suppose your original internal table is ITAB.
Create one more with just one field
STAB eg.
3. Loop at ITAB.
STAB-field1 = ITAB-Field1.
COLLECT stab.
ENDLOOP.
4. In stab u will have only TWO records,
1
2
regards,
amit m. -
Select Distinct rows from 3 tables
I need to retrive information from 3 different tables by applying a specific condition.
I have the following query which works fine for retrieving desired data from 2 tables.
SELECT
a.userId
FROM userGeneral
a inner
join userSpecific
b on a.userId
= b.userId
WHERE
a.userActive
= 1
userId
111
222
333
444
Now I have a third table called userMgr which may contain multiple records for each userId with a corresponding mgrId value. It has a primary key identity column called userRecId and I would like to fetch the
mgrId value corresponding to the MAX(userRecId) for the matching userId.
userRecId | userId | mgrId
1 | 111 | 123
2 | 111 | 234
3 | 111 | 345
4 | 333 | 345
5 | 333 | 456
The resultset should be as follows after joining all the 3 tables.
userId | mgrId
111 | 345
222 | NULL
333 | 456
444 | NULL
Can anyone please help with this query.I need to retrive information from 3 different tables by applying a specific condition.
I have the following query which works fine for retrieving desired data from 2 tables.
SELECT
a.userId
FROM userGeneral
a inner
join userSpecific
b on a.userId
= b.userId
WHERE
a.userActive
= 1
userId
111
222
333
444
Now I have a third table called userMgr which may contain multiple records for each userId with a corresponding mgrId value. It has a primary key identity column called userRecId and I would like to fetch the
mgrId value corresponding to the MAX(userRecId) for the matching userId.
userRecId | userId | mgrId
1 | 111 | 123
2 | 111 | 234
3 | 111 | 345
4 | 333 | 345
5 | 333 | 456
The resultset should be as follows after joining all the 3 tables.
userId | mgrId
111 | 345
222 | NULL
333 | 456
444 | NULL
Can anyone please help with this query.
try this:
select userId,userRecId,
from userMgr,
(SELECT a.userId, max(a.userRecId)
FROM userGeneral a inner join userSpecific b on a.userId = b.userId
group by a.userId
WHERE a.userActive = 1) table1(userId,userRecId)
where userMgr.userRecId = table1.userRecId -
Restore deleted rows in sql server 2008
Hi,
I have problem, I used import and export wizard in sql server 2008, and select wrong database in source data and wrong database in destination data (i Reflect databases) and in editing mapping i make check for delete rows in destination table.
the step final complete and i lost my data and i don't have backup
how i can restore my dataits not a straight forward activity if you don't have backups, first thing you need to do is to create proper maintenance plan for you databases. You can refer below links which could give some clue about your probles.
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/86befdbe-9806-4d96-9e9f-ead753d0fc20/recover-deleted-rows-from-sql-server-database?forum=transactsql
http://sqlserver2000.databases.aspfaq.com/how-do-i-recover-data-from-sql-server-s-log-files.html
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
Praveen Dsa | MCITP - Database Administrator 2008 |
My Blog | My Page -
Bulk Insert from SQL Server to Oracle
I have to load around 20 million rows from SQL Server table to Oracle table using Network Link,wrote following code using Bulk Collect,which is working but taking more time(taking 5 hrs).
I also tried with changing table to parallel degree 8 didn't help(Also Oracle Table set to NOLOGGONG mode).
Is there any better way to do this ? Appreciate any help in this regard .
Script :
CREATE OR REPLACE PROCEDURE INSERT_SQLSERVER_TO_ORACLE
IS
TYPE v_ARRAY IS TABLE OF TARGET_CUST%ROWTYPE INDEX BY BINARY_INTEGER;
ins_rows v_ARRAY;
BEGIN
DECLARE CURSOR REC1 IS
SELECT COL1, COL2,COL3,COL4 SOURCE_SQLSERVER_CUST;
BEGIN
OPEN REC1;
LOOP
FETCH REC1 BULK COLLECT INTO ins_rows LIMIT 5000;
FORALL i IN ins_rows.FIRST..ins_rows.LAST
INSERT INTO TARGET_CUST VALUES ins_rows(i);
EXIT WHEN REC1%NOTFOUND;
END LOOP;
COMMIT;
CLOSE REC1;
END;
END;
Thanks in Advance.887204 wrote:
I have to load around 20 million rows from SQL Server table to Oracle table using Network Link,wrote following code using Bulk Collect,which is working but taking more time(taking 5 hrs).I would not pull that data via a network link and use standard SQL insert statements. Bulk processing is meaningless in this context. It does nothing to increase the performance - as context switching is not the issue.
The biggest factor is pulling 20 million rows's data via database link across the network. This will be slow by it's very nature.
I would use bcp (Bulk Copy export) on SQL-Server to write the data to a CSV file.
Zip that file. FTP/scp/sftp it to the Oracle server. Unzip it.
Then do a parallel direct load of the data using SQL*Loader.
This will be a lot faster than pulling uncompressed data across the network, a couple of rows at a time (together with the numerous moving parts on the Oracle side that uses a HS agent as interface between SQL-Server and the Oracle database). -
Load distinct rows with sequence
Hi All
I have requirement at my client where we need to load distinct rows from the source TABLEA into TABLEB and add sequence in target TABLEB.
As we know in Oracle we cant use sequence with distinct keyword, one of the solution is to use the sequence in target so ODI will capture
distinct rows from source and use the sequence only in target table but if the source and target are on same schema then ODI doesn't create
C$ table but it load data directly into target table and we get the error of invalid use of sequence.It wors fine if source and target table on different
schema. I like to know if there is any way force ODI to create C$ table with distinct rows and load the sequence in target table only even source and
target are on same schema. Otherwise I have create two interface to capture the distinct rows firct and then update the same table with sequence
in second step. I really wanna avoid creating 2 interface for this simple job.Let me know if you have better solution.
Thanks
Kashifuser634784 wrote:
But is there any way to get the same outcome without using the subquery.In reality... No.
You can hide the fact that you have to generate a row_number for the records by using a view... ;)
SQL> ed
Wrote file afiedt.buf
1 create table t as select 1 as Empid, to_date('01-jan-2008','DD-MON-YYYY') as startdate, null as enddate, 'O1' as organisation from dual union all
2 select 2, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O1' from dual union all
3 select 3, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O1' from dual union all
4 select 4, to_date('5-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O2' from dual union all
5 select 5, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O2' from dual union all
6 select 6, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O2' from dual union all
7 select 7, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O3' from dual union all
8* select 8, to_date('2-jan-2008','DD-MON-YYYY'), to_date('31-jul-08','DD-MON-YYYY'), 'O3' from dual
9 /
Table created.
SQL> ed
Wrote file afiedt.buf
1 create view vw_x as
2* select empid, startdate, enddate, organisation, row_number() over (partition by organisation order by empid) rn from t
SQL> /
View created.
SQL> select * from vw_x where rn = 1;
EMPID STARTDATE ENDDATE OR RN
1 01-JAN-08 O1 1
4 05-JAN-08 31-JUL-08 O2 1
7 02-JAN-08 31-JUL-08 O3 1
SQL> -
How to select distinct rows ..?
Hi all...
I am having one table with many columns. I want to select distinct rows from one column and for each row selected, i want to have one unique number.
For ex:
SELECT DISTINCT SUM(ROWNUM) OVER(ORDER BY C.SPECIFICATION NULLS LAST) AS CODE,
C.SPECIFICATION FROM TABLE_1 C WHERE condition.
In this case, there is a chance of getting duplicate values (1 and 4 rows selected = total 5) and (3 and 2 rows selected = total 5)
i thought of selecting through sub query like this
select rownum, code from (select distinct SPECIFICATION as code from table where ...)
Is there anymore options to get the desired output.
Thanks in advance,
Paltry like this:
select distinct
dense_rank() over(order by c.specification) as code,
c.specification
from table_1 c
where condition -
Fetching a partial range of selected result rows from the client side
It has been a while since I started trying to solve this Oracle puzzle.
Basically, what I need it is a way to fetch from the client side a run-time
defined range of result rows of a arbitrary SELECT query.
In low-end databases like MySQL I can do it simply by appending the LIMIT
argument to the end of the SELECT query statment passing the number of
the first row that I want to be returned from the server from the total
result rows available in the result set and the maximum number of rows
that it may return if available.
In higher end databases I am supposed to use server side cursors to skip
any initial rows before the first that I want to retrieve and fetch only
the rows I want up to the given limit.
I am able to achieve this with PostgreSQL and Microsoft SQL server, but I
am having a hard time with Oracle. The main problem is how do I fetch
result rows from a server side cursor and have their data returned to a
client side in a result set like in a straight SELECT query?
I was able to create a cursor and fecth a row into a server side record
variable with the following PL/SQL code.
DECLARE
CURSOR c IS SELECT * FROM my_table;
my_row c%ROWTYPE;
BEGIN
OPEN c;
FETCH c INTO my_row;
CLOSE c;
END;
I want to do this from PHP, so I don't have client side ESQL variables to
store the result set data structure. Anyway, if I can do it just with
SQLPlus I should be able to do it in PHP.
If I do straight SELECT I can get the result set, but in a PL/SQL script
like the one above I don't seem to be able to select the data in the
fetched row record to have returned to the client. Does a straight SELECT
query sends the result rows to a default client side variable?
If anybody can help, I would appreciate if you could mail me at
[email protected] because I am not able to access this forum all the time in
the Web. BTW, is it possible to access this forum by e-mail?
Thanks in advance,
Manuel Lemos
nullHello Jason,
On 03-Feb-00 05:34:14, you wrote:
I'm not sure I totally understand your problem, but I think you might be able
to solve it by using the ROWNUM variable. ROWNUM returns the sequenc number
in which a row was returned when first selected from a table. The first row
has ROWNUM = 1, the second has ROWNUM = 2, etc. Just remember that the
ROWNUM is assigned as soon as it's selected, even before an order by. So if
you have an order by clause, it'll mess it up. Here's an example. I hope
that helps.I though of that before but it doesn't help because if you use ORDER BY the
first result row might not have ROWNUM=1 and so on. Another issue is that
I want to be able to skip a given number of result rows before returning
anything to the client.
The only way I see to do it is to get the rows with server side cursor.
But how do I return them to the client? Where does a normal select returns
the rows? Isn't there a way to specify that the fetch or something else
return the rows there?
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=[email protected]
E-mail: [email protected]
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
null -
Can any body tell me how to get distinct row(not distinct value) from a xml document without using calculated column ?
Is there any stylesheet available which will allow us to extract distinct row from a xml documentSajjad
To say frankly, there is no single xMII-defined action to get distinct rows from an XML File in BLS.
Instead, you may try with a number of actions (Repeater, Conditional etc) to loop the XML file, then check whether or not each column values one by one in previous row are matched with each accordingly column values one by one in next row while looping, then append rows to the XML Output Document depeding on satisfaction of mismatched two successive rows.
Regards
Som -
Cannot get data of the row from OLE DB provider "OraOLEDB.Oracle" for linked server
I have created a stored procedure in SQL Server for a report that uses parameters. In the report I am linking an Oracle table. I use a subquery like this to query the Oracle table: (select * from openquery(oracle_linked_server, 'select
partno, description from oracletable')). If I run the subquery it works fine every time. The linked server uses an oracle account which has access to the oracle table. When I first created the Stored Procedure it worked fine for me. When
I test the report, it worked fine. Then I asked another user to test it and it broke with the below error message.
OLE DB provider "OraOLEDB.Oracle" for linked server "XXXX_ORACLE" returned message "ORA-01403: no data found".
Msg 7346, Level 16, State 2, Procedure usp_report_XXXXXX, Line 15
Cannot get the data of the row from the OLE DB provider "OraOLEDB.Oracle" for linked server "XXXX_ORACLE".
Now when I try the report or the stored procedure, I get the same error. I tested the oracle subquery in the stored procedure and it still works. The report uses a service account to execute the stored procedure.
I am using SQL Server 2012 Developer Edition 64 bit (11.0.5058) Management Studio to develop the stored procedure. The SQL Server I am accessing and running the stored procedure is SQL Server 2008R2 Developer Edition 64bit (10.50.2550). The user
that tested the report for me has SQL Server 2008R2 but that shouldn't matter since he is running the report in Internet Explorer.
What is changing that it works for a while and then stops?
Fred
Fred SchmidI found the answer. It was in the query. I put the TRIM statement on the part# field in the Oracle subquery and took the LTRIM function out of the ON clause that joined my SQL Server table with the Oracle linked server table. Now everything
works. The query looks like this:
SQL_Server_Table sst
LEFT OUTER JOIN
(SELECT * FROM OPENQUERY(OracleLinkedServer, 'SELECT TRIM(partNo) AS partNo, partDesc FROM OracleTable')) ols
ON sst.partNo = ols.partNo
Thanks for pointing me in the right direction.
Fred Schmid -
Attachments from CRM in DMS content server
Hello,
I have configured a DMS content server to save the attachments from CRM. but can not get the store in the content, as I can do? Attachments I keep it via web from the interlocutor.
I touched the table SDOKPHCL and the value BDS_POC1 and I have put the value of content, but still keep it to or at the base's own CRM.
I need to configure?
Thank you.Hello,
Table SOFFCONT1 attachments are stored that are recorded in the database logic of sap. That is if the id of the document not find it in this chart means that you are storing away in a content server.
I've gotten crm annexes the content stored on a server.
The first thing I have done is create a content server-class CRM. OAC0 in, then I created the category AOCRS taking the content. CSADMIN and I found that the content is running.
In transaction SKPR08 BDS_POC1 class I have assigned to the Z-server content that I created. and in all kinds of CRM type I have assigned the new Z category I created.
After the transaction SBDSV2 I created a new record with BUS1006 in this case because it was a contact in CRM and I have given the document class Z BDS_ATTACH the category of content.
The BUS is obtained by a trace of the transaction and SWELS swel (with some modification from the transaction in which I attach the document).
In SBDSV1 I've got to bus1006 BDS_LOC1 class.
And with that I have solved the problem.
Maybe you are looking for
-
I recently upgraded the RAM on my computer, and this is the first time I have connected my iPod since the upgrade. As soon as I connected my iPod to my computer, it told me I had to restore it to factory settings. So I did that. I have attempted to s
-
Jstart.exe process in sap mmc is not getting started
Hi, The jstart.exe process of sap mmc (management console/server) is not getting started. The status for this process is "starting the processes". Need help! The developer trace is as follows : trc file: "dev_jstart.7668", trc level: 1, release: "720
-
Conversion agent-edi850 purchase order document
HI, i saw a blog which shows the conversion of EDIFACT to IDOC byy using conversion agent in XI. (/people/bla.suranyi/blog/2006/06/08/sap-xi-supports-edifact) i want to convert a EDI850 a ANSIX12 document into IDOC...... Can someone help........
-
dear all is there any BAPI or function module to change Assignmnet no. (ZUONR) of T code FB02. i want to change it in a mass. i have tried FI_ITEMS_MASS_CHANGE but its not working...is there any way to do BDC for the same... or we can give any condit
-
[OSB] Invoking OSB HTTP proxy as a part of a global transaction
Hi, my question is, can a OSB HTTP proxy be executed in context of the global transaction? I did two tests. One had the following scenario: HTTP OSB proxy invokes JMS OSB proxy that invokes an "Insert to database" business services. Both of the proxi