Concatenations in UDF in P6
Hi there,
I am trying to concatenate a literal with a field. For example, if the field was CurrentPhase, and this was SQL, I would be doing this...
'In ' || CurrentPhase.
I know that literals are in double-quotes but I can't seem to crack what the operator would be.
I have tried the following (concatenating two literals together).
"In " || " Some other literal"
"In " + " Some other literal"
"In " && " Some other literal"
"In " & " Some other literal"
And even ...
CONCAT("In ", "Some other literal")
Has anyone any ideas? We are using Primavera, P6, R 8.2
Thanks
Hi Kamlesh,
What is your SAP Version and Patch Level ?
I tested the same what you are mentioned but iam not face any problem the whole text
will be pasted propertly in my UDF.
You Create a another UDF and test it.
Regards
Jambulingam.P
Similar Messages
-
UDF needed for Strin Concatenation.
Dear Friends,
I am new to XI The requirement is like.
"In order to map field E1EDL20-VBELN, Concatenate field CH_VBELN with 00 in the left side.
For example if we have in the file ""80008000"" as a value of field CH_VBELN then the field E1EDL20-VBELN will be mapped with 0080008000.
E1EDL20-VBELN = 0080008000"Hi,
Use Constant as 00 and use Concatanate function and mapp CH_VBELN and constant field to the target field E1EDL20-VBELN
Ex:
Constant(00)
Cocatenate----
E1EDL20-VBELN
CH_VBELN
Regards
Seshagiri -
Hi Experts,
I am trying to trigger alert using UDF in message mapping.
My UDF looks like this.
*Map map = container.getTransformationParameters();
String msgID = (String) map.get("MessageId");
Channel channel = LookupService.getChannel("Alert_Call_Receiver_BS","Alert_Call_Receiver_CC" );
RfcAccessor accessor = LookupService.getRfcAccessor(channel);
String rfcxml ="<?xml version="1.0" encoding="UTF-8"?><ns0:SALERT_CREATE xmlns:ns0="urn:sap-com:document:sap:rfc:functions"><IP_ALIAS/><IP_APPLICATION_GUID/><IP_CAT>ALERT_EMAIL</IP_CAT><IP_XML_CONTAINER/><IT_CONTAINER><item><ELEMENT>OBJECT_TYPE</ELEMENT><TAB_INDEX>0</TAB_INDEX><ELEMLENGTH>1</ELEMLENGTH><TYPE>C</TYPE><VALUE>"v_OBJECT_TYPE"</VALUE></item><item><ELEMENT>OBJECT_ID</ELEMENT><TAB_INDEX>0</TAB_INDEX><ELEMLENGTH>10</ELEMLENGTH><TYPE>C</TYPE><VALUE>"v_OBJECT_ID"</VALUE></item></IT_CONTAINER></ns0:SALERT_CREATE>";
InputStream inputStream =new ByteArrayInputStream(rfcxml.getBytes());
XmlPayload payload = LookupService.getXmlPayload(inputStream);
Payload rfcOutPayload = null;
rfcOutPayload = accessor.call(payload);
return v_OBJECT_TYPE;*
When I do a check of my message mapping, I am getting error
Source code has syntax error: /usr/sap/XIS/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapf74ccc40c02211dec6c4cecf0000a002/source/com/sap/xi/tf/_ENOVIA_Error_MT_Alert_Call_MT_.java:63: ';' expected String rfcxml ="<?xml version="1.0" encoding="UTF-8"?><ns0:SALERT_CREATE xmlns:ns0="urn:sap-com:document:sap:rfc:functions"><IP_ALIAS/><IP_APPLICATION_GUID/><IP_CAT>ALERT_EMAIL</IP_CAT><IP_XML_CONTAINER/><IT_CONTAINER><item><ELEMENT>OBJECT_TYP.
I have not imported any thing for this UDF. Can you pleasae suggest if the error is due to missing imports?
If so please suggest the requred imports.
Thanks and best regards,
PrasadTry with this
String rfcxml ="<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:SALERT_CREATE xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"><IP_ALIAS/><IP_APPLICATION_GUID/><IP_CAT>ALERT_EMAIL</IP_CAT><IP_XML_CONTAINER/><IT_CONTAINER><item><ELEMENT>OBJECT_TYPE</ELEMENT><TAB_INDEX>0</TAB_INDEX><ELEMLENGTH>1</ELEMLENGTH><TYPE>C</TYPE><VALUE>"+v_OBJECT_TYPE+"</VALUE></item><item><ELEMENT>OBJECT_ID</ELEMENT><TAB_INDEX>0</TAB_INDEX><ELEMLENGTH>10</ELEMLENGTH><TYPE>C</TYPE><VALUE>"+v_OBJECT_ID+"</VALUE></item></IT_CONTAINER></ns0:SALERT_CREATE>";
Escape characters and string concatenation characters are added -
Which is better UDF or STUFF function ?
Hi,
We have a requirement like to retrieve a concatenated string of values as a column. For this whether i should use UDF with SQL query or STUFF.
Please suggest.
Here is my Example
--Create function
CREATE FUNCTION dbo.GroupsList(@AgentID NVARCHAR(32))
RETURNS NVARCHAR(MAX)
AS
-- Returns the grouplist
BEGIN
DECLARE @listStr VARCHAR(MAX);
SELECT @listStr = COALESCE(@listStr+',' ,'') + g.GroupName
FROM
AgentIDGroup ag
INNER JOIN Groups g
ON ag.idindex = g.IDOrPhoneNoIndex
WHERE
ag.AgentID = @AgentID;
IF(@listStr IS NULL)
SET @listStr = '';
RETURN @listStr;
END;
GO
--Call UDF to get resultset
SELECT
a.*
,dbo.GroupsList(a.PhoneUserID) as GroupsList
FROM
Agents a
--CTE with STUFF function and XML PATH clause
WITH CTE AS (
SELECT AgentID,
STUFF((SELECT ', ' + rtrim(convert(nvarchar(32),G.GroupName))
FROM AgentIDGroup AG1 JOIN Groups G on G.IDOrPhoneNoIndex = AG1.idindex WHERE AG.AgentID = AG1.AgentID AND G.GroupFlag = 0
FOR XML PATH('')),1,1,'')
GroupsList FROM AgentIDGroup AG GROUP BY AgentID )
SELECT A.*, ISNULL(CTE.GroupsList,'') as GroupsList
FROM Agents A LEFT JOIN CTE on A.PhoneUserID = CTE.AgentID
--In both case the output will be like this
PhoneUserID | FirstName | LastName | MiddleName | GroupsList
6001 Jill Steeves J test
group,Delegates
Thanks,
BijayHi,
We have a requirement like to retrieve a concatenated string of values as a column. For this whether i should use UDF with SQL query or STUFF.
Please suggest.
Here is my Example
--Create function
CREATE FUNCTION dbo.GroupsList(@AgentID NVARCHAR(32))
RETURNS NVARCHAR(MAX)
AS
-- Returns the grouplist
BEGIN
DECLARE @listStr VARCHAR(MAX);
SELECT @listStr = COALESCE(@listStr+',' ,'') + g.GroupName
FROM
AgentIDGroup ag
INNER JOIN Groups g
ON ag.idindex = g.IDOrPhoneNoIndex
WHERE
ag.AgentID = @AgentID;
IF(@listStr IS NULL)
SET @listStr = '';
RETURN @listStr;
END;
GO
--Call UDF to get resultset
SELECT
a.*
,dbo.GroupsList(a.PhoneUserID) as GroupsList
FROM
Agents a
--CTE with STUFF function and XML PATH clause
WITH CTE AS (
SELECT AgentID,
STUFF((SELECT ', ' + rtrim(convert(nvarchar(32),G.GroupName))
FROM AgentIDGroup AG1 JOIN Groups G on G.IDOrPhoneNoIndex = AG1.idindex WHERE AG.AgentID = AG1.AgentID AND G.GroupFlag = 0
FOR XML PATH('')),1,1,'')
GroupsList FROM AgentIDGroup AG GROUP BY AgentID )
SELECT A.*, ISNULL(CTE.GroupsList,'') as GroupsList
FROM Agents A LEFT JOIN CTE on A.PhoneUserID = CTE.AgentID
--In both case the out will be like this
ID | FirstName |
LastName MiddleName
| GroupsList
6001 Jill
Steeves test group,Delegates
Thanks,
Bijay -
UDF: How to convert string with sign into integer
Hi
I have a number e.g 123456 (xsd:string) and sign - or + (xsd:string) and both are concatenated and fed into UDF. I want this string to be converted into Integer. If I use the below kind of statement it is not working and throwing the below error.
int BilledAmount = Integer.parseInt(b[0]);
Exception:
RuntimeException in Message-Mapping transformation: Exception:[java.lang.NumberFormatException: For input string: "+000000000006684"]
Any guess on this issue ??
Regards
KumarHey buddy,
Hope you are doing gr8, I'm getting ready leaving this friday..:-)
Aamir b[0] doesn't correspond to the first character of the string. He has multiple input values, hence he is using Context. See my structure and UDF I mentioned above, actually the above is his requirement I believe.
Yes, If you have + symbol in front of String and if you try to conver to Integer object it will throw an exception. Coz it doesn't make sense to add + symbol at all. if you don't have any sign in front it implies it's positive, am I right? But in case of negative, you need to explicitly include - symbol in front.
This is the reason that java couldn't able to convert the string that has + symbol in front, but it can in case it has - symbol in front.
I hope it clears a bit..
raj. -
UDF: Mapping query-------Urgent
hi...
I m doing a scenario from File to JDBC. I have the following requirement.
Source:
Field1
Field2
On the target side i should be able to insert into database such that in column FIELD i get:
Field1
Field2
This new line can be incorporated by concatenating Field1 with '|| chr(10) ||'
which is used in Oracle for inserting a new line.
But now i am facing a problem. The database is treating '|| chr(10) ||' as a string and instead of getting Field2 on a new line i am getting the inserted row as:
Field1 || chr(10) || Field2.
Please help me resolve this.Hi,
A simple solution this is to write an UDF.
You can write a code in UDF as below
Pass a as an argument.
String c;
c = a + "\n"
return c;
use this c as variable in query.
Regards,
Akshay Jamgaonkar.
Reward points if find useful. -
Hi,
I am working on a scenario wherin i have to concatenate fields(around 30) on the source side and map it to a single target field.I have to map it as a fixed length i.e., if a field on the source side is of length 10 and if we pass only 5 characters, the remaining 5 plsces should be spaces and the next field should start from the 11th position as shown below
source data target concat data(with spaces)
filed1(10) abcd field abcd 123
field2(5) 123
Can any one please help me in solving this.
Thanks,
VikramHi,
UDF can be used to solve your problem. A UDF can hold 20 input fields. So, you have to use 3 UDFs. In the First two UDF, you can concatenate the input fields and also check for the spaces. In third UDF, you will be concatenating the Output of First two UDF.
Concatenation can be done as : String3 = String2 + String1 in the UDFs.
I hope this would solve your problem.
Regards,
Rahul -
Concatenating texts from multiple IDoc segments
Hi everybody!
I have to concatenate log texts supplied via IDoc segments into one string. There can be zero or more segments, each with one line of the long text. The result should be one single string field filled with all the lines concatenated.
What's the easiest way to achieve this result? Do I need a user-defined function or can I code this using standard built-in funtions (this solution would be preferred)?
Regards,
JoergUse the UDF with the following logic.
Take the input type as Queue of the Segments
Concatenate the temp = temp + a<i> in the loop
return the temp.
<b>UDF as follows:</b>
String temp = " ";
for(int i=0; i< a.lenght; i++)
temp = temp + a<i>
return temp;
Your probelm will solve with the above UDF.
Warm Regards,
Vijay -
Are we actually going to get a string concatenation aggregate in SQL Server 2008?? I am so sick of having to write a UDF for every concatenation I want to do. I am well aware of all the methods available to do it now, and they are all junk, and the performance is horrible. I'm sure it is a challenging problem, and there are known pitfalls, but its time to address these.
The notion that it is the responsibility of the front end to do the concatenation is pure bs. You don't dump 10,000 rows to your report server when you only need to display 1000, just so you can concatenate one lousy column.
I want to be able to write:
SELECT CustName, SUM(ProductPrice), CONCAT(ProductName, [my separator], ORDER OVER ProductName ASC)
FROM Orders
And I'm not going to stop complaining til I get it! (-;This is just the 'wrong' place for your compliant to have an 'real' effect.
Register you complaint/desire at:
Suggestions for SQL Server
http://connect.microsoft.com/sqlserver
And then get all of your friends and associates that also think it is a good idea to 'vote' on your request. (It is a 'popularity' contest'.) -
Udf Data is not being displayed in the report
Hi all,
i have designed one report in which i am displaying some udf fields along with other system fields.
i have not used any selection criteria.
when i run report it doesn't display udf data of some random rows in the report even if data is peresent in that udf field.
If i open sales order and press 'Shift-F2' and update the document and now if i run report then i get that udf value in the report.
why this happening. data is there in the udf field only its not displayed in the report with out updating the that udf.
pls suggest some solution.
regsrds,
Chetan.Hi Ashish,
I ran the "ZPS/!ZPS" in RSRT where ZPS is the infoset name. In Dev, it displayed the values. In QA, it displayed the below messages:
ECharacteristic 0TCAKYFNM does not exist. Check authorizations
WThere are calculated elements. These results are bracketed [ ]
and below that, it displayed the values for Number of records. But, it has not displayed the values for the other figures.
Does this has any impact in QA.
Thanks & Regards,
AVN Rao. -
Error while setting a value into an UDF of type date
Hello,
i get the following error while trying to set a value to an udf with the type "date":
Exception from Server: RPC_E_SERVERFAULT
This code is used:
objDate = CDate(objLineRecordSet.Fields.Item("U_TESTDATE").Value)
objDocument.Lines.UserFields.Fields.Item("U_ACTDATE").Value = objDate '### Here comes the error
The application is in PL 29Christian,
If you search this forum on "date UDF" you will find many posts that may assist you such as this one ...
Format of string passed to Date/Time Hour UDF
HTH,
Eddy -
Error while creating an UDF in a PI 7.1 Mapping
Hi experts,
I'm having problems after creating an UDF in a Message mapping. I receive the error:
the length 0 of the array 'sortedFunctionKeys' is not equal to the number 1 of functions.
It seems like forgeting initializing something...
Regards
GonzaloUpgrading my JDK to 1.6 in my PC almost solved the problem. Anyway, sometimes that happens again.
What I actually do:
1.-Creating my Message Mapping
2.-Saving it
3.-Developping my UDF
The problem occcurs when you create an UDF and just in that moment you don't save it. It will be a bug...
Hope that helps you
Regards
Gonzalo -
Hi All,
Requesting your help in fixing an UDF issue.
This UDF is to check for a table entry and if not found it will create an alert with some source values.
Now the problem is, alert mails are getting created but the values are not getting passed.
Here is the source code:
AbstractTrace trace;
trace = container.getTrace();
MappingTrace trace1;
trace1 = container.getTrace();
Object cachedValue = null;
String result = null;
String sender = null;
String receiver = null;
//Check if source is null or blank. If so then pass blank value to target
if(((sourceValue1.trim()).equals("")) || ((sourceValue2.trim()).equals("")) || ((sourceValue3.trim()).equals("")))
result="";
else
Map map = container.getTransformationParameters();
//Sender System name which is the same as the Sender Business System name in Integration Directory
sender = (String) map.get(StreamTransformationConstants.SENDER_SYSTEM);
//Receiver System name which is the same as the Receiver Business System name in Integration Directory
receiver = (String) map.get(StreamTransformationConstants.RECEIVER_SYSTEM);
// Parameter for cache value. A semicolon is used as a separator between keys
String CONTAINER_PARAMETER = subCat.trim() + UDFReader.getString("PARAMETER_DELIMETER") +sourceValue1.trim() + UDFReader.getString("PARAMETER_DELIMETER") +sourceValue2.trim() + UDFReader.getString("PARAMETER_DELIMETER") +sourceValue3.trim();
trace1.addWarning("CONTAINER PARAMETER: " + CONTAINER_PARAMETER + "\n");
trace.addDebugMessage(UDFReader.getString("CACHE_CONTAINER_PARAMETER_TEXT") + CONTAINER_PARAMETER);
// Retrieve cached value
cachedValue = container.getParameter(CONTAINER_PARAMETER);
if(cachedValue!=null)
// Cached value found
result = cachedValue.toString();
trace.addDebugMessage(UDFReader.getString("CACHE_RESULT_TEXT") + result);
else
// Cached value not present. Fetch value from database
// Build key column names array to be passed to java class
String keyColNames[] =new String[6];
keyColNames[0]=UDFReader.getString("SAP_SYSTEM_COLUMN_NAME");
keyColNames[1]=UDFReader.getString("LEGACY_SYSTEM_COLUMN_NAME");
keyColNames[2]=UDFReader.getString("SUBCATEGORY_COLUMN_NAME");
keyColNames[3]=sourceField1;
keyColNames[4]=sourceField2;
keyColNames[5]=sourceField3;
trace1.addWarning("KeyColNames" + keyColNames[0] + "\n" + keyColNames[1] + "\n" + keyColNames[2] + "\n" + keyColNames[3] + "\n" + keyColNames[4] + "\n" + keyColNames[5] + "\n");
// Build key column values array to be passed to java class
String keyColValues[] = new String[6];
//Check whether sender system is SAP or Legacy
if(sourceField1.startsWith(UDFReader.getString("SAP_SYSTEM_PREFIX")))
//Sender system is SAP
keyColValues[0]=sender;
//Receiver system is Legacy
keyColValues[1]=receiver;
else
//Receiver system is SAP
keyColValues[0]=receiver;
//Sender system is Legacy
keyColValues[1]=sender;
keyColValues[2]=subCat.trim();
keyColValues[3]=sourceValue1.trim();
keyColValues[4]=sourceValue2.trim();
keyColValues[5]=sourceValue3.trim();
// Fetch result using java class
result=RfcLookupHandler.RFCLookup(table,keyColNames,
keyColValues,targetField,trace);
trace1.addWarning("Result:" + result);
if(!result.equals(RfcLookupHandler.VALNOTFOUND))
// Record found in database
container.setParameter(CONTAINER_PARAMETER,result);
else
// Record not found in database
//Autogenerated message id generated at runtime
String msgId = (String) map.get ( StreamTransformationConstants.MESSAGE_ID);
//Dynamic alert message details-Trigerred through RFC SALERT_CREATE
String element[] = new String[9];
String tabIndex[] = new String[9];
String elementLength[] = new String[9];
String type[] = new String[9];
String value[] = new String[9];
//Container names for alert message
element[0] = UDFReader.getString("CONTAINER_NAME_MESSAGE_ID");
element[1] =UDFReader.getString("CONTAINER_NAME_INTERFACE_NAME");
element[2] =UDFReader.getString("CONTAINER_NAME_OBJECT_TYPE");
//element[2]="SAP_MAT_NO";
element[3] =UDFReader.getString("CONTAINER_NAME_OBJECT_TYPE"); ;
element[4] =UDFReader.getString("CONTAINER_NAME_OBJECT_TYPE");
//element[4]="PLANT";
element[5] = UDFReader.getString("CONTAINER_NAME_OBJECT_VALUE");
element[6] = UDFReader.getString("CONTAINER_NAME_OBJECT_VALUE");
element[7] =UDFReader.getString("CONTAINER_NAME_OBJECT_VALUE");
element[8] ="TABLE";
trace1.addWarning("Warning: \n" + element[0] + "\n" + element[1] + "\n" + element[2] + "\n" + element[3] + "\n" + element[4] + "\n" + element[5] + "\n" + element[6] + "\n" + element[7] + "\n" + element[8]);
//Tab index of container variables in alert message
tabIndex[0] = "000001";
tabIndex[1] = "000002";
tabIndex[2] = "000003";
tabIndex[3] = "000004";
tabIndex[4] = "000005";
tabIndex[5] = "000006";
tabIndex[6] = "000007";
tabIndex[7] = "000008";
tabIndex[8] = "000009";
//Length of containers
elementLength[0] = elementLength[1] = elementLength[2] =elementLength[3] = elementLength[4] = elementLength[5] = elementLength[6] = elementLength[7]=elementLength[8]=UDFReader.getString("CONTAINER_VALUE_LENGTH");
//Data type of containers
type[0] = type[1] = type[2] = type[3] = type[4]=type[5] = type[6] =type[7] ="C";
//Values supplied to containers
value[0] =msgId;
value[1] =interfaceName;
value[2] = sourceField1;
value[3] = UDFReader.getString("MESSAGE_SEPARATOR_HYPHEN") + sourceValue1.trim();
value[4] = UDFReader.getString("MESSAGE_SEPARATOR_COMMA") + sourceField2;
value[5] = UDFReader.getString("MESSAGE_SEPARATOR_HYPHEN") + sourceValue2.trim();
value[6] = UDFReader.getString("MESSAGE_SEPARATOR_COMMA") + sourceField3;
value[7] = UDFReader.getString("MESSAGE_SEPARATOR_HYPHEN") + sourceValue3.trim();
value[8] =table;
trace1.addWarning("Table: "+table);
// Check error handling flag
if(errorHandlingFlag.equalsIgnoreCase("E"))
//Throw Error and generate alert message
trace.addInfo(UDFReader.getString("NO_RESULT_FLAG_E_TRACE"));
trace1.addWarning("Error Flag: E");
for (int i=0; i<9; i++){
trace1.addWarning("Parameters["+i+"]: " +value[i]);
result = SUPPRESS;
RfcAlertHandler.RFCAlert(alertCat,element,tabIndex,elementLength,type,value,trace);
throw new ValueMappingException(UDFReader.getString("NO_RESULT_FLAG_E_EXCEPTION"));
else if(errorHandlingFlag.equalsIgnoreCase("N"))
//Pass 'NA' value to target
result=UDFReader.getString("NO_RESULT_FLAG_N_VALUE_PASSED");
trace.addInfo(UDFReader.getString("NO_RESULT_FLAG_N_TRACE"));
trace1.addWarning("Error Flag: N");
else if(errorHandlingFlag.equalsIgnoreCase("B"))
//Pass blank value to target
result="";
trace.addInfo(UDFReader.getString("NO_RESULT_FLAG_B_TRACE"));
trace1.addWarning("Error Flag: B");
else
//Incorrect Error Handling Flag
trace.addInfo(UDFReader.getString("INCORRECT_FLAG_TRACE"));
trace1.addWarning("Error Flag: INCORRECT");
result = SUPPRESS;
throw new ValueMappingException(UDFReader.getString("INCORRECT_FLAG_EXCEPTION"));
return result;
Can someone check where could be the problem?
Thanks,
Glory.What is RfcLookupHandler? And where is RFC channel settings?
-
Get dynamic filename in a Java Mapping (NOT UDF)
Hi,
we are using a Java Mapping step in XI (not UDF). We need to have access to the filename. In the File Adapter we set the message attributes and can see the filename value in the SXMB_MONI.
We use the following code fragment to have access to the filename:
Container container = new Context(new FunctionWrapper(0));
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String sourceFileName = conf.get(key);
This doesn't work. We think the declaration of the container class is wrong. Does anybody have some information about using the dynamic attributes in Java Mappings?
Thanks in advance
Michaelimport com.sap.aii.mapping.api.*;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
public class JavaProgram
implements StreamTransformation
public JavaProgram()
public void setParameter(Map map)
param = map;
if(param == null)
param = new HashMap();
public void execute(InputStream inputstream, OutputStream outputstream)
try
DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
DynamicConfigurationKey dynamicconfigurationkey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
String s = dynamicconfiguration.get(dynamicconfigurationkey);
//Your logic
catch(Throwable throwable)
throwable.printStackTrace();
private Map param; -
Concatenating values in one row
I need to write a function that will give me a concatenated list of all the records where gurmail_matl_code_mod like '8%'
This query is giving me those results:
GURMAIL_PIDM CODE1 CODE2
1135711
1135711 8IBD
1135711 8IBW
I want something like this 1135711 8IBW 8IBD in one row.
select
gurmail_pidm,
max(decode(rn,1,gurmail_matl_code_mod )) code1,
max(decode(rn,2,gurmail_matl_code_mod )) code2
from (select gurmail_pidm,
gurmail_matl_code_mod,
row_number() over (partition by gurmail_pidm order by gurmail_matl_code_mod desc) rn
from
(select gurmail_pidm,gurmail_matl_code_mod
from saturn.spriden,
general.gurmail
where spriden_pidm = gurmail_pidm
and spriden_change_ind is null
and gurmail_matl_code_mod like '8%'
and gurmail_pidm = 1135711
and GURMAIL_DATE_PRINTED is null
and gurmail_matl_code_mod is not null))
group by gurmail_pidm, gurmail_matl_code_mod How I can modify this query or let me know if you have other ideas..
Thank youHello
try this,
SQL> with tab as(Select 1135711 GURMAIL_PIDM, Null CODE1 from dual Union All
2 Select 1135711 GURMAIL_PIDM, '8IBD' CODE1 from dual Union All
3 Select 1135711 GURMAIL_PIDM, '8IBW' CODE1 from dual)
4 SELECT GURMAIL_PIDM || sys_connect_by_path(CODE1,' ') Result
5 FROM (SELECT GURMAIL_PIDM
6 ,code1
7 ,row_number() over(Partition BY GURMAIL_PIDM Order BY GURMAIL_PIDM) rn
8 FROM tab)
9 WHERE connect_by_isleaf = 1
10 Start With rn = 1
11 Connect BY Prior rn = rn - 1;
RESULT
1135711 8IBW 8IBDHope this helps
Christian Balz
Maybe you are looking for
-
Mvt type 313 Q via delivery not allowed
Hi, We have a scenario in our priject where the material (project stock) has to be moved from a srorage location to the customer site which again has been defined as a storage location. For this we have enabled the stoarge location to storage locatio
-
Empty BPEL Project Fails to migrate...
Hi Everyone, I migrated a BPEL project from JDeveloper 10.1.2 to 10.1.3.3. After successfully letting JDev do the migration for me, the rebuild failed, and I ended up deleting all the project code, leaving only the receiveInput - relayOutput skeleton
-
I need help deleteing documents from Abode ReaderIX
Can someone please tell me how to delete documents - everytime I highlight a document to be deleted the delete never selects. I can not delete documents -- I need help please someone anyone help!!!!!!!!!!!!!
-
NJAWIN displaying pop up error message
Hi. I am using njawin to display external svg documents/web pages in an applet. It all works well until there is a link to pop up window. jawin.dll is displaying then the following error message: Event Processing Error java.lang.NoClassDefFoundError:
-
Do you guys experience white lines appear on your xperia Z3 screen?
Do you guys experience white lines appear on your xperia Z3 screen?