Colour duplicate values in html output
Hello,
I am looking to colour duplicate values in an html output file.
I have written a folder comparison ps script which shows output as below:
Name Length Version
Name length and version are the column names
Now there are many duplicate entries under name column which I need to highlight using any one colour. I have sorted the output under name using alphabetical order.
I just need to highlight all duplicate values using a particular colour.
Thanks in advance.
Posting my script here:
# Get Start Time
$startDTM = (Get-Date)
$a = "<style>"
$a = $a + "BODY{background-color:peachpuff;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}"
$a = $a + "</style>"
$folderReference = Read-Host "Enter Reference Folder Name"
$folderDifference = Read-Host "Enter Difference Folder Name"
$FolderReferenceContents = Get-ChildItem $folderReference -Recurse |
where-object {-not $_.PSIsContainer}
$FolderDifferenceContents = Get-ChildItem $folderDifference -Recurse |
where-object {-not $_.PSIsContainer}
#get only files that are on reference folder not base folder
$one = Compare-Object -ReferenceObject $FolderReferenceContents `
-DifferenceObject $FolderDifferenceContents -Property ('Name', 'Length','Get-FileVersionInfo') -PassThru |
where-object { $_.SideIndicator -eq '<='} | select Name, Length, LastWriteTime, VersionInfo
#get only files that are on base folder not on reference
$two = Compare-Object -ReferenceObject $FolderReferenceContents `
-DifferenceObject $FolderDifferenceContents -Property ('Name', 'Length','Get-FileVersionInfo') -PassThru |
where-object { $_.SideIndicator -eq '=>'} | select Name, Length, LastWriteTime, VersionInfo
$three = $one + $two | sort-object -property Name | ConvertTo-HTML -Fragment
# Get End Time
$endDTM = (Get-Date)
# Echo Time elapsed
$four = "Elapsed Time: $(($endDTM-$startDTM).totalseconds) seconds"
ConvertTo-HTML -Head $a -Body "$one $two $three $four" -Title "Output" | Out-File C:\output.html
Similar Messages
-
Duplicate Files in HTML Output
RoboHelp HTML 11
I did a lot of experimenting this week inserting Captivate demos into my project. Today, while trying to determine why my output is over 1 GB in size, I looked in the !SSL!\Multiscreen_HTML5\desktop folder. I see many, many copies of folders related to these videos. There's a set with one timestamp containing "Video Topic 1", "Video Topic 2", etc.; there are many similar sets with different timestamps.
I should be able to delete all of these, right? Wont' anything that's still needed will be recreated when I Generate a new output?
Also, does anyone know why all these duplicates appear?
Thanks.
-- ShawnHi there
When you say "Multiscreen", you may not realize it, but you are creating many different outputs.
So let's assume you add a Captivate video to Topic "V" and that video is in SWF format. If you generate Multiscreen output and you have a profile enabled for iPhone, Android Phone, iPad, Android Galaxy Tab, Kindle Fire and Desktop, that's a total of six profiles. That means your output will indeed have six copies of the SWF. One for each of the profiles. Each profile has its own complete set of output files.
The only way to reduce the number of output files is to reduce the number of profiles you are generating to.
Cheers... Rick -
Avoid duplicate values in a row!
Hi,
I posted this query few days back and got the response to .. but now i am facing a new problem in this.. so let me explain this again,
I have a table A as follows
TableA
ID data1 data2
1 aa zz
1 bb xx
1 cc yy
1 aa yy
1 bb zz
When i select data1 ColumnA, data2 ColumnB from TableA,
I need it to be displayed in single row seperated by comma, is their any way to do it....
ColumnA ColumnB
aa,bb,cc zz,xx,yy
So i got a response to use one of the technique suggested by,
http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
I used the following function to achieve it..
CREATE OR REPLACE FUNCTION get_data (p_id in tableA.id%TYPE)
RETURN VARCHAR2
IS
l_text VARCHAR2(32767) := NULL;
BEGIN
FOR cur_rec IN (SELECT data1 FROM tableA WHERE id = p_id) LOOP
l_text := l_text || ',' || cur_rec.data1;
END LOOP;
RETURN LTRIM(l_text, ',');
END;
The above function works .. brings all the data in the column in a single line.. but.. it has duplicates in that row.. how to avoid the duplicates it..
i am getting OUTPUT as
columnA ColumnB
aa,bb,cc,aa,bb zz,xx,yy,yy,zz
but i need it as follows
ColumnA ColumnB
aa,bb,cc zz,xx,yy
How to avoid those duplicate values.. could some one help me around
Thanks in advance
-PreethaMay be this can give you an idea to customize it for you!
http://www.williamrobertson.pwp.blueyonder.co.uk/documents/one_row.html
Sorry! I didn't know! It is the same example that is referred in both the links!
Cheers
Sarma.
Message was edited by:
Radhakrishna Sarma -
Using Custom XSLT File for html output file
Hi all
I have probably rather a silly question but I have not found a solution yet.
I would like to use a custom XSLT file, which I already have and is working, within a Biztalk Map. The custom XSLT is generating a html file out of an xml file. However I'm not able to succeed so far because I have probably some issues in defining the correct
target schema.
The output that I get at the moment is just a duplicate of the input, probably because I have used the schema for source and target.
So my question is, how do I create a html file out of an xml with a custom XSLT file?
Sorry if this is a nooby question but I couldn't find an answer.Hi Jerome,
Sorry, your question is not very clear. "I would like to use a custom XSLT file, which I already have and is working, within a BizTalk Map. The custom XSLT is generating a html file out of an xml file" - You have an XSLT which you use for map and how
its generating a HTML file? Are you using something like this?
Changing an XML Response to an HTML output using a Map
If your requirement is to output the html file from the received XML file using XSLT, then use a custom pipeline at send port like XSLT Transform Component and provide the XST which would change the XML to HTML. Here is an example of an XST which I have
used in the past, which converts the received OrderResponse XML to nicely formatted HTML.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://biztalk.orderapp.schemas.OrderResponse">
<xsl:template match="/">
<html>
<body>
<TABLE BORDER="0" cellspacing="2" cellpadding="2" width="90%">
<xsl:apply-templates select="/ns0:OrderResponse"/>
</TABLE>
</body>
</html>
</xsl:template>
<xsl:template match="/ns0:OrderResponse">
<TR>
<TD colspan="8" align="center">
<H1>Order Confirmation</H1>
</TD>
</TR>
<TR>
<TD colspan="2">
<B>Order no : </B>
</TD>
<TD colspan="6" align="left">
<xsl:value-of select="ns0:OrderHeader/ns0:OrderNumber/text()"/>
</TD>
</TR>
<TR>
<TD colspan="2">
<B>Supplier : </B>
</TD>
<TD colspan="6" align="left">
<xsl:value-of select="ns0:SupplierDetails/ns0:SupplierName/text()"/>
</TD>
</TR>
<TR>
<TD colspan="2">
<B>Supplier Order no : </B>
</TD>
<TD colspan="6" align="left">
<xsl:value-of select="ns0:SupplierDetails/ns0:SupplierOrderNumber/text()"/>
</TD>
</TR>
<TR>
<TD colspan="2">
<B>Account no : </B>
</TD>
<TD colspan="6" align="left">
<xsl:value-of select="ns0:OrderHeader/ns0:CustomerAccountNumber/text()"/>
</TD>
</TR>
<TR>
<TD colspan="2">
<B>Order date : </B>
</TD>
<TD colspan="6" align="left">
<xsl:value-of select="ns0:OrderHeader/ns0:OriginalOrderCreationDate/text()"/>
</TD>
</TR>
<TR>
<TD colspan="2">
<B>Delivery date : </B>
</TD>
<TD colspan="6" align="left">
<xsl:value-of select="ns0:OrderHeader/ns0:DeliveryDate/text()"/>
</TD>
</TR>
<TR>
<TD colspan="2">
<B>Order Status : </B>
</TD>
<TD colspan="6" align="left">
<xsl:value-of select="ns0:OrderHeader/ns0:OrderStatus/text()"/>
</TD>
</TR>
<TR>
<TD colspan="8">
<BR></BR>
</TD>
</TR>
<TR>
<TD valign="top">
<B>Line</B>
</TD>
<TD valign="top">
<B>Code</B>
</TD>
<TD valign="top">
<B>UOM</B>
</TD>
<TD valign="top">
<B>
Avail<BR></BR>Qty
</B>
</TD>
<TD valign="top">
<B>
Line<BR></BR>Price
</B>
</TD>
<TD valign="top">
<B>
Line<BR></BR>Status
</B>
</TD>
</TR>
<xsl:for-each select="ns0:LineItems">
<xsl:for-each select="ns0:LineItem">
<TR>
<TD valign="top">
<xsl:value-of select="ns0:LineNumber/text()"/>
</TD>
<TD valign="top">
<xsl:value-of select="ns0:ProductCode/text()"/>
</TD>
<TD valign="top">
<xsl:value-of select="ns0:UnitOfMeasure/text()"/>
</TD>
<TD valign="top">
<xsl:value-of select="ns0:Quantity/text()"/>
</TD>
<TD valign="top">
<xsl:value-of select="ns0:UnitPrice/text()" />
</TD>
<TD valign="top">
<xsl:value-of select="ns0:LineStatus/text()" />
</TD>
</TR>
</xsl:for-each>
</xsl:for-each>
<TR>
<TD colspan="8">
<BR></BR>
</TD>
</TR>
</xsl:template>
</xsl:stylesheet>
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
Avoiding null and duplicate values using model clause
Hi,
I am trying to use model clause to get comma seperated list of data : following is the scenario:
testuser>select * from test1;
ID VALUE
1 Value1
2 Value2
3 Value3
4 Value4
5 Value4
6
7 value5
8
8 rows selected.
the query I have is:
testuser>with src as (
2 select distinct id,value
3 from test1
4 ),
5 t as (
6 select distinct substr(value,2) value
7 from src
8 model
9 ignore nav
10 dimension by (id)
11 measures (cast(value as varchar2(100)) value)
12 rules
13 (
14 value[any] order by id =
15 value[cv()-1] || ',' || value[cv()]
16 )
17 )
18 select max(value) oneline
19 from t;
ONELINE
Value1,Value2,Value3,Value4,Value4,,value5,
what I find is that this query has duplicate value and null (',,') coming in as data has null and duplicate value. Is there a way i can avoid the null and the duplicate values in the query output?
thanks,
Edited by: orausern on Feb 19, 2010 5:05 AMHi,
Try this code.
with
t as ( select substr(value,2)value,ind
from test1
model
ignore nav
dimension by (id)
measures (cast(value as varchar2(100)) value, 0 ind)
rules
( ind[any]= instr(value[cv()-1],value[cv()]),
value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
and ind[cv()]=0 THEN ',' || value[cv()] END
select max(value) oneline
from t;
SQL> select * from test1;
ID VALUE
1 Value1
2 Value2
3 Value3
4 Value4
5 Value4
6
7 value5
8
8 ligne(s) sélectionnée(s).
SQL> with
2 t as ( select substr(value,2)value,ind
3 from test1
4 model
5 ignore nav
6 dimension by (id)
7 measures (cast(value as varchar2(100)) value, 0 ind)
8 rules
9 ( ind[any]= instr(value[cv()-1],value[cv()]),
10 value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
11 and ind[cv()]=0 THEN ',' || value[cv()] END
12 )
13 )
14 select max(value) oneline
15 from t;
ONELINE
Value1,Value2,Value3,Value4,value5
SQL> -
Missing a single space in html output
Hello to all,
take a look at the following code copied from a View
<% DATA: eins TYPE STRING VALUE 'ClassEins',
zwei TYPE STRING VALUE 'ClassZwei'. %>
<span id="Test1" class="<%=eins%> ClassZwei">test it</span>
<span id="Test2" class="ClassEins <%=zwei%>">test it</span>
it works fine if compression is set to NONE, but if compression is set to 1 (remove spaces) or 2 (remove spaces, CR, LF) the html output looks like this:
<span id="Test1" class="ClassEinsClassZwei">test it</span>
<span id="Test2" class="ClassEins ClassZwei">test it</span>
Where is the single space? Whats wrong? Why is the first space removed, but the second isnt?Thilo,
At this stage we are not planning a kernel patch, unless your business case is really pressing. (In which case update OSS message so that rethink why nein is the right answer.) We have actually spend a number of hours to find where this is stripped (by accident), and see that the price to fix this, is very high for us. The truth is that this is a minor problem that only happens when you active the additional compression, where our first suggestion would be to just skip the compression for this page. (All of this been said, we will keep it on the toDo list, and see if can get the resources at same stage to dive into kernel development again.)
(Just for interest, not even myself could remember where some of this code is executed. Your problem provided a nice trip down memory lane!)
As for the back tics, they are string literals, and are space sensitive in ABAP. An example:
CONCATENATE 'a ' 'b ' 'c ' INTO s. --> s = "abc".
CONCATENATE `a ` `b ` `c ` INTO s. --> s = "a b c ".
The nice thing about this is that it is now possible to write in ABAP strings that contain <b>both</b> HTML and JavaScript all in one:
s = `<body onload="myFunc('JSparm');">`.
We use " and ' for the HTML and JavaScript, and the ` to build the ABAP string. Makes the Java colleagues just jealous of our writing style:)
brian -
Reports 3/6i HTML Output Print problem
Hi!
I am using Reports 3 to generate HTML output but when I print this HTML output, it does not break at Oracle Reports Page break. It looks like the browser takes its default settings for margins. I am using IE 5.5.
I tried the following options
1. Using { page-break-after: always } option in 'After Page Value' of Report Escapes property (Report)
2. Changing margin settings of browser, but was not able to change them to 0.
I want to print the HTML report with page breaks where Oracle marks as Page Break.
If possible, Please do write me at [email protected]
Thanks,
Praveen KumarPraveen,
When you generate a HTML page in Reports, you are generating a single page document that is then intepretted by the browser. You are correct that when you then print this page from the browser then it will not necessarily break at the same point as the reports page breaks.
The only way to guarantee that you will get the same breaks is to use a different format. Most commonly people use PDF format when they want the printed page to match exactly what's on the screen. Alternatively you could include a link on the HTML rendition of the report that resubmits the report to the server but instructs the server to print the report directly.
Hope this helps,
Danny -
How to restrict the duplicate values in lov column of VO based Adv Table
Hi Gurus,
I want to restrict the duplicate values at lov which is a colunm in an Adv Table.
If user enters duplicate values then first it should show an error msg that Duplicate values have been entered.
After the duplicate values have been removed, then the user can save all the values in the table.
My Adv Table is based on a VO.
The link how to restrict the duplicate values at form level
talks about Adv Table based on a EoVO, which doesnot work in my case.
My Approach,
I am iterating through RowSetIterator and committing through PROCEDURE.
I am able to avoid duplicate entry through a function checkRespId. (given below)
Below code is for iterating and committing.
public void saveline(String reqid,String userid)
System.out.println("RequestId/saveline"+reqid);
System.out.println("UserId/saveline"+userid);
OAViewObject vo = (OAViewObject)getRespLineVO1();
RespLineVORowImpl row = null;
int fetchedRowCount = vo.getFetchedRowCount();
RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
if (fetchedRowCount > 0)
deleteIter.setRangeStart(0);
deleteIter.setRangeSize(fetchedRowCount);
for (int i = 0; i < fetchedRowCount; i++)
System.out.println("Inside the for LOOP");
row = (RespLineVORowImpl)deleteIter.getRowAtRangeIndex(i);
String respoidid = row.getAttribute("ResponsibilityId")+"";
String respname = row.getAttribute("ResponsibilityName")+"";
String stdate = row.getAttribute("StartDate")+"";
String enddate = row.getAttribute("EndDate")+"";
String linestatus ="A";
if(userid!=null)
if(!(respoidid.equals("null")) && respoidid!=null)
String checkingrespid=null;
checkingrespid = checkRespId(userid,respoidid);+contains no if not duplicate and yes if its duplicate+
System.out.println("checkingrespid for Resp with ID :"+respoidid+"exists or not "+checkingrespid);
if(checkingrespid.equals("No"))
String message, result = null;
Connection txn = getOADBTransaction().getJdbcConnection();
try
calling PROC ...
catch(Exception e)
message = "Error in Inserting into line" + e;
throw new OAException(message, OAException.ERROR);
else
throw new OAException("You have entered duplicate no. of values", OAException.ERROR);
else
System.out.println("respoidid is null");
break;
deleteIter.closeRowSetIterator();
public String checkRespId(String userid,String respoidid)
String createRow="No";
OAViewObject vo = (OAViewObject)findViewObject("CheckRespVO1");
if (vo != null)
vo.setWhereClauseParams(null);
vo.setWhereClauseParam(0, userid);
vo.setWhereClauseParam(1, respoidid);
vo.executeQuery();
System.out.println("ROW COUNT IS "+vo.getRowCount());
if(vo.getRowCount()>0)
createRow="Yes";
else
createRow="No";
return createRow;
Problem:
I remove the duplicate entries and click on save and get this error.
Unable to perform transaction on the record. \nCause: The record contains stale data. The record has been modified by another user.
\nAction: Cancel the transaction and re-query the record to get the new data.
Thanks,
SombitHi Anil,
I am trying out your code but stuck in inserting the rows
using your code in URL: http://oracleanil.blogspot.com/2010/09/oaf-passing-table-type-object-to-oracle.html
I am always getting the same exception i.e COde blast in when I run.
My modified code is:
String[] as = null;
Number[] vNumber = null;
Number[] vNumberrespid = null;
Number reqidnumber = null;
reqidnumber = new Number(Integer.parseInt(reqid));
Connection txn = getOADBTransaction().getJdbcConnection();
String mCreateSearchRequestStatement = null;
OAViewObject vo = (OAViewObject)findViewObject("RespLineVO1");
int j = vo.getFetchedRowCount();
try
System.out.println("abouce try");
vo.reset();
if (vo.getFetchedRowCount() > 0)
System.out.println(String.valueOf("Fetched row count ").concat(String.valueOf(vo.getFetchedRowCount())));
int i = 0;
as = new String[j];
vNumber = new Number[j];
vNumberrespid = new Number[j];
while (vo.hasNext())
vo.next();
System.out.println(String.valueOf("Inisde the do while loop").concat(String.valueOf(i)));
vNumber[i] = (reqidnumber);
vNumberrespid = ((Number)vo.getCurrentRow().getAttribute("ResponsibilityId"));
as[i] = String.valueOf(vo.getCurrentRow().getAttribute("ResponsibilityName")).concat(String.valueOf(""));
System.out.println("Request ID "+reqidnumber[i]);//getting null even there is some value selected
System.out.println("ResponsibilityId "+vNumberrespid[i]);//getting null even there is some value selected
System.out.println("Resp Name "+as[i] );//getting null even there is some value selected
i++;
CallableStatement cs = txn.prepareCall("{call XX_PassTableType.XX_PassTableType_prc(:1, :2,:3)}");
ARRAY array = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumber);
ARRAY arraynew = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", txn), txn, vNumberrespid);
ARRAY array1 = new ARRAY(new ArrayDescriptor("APPS.JTF_VARCHAR2_TABLE_100", txn), txn, as);
cs.setArray(1, array);
cs.setArray(2, arraynew);
cs.setArray(3, array1);
cs.registerOutParameter(3, 2003, "JTF_VARCHAR2_TABLE_100");
cs.execute();
ARRAY error = null;
error = (ARRAY)cs.getArray(2);
if ((error != null) && (error.length() > 0))
System.out.println(String.valueOf("Error is ").concat(String.valueOf(error.getArray())));
String[] retError = new String[j];
retError = (String[])error.getArray();
System.out.println(String.valueOf("Error in saving data").concat(String.valueOf(retError[0])));
cs.close();
catch (Exception exception)
throw new OAException("code blast", OAException.ERROR);
Thanks,
Sombit -
Duplicate value in Command extract report
Hi Experts
I am getting a duplicate record when extracting the BOM which is so called Material Extract in my words
when running the report I am getting the duplicate value for the cost estimate. near the form extract_bom_details under select queries
Can anyone help me why I am getting so by seeing the coding please.
TYPES:
BEGIN OF ty_bom,
matnr(12) TYPE c, " Material #
werks(4) TYPE c, " Plant
stprs(10) TYPE c, " Quantity
meins(3) TYPE c, " Unit of Measure
END OF ty_bom,
it_ty_bom TYPE ty_bom OCCURS 0,
*Start of block of changes for JPC20061107
BEGIN OF ty_bom_sapfmt,
matnr TYPE MARC-MATNR, " Material #
werks TYPE MARC-WERKS, " Plant
stprs TYPE MBEW-STPRS, " Quantity
meins TYPE MARA-MEINS, " Unit of Measure
END OF ty_bom_sapfmt.
Report COMMAND_EXTRACT_D *
REPORT command_extract_d .
*CLASS cl_gui_control DEFINITION LOAD.
*CLASS cl_gui_frontend_services DEFINITION LOAD.
Tables
TABLES:
kna1,
knb1,
knvv,
mara,
mast, "JPC20061107
marc,
makt,mbew,
sscrfields.
CONSTANTS: BEGIN OF gc_status,
acc TYPE zcrstat1 VALUE ' ACC',
hol TYPE zcrstat1 VALUE ' HOL',
sto TYPE zcrstat1 VALUE ' STO',
ok TYPE zcrstat1 VALUE ' OK',
hold TYPE zcrstat1 VALUE 'HOLD',
END OF gc_status.
CONSTANTS: BEGIN OF gc_reason,
000 TYPE zreason VALUE '000',
001 TYPE zreason VALUE '001',
002 TYPE zreason VALUE '002',
003 TYPE zreason VALUE '003',
004 TYPE zreason VALUE '004',
005 TYPE zreason VALUE '005',
006 TYPE zreason VALUE '006',
007 TYPE zreason VALUE '007',
008 TYPE zreason VALUE '008',
010 TYPE zreason VALUE '010',
011 TYPE zreason VALUE '011',
021 TYPE zreason VALUE '021',
022 TYPE zreason VALUE '022',
023 TYPE zreason VALUE '023',
024 TYPE zreason VALUE '024',
025 TYPE zreason VALUE '025',
026 TYPE zreason VALUE '026',
999 TYPE zreason VALUE '999',
END OF gc_reason.
TYPES: BEGIN OF ty_kna1_fields,
kunnr TYPE kna1-kunnr,
sperr TYPE kna1-sperr,
aufsd TYPE kna1-aufsd,
lifsd TYPE kna1-lifsd,
faksd TYPE kna1-faksd,
loevm TYPE kna1-loevm,
END OF ty_kna1_fields.
TYPES: BEGIN OF ty_knb1_fields,
kunnr TYPE knb1-kunnr,
bukrs TYPE knb1-bukrs,
sperr TYPE knb1-sperr,
loevm TYPE knb1-loevm,
END OF ty_knb1_fields.
TYPES: BEGIN OF ty_knvv_fields,
kunnr TYPE knvv-kunnr,
vkorg TYPE knvv-vkorg,
vtweg TYPE knvv-vtweg,
spart TYPE knvv-spart,
aufsd TYPE knvv-aufsd,
lifsd TYPE knvv-lifsd,
faksd TYPE knvv-faksd,
END OF ty_knvv_fields.
TYPES: BEGIN OF ty_knkk_fields,
kunnr TYPE knkk-kunnr,
kkber TYPE knkk-kkber,
ctlpc TYPE knkk-ctlpc,
crblb TYPE knkk-crblb,
knkli TYPE knkk-knkli,
klimk TYPE knkk-klimk,
skfor TYPE knkk-skfor,
ssobl TYPE knkk-ssobl,
END OF ty_knkk_fields.
TYPES: BEGIN OF ty_cust_stat_output,
kunnr(10) TYPE c, "Customer #
stat(4) TYPE c, "Customer status
END OF ty_cust_stat_output.
TYPES:
BEGIN OF ty_customers,
kunnr(10) TYPE c, " Customer #
div1(1) TYPE c, " Pipe delimiter
name1(32) TYPE c, " Customer name
div2(1) TYPE c, " Pipe delimiter
altkn(8) TYPE c, " Old Customer #
div3(1) TYPE c, " Pipe delimiter
stras(30) TYPE c, " Street
div4(1) TYPE c, " Pipe delimiter
ort01(20) TYPE c, " City
div5(1) TYPE c, " Pipe delimiter
regio(3) TYPE c, " State
div6(1) TYPE c, " Pipe delimiter
pstlz(4) TYPE c, " Postcode
div7(1) TYPE c, " Pipe delimiter
telf1(14) TYPE c, " Phone 1
div8(1) TYPE c, " Pipe delimiter
telf2(14) TYPE c, " Phone 2
div9(1) TYPE c, " Pipe delimiter
erdat(10) TYPE c, " date
div10(1) TYPE c, " Pipe delimiter
splant(2) TYPE c, " plant
div11(1) TYPE c, " Pipe delimiter
END OF ty_customers,
it_ty_customers TYPE ty_customers OCCURS 0,
BEGIN OF ty_custstat,
kunnr(11) TYPE c, " Customer #
company(2) TYPE c, " #
status(3) TYPE c, " acc,cod,hol,
END OF ty_custstat,
it_ty_custstat TYPE ty_custstat OCCURS 0.
TYPES:
BEGIN OF ty_materialm,
matnr(12) TYPE c, " Material #
maktx2(40) TYPE c, " Command sales desc.
maktx(16) TYPE c, " Basic description
extwg(6) TYPE c, " External Material Group
flag1(1) TYPE c, "
flag2(1) TYPE c, "
flag3(1) TYPE c, "
flag4(1) TYPE c, "
END OF ty_materialm,
it_ty_materialm TYPE ty_materialm OCCURS 0,
BEGIN OF ty_materialp,
matnr(12) TYPE c, " Material #
werks(4) TYPE c, " plant
batch(1) TYPE c, " download to batch
END OF ty_materialp,
it_ty_materialp TYPE ty_materialp OCCURS 0.
TYPES:
BEGIN OF ty_bom,
matnr(12) TYPE c, " Material #
werks(4) TYPE c, " Plant
stprs(10) TYPE c, " Quantity
meins(3) TYPE c, " Unit of Measure
END OF ty_bom,
it_ty_bom TYPE ty_bom OCCURS 0,
*Start of block of changes for JPC20061107
BEGIN OF ty_bom_sapfmt,
matnr TYPE MARC-MATNR, " Material #
werks TYPE MARC-WERKS, " Plant
stprs TYPE MBEW-STPRS, " Quantity
meins TYPE MARA-MEINS, " Unit of Measure
END OF ty_bom_sapfmt.
Selection screen definition
SELECTION-SCREEN: BEGIN OF BLOCK bom WITH FRAME TITLE text-004.
PARAMETERS:
p_dbom LIKE filepath-pathintern DEFAULT 'Z_COMMAND_BOM_EXTRACT',
p_fbom LIKE rlgrap-filename.
SELECT-OPTIONS:
s_bmatnr FOR MARA-MATNR, "JPC20061107
s_bwerks FOR MAST-WERKS no-extension no intervals, "JPC20061107
s_bextwg FOR mara-extwg.
SELECTION-SCREEN: END OF BLOCK bom.
SELECT-OPTIONS:
s_kunnr FOR kna1-kunnr.
SELECTION-SCREEN: END OF BLOCK ccst.
DATA: clsdir TYPE REF TO cl_gui_frontend_services.
DATA: strfolder TYPE string.
DATA: folderln TYPE i.
DATA: gva_error(1) TYPE c VALUE ' '.
Initial procedure on START ***************
INITIALIZATION.
p_fcust = 'CUST.prn'.
p_fmatm = 'MATM.prn'.
p_fmatp = 'MATP.prn'.
p_fbom = 'BOM.prn'.
p_fccst = 'CCSTAT.prn'.
p_fccst2 = 'CCSTATC.prn'.
p_fccstl = 'CCSTATL.prn'.
s_dextwg-option = 'BT'.
s_dextwg-low = '1'.
s_dextwg-high = '8'.
APPEND s_dextwg.
s_bextwg-option = 'BT'.
s_bextwg-low = '1'.
s_bextwg-high = '1'.
APPEND s_bextwg.
AT SELECTION-SCREEN.
IF p_ccust EQ 'X' AND ( p_fcust IS INITIAL OR p_dcust IS INITIAL ).
MESSAGE s000(zppu)
WITH 'You must specify the file details for the customer data'.
gva_error = 'X'.
ENDIF.
IF p_cmatm EQ 'X' AND ( p_fmatm IS INITIAL OR
p_fmatp IS INITIAL OR
p_dmatm IS INITIAL ).
MESSAGE s001(zppu)
WITH 'You must specify the file details for the material data'.
gva_error = 'X'.
ENDIF.
IF p_cbom EQ 'X' AND ( p_fbom IS INITIAL OR p_dbom IS INITIAL ).
MESSAGE s002(zppu)
WITH 'You must specify the file details for the BOM data'.
gva_error = 'X'.
ENDIF.
IF p_cbom EQ 'X'.
IF s_bwerks-low is initial.
MESSAGE s002(zppu)
WITH 'You must specify a plant to run BOM extract for'.
gva_error = 'X'.
ENDIF.
IF LINES( s_bwerks ) > 1.
MESSAGE s002(zppu)
WITH 'You can only specify 1 plant for BOM extract'.
gva_error = 'X'.
ENDIF.
ENDIF.
IF p_ccst EQ 'X' AND ( p_fccst IS INITIAL OR
p_fccst2 IS INITIAL OR
p_fccstl IS INITIAL OR
p_dccst IS INITIAL ).
MESSAGE s002(zppu)
WITH 'You must specify the file details for the customer'
'status data'.
gva_error = 'X'.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
PERFORM user_command.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fcust.
PERFORM get_gui_filename USING p_dcust p_fcust.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fmatm.
PERFORM get_gui_filename USING p_dmatm p_fmatm.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fmatp.
PERFORM get_gui_filename USING p_dmatm p_fmatp.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fbom.
PERFORM get_gui_filename USING p_dbom p_fbom.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fccst.
PERFORM get_gui_filename USING p_dccst p_fccst.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fccst2.
PERFORM get_gui_filename USING p_dccst p_fccst2.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fccstl.
PERFORM get_gui_filename USING p_dccst p_fccstl.
END-OF-SELECTION.
Data selection execution.
DATA: lwa_kna1 TYPE kna1,
lwa_knb1 TYPE knb1,
lwa_knvv TYPE knvv.
DATA: lwa_marc TYPE marc,
lwa_mara TYPE marav,
lwa_makt TYPE makt.
DATA: lit_marav TYPE marav OCCURS 0.
DATA: lit_customers TYPE it_ty_customers,
lwa_customers TYPE ty_customers.
DATA: lit_custstat TYPE it_ty_custstat,
lwa_custstat TYPE ty_custstat.
DATA: lit_materialm TYPE it_ty_materialm,
lwa_materialm TYPE ty_materialm.
DATA: lit_materialp TYPE it_ty_materialp,
lwa_materialp TYPE ty_materialp.
*(del)DATA: lwa_bomlist TYPE ty_bomlist, "JPC20061107
*(del) lit_bomlist TYPE it_ty_bomlist. "JPC20061107
DATA: lwa_bom TYPE ty_bom_sapfmt,
lit_bom TYPE it_ty_bom WITH HEADER LINE. "JPC20061107
lit_bom TYPE it_ty_bom. "JPC20061107
DATA: output_file TYPE string.
DATA: lock_file TYPE string.
DATA: lva_mssage TYPE string.
DATA: lva_matnr(18) TYPE n.
DATA: lva_date TYPE datum.
DATA: txtper(3) TYPE c.
DATA: custper TYPE i.
DATA: custcount TYPE i.
DATA: itemnum TYPE i.
CHECK gva_error <> 'X'.
IF p_ccust EQ 'X'. " Do the customer file extract
PERFORM extract_customer_details.
ENDIF.
IF p_cmatm EQ 'X'. " Do the Material file extract
PERFORM extract_material_details.
ENDIF.
IF p_cbom EQ 'X'. " Do the BOM file extract
PERFORM extract_bom_details.
ENDIF.
IF p_ccst EQ 'X'. " Do the customer credit status file extract
PERFORM extract_credit_status_details.
ENDIF.
*& Form extract_customer_details
text
--> p1 text
<-- p2 text
FORM extract_customer_details.
SELECT * FROM knb1
INTO lwa_knb1
WHERE bukrs = p_dcomp.
MOVE-CORRESPONDING lwa_knb1 TO lwa_customers.
MOVE-CORRESPONDING lwa_knb1 TO lwa_custstat.
MOVE '#' TO lwa_custstat-company.
MOVE p_dwerk TO lwa_customers-splant.
--WG1K903075: Start Delete-
move: '|' to lwa_customers-div1,
'|' to lwa_customers-div2,
'|' to lwa_customers-div3,
'|' to lwa_customers-div4,
'|' to lwa_customers-div5,
'|' to lwa_customers-div6,
'|' to lwa_customers-div7,
'|' to lwa_customers-div8,
'|' to lwa_customers-div9,
'|' to lwa_customers-div10,
'|' to lwa_customers-div11.
--WG1K903075: End Delete---
--WG1K903075: Start Insert-
MOVE: ' ' TO lwa_customers-div1,
' ' TO lwa_customers-div2,
' ' TO lwa_customers-div3,
' ' TO lwa_customers-div4,
' ' TO lwa_customers-div5,
' ' TO lwa_customers-div6,
' ' TO lwa_customers-div7,
' ' TO lwa_customers-div8,
' ' TO lwa_customers-div9,
' ' TO lwa_customers-div10,
' ' TO lwa_customers-div11.
--WG1K903075: End Insert---
APPEND lwa_customers TO lit_customers.
APPEND lwa_custstat TO lit_custstat.
ENDSELECT.
DESCRIBE TABLE lit_customers LINES custcount.
LOOP AT lit_customers INTO lwa_customers.
txtper = 100 * sy-tabix / custcount.
custper = txtper.
SELECT SINGLE * FROM kna1
INTO lwa_kna1
WHERE kunnr = lwa_customers-kunnr.
MOVE-CORRESPONDING lwa_kna1 TO lwa_customers.
lva_date = lwa_customers-erdat.
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = lva_date
IMPORTING
date_external = lwa_customers-erdat
EXCEPTIONS
date_internal_is_invalid = 1
OTHERS = 2.
REPLACE ALL OCCURRENCES OF '.'
IN lwa_customers-erdat WITH '/'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = lwa_customers-kunnr
IMPORTING
output = lwa_customers-kunnr.
WRITE: lwa_customers-kunnr RIGHT-JUSTIFIED TO lwa_customers-kunnr.
MODIFY lit_customers FROM lwa_customers.
Percentage indicator display
lva_mssage = 'Extracting customers'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = custper
text = lva_mssage.
ENDLOOP.
IF p_gui IS INITIAL.
PERFORM get_file_path USING p_dcust p_fcust output_file.
OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
LOOP AT lit_customers INTO lwa_customers.
TRANSFER lwa_customers TO output_file.
ENDLOOP.
CLOSE DATASET output_file.
ELSE.
MESSAGE s002(zppu)
WITH 'Dataset' output_file 'cannot be opened on the server'.
ENDIF.
ELSE.
MOVE p_fcust TO output_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = output_file
filetype = 'ASC'
TABLES
data_tab = lit_customers
EXCEPTIONS
OTHERS = 11.
ENDIF.
output_file = custcount.
CONCATENATE
output_file
' Customers extracted'
INTO
lva_mssage.
message lva_mssage type 'I'.
ENDFORM. " extract_customer_details
*& Form extract_bom_details
text
--> p1 text
<-- p2 text
FORM extract_bom_details.
select MARAMATNR MBEWBWKEY MBEWSTPRS MARAMEINS "JPC20061220
into lwa_bom
from ( MARAV AS MARA
inner join MARC
ON MARAMATNR = MARCMATNR
INNER join MBEW
ON MARCMATNR = MBEWMATNR
AND MARCWERKS = MBEWBWKEY
where MARA~MATNR in s_bmatnr
and MBEW~BWKEY in s_bwerks
and MARA~EXTWG in s_bextwg.
clear lit_bom.
WRITE lwa_bom-matnr TO lit_bom-matnr.
MOVE lwa_bom-werks TO lit_bom-werks.
MOVE: lwa_bom-stprs TO lit_bom-stprs,
lwa_bom-meins TO lit_bom-meins.
APPEND lit_bom.
ENDSELECT.
SORT lit_bom ascending.
Ending for lines inserted for change 20061107
IF p_gui IS INITIAL. "write to server
PERFORM get_file_path USING p_dbom p_fbom output_file.
OPEN DATASET output_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc EQ 0.
custcount = lines( lit_bom ).
LOOP AT lit_bom.
txtper = 100 * sy-tabix / custcount.
custper = txtper.
lva_mssage = 'Extracting material B.O.Ms'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING percentage = custper
text = lva_mssage.
TRANSFER lit_bom TO output_file.
ENDLOOP.
CLOSE DATASET output_file.
ELSE.
MESSAGE s002(zppu)
WITH 'Dataset' output_file 'cannot be opened on the server'.
ENDIF.
ELSE.
MOVE p_fbom TO output_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = output_file
filetype = 'ASC'
write_field_separator = ' '
TABLES
data_tab = lit_bom
EXCEPTIONS
OTHERS = 11.
ENDIF.
ENDFORM. " extract_bom_details
output with duplicate values
MARA BWKEY STPRS MEINS
10004989 BN01 28.00 TO
10004989 BN01 28.00 TO
10005010 BN01 19.00 EA
10005010 BN01 19.00 EA
10005018 BN01 800.00 BAG
10005018 BN01 800.00 BAG
10005115 BN01 82.74 TO
10005115 BN01 82.74 TO
10005117 BN01 137.30 TO
10005117 BN01 137.30 TO
Regards
PirozHi,
Use this statement then duplicate entries removed.
DELETE ADJACENT DUPLICATES FROM table-field.
regards,
Lakshminarayana -
XSLT HTML output escaping problem
I am having problems with JAXP XSLT output escaping in HTML. I have an XML document which correctly escapes &, <, > etc (eg: &). However, when I transform the document the XSLT processor is escaping these values again. This means that the HTML output contains & where the XML document contains & (for example). Surely correctly escaped characters in the XML should be left alone? Or should the XML document not contain escaped characters? In my understanding special characters in text nodes of XML documents should be escaped. Obviously a work around is to disable output escaping on these nodes but that is a real pain to have to do each time you pull a value through from the XML document. I'm confused as to what format the XSLT processor expects the XML to be in in relation to escaping of elements. Any information gratefully accepted!
Thanks.Sorry! I was getting confused - the special characters were being escaped twice before they reached the XSLT processor. It looks like the processor will leave alone escape sequences that are already in the XML when it transforms to HTML.
-
I can't seem to display HTML from XML.
In my XML file I store the HTML snippet in an XML tag:
<PRE>
<body.htmlcontent>
<<table width="540" border="0" cellpadding="0" cellspacing="0">
<tr><td>
<font face="Helvetica, Arial" size="2">
<!-- STILL IMAGE GOES HERE -->
<img src="graphics/imagegoeshere.jpg" width="200" height="175" align="right" vspace="0" hspace="7">
<!-- END STILL IMAGE TAG -->
<!-- CITY OR TOWN NAME GOES FIRST FOLLOWED BY TWO LETTER STATE ABBREVIATION -->
<b>City, state abbreviation</b> -
<!-- CITY OR TOWN NAME ENDS HERE -->
<!-- STORY TEXT STARTS HERE -->
Story text goes here..
<!-- STORY TEXT ENDS HERE -->
</font>
</td></tr></table>
</body.htmlcontent>
</PRE>
I use the following in my xsl:
<xsl:value-of select="body.HTMLcontent" disable-output-escaping="yes"/>
However, the HTML output <PRE><</PRE>is still outputted and all of the HTML tags
are displayed in the browser. How do I display the HTML properly?
Bob Hewett
[email protected]This makes sense. Here's why.
oraxsl internally uses the:
void XSLProcessor.processXSL(style,source,printwriter);
XSLSample.java uses:
DocumentFragment XSLProcessor.processXSL(style,source);
The former supports <xsl:output> and all
options related to writing out output
that might not be valid XML (including the disable output escaping)
The latter is pure XML-to-XML tree returned,
so no <xsl:output> or disabled escaping
can be used since nothing's being output,
just a DOM tree fragment of the result is
being returned.
null -
Read two CSV files and remove the duplicate values within them.
Hi,
I want to read two CSV files(which contains more than 100 rows and 100 columns) and remove the duplicate values within that two files and merge all the unique values and display it as a single file.
Can anyone help me out.
Thanks in advance.kirthi wrote:
Can you help me....Yeah, I've just finished... Here's a skeleton of my solution.
The first thing I think you should do is write a line-parser which splits your input data up into fields, and test it.
Then fill out the below parse method, and test it with that debugPrint method.
Then go to work on the print method.
I can help a bit along the way, but if you want to do this then you have to do it yourself. I'm not going to do it for you.
Cheers. Keith.
package forums.kirthi;
import java.util.*;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import krc.utilz.io.ParseException;
import krc.utilz.io.Filez.LineParser;
import krc.utilz.io.Filez.CsvLineParser;
public class DistinctColumnValuesFromCsvFiles
public static void main(String[] args) {
if (args.length==0) args = new String[] {"input1.csv", "input2.csv"};
try {
// data is a Map of ColumnNames to Sets-Of-Values
Map<String,Set<String>> data = new HashMap<String,Set<String>>();
// add the contents of each file to the data
for ( String filename : args ) {
data.putAll(parse(filename));
// print the data to output.csv
print(data);
} catch (Exception e) {
e.printStackTrace();
private static Map<String,Set<String>> parse(String filename) throws IOException, ParseException {
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(filename));
CsvLineParser.squeeze = true; // field.trim().replaceAll("\\s+"," ")
LineParser<String[]> parser = new CsvLineParser();
int lineNumber = 1;
// 1. read the column names (first line of file) into a List
// 2. read the column values (subsequent lines of file) into a List of Set's of String's
// 3. build a Map of columnName --> columnValues and return it
} finally {
if(reader!=null)reader.close();
private static void debugPrint(Map<String,Set<String>> data) {
for ( Map.Entry<String,Set<String>> entry : data.entrySet() ) {
System.out.println("DEBUG: "+entry.getKey()+" "+Arrays.toString(entry.getValue().toArray(new String[0])));
private static void print(Map<String,Set<String>> data) {
// 1. get the column names from the table.
// 2. create a List of List's of String's called matrix; logically [COL][ROW]
// 3. print the column names and add the List<String> for this col to the matrix
// 4. print the matrix by inerating columns and then rows
} -
$$PlaceHolder$$ in RH7 HTML output
Help!. We have recently upgraded from RH6 to RH7 (as part of
Adobe Tech Comm Suite). Opening a RH6 project with RH7 all seems OK
(topics, template, TOC, etc.) until I try closing and/or saving a
topic. At this point -even if I've made no changes to the topic nor
to the template- I am noticed that changes have been made to the
header and footer and I am prompted to "apply the modification" to
either "all the topics created from the template" or "only to the
current topic". No matter what option I choose, every time I work
with the same topic/s I have to repeat the whole process. Then,
when I generate the HTML output, the text "$$PlaceHolder$$" appears
instead of the header and footer. All the other features (Topic
contents, TOC, Glossary, Browse sequences) are displayed properly.
Note that header and footer look OK in Preview mode!
About configurations: I have unistalled RH 6 before
installing RH7; RH7 is version 7.01.001; my OS is Windows XP Pro
(2002 with SP2).
I don't know what to do other than going back to RH6. Please
help!We have the same issue... the auto-update Date field in the
footer causes the template warning message in RH 7. We have never
had this problem before (all the way back to RoboHelp 9 and X5).
Colum, you wrote:
quote:
A template is just standard text that can be applied to a
topic.
Well, that's partly true. A template is used to enforce
headers, footers, and styles. Standard text, not included in a
header and footer is only good once--if the template's body
changes, that doesn't get pushed to topics (unless the standard
text is included in a snippet); header and footer changes are
pushed. So, I guess my point is that the templates are used to
enforce a "corporate look". If you alter that look or delete
standard text/variables, then you should be prompted with the
warning. I'd imagine that for many authors, these warnings come as
a surprise in RH 7. The content of the template really hasn't
changed, just the value of a variable. -
Stop desktop's title from getting rendered in the final HTML output
Is there a way to stop the desktop's title value from being rendered and displayed in the HTML source of the page? I don't want to use a backing file to achieve this -- looking for a simple easy configuration to remove all the desktop property definitions from getting rendered to the final HTML output.
Specifically trying to remove the title:
<title >Microsite Desktop</title>
<meta name="bea-portal-meta-skeleton" content="/framework/skeletons/testmicrositeskel"/>
<meta name="bea-portal-meta-skin" content="/framework/skins/testcardsskin"/>
<meta name="bea-portal-meta-skin-images" content="/framework/skins/testcardsskin/images"/>
Edited by sjayas01 at 12/18/2007 8:38 AMTry this function.
data: label type string.
CALL FUNCTION 'DDIF_FIELDLABEL_GET'
EXPORTING
tabname = 'MARA'
FIELDNAME = 'MATNR'
* LANGU = SY-LANGU
* LFIELDNAME = ' '
IMPORTING
LABEL = label.
Regards,
Rich Heilman -
How find out the duplicate value from each columns.
I have below four columns,
How can i find out the duplicate value from each columns.
with All_files as (
select '1000' as INVOICE,'2000' AS DELIVERYNOTE,'3000' CANDELINVOICE,'4000' CANDELIVERYNOTE from dual union all
select '5000','6000','7000','8000' from dual union all
select '9000','1000','1100','1200' from dual union all
select '1200','3400','6700','8790' from dual union all
select '1000','2000','3000','9000' from dual union all
select '1230','2340','3450','4560' from dual
SELECT * FROM All_files
Output should be as per below.
1000 2000 3000 4000
9000 1000 1100 1200
1200 3400 6700 8790
1000 2000 3000 9000
Required to check uniqueness in cross columns.
Thanks.Try this (sorry about the formatting)...
WITH all_files AS (SELECT '1000' AS INVOICE,
'2000' AS DELIVERYNOTE,
'3000' CANDELINVOICE,
'4000' CANDELIVERYNOTE
FROM DUAL
UNION ALL
SELECT '5000',
'6000',
'7000',
'8000'
FROM DUAL
UNION ALL
SELECT '9000',
'1000',
'1100',
'1200'
FROM DUAL
UNION ALL
SELECT '1200',
'3400',
'6700',
'8790'
FROM DUAL
UNION ALL
SELECT '1000',
'2000',
'3000',
'9000'
FROM DUAL
UNION ALL
SELECT '1230',
'2340',
'3450',
'4560'
FROM DUAL),
t_base
AS (SELECT invoice
|| ','
|| deliverynote
|| ','
|| candelinvoice
|| ','
|| candeliverynote
str
FROM all_files),
t_str
AS (SELECT str || ',' AS str,
(LENGTH (str) - LENGTH (REPLACE (str, ','))) + 1
AS no_of_elements
FROM t_base),
t_n_rows
AS ( SELECT LEVEL AS i
FROM DUAL
CONNECT BY LEVEL <=
( SELECT SUM (no_of_elements) FROM t_str)),
t_build AS (SELECT t_str.str,
nt.i AS element_no,
INSTR (t_str.str,
DECODE (nt.i, 1, 0, 1),
DECODE (nt.i, 1, 1, nt.i - 1))
+ 1
AS start_pos,
INSTR (t_str.str,
1,
DECODE (nt.i, 1, 1, nt.i))
AS next_pos
FROM t_str
JOIN
t_n_rows nt
ON nt.i <= t_str.no_of_elements),
t_build2
AS (SELECT RTRIM (str, ',') AS original_string,
SUBSTR (str, start_pos, (next_pos - start_pos))
AS single_element,
element_no
FROM t_build),
t_build3
AS (SELECT single_element,
COUNT( * )
OVER (PARTITION BY single_element
ORDER BY single_element)
ele_count
FROM t_build2)
SELECT DISTINCT INVOICE,
DELIVERYNOTE,
CANDELINVOICE,
CANDELIVERYNOTE
FROM all_files, t_build3
WHERE ele_count > 1
AND ( INVOICE = single_element
OR DELIVERYNOTE = single_element
OR CANDELINVOICE = single_element
OR CANDELIVERYNOTE = single_element)I think this will be faster than the previous solution?
Cheers
Ben
Edited by: Munky on Feb 17, 2011 2:11 PM - "I think this will be faster than the previous solution?", nope - it's not :(
Maybe you are looking for
-
How do I query a SharePoint List using a url and filtering on date?
I am reading a SharePoint list using jquery. Everything is working fine except for the filter. Each list item has an expiration date. I want to retrieve JUST the items that have not expired (Expires > Today) but I can't figure out the url syntax a
-
Can't install Bootcamp...
This is the second mac I've tried to install windows on. First one I tried for a total of about 40 hours and went to the apple store twice. They couldn't do it, so I finally just gave up. I concluded that even though it was a 2006 if wasn't late enou
-
Hi For customer down payment F-37 do we have any Bapi or other way to post it ? or we will do BDC for the same ? please suggest. also if I need to revrese it then what FM can I use ? Thanks
-
How to upgrade FreeBSD amd64 Firefox 3.0.5 to current version
Folks: Stopped working with FreeBSD Firefox approx 5 years ago. Recently needed to use the machine that this version of Firefox is currently resident on. Checked the Preferences->Advanced->Update and the updates that are supposedly automatic when "Ab
-
I am unable to display any type of symbol (like alpha, beta, etc.), when either selected from the font list or copy/pasting from my computer's character map. Any suggestions or is this indeed a Designer problem?