Help to edit the output of a method please
Hi
I have a piece of code which i need to change. Currently the method connects to a socket c, and reads in a string from a method called get(String), which returns a string, i however need to change this so that the method get(String) returns a list. I am not sure however how to go about changing this code so as to do this
public void run() {
try {
BufferedReader i = new BufferedReader(new InputStreamReader(c.getInputStream()));
DataOutputStream o = new DataOutputStream(c.getOutputStream());
try {
while (true) {
String s = i.readLine();
if (s.startsWith("GET")) {
StringTokenizer t = new StringTokenizer(s, " ");
t.nextToken(); // discard GET
String p = t.nextToken();
String response = get(p);
o.writeBytes("HTTP/1.0 200 OK\nContent-Type: text/plain\nContent-Length: "
+ (response.length() + 1)
+ "\n\n"
+ response + "\n");
break;
} catch (Exception x) {
System.err.println("Error: " + x);
x.printStackTrace();
o.writeBytes(SAYWHAT + "Error: " + x);
o.close();
} catch (Exception x) {
System.err.println("Error: " + x);
x.printStackTrace();
}Currently this method seperates the words in the string output by the get(String) method as far as i can see and writes this output to a HTTP address. I dont know how i could go about changing this so that instead of outputting a string, get(string) will output a list, which in turn will be output by this run() method to a HTTP address. I would welcome any help with this problem, as i dont know where to start.
Thanks
Thanks for the references, ive been looking through these for a while now but i cannot figure out how to do what i have to do. I have not been able to find a way to read in from an array, i found a ByteArrayInputStream but am not sure how this works. Does anybody know of a way to read in from an array using a BufferedReader or some similar construct?
Similar Messages
-
Can anyone help me find the output option in Bridge CC?
Can anyone help me find the output option in Bridge CC?
http://helpx.adobe.com/bridge/kb/install-output-module-bridge-cc.html
-
Help to catch the output of a Transaction
Hi,
I have this issue and need help, I have a program lets say "ZPROGRAM", this programs calls a RFC "ZFUNC" this function must be able to send the parameters to execute a SAP standard transaction for example MB51, the function must send the plant number, storage location, and material number, then this RFC must catch the output of the report into an internal table so that i can work with the output in "ZPROGRAM", in other words what I see on screen as result of MB51 I need it in an internal table so that I can manupulate the data.
I hope someone could tell me how to accomplish this.
Thanks in advice.Hi,
Pls try
DATA list_tab TYPE TABLE OF abaplist.
DATA vlist LIKE table of LISTZEILE WITH HEADER LINE.
submit RM07DOCS
with XXX
EXPORTING LIST TO MEMORY
and return .
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
list_index = -1
TABLES
listasci = vlist
listobject =list_tab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
Regards,
Pole
Edited by: Pole li on Jul 17, 2008 3:57 AM -
How to call a Java method n map the output of that method to a table in ODI
Hi,
I'm new to ODI. I've written an interface which joins two tables( in source ) to a file (in target). Now i have to apply a method(java call) on each element of a column in the target. Now my questions are :
1. All that i know is to use Procedure using either Jython or Java BeanShell. Can you give some sample commands to achieve such functionality?
2. Where should i actually apply this procedure? Is it possible to apply this procedure within the Interface during mapping (so that i can directly map the result to the output file)?
Thanks in advance :)VikasKiran wrote:
1. All that i know is to use Procedure using either Jython or Java BeanShell. Can you give some sample commands to achieve such functionality?Hi Vikash,
Suppose the java code is like below
import java.io.*;
public class FileWrite
public void writeFile()
FileOutputStream fos;
DataOutputStream dos;
try {
File file= new File("C:\\MyFile.txt");
fos = new FileOutputStream(file);
dos=new DataOutputStream(fos);
dos.writeInt(2333);
dos.writeChars("Hello World");
} catch (IOException e) {
e.printStackTrace();
Next we compile the .java class from the command line and create the jar file.
Then copy and paste the .jar archive to the ODI drivers folder. Next we restart the ODI agent.
Now call methods in this class from either Jython
import FileWrite
fw=FileWrite()
fw.writeFile()
or from the Java BeanShell
import FileWrite;
FileWrite fw = new FileWrite();
fw.writeFile();
2. Where should i actually apply this procedure? Is it possible to apply this procedure within the Interface during mapping (so that i can directly map the result to the output file)?If your method is inside your jar file returning one value then store into one variable.Then use this variable in your interface or procedure wherever you want.
As GURU told we cannot use procedure inside interface mapping.
Thanks -
Help in interpreting the output of explain plan
Hi,
I have written a query in two different ways and then run an explain plan on both of them. Both these queries give same result. I want to know which one will be more efficient. I am giving the output of explain plan for both the queries:
The second plan has a lower cost but has much higher consistent gets !!
Please advise.
Plan 1:
Execution Plan
0 SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=8637 Card= 1 Bytes=10132)
1 0 SORT (ORDER BY) (Cost=8637 Card=1 Bytes=10132)
2 1 WINDOW (SORT) (Cost=8637 Card=1 Bytes=10132)
3 2 COUNT (STOPKEY)
4 3 VIEW (Cost=8635 Card=1 Bytes=10132)
5 4 SORT (ORDER BY) (Cost=8635 Card=1 Bytes=862)
6 5 WINDOW (SORT) (Cost=8635 Card=1 Bytes=862)
7 6 MAT_VIEW ACCESS (FULL) OF 'PRD_SEARCH_MVW' (MAT_VIEW) (Cost=8633 Card=1 Bytes=862)
Statistics
577 recursive calls
0 db block gets
39202 consistent gets
34798 physical reads
0 redo size
72348 bytes sent via SQL*Net to client
4295 bytes received via SQL*Net from client
9 SQL*Net roundtrips to/from client
10 sorts (memory)
0 sorts (disk)
100 rows processed
Plan-2
Execution Plan
0 SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=982 Card=1 Bytes=10145)
1 0 SORT (ORDER BY) (Cost=982 Card=1 Bytes=10145)
2 1 WINDOW (SORT) (Cost=982 Card=1 Bytes=10145)
3 2 COUNT (STOPKEY)
4 3 VIEW (Cost=980 Card=1 Bytes=10145)
5 4 SORT (ORDER BY) (Cost=980 Card=1 Bytes=10132)
6 5 WINDOW (SORT) (Cost=980 Card=1 Bytes=10132)
7 6 WINDOW (SORT) (Cost=980 Card=1 Bytes=10132)
8 7 VIEW (Cost=977 Card=1 Bytes=10132)
9 8 WINDOW (SORT PUSHED RANK) (Cost=977 Card=1 Bytes=889)
10 9 NESTED LOOPS (Cost=976 Card=1 Bytes=889)
11 10 HASH JOIN (Cost=305 Card=670 Bytes=18090)
12 11 HASH JOIN (Cost=23 Card=140 Bytes=2240)
13 12 INDEX (FAST FULL SCAN) OF 'GLCAT_GRP_TO_CAT_PK' (INDEX (UNIQUE)) (Cost=2 Card=52 Bytes=364)
14 12 MAT_VIEW ACCESS (FULL) OF 'GLCAT_CAT_TO_MCAT' (MAT_VIEW) (Cost=20 Card=1039 Bytes=9351)
15 11 INDEX (FAST FULL SCAN) OF 'PCITEM2GLCATMCAT_FK_IDS' (INDEX) (Cost=281 Card=16903 Bytes=185933)
16 10 MAT_VIEW ACCESS (BY INDEX ROWID) OF 'PRD_SEARCH_MVW' (MAT_VIEW) (Cost=1 Card=1 Bytes=862)
17 16 INDEX (UNIQUE SCAN) OF 'PK_PRD_SEARCH_ID' (INDEX (UNIQUE)) (Cost=0 Card=1)
Statistics
481 recursive calls
2 db block gets
195742 consistent gets
7516 physical reads
0 redo size
71567 bytes sent via SQL*Net to client
6629 bytes received via SQL*Net from client
9 SQL*Net roundtrips to/from client
15 sorts (memory)
1 sorts (disk)
100 rows processedRegards
Madhup
Message was edited by:
MadhupThanks a lot for you input. I am posting both the queries below. My requirements are following:
1) I have a products table
2) I have Created grouping hierarchy - Groups, Categories and then Micro-categories - and have setup a separate table for each of them in my database
3) Then I have mapping tables, i.e. a table that stores group to category mapping, another table that stores category to micro-category mapping.
4) Products are mapped directly to micro-categories and one product could be mapped to multiple micro-categories.
5) I have created a materialized view on product and store the mappings as comma separated list of IDs - I have three fields there, on to store comma separated group id, second to store comma separated category ids and third to store the comma separated micro category ids to which the product is mapped.
Now I want to write a query that will return a specified number of matches from this table based on user defined criterion. There are few other filter cirterion apart from Group/Category and Microcategory. These are Company Name, Country, Type of company etc.
This query when run on production will be accessed very frequently - I expect the access to be in the tune of around 5-10 times per second.
There are 50 records in the group table
There are 500 categories
There are 20000 micro-categories
Group to category mapping table has around 1000 records
Category to microcategory table has around 25000 records
The product table has around 100,000 products.
Product to microcategory mapping table has 350000 records
The product mview has the same number of records as that in products table.
The first query uses the single materialized view to access data, however, it always does a full table scan and does not use any index.
When I noticed this in the explain plan, then I tried to write the second query which is using JOINs to arrive at the same output.
The explain plan now says that it is using Index scans.
I did a sample run of both the queries on my production system and I had to withdraw both of them as both brought my system to grinding halt within few minutes of going live.
My system at present receives around 3000 requests per hour during peak load and around 600 requests per hour during off-peak hours.
And I was testing these queries in Off-peak hours !!
Here are the two sql queries just for reference - there are several variables plugged in where clause which are the key drivers of the query:
SQL-1
SELECT DECODE(:OPT,2,A.SC,(MAX(A.SC) OVER (PARTITION BY A.PRD_SEARCH_COMPANY))) AS SO,
A.SC, A.PRD_SEARCH_ID,
A.PRD_SEARCH_COMPANY_ID, A.PRD_SEARCH_COMPANY, A.PRD_SEARCH_COMPANYID_ENCRYPTED,
A.PRD_SEARCH_PCID, A.PRD_SEARCH_URL, A.PRD_SEARCH_PC_CLNT_HOME,
A.PRD_SEARCH_CLNT_ENABLED, A.PRD_SEARCH_CODE, A.PRD_SEARCH_NAME,
A.PRD_SEARCH_DESC_SMALL, A.PRD_SEARCH_DESC_DETAILED, A.PRD_SEARCH_DESC_HTML,
A.PRD_SEARCH_IMG_SMALL, A.PRD_SEARCH_IMG_LARGE, A.PRD_SEARCH_WEIGHT_ITEM,
A.PRD_SEARCH_MODIFIEDDATE, A.PRD_SEARCH_SIZE, A.PRD_SEARCH_LABEL1,
A.PRD_SEARCH_LABEL1_VALUE, A.PRD_SEARCH_LABEL2, A.PRD_SEARCH_LABEL2_VALUE,
A.PRD_SEARCH_LABEL3, A.PRD_SEARCH_LABEL3_VALUE, A.PRD_SEARCH_LABEL4,
A.PRD_SEARCH_LABEL4_VALUE, A.PRD_SEARCH_LABEL5, A.PRD_SEARCH_LABEL5_VALUE,
A.PRD_SEARCH_LABEL6, A.PRD_SEARCH_LABEL6_VALUE, A.PRD_SEARCH_CAT_ID,
A.PRD_SEARCH_CAT_NAME, A.PRD_SEARCH_CAT_FLNAME, A.PRD_SEARCH_NAVIGATION_TREE,
A.PRD_SEARCH_NAVIGATION_TREE_ID,A.PRD_SEARCH_CITY, A.PRD_SEARCH_STATE,
A.PRD_SEARCH_COUNTRY, A.PRD_SEARCH_PRICE_SALE, A.PRD_SEARCH_PC_CLNT_TYPE,
A.PRD_SEARCH_PC_CLNT_TYPE_DESC,
A.PRD_SEARCH_COMPANY_PHONE, A.PRD_SEARCH_COMPANY_MOBILE, A.PRD_SEARCH_COMPANY_FAX,
A.PRD_SEARCH_COMPANY_EMAIL, A.PRD_SEARCH_GLCAT_MCAT_ID_LIST, A.PRD_SEARCH_GLCAT_CAT_ID_LIST,
A.PRD_SEARCH_GLCAT_GRP_ID_LIST, A.PRD_SEARCH_GL_COUNTRY_ISO, A.PRD_SEARCH_GLUSR_USR_ID,
A.PRD_SEARCH_TRUSTSEAL_CODE, A.PRD_SEARCH_CUSTTYPE_ID, A.PRD_SEARCH_CUSTTYPE_NAME,
A.PRD_SEARCH_CUSTTYPE_WEIGHT, A.PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, A.PRD_SEARCH_CUSTTYPE_RANK,
A.PRD_SEARCH_PC_ITEM_HOTNEW, A.RK
FROM
(SELECT /*+ FIRST_ROWS (500) */ DECODE(:S_MODE,2,1,3,to_number(to_char(PRD_SEARCH_MODIFIEDDATE,'yyyymmdd')),1) AS SC,
PRD_SEARCH_ID,
PRD_SEARCH_COMPANY_ID, PRD_SEARCH_COMPANY, PRD_SEARCH_COMPANYID_ENCRYPTED,
PRD_SEARCH_PCID, PRD_SEARCH_URL, PRD_SEARCH_PC_CLNT_HOME,
PRD_SEARCH_CLNT_ENABLED, PRD_SEARCH_CODE, PRD_SEARCH_NAME,
PRD_SEARCH_DESC_SMALL, PRD_SEARCH_DESC_DETAILED, PRD_SEARCH_DESC_HTML,
PRD_SEARCH_IMG_SMALL, PRD_SEARCH_IMG_LARGE, PRD_SEARCH_WEIGHT_ITEM,
PRD_SEARCH_MODIFIEDDATE, PRD_SEARCH_SIZE, PRD_SEARCH_LABEL1,
PRD_SEARCH_LABEL1_VALUE, PRD_SEARCH_LABEL2, PRD_SEARCH_LABEL2_VALUE,
PRD_SEARCH_LABEL3, PRD_SEARCH_LABEL3_VALUE, PRD_SEARCH_LABEL4,
PRD_SEARCH_LABEL4_VALUE, PRD_SEARCH_LABEL5, PRD_SEARCH_LABEL5_VALUE,
PRD_SEARCH_LABEL6, PRD_SEARCH_LABEL6_VALUE, PRD_SEARCH_CAT_ID,
PRD_SEARCH_CAT_NAME, PRD_SEARCH_CAT_FLNAME, PRD_SEARCH_NAVIGATION_TREE,
PRD_SEARCH_NAVIGATION_TREE_ID,PRD_SEARCH_CITY, PRD_SEARCH_STATE,
PRD_SEARCH_COUNTRY, PRD_SEARCH_PRICE_SALE, PRD_SEARCH_PC_CLNT_TYPE,
PRD_SEARCH_PC_CLNT_TYPE_DESC,
PRD_SEARCH_COMPANY_PHONE, PRD_SEARCH_COMPANY_MOBILE, PRD_SEARCH_COMPANY_FAX,
PRD_SEARCH_COMPANY_EMAIL, PRD_SEARCH_GLCAT_MCAT_ID_LIST, PRD_SEARCH_GLCAT_CAT_ID_LIST,
PRD_SEARCH_GLCAT_GRP_ID_LIST, PRD_SEARCH_GL_COUNTRY_ISO, PRD_SEARCH_GLUSR_USR_ID,
PRD_SEARCH_TRUSTSEAL_CODE, PRD_SEARCH_CUSTTYPE_ID, PRD_SEARCH_CUSTTYPE_NAME,
PRD_SEARCH_CUSTTYPE_WEIGHT, PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, PRD_SEARCH_CUSTTYPE_RANK,
PRD_SEARCH_PC_ITEM_HOTNEW,
ROW_NUMBER() OVER (PARTITION BY PRD_SEARCH_COMPANY_ID
ORDER BY DECODE(:S_MODE,2,1,3,to_number(to_char(PRD_SEARCH_MODIFIEDDATE,'yyyymmdd')),1) DESC) AS RK
FROM PRD_SEARCH
WHERE DECODE(:GRP_ID_STR,NULL,1,REGEXP_INSTR(','||REPLACE(PRD_SEARCH_GLCAT_GRP_ID_LIST,' ','')||',',:MYGRP_ID_STR)) > 0
AND DECODE(:CAT_ID_STR,NULL,1,REGEXP_INSTR(','||REPLACE(PRD_SEARCH_GLCAT_CAT_ID_LIST,' ','')||',',:MYCAT_ID_STR)) > 0
AND DECODE(:MCAT_ID_STR,NULL,1,REGEXP_INSTR(','||REPLACE(PRD_SEARCH_GLCAT_MCAT_ID_LIST,' ','')||',',:MYMCAT_ID_STR)) > 0
AND DECODE(:ITEM_ID_STR,NULL,1,REGEXP_INSTR(','||PRD_SEARCH_ID||',',:MYITEM_ID_STR)) > 0
AND DECODE(:COUNTRY_ISO,NULL,1,REGEXP_INSTR(','||PRD_SEARCH_GL_COUNTRY_ISO||',',:COUNTRY_ISO)) > 0
AND DECODE(nvl(NULL,0),0,1,PRD_SEARCH_COMPANY_ID) = DECODE(nvl(NULL,0),0,1,NULL)
AND DECODE(nvl(NULL,0),0,1,PRD_SEARCH_GLUSR_USR_ID) = DECODE(nvl(NULL,0),0,1,NULL)
AND PRD_SEARCH_CLNT_ENABLED >= nvl(:LIST_TYPE,0)
AND NVL(Length(PRD_SEARCH_TRUSTSEAL_CODE),0) >= :TSONLY
ORDER BY SC DESC, PRD_SEARCH_CUSTTYPE_WEIGHT ASC, DBMS_RANDOM.RANDOM
) A
WHERE A.RK <= :MY_PRD_PER_COMP
AND ROWNUM <= :MYMAXREC
ORDER BY SO DESC, DECODE(:OPT,2,'1',A.PRD_SEARCH_COMPANY), A.RK ASC, DBMS_RANDOM.RANDOM
SQL-2
SELECT
DECODE(:OPT,2,SC,(MAX(SC) OVER (PARTITION BY PRD_SEARCH_COMPANY))) AS SO,
SC, PRD_SEARCH_ID,
PRD_SEARCH_COMPANY_ID, PRD_SEARCH_COMPANY, PRD_SEARCH_COMPANYID_ENCRYPTED,
PRD_SEARCH_PCID, PRD_SEARCH_URL, PRD_SEARCH_PC_CLNT_HOME,
PRD_SEARCH_CLNT_ENABLED, PRD_SEARCH_CODE, PRD_SEARCH_NAME,
PRD_SEARCH_DESC_SMALL, PRD_SEARCH_DESC_DETAILED, PRD_SEARCH_DESC_HTML,
PRD_SEARCH_IMG_SMALL, PRD_SEARCH_IMG_LARGE, PRD_SEARCH_WEIGHT_ITEM,
PRD_SEARCH_MODIFIEDDATE, PRD_SEARCH_SIZE, PRD_SEARCH_LABEL1,
PRD_SEARCH_LABEL1_VALUE, PRD_SEARCH_LABEL2, PRD_SEARCH_LABEL2_VALUE,
PRD_SEARCH_LABEL3, PRD_SEARCH_LABEL3_VALUE, PRD_SEARCH_LABEL4,
PRD_SEARCH_LABEL4_VALUE, PRD_SEARCH_LABEL5, PRD_SEARCH_LABEL5_VALUE,
PRD_SEARCH_LABEL6, PRD_SEARCH_LABEL6_VALUE, PRD_SEARCH_CAT_ID,
PRD_SEARCH_CAT_NAME, PRD_SEARCH_CAT_FLNAME, PRD_SEARCH_NAVIGATION_TREE,
PRD_SEARCH_NAVIGATION_TREE_ID,PRD_SEARCH_CITY, PRD_SEARCH_STATE,
PRD_SEARCH_COUNTRY, PRD_SEARCH_PRICE_SALE, PRD_SEARCH_PC_CLNT_TYPE,
PRD_SEARCH_PC_CLNT_TYPE_DESC,
PRD_SEARCH_COMPANY_PHONE, PRD_SEARCH_COMPANY_MOBILE, PRD_SEARCH_COMPANY_FAX,
PRD_SEARCH_COMPANY_EMAIL, PRD_SEARCH_GLCAT_MCAT_ID_LIST, PRD_SEARCH_GLCAT_CAT_ID_LIST,
PRD_SEARCH_GLCAT_GRP_ID_LIST, PRD_SEARCH_GL_COUNTRY_ISO, PRD_SEARCH_GLUSR_USR_ID,
PRD_SEARCH_TRUSTSEAL_CODE, PRD_SEARCH_CUSTTYPE_ID, PRD_SEARCH_CUSTTYPE_NAME,
PRD_SEARCH_CUSTTYPE_WEIGHT, PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, PRD_SEARCH_CUSTTYPE_RANK,
PRD_SEARCH_PC_ITEM_HOTNEW, RK
FROM
SELECT
/*+ FIRST_ROWS (500) */ DECODE(:OPT,2,SC,(MAX(SC) OVER (PARTITION BY PRD_SEARCH_COMPANY))) AS SO,
SC,PRD_SEARCH_ID,
PRD_SEARCH_COMPANY_ID, PRD_SEARCH_COMPANY, PRD_SEARCH_COMPANYID_ENCRYPTED,
PRD_SEARCH_PCID, PRD_SEARCH_URL, PRD_SEARCH_PC_CLNT_HOME,
PRD_SEARCH_CLNT_ENABLED, PRD_SEARCH_CODE, PRD_SEARCH_NAME,
PRD_SEARCH_DESC_SMALL, PRD_SEARCH_DESC_DETAILED, PRD_SEARCH_DESC_HTML,
PRD_SEARCH_IMG_SMALL, PRD_SEARCH_IMG_LARGE, PRD_SEARCH_WEIGHT_ITEM,
PRD_SEARCH_MODIFIEDDATE, PRD_SEARCH_SIZE, PRD_SEARCH_LABEL1,
PRD_SEARCH_LABEL1_VALUE, PRD_SEARCH_LABEL2, PRD_SEARCH_LABEL2_VALUE,
PRD_SEARCH_LABEL3, PRD_SEARCH_LABEL3_VALUE, PRD_SEARCH_LABEL4,
PRD_SEARCH_LABEL4_VALUE, PRD_SEARCH_LABEL5, PRD_SEARCH_LABEL5_VALUE,
PRD_SEARCH_LABEL6, PRD_SEARCH_LABEL6_VALUE, PRD_SEARCH_CAT_ID,
PRD_SEARCH_CAT_NAME, PRD_SEARCH_CAT_FLNAME, PRD_SEARCH_NAVIGATION_TREE,
PRD_SEARCH_NAVIGATION_TREE_ID,PRD_SEARCH_CITY, PRD_SEARCH_STATE,
PRD_SEARCH_COUNTRY, PRD_SEARCH_PRICE_SALE, PRD_SEARCH_PC_CLNT_TYPE,
PRD_SEARCH_PC_CLNT_TYPE_DESC,
PRD_SEARCH_COMPANY_PHONE, PRD_SEARCH_COMPANY_MOBILE, PRD_SEARCH_COMPANY_FAX,
PRD_SEARCH_COMPANY_EMAIL, PRD_SEARCH_GLCAT_MCAT_ID_LIST, PRD_SEARCH_GLCAT_CAT_ID_LIST,
PRD_SEARCH_GLCAT_GRP_ID_LIST, PRD_SEARCH_GL_COUNTRY_ISO, PRD_SEARCH_GLUSR_USR_ID,
PRD_SEARCH_TRUSTSEAL_CODE, PRD_SEARCH_CUSTTYPE_ID, PRD_SEARCH_CUSTTYPE_NAME,
PRD_SEARCH_CUSTTYPE_WEIGHT, PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, PRD_SEARCH_CUSTTYPE_RANK,
PRD_SEARCH_PC_ITEM_HOTNEW,
ROW_NUMBER() OVER (PARTITION BY PRD_SEARCH_COMPANY_ID
ORDER BY DECODE(:S_MODE,2,1,3,TO_NUMBER(TO_CHAR(PRD_SEARCH_MODIFIEDDATE,'YYYYMMDD')),1) DESC) AS RK
FROM
SELECT
DECODE(:S_MODE,2,1,3,TO_NUMBER(TO_CHAR(PRD_SEARCH_MODIFIEDDATE,'YYYYMMDD')),1) AS SC,
PRD_SEARCH_ID,
PRD_SEARCH_COMPANY_ID, PRD_SEARCH_COMPANY, PRD_SEARCH_COMPANYID_ENCRYPTED,
PRD_SEARCH_PCID, PRD_SEARCH_URL, PRD_SEARCH_PC_CLNT_HOME,
PRD_SEARCH_CLNT_ENABLED, PRD_SEARCH_CODE, PRD_SEARCH_NAME,
PRD_SEARCH_DESC_SMALL, PRD_SEARCH_DESC_DETAILED, PRD_SEARCH_DESC_HTML,
PRD_SEARCH_IMG_SMALL, PRD_SEARCH_IMG_LARGE, PRD_SEARCH_WEIGHT_ITEM,
PRD_SEARCH_MODIFIEDDATE, PRD_SEARCH_SIZE, PRD_SEARCH_LABEL1,
PRD_SEARCH_LABEL1_VALUE, PRD_SEARCH_LABEL2, PRD_SEARCH_LABEL2_VALUE,
PRD_SEARCH_LABEL3, PRD_SEARCH_LABEL3_VALUE, PRD_SEARCH_LABEL4,
PRD_SEARCH_LABEL4_VALUE, PRD_SEARCH_LABEL5, PRD_SEARCH_LABEL5_VALUE,
PRD_SEARCH_LABEL6, PRD_SEARCH_LABEL6_VALUE, PRD_SEARCH_CAT_ID,
PRD_SEARCH_CAT_NAME, PRD_SEARCH_CAT_FLNAME, PRD_SEARCH_NAVIGATION_TREE,
PRD_SEARCH_NAVIGATION_TREE_ID,PRD_SEARCH_CITY, PRD_SEARCH_STATE,
PRD_SEARCH_COUNTRY, PRD_SEARCH_PRICE_SALE, PRD_SEARCH_PC_CLNT_TYPE,
PRD_SEARCH_PC_CLNT_TYPE_DESC,
PRD_SEARCH_COMPANY_PHONE, PRD_SEARCH_COMPANY_MOBILE, PRD_SEARCH_COMPANY_FAX,
PRD_SEARCH_COMPANY_EMAIL, PRD_SEARCH_GLCAT_MCAT_ID_LIST, PRD_SEARCH_GLCAT_CAT_ID_LIST,
PRD_SEARCH_GLCAT_GRP_ID_LIST, PRD_SEARCH_GL_COUNTRY_ISO, PRD_SEARCH_GLUSR_USR_ID,
PRD_SEARCH_TRUSTSEAL_CODE, PRD_SEARCH_CUSTTYPE_ID, PRD_SEARCH_CUSTTYPE_NAME,
PRD_SEARCH_CUSTTYPE_WEIGHT, PRD_SEARCH_CUSTTYPE_WEIGHT_TZ, PRD_SEARCH_CUSTTYPE_RANK,
PRD_SEARCH_PC_ITEM_HOTNEW,
ROW_NUMBER() OVER (PARTITION BY P.PRD_SEARCH_ID ORDER BY P.PRD_SEARCH_ID) RK1
FROM
GLCAT_GRP_TO_CAT G2C, GLCAT_CAT_TO_MCAT C2M, PC_ITEM_TO_GLCAT_MCAT M, PRD_SEARCH P
WHERE
G2C.FK_GLCAT_CAT_ID = C2M.FK_GLCAT_CAT_ID
AND C2M.FK_GLCAT_MCAT_ID = M.FK_GLCAT_MCAT_ID
AND M.FK_PC_ITEM_ID = P.PRD_SEARCH_ID
AND DECODE(:MCAT_ID_STR, NULL, 1, INSTR(','||:MCAT_ID_STR||',',','||M.FK_GLCAT_MCAT_ID||',',1))> 0
AND DECODE(:CAT_ID_STR, NULL, 1, INSTR(','||:CAT_ID_STR||',',','||C2M.FK_GLCAT_CAT_ID||',',1)) > 0
AND DECODE(:GRP_ID_STR, NULL, 1, INSTR(','||:GRP_ID_STR||',',','||G2C.FK_GLCAT_GRP_ID||',',1)) > 0
AND DECODE(:ITEM_ID_STR,NULL,1,INSTR(','||:ITEM_ID_STR||',' , ','||P.PRD_SEARCH_ID||',')) > 0
AND DECODE(:COUNTRY_ISO,NULL,1,INSTR(','||:COUNTRY_ISO||',', ','||P.PRD_SEARCH_GL_COUNTRY_ISO||',')) > 0
AND DECODE(NVL(:COMPANY_ID,0),0,1,P.PRD_SEARCH_COMPANY_ID) = DECODE(NVL(:COMPANY_ID,0),0,1,:COMPANY_ID)
AND DECODE(NVL(:GLUSR_ID,0),0,1,P.PRD_SEARCH_GLUSR_USR_ID) = DECODE(NVL(:GLUSR_ID,0),0,1,:GLUSR_ID)
AND P.PRD_SEARCH_CLNT_ENABLED >= NVL(:LIST_TYPE,0)
AND NVL(LENGTH(P.PRD_SEARCH_TRUSTSEAL_CODE),0) >= :TSONLY
WHERE RK1=1
ORDER BY SC DESC, PRD_SEARCH_CUSTTYPE_WEIGHT ASC, DBMS_RANDOM.RANDOM
) A
WHERE A.RK <= :MY_PRD_PER_COMP
AND ROWNUM <= :MYMAXREC
ORDER BY A.SO DESC, DECODE(:OPT,2,'1', A.PRD_SEARCH_COMPANY), A.RK ASC, DBMS_RANDOM.RANDOMRegards
Madhup -
Can we edit the output file of Crystal?
Hi,
We need to create a crystal report but the user wants to have some fields in the output .rpt file to be editable. Can we really do it? if yes, how to do it?
Thanks!Girish,
Thanks for your reply! We are not going to edit the field name. We are looking to edit the field value. For example, in the output file, we have 100 different trading records and each of them will have different commission. The users hope they can edit the value of the commission for each record. I have tried with Crystal and it seems that I can edit the field but all records will have same value for the column. Do you know if we can edit the value of commission for each record?
Thanks! -
Help needed in the output file
Hi
Here is my query,
DECLARE
vProduct VARCHAR2(100) := 'Prints';
vProduct1 VARCHAR2(100) := 'Pk';
vName VARCHAR2(100) := 'Photos';
vName1 VARCHAR2(100) := 'B';
BEGIN
DBMS_OUTPUT.PUT_LINE('Product '||' '||'Name');
DBMS_OUTPUT.PUT_LINE('----------------------');
DBMS_OUTPUT.PUT_LINE(vProduct ||' '||vName);
DBMS_OUTPUT.PUT_LINE(vProduct1 ||' '||vName1);
END;
Product Name
Prints Photos
Pk B
But i need the output as like this
Product Name
Prints Photos
Pk B
With a tab space between each values even i have different lengths in the value.
Is this possible ?Ok Rob Thanks..........
Its worked fine -
Is it possible for a user to edit the output of a form before printing?
This might sound odd but the business have requested the ability to edit the text of a Smartform before printing. i.e. a standard form can be printed 'as is' for most employees but certain exceptions may require the wording to be slightly amended.
I don't think this is possible but I want to know for sure.
Any advice is much appreciated.
Many thanks
MattHi Matt,
Sanjay was right.
That is the best you can do as of now.
Have a screen when the user has a chance of modifying the texts that are currently being displayed on the print. Let him save the texts and then trigger the smrtform, which would pick the updated texts instead of the old ones.
the function modules READ_TEXT, SAVE_TEXT may come in handy here.
regards,
Ravi -
Ilustrator CS6 - How do I edit the output settings?
Hi, its really annoying that I cant change the output settings when I save for web something. I just want to tell Illustrator that I dont want to create a new images folder everytime I save something, and I dont want to add a _N at the end of the file name...
Is there a way to change this?, I couldnt find it.
Thanks.This feature has been removed from CS6:
As quoted from this Adobe employee blog post on the new CS6 Save for Web feature:
The Output Settings dialog box, used to control HTML file formatting, slice naming, and background image handling, has been removed.
I haven't had any luck figuring out a work-around, but I'll keep poking around. -
HELP! Editing the masterpage made the site go completely down.
I get an Error File not found. now on every page. I downloaded the master page (because they have editing with sharepoint designer disabled) and altered it. I then tried to upload it to overwrite the master page. Then I got the error. Every
page I try to go to just gives me the error. How do I set this right?
I can't use SharePoint designer because they've disabled it for editing the site.
I did open a web folder and successfully navigated tot the master page, but I can't do anything to it. I tried to replace it with an unedited version of the master, but I get a message saying "Could not find this item".I got it... sort of. I was able to hit back on my browser to a cached page and access site settings that still worked. Then i set the master page to an earlier version. For some reason, the other one is now corrupt and won't roll back, but
at least now I can continue. -
Pls help to rewrite the query in another method .
Insert into bl_voyage_details (BVD_COMPANY,BVD_REFERENCE,BVD_SERIAL,BVD_CARRIER,BVD_VESSEL,BVD_VOY,BVD_LOCATION,BVD_TYPE,BVD_CRT_BY,BVD_CRT_ON,
BVD_UPD_BY,BVD_UPD_ON,BVD_STATUS,BVD_STATUS_DATE,BVD_STATUS_BY )
Values (Select bdl_company,bdl_reference,
*(select nvl(max(bvd_serial),0)+1 from bl_voyage_details)*
,bdl_carrier,bdl_vessel,bdl_voy,bdl_location,bdl_type,user,sysdate,user,'0',sysdate,sysdate from bl_details)
Insert into bl_voyage_details (BVD_COMPANY,BVD_REFERENCE,BVD_SERIAL,BVD_CARRIER,BVD_VESSEL,BVD_VOY,BVD_LOCATION,BVD_TYPE,BVD_CRT_BY,BVD_CRT_ON,
BVD_UPD_BY,BVD_UPD_ON,BVD_STATUS,BVD_STATUS_DATE,BVD_STATUS_BY )
Values (Select bdl_company,bdl_reference,
*(select nvl(max(bvd_serial),0)+1 from bl_voyage_details where (BVD_COMPANY,BVD_REFERENCE)in (bdl_company,bdl_reference)* )
,bdl_carrier,bdl_vessel,bdl_voy,bdl_location,bdl_type,user,sysdate,user,'0',sysdate,sysdate from bl_details)
Edited by: Rinz on Apr 27, 2010 3:57 PM
Edited by: Rinz on Apr 27, 2010 3:57 PMSeems related to your previous question ( Procedure creation )
Is there any reason why you couldn't just use a sequence:
insert into bl_voyage_details
(bvd_company,
bvd_reference,
bvd_serial,
bvd_carrier,
bvd_vessel,
bvd_voy,
bvd_location,
bvd_type,
bvd_crt_by,
bvd_crt_on,
bvd_upd_by,
bvd_upd_on,
bvd_status,
bvd_status_date,
bvd_status_by
select bdl_company,
bdl_reference,
some_sequence.nextval, --<< use a sequence
bdl_carrier,
bdl_vessel,
bdl_voy,
bdl_location,
bdl_type,
user,
sysdate,
user,
sysdate,
'0',
sysdate,
sysdate
from bl_details;Also:
To post formatted code, put the {noformat} {noformat}- tag before and after your examples.
When you post:
{noformat} select *
from dual;
{noformat}
it will appear as: select *
from dual;
on the forum.
The FAQ will tell you more: http://forums.oracle.com/forums/help.jspa -
Can anyone help me edit the xml in Feedburner?
I successfully resubmitted my podcast to Itunes so that now it only takes the podcasts, and all six episodes are there. Yay!
Problem is now that it shows it created by "[email protected]"
I can see just where that is in the xml feed, but when I try to edit it, nothing happens.
also the website sends it just to the page for podcasts, but that's ok as the tabs are all at the top and anyone who wants to can click ont he tabs to read more. And I think having it link to the entire blog was part of the problem in the first place. I'm just concerned about the "noreply" thing.
Here is the podcast on itunes:
http://itunes.apple.com/us/podcast/new-york-irish-arts/id435952770
The offending line in the xml is this:
<managingEditor>[email protected] (Gwen Orel)</managingEditor>
<lastBuildDate>Wed
But I don't know how to get in there to change it. Help....As far as I can deduce you have created the podcast using Blogger's online service, then submitted the feed URL they give you to Feedburner: the Feedburner feed, which has been submitted to iTunes, is at
http://feeds.feedburner.com/blogspot/IWRRu
Both Blogger and Feedeburner create and host the feed themselves: it's not possibile for you to edit this directly. You have to make any required changes in Blogger.
There is a bit of a mystery over the offending entry. That area on the iTunes Store should be populated from the 'itunes:author' tag; there is such a tag, containing just your name. ITunes does not, in theory, read the 'managingEditor' tag, so why it's displaying the contents of this tag I can't say. It's all something you would have to take up with Blogger: but these free service come at the price of accepting their way of doing things and one of the things which is liable to happen is that they like links back to their own site. That one is a bit odd, though. -
Need help to format the output of the query.
First of all i would like to say I m newbi in oracle query
and of course thanks to read the thread.
I have a problem formatting a query output.
Actually the query is like the following :
select a1
,b1
,c1
from table
where id.table=1
UNION
select a2
,b2
,c2
from table2
where id.table2=1
order by 1;
exit;
my actual output
a1 b1 c1
a2 b2 c2
a1 b1 c1
a2 b2 c2
my desired output
a1 b1 c1
a2 b2 c2
a1 b1 c1
a2 b2 c2
So what i need is an empy row between the groups of results
and to shift the union query.
thanks in advanceSQL>select * from t1;
C1 C2 C3
1 2 3
2 3 4
3 4 5
SQL>select * from t2;
C1 C2 C3
30 40 50
20 30 40
10 20 30
SQL>select c1,c2,c3
2 from( select c1,c2,c3,1 flg
3 from t1
4 union all
5 select c1,c2,c3,2
6 from t2
7 union all
8 select null,null,null,1
9 from dual)
10 order by flg,c1,c2,c3 nulls last;
C1 C2 C3
1 2 3
2 3 4
3 4 5
<br>
10 20 30
20 30 40
30 40 50
7 rows selected.
Funny....... -
Plzz help me with the output of this code....
hi all..
plz check this code and tell me how to select one or more options from this Jlist and write the selected item into a text file....This code does that but the text file shows only one item (i tried using arry but din work) AND text file displays the item which is selected last time the code is interpreted..
import java.awt.*;
import java.io.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class mld extends JFrame implements ListSelectionListener, ActionListener
{private JFrame myframe = new JFrame("Select File");
private DefaultListModel listModel = new DefaultListModel();
private JList list= new JList(listModel);
private String selString = "select file name";
private JButton selButton;
public mld(){
super("mld");
addWindowListener(new WindowAdapter()
{ public void windowClosing(WindowEvent ev) {dispose();
System.exit(0);
listModel.addElement("prog1");
listModel.addElement("prog2");
listModel.addElement("prog3");
listModel.addElement("prog4");
listModel.addElement("prog5");
listModel.addElement("prog6");
listModel.addElement("prog7");
listModel.addElement("prog8");
listModel.addElement("prog9");
listModel.addElement("prog10");
listModel.addElement("prog11");
listModel.addElement("prog12");
list.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
list.addListSelectionListener(this);
JScrollPane listScrollPane = new JScrollPane(list);
JButton selButton = new JButton(selString);
selButton.setActionCommand(selString);
selButton.addActionListener(this);
//Create a panel that uses FlowLayout (the default).
JPanel buttonPane = new JPanel();
buttonPane.add(selButton);
Container contentPane = getContentPane();
contentPane.add(listScrollPane, BorderLayout.CENTER);
contentPane.add(buttonPane, BorderLayout.SOUTH);
pack();
show();}
public void valueChanged(ListSelectionEvent e) {}
public void actionPerformed(ActionEvent e){
String tmp = new String(list.getSelectedValue().toString());
try{
FileOutputStream fileOut = new FileOutputStream("temp.txt");
fileOut.write(tmp.getBytes());
fileOut.close();}
catch (Exception e1)
{ e1.printStackTrace(); }
//*main method//
public static void main(String s[]) {
JFrame frame = new mld();
try {
Process p = Runtime.getRuntime().exec("notepad temp.txt ");
p.waitFor();
Process p1 = Runtime.getRuntime().exec("c:/Program Files/Microsoft Office/Office/outlook.EXE /c ipm.note /m [email protected] /a c:/temp.txt");
catch(Exception e)
{ e.printStackTrace(); }
Thanx in advance
bharthireplace
FileOutputStream fs = new FileOutputStream("filename");
with
FileOutputStream fs = new FileOutputStream("filename",true); -
Dear all,
we wrote one query to fetch wrong entries as per the clients requirement. Here is our query
SELECT A.TRANSID, A.VATAMOUNT, A.VATGROUP, B.BASEREF,
C.CARDCODE, D.DEBPAYACCT, E.SEGMENT_3,B.REFDATE
FROM JDT1 A JOIN OJDT B
ON A.TRANSID=B.TRANSID
LEFT OUTER JOIN OINV C
ON B.BASEREF=C.DOCNUM
LEFT OUTER JOIN OCRD D
ON C.CARDCODE=D.CARDCODE
LEFT OUTER JOIN OACT E
ON D.DEBPAYACCT=E.ACCTCODE
LEFT OUTER JOIN OCRD F
ON C.CARDCODE=F.CARDCODE
right OUTER JOIN OASC G
ON G.CODE=E.SEGMENT_3
SELECT * FROM DBO.V_GET_GLST_INFO
WHERE CONVERT(VARCHAR, REFDATE,112) BETWEEN '20080701' AND '20081231'
AND VATGROUP='S1-Lb' AND SEGMENT_3 = '11'
in this query i have to give segment as parameter so when i tries to execute this query it does not fetch the data. please can anybody will help me.
thanks & Regards
Tavargeri Ganeshsorry the actual query is
SELECT A.TRANSID, A.VATAMOUNT, A.VATGROUP, B.BASEREF,
C.CARDCODE, D.DEBPAYACCT, E.SEGMENT_3,B.REFDATE
FROM JDT1 A JOIN OJDT B
ON A.TRANSID=B.TRANSID
LEFT OUTER JOIN OINV C
ON B.BASEREF=C.DOCNUM
LEFT OUTER JOIN OCRD D
ON C.CARDCODE=D.CARDCODE
LEFT OUTER JOIN OACT E
ON D.DEBPAYACCT=E.ACCTCODE
LEFT OUTER JOIN OCRD F
ON C.CARDCODE=F.CARDCODE
right OUTER JOIN OASC G
ON G.CODE=E.SEGMENT_3
WHERE CONVERT(VARCHAR, REFDATE,112) BETWEEN '20080701' AND '20081231'
AND VATGROUP='S1-Lb' AND VATAMOUNT>0 AND SEGMENT_3 IS NOT NULL
Thanks
Tavargeri Ganesh
Maybe you are looking for
-
Dropbox automator script no longer working with Mavericks
Hi, I use two versions of the following shell script (found on the net), launched by automator, to set up two Dropbox accounts : Since upgrading to Mavericks, the script hangs when execution is requested. If the execution is then stopped and then req
-
Hi SAP GURU'S I configured all service tax settings And posting the invoice as down payment But the service tax is not calculating, normal entry coming like as below Spl Customer A/c DR To Bank The tax code is showing but tax not
-
OpenUI!!!! Upgraded to Siebel 8.1.1.9.
I have upgraded to Siebel 8.1.1.9. I can login by command -- srvrmgr and connect to the server normally. But after i started the HTTP Server,i visit the web http://192.168.2.78:8080/loyalty_enu/ The server you are trying to access is either busy or e
-
ERROR [STDERR] java.lang.OutOfMemoryError
Hi, We are using Primavera P6, We are facing below issue on on web tier >> ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space Please suggest Regards
-
Is there a way to photostream pictures from two separate iCloud accounts (two iphones that I own) to the same mac, for simultaneous display in iPhoto?