To find the greatest date from table
guys,
I currently use this query to find the difference between sysdate and the oldest date in the table
select (SYSDATE - cur_date) from comp_check
the problem is it fives multiple records as output.
i want to design a query that will give the difference between sysdate and the oldest date in the table(it should throw only one record as the result)
how do i do that.
thanks in advance
SQL> select sysdate-min(created) from all_users
SQL> /
SYSDATE-MIN(CREATED)
507,373866
SQL> Nicolas.
MIN usage for oldest. Correction after ennisb's remark, thanks.
Message was edited by:
N. Gasparotto
Similar Messages
-
How to find the deleted data in tables
guys,
how to find the deleted data in tables example: i want to see whether anyone deleted data in MB5B report tables like mbew, etc.,
regards,Hi,
MBEWH is actually the history table of MBEW. It will record all the changes. As I have told you earlier if you have deleted the record dirctly from the table then it will not come even in the table MBEWH
That means no changes have been made.
regards -
Need to know the sqluery to find the disabled date from OIM 9.1.0.1
Hi Experts,
Need very urgent inputs from you all for the preparation of our audit.
We are using OIM9.1.0.1
We need to know the sqlquery for finding the Disabled date in OIM given the user ids, as currently we are unable to get the exact data from Historical Reports Option in OIM.
I need to give in this format:
select usr_login, usr_disabled from schemaname.tablename where usr_login in
('aaa','bbb'..... etc)
We have three attributes :USR_DISABLED_BY_PARENT,USR_DISABLED,USR_DEPROVISIONING_DATE,but none of them give the exact date,
USR_DISABLED gives just a flag as 1 or 0.
Also there are no other fields in the corresponding usr table.
So how to fetch the exact Disabled date from OIM system when I input the user ids.
Your immediate response is appreciated.
Thanks
SSIn the entire thread many experts have given nice queries in different formats...
The best approach would be to open up the SQL Developer, connect with the OIM Database and experiment with all sorts of SQL queries provided by all the experts..
Learn some SQL techniques, like Inner Join etc...
Then you yourself will be able to figure out what you need, in exactly which format, for which users and for whom you have to restrict
Then not only this question, you would be able to solve dozens of similar such issues yourself...
And trust me, nothing can match that...
Just in case, you are not familiar with SQL Developer,
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
Oracle SQL Developer 3.2.1 (3.2.10.09.57)
September 24, 2012
The Disabled DATE will be the creation date of that entry in the UPA_FIELDS table when Users.Status changed to Disabled.
SELECT USR.USR_LOGIN, UPA_FIELDS.CREATE_DATE
FROM UPA_FIELDS
WHERE UPA_FIELDS.FIELD_NAME='Users.Status'
AND UPA_FIELDS.FIELD_NEW_VALUE='Disabled'
AND UPA_FIELDS.UPA_USR_KEY=USR.USR_KEY
AND USR.USR_LOGIN NOT IN ('XELSYSADM', 'XELOPERATOR', 'WEBLOGIC'); -
Query to find oldest man data from table
Emp tab:
f_name varchar2(30)
l_name varchar2(30)
dob date
sex varchar2(5)
I want to find the F_name of the oldest man born in year 1965 , who possess the "DA" in the f_name.How about this?
SELECT f_name
FROM (SELECT *
FROM emp
WHERE TRUNC(dob) = 1965
AND UPPER(f_name) LIKE '%DA%'
ORDER BY dob desc
WHERE ROWNUM = 1
not tested and assuming that there are no duplicate dates. Another option would be analytic functions.
C. -
Find the missing date from output data
Hi Guys,
For Ex,
I have the following ouput rows with column like
Id Name Mobile Signindate
1 AAA XXX 2012-03-01
2 AAA XXX 2012-03-02
3 AAA XXX 2012-03-05
4 AAA XXX 2012-03-06
5 AAA XXX 2012-03-07
the above rows will get based on startdate and enddate parameter like (mar 1,2012 ) to (mar 31,2012)
the Actual output needed is the missing date of Signin ,here in above ex ,it will be march 3 ,march4
Final Output is,
Id Name Mobile Signindate-Missed date
1 AAA XXX 2012-03-03
2 AAA XXX 2012-03-04
how to do in tsql
any help is needed
Thanks
r.bfinal output getting like this,
d ResourceID
ResourceName ReportsTo
Location eMail
Mobile Workdate
2013-12-01 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-07 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-08 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-11 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-12 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-13 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-14 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-15 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-16 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-17 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-18 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-19 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-20 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-21 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-22 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-25 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-26 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-27 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-28 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-29 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-30 NULL
NULL NULL
NULL NULL
NULL NULL
2013-12-31 NULL
NULL NULL
NULL NULL
NULL NULL
SELECT d.* ,a.*
FROM @Dates d
left join #tmp a on d.d =a.Workdate
WHERE d NOT in (SELECT Workdate
FROM #tmp)
suggestions needed, all fields coming as null except workdate ,workdate is the missing date
tnkx
r.b -
Find the correct data from series of messages
I have the RFC -> XI -> SOAP scenario; In this scenario, RFC will send some notes of service for the WEB service via SOAP.
When I access the monitor of messages of the XI, I got series of messages. How I should find the correct messages out of this bunch.
How can I locate one definitive note for the number of it through the monitor of the XI?a s
You need to use selection criteria to restrict message view to the relevant messages
Monitor for Processed XML Messages
http://help.sap.com/saphelp_nw04/helpdata/en/c4/9a5c3bab977239e10000000a114084/frameset.htm
Once you have identified the relevant messages (say your three examples of the same message type), you then need to distinguish between each one. To do this you will need to open each relevant message then view the payload of the inbound message and / or the response message. This blog is only relevant in that it highlights the message header, payload etc. Refer to left hand side of screen once you have displayed the message version
Monitoring for Processed XML messages in ABAP Proxy
Monitoring for Processed XML messages in ABAP Proxy
Regards,
Mike -
I don't even know if this is posible.
I'm using iwork '09
View PDFI hope I can clarify:
For our purposes here:
Table 1 = "Step 2 - Product Sizes"
Table 2 = "Option id Master"
Table 3 = "Export - Product Info"
Table 1:
The user would enter values for "productcode," "Horz," and "Vert"
"Size" would auto fill based on values in Horiz and Vert (I have this taken care of already).
Table 2: This is a completely static table that I want to search against. - Data from other tables in the doc does not alter or change the data in this doc.
We just want to look at table 2. Find the existing value in "table 2 : size" column that matches the "table 1 : size" column and then pull the "optionids" and "productprice" from that row.
Can the value from "Table 1 : Size" be used as a search term in "Table 2 : Size?"
Table 3: The user does not enter any values on this table.
"productcode" is pulled from table 1 - "Table 1 :: A5" = "Table 3 :: A5"
"optionids" and "productprice" are pulled from Table 2 columns "D" and "E" - however we do not know which Table 2 row it is pulling from until we enter data in Table 1.
As I'm writing this I'm realizing that
A. this is probably really confusing to you.
B. this may be impossible inside of numbers.
If you have some other method that would facilitate the same out come but be structured differently please let me know.
--- maybe to help you understand further what I am doing here is my current workflow:
I record the size of a piece of art.
Then I manually go to my "Option id Master" and find the same size.
I then copy the corresponding "optionids" and "productprice" cells. (these options control the prices displayed on my website)
I got to my "Export - Product Info" table and paste the values in the corresponding cells.
I was hoping to automate this as it takes a long time when you have hundreds of products.
Thanks for the help! -
How to find the costliest course from the below table.
dear experts,
please help me to find the costliest course from the below data
COURSE CCOST
pgdca 4500
dca 7200
mca 22000
dcp 5000
pgdca 4500
dap 6200
dcap 5200
hdcp 14000
pgdca 4500
dca&p 11000Then read the FAQ for how to post a question on the forum.
1. You didn't say anything about using an Oracle database or what your 4 digit version of Oracle is.
2. You didn't provide a table name, the table DDL or insert statements to create the table and data
3. You didn't post the queries that you tried to write and tell us whether they work or not.
4. You didn't tell us when this homework assignment is due or that you needed a query.
This isn't a coding service. The forum is to help you with questions or issues you are having with YOUR queries.
No one can write a query without having a table. If you want help post the info requested above. -
How to delete the duplicate data from PSA Table
Dear All,
How to delete the duplicate data from PSA Table, I have the purchase cube and I am getting the data from Item data source.
In PSA table, I found the some cancellation records for that particular records quantity would be negative for the same record value would be positive.
Due to this reason the quantity is updated to target but the values would summarized and got the summarized value of all normal and cancellation .
Please let me know the solution how to delete the data while updating to the target.
Thanks
Regards,
SaiHi,
in deleting the records in PSA table difficult and how many you will the delete.
you can achieve the different ways.
1. creating the DSO maintain the some key fields it will overwrite the based on key fields.
2. you can write the ABAP logic deleting the duplicate records at info package level check with the your ABAPer.
3.you can restrict the cancellation records at query level.
Thanks,
Phani. -
To find the lowest salary from a table
hello guys,
i need to find the lowest salary from a table. whats the easy way to do this.How do you handle ties?
If you want multiple rows returned when there are multiple people with the same salary
SELECT *
FROM(
SELECT a.*,
rank() over (order by salary desc ) rnk
FROM your_table a)
WHERE rnk = 1If you want to handle ties differently, use a different analytic function. Probably dense_rank or row_number.
Justin -
Migration from PC with MA did not end. Had to shut down MacBookPro. After restart no new user was created. Can't find the transferred data (35 GB). Would like to delete it.
iTunes is required to initially activate the phone. Back when the iPhone 3G was sold, you would take it out of the box and see a "Connect to iTunes" screen. She HAD to connect to a computer in order to begin using the phone. Does she remember what computer this was?
-
hello, we need to remove the dirty data from MDS, but we found we can only do this from MDS web, and we need to do this by store procedure to make this process automatically. is there any easy method to remove the data from MDS automatically? thank.
WarrenHi Warren,
Assuming the dirty data is easily identifiable, all you need to do is use the staging process with import type of 5 (de-activate - i.e., soft delete) or import type of 6 (hard delete).
Could give more details if I knew the version of MDS you are running (SQL 2008R2 or SQL 2012).
Kind regards,
M -
Fetch data from table and generate attachment than mail it.
Hello Experts,
From couple of day I am searching on Google for a better database procedure that will help me to get data from tables and generate attachment and mail it but i fail.
My Scenario is:
I have a query that will fetch almost 5000 records from database tables. Each record has almost 75 characters
select a.location_code,
a.item_code,
b.description item_desc,
to_char(a.manufact_date,'ddMonyy')mfg,
to_char((a.manufact_date + nvl(b.expiry_period,0)),'ddMonyy')expr,
to_char((a.manufact_date + nvl(b.qurantine_period,0)),'ddMonyy')qrtn,
round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) days_elapsed,
a.closing_balance_posted quantity
from wms_stock_current_balance_v a, wms_item_setup_mast b
where a.closing_balance > 0
and a.item_code = b.item_code
and a.loc_type in ('RACKING','PICKING','QUICKA','BUNDLED')
and nvl(b.qurantine_period,0) > 0
and round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) <= 0
order by a.item_code, a.location_code;
Sample data of above query is
LOCATION_CODE
ITEM_CODE
ITEM_DESC
MFG
Expiry
Quarantine
Days Elapse
Quantity
13DL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
14DL0
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
134
14DL2
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
160
14DR2
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
20
14LL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17ER2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17GL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17SL0
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
64
18QL0
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
160
19AR5
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
160
19DL1
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
19JR0
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
60
19TL1
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
20GR2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
40
36FL3
000000000000000F0487
CLEAR COOL BLACK 05ML
18-Feb-10
29-Mar-14
2-Jun-13
-124
65
19UR0
000000000000000F0591
COMFORT WHITE 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
1
12SL1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
42
12SR1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
42
14OR1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
8
36EL4
000000000000000F0594
CLEAR HF DECRASE 5M*360
14-Feb-10
14-Feb-11
12-Oct-10
-1088
14
13VL1
000000000000000F0595
CLEAR COM SFT CRE 5*360
8-Feb-10
8-Feb-11
6-Oct-10
-1094
160
14ER0
000000000000000F0595
CLEAR COM SFT CRE 5*360
8-Feb-10
8-Feb-11
6-Oct-10
-1094
105
Database Info
Oracle 10g
Version 10.2.0.1.0Look at the sample code for generating a CSV file that I've just posted in response to a similar question:
Re: How to execute a proc and spool files in a database job
And the use the search button in this forum to find sample code for sending a CLOB as a plain/text e-mail attachment using UTL_SMTP. -
How to retrieve multiple data from table and represent it in jsp page
Hi
The below JavaScript code is used to add row in the table when I want to add multiple row data into table for single entry no field.
<html> function addRow()
i++;
var newRow = document.all("tblGrid").insertRow();
var oCell = newRow.insertCell();
oCell.innerHTML = "<input name='srno"+i+"' type='text' id='srno"+i+"' size=10>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='itmcd"+i+"' type='text' id='itmcd"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='itmnm"+i+"' type='text' id='itmnm"+i+"' size='15'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='indentqty"+i+"' type='text' id='indentqty"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='uom"+i+"' type='text' id='uom"+i+"' size='10'><input type='hidden' name='mcode"+i+"'id='mcode"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='packqty"+i+"' type='text' id='packqty"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='packuom"+i+"' type='text' id='packuom"+i+"' size='10'><input type='hidden' name='pack"+i+"' id='pack"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='rate"+i+"' type='text' id='rate"+i+"' size='10'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='dor"+i+"' type='text' id='dor"+i+"' size='0' onClick='"+putdate(this.name)+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='bccode"+i+"' type='text' id='bccode"+i+"' size='10'></td><input type='hidden' name='bcc"+i+"' id='bcc"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='cccode"+i+"' type='text' id='cccode"+i+"' size='10'></td><input type='hidden' name='ccc"+i+"' id='ccc"+i+"'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input name='remark2"+i+"' type='text' id='remark2"+i+"' size='20'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='button' value='Delete' onclick='removeRow(this);' />";
// oCell = newRow.insertCell();
// oCell.innerHTML = "<input type='button' value='Clear' onclick='clearRow(this);' />";
}<html> Then this data are send to the next Servlet for adding into two table.
My header portion data are added into one table which added only one row in table. while footer section data are added into the no of rows in another table dependent on No. of
Rows added into jsp page.
Here is an code for that logic.
<html>
ArrayList<String> mucode = new ArrayList<String>();
ArrayList<Integer> serials = new ArrayList<Integer>();
ArrayList<Integer> apxrate = new ArrayList<Integer>();
ArrayList<Integer> srname = new ArrayList<Integer>();
ArrayList<String> itcode = new ArrayList<String>();
ArrayList<String> itname = new ArrayList<String>();
ArrayList<Integer> iqnty = new ArrayList<Integer>();
ArrayList<String> iuom = new ArrayList<String>();
ArrayList<Integer> pqnty = new ArrayList<Integer>();
ArrayList<String> puom1 = new ArrayList<String>();
ArrayList<Integer> arate = new ArrayList<Integer>();
ArrayList<String> rdate = new ArrayList<String>();
ArrayList<String> bcs = new ArrayList<String>();
ArrayList<String> ccs = new ArrayList<String>();
ArrayList<String> remarkss = new ArrayList<String>();
//ArrayList<Integer> qtyrecs = new ArrayList<Integer>();
//ArrayList<String> dors = new ArrayList<String>();
//ArrayList<String> remarks = new ArrayList<String>();
String entryn = request.getParameter("entryno");
String rows = request.getParameter("rows");
out.println(rows);
//String Entryno = request.getParameter("entryno");
// out.println(Entryno);
int entryno = 0,reqqty = 0,srno = 0,deprequest = 0,rowcount = 0;
if(!Entryno.equals("")){
entryno = Integer.valueOf(Entryno);
if(!rows.equals("")){
rowcount = Integer.valueOf(rows);
for(int i=1;i<=rowcount;i++){
if(request.getParameter("srno"+i)!=null){
serials.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
out.println(serials.size());
for(int i=1;i<=rowcount;i++){
if(request.getParameter("srno"+i)!=null){
srname.add(Integer.valueOf(request.getParameter("srno"+i).trim()));
out.println(srname.get(0));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("itmcd"+i)!=null){
itcode.add(request.getParameter("itmcd"+i).trim());
} //out.println(itcode.get(i));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("itmnm"+i)!=null){
itname.add(request.getParameter("itmnm"+i).trim());
}//out.println(itname.get(i));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("indentqty"+i)!=null){
iqnty.add(Integer.valueOf(request.getParameter("indentqty"+i).trim()));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("uom"+i)!=null){
iuom.add(request.getParameter("uom"+i).trim());
}//out.println(iuom.get(i));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("mcode"+i)!=null){
mucode.add(request.getParameter("mcode"+i).trim());
for(int i=1;i<=rowcount;i++){
if(request.getParameter("packqty"+i).equals("")){
pqnty.add(0);
}else
pqnty.add(Integer.valueOf(request.getParameter("packqty"+i).trim()));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("pack"+i)!=null){
puom1.add(request.getParameter("pack"+i).trim());
}else
puom1.add("");
for(int i=1;i<=rowcount;i++){
if(request.getParameter("rate"+i).equals("")){
arate.add(0);
}else
arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
/* for(int i=1;i<=rowcount;i++){
if(request.getParameter("rate"+i)!=null){
arate.add(Integer.valueOf(request.getParameter("rate"+i).trim()));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("dor"+i)!=null){
try{
rdate.add(dashdate.format(slashdate.parse(request.getParameter("dor"+i).trim())));
}catch(ParseException p){p.printStackTrace();}
}else
{ rdate.add("");}
for(int i=1;i<=rowcount;i++){
if(request.getParameter("bcc"+i)!=null){
bcs.add(request.getParameter("bcc"+i).trim());
}out.println(bcs.get(0));
for(int i=1;i<=rowcount;i++){
if(request.getParameter("ccc"+i)!=null){
ccs.add(request.getParameter("ccc"+i).trim());
}out.println(ccs.get(0));
for(int i=1;i<=rowcount;i++){
out.println("remark2");
if(request.getParameter("remark2"+i)!=null){
remarkss.add(request.getParameter("remark2"+i).trim());
}out.println(remarkss.get(0));
ArrayList<String> Idate = new ArrayList<String>();
for(int i=1;i<=rowcount;i++){
if(request.getParameter("dateindent"+i)!=null){
try{
Idate.add(dashdate.format(dashdate.parse(request.getParameter("dateindent"+i).trim())));
}catch(ParseException p){p.printStackTrace();}
String Rdate = dashdate.format(new java.util.Date());
String tdate = dashdate.format(new java.util.Date());
// String Indentdate = dashdate.format(new java.util.Date());
// String ApprovedT1 = dashdate.format(new java.util.Date());
// String ApprovedT2 = dashdate.format(new java.util.Date());
// String ApprovedT1=" ";
//String ApprovedT2="";*/
String ApprovedT1= dashdate.format(new java.util.Date());
out.println (ApprovedT1);
String ApprovedT2=dashdate.format(new java.util.Date());
out.println(ApprovedT2);
String Indentdate=(dashdate.format(slashdate.parse(request.getParameter("dateindent").trim())));
out.println(Indentdate);
String Cocode ="BML001";
out.println(Cocode);
String Deptcode = request.getParameter("dept1");
out.println(Deptcode);
String Empcode = request.getParameter("emp");
out.println(Empcode);
String Refno =request.getParameter("rtype");
out.println(Refno);
String Divcode = request.getParameter("todiv1");
out.println(Divcode);
String Usercode = "CIRIUS";
String Whcode = request.getParameter("stor");
out.println(Whcode);
// String Itemgroupcode = request.getParameter("");
String Itemgroupcode ="120000";
out.println(Itemgroupcode);
String Supplytypecode = request.getParameter("stype");
out.println(Supplytypecode);
String Delcode = request.getParameter("deliverycode");
out.println(Delcode);
String Itemclass="WS";
out.println(Itemclass);
// String Itemclass = request.getParameter("iclass");
// out.println(Itemclass);
String unitcode = request.getParameter("uni");
out.println(unitcode);
String Todivcode = request.getParameter("todiv1");
out.println(Todivcode);
String Appxrate = request.getParameter("rate");
out.println(Appxrate);
String Srno = request.getParameter("srno");
out.println(Srno);
/* String Indqty = request.getParameter("indentqty");
out.println(Indqty);*/
String Itemcode = request.getParameter("itmcd");
out.println(Itemcode);
String Othersp = request.getParameter("remark1");
out.println(Othersp);
String Reqdt = request.getParameter("dor");
out.println(Reqdt);
String Munitcode = request.getParameter("mcode");
out.println(Munitcode);
String Packqty = request.getParameter("packqty");
out.println(Packqty);
String Packuom = request.getParameter("pack");
out.println(Packuom);
String Remark2 = request.getParameter("remark2");
out.println(Remark2);
String BC = request.getParameter("bcc");
out.println(BC);
String CC = request.getParameter("ccc");
out.println(CC);
try{
st=connection.createStatement();
connection.setAutoCommit(false);
String sql="INSERT INTO PTXNINDHDR(COCODE,DEPTCODE,EMPCODE,APPROVEDT1,APPROVEDT2,INDDT,ENTRYNO,REFNO,REMARKS,DIVCODE,USERCODE,WHCODE,ITEMGROUPCODE,SUPTYPECODE,DELCODE,UNITCODE,TODIVCODE,ITEMCLASS)VALUES('"+Cocode+"','"+Deptcode+"','"+Empcode+"','"+ApprovedT1+"','"+ApprovedT2+"','"+Indentdate+"',"+Entryno+",'"+Refno+"','"+Othersp+"','"+Divcode+"','"+Usercode+"','"+Whcode+"','"+Itemgroupcode+"','"+Supplytypecode+"','"+Delcode+"','"+unitcode+"','"+Todivcode+"','"+Itemclass+"')";
out.println(sql);
st.addBatch(sql);
for(int i=0;i<serials.size();i++){
out.println("Inside the Statement");
String query3="test query for u";
out.println(query3);
String queryx="Insert into PTXNINDDTL(APXRATE,ENTRYNO,BRKNO,INDQTY,ITEMCODE,OTHERSPFCS,MUNITCODE,PACKQTY,PACKUOM,REMARKS,DIMSUBGRPCODE,DIMCODE,REQDT)VALUES("+arate.get(i)+","+entryno+","+srname.get(i)+","+iqnty.get(i)+","+itcode.get(i)+",'"+Othersp+"','"+mucode.get(i)+"',"+pqnty.get(i)+",'"+puom1.get(i)+"','"+remarkss.get(i)+"','"+bcs.get(i)+"','"+ccs.get(i)+"','"+rdate.get(i)+"')";
out.println(queryx);
st.addBatch(queryx);
int[] result=st.executeBatch();
connection.commit();
for(int k=0;k<result.length;k++)
out.println("rows updated by "+(k+1)+"insert sta:"+result[k]+"");
catch(BatchUpdateException bue)
out.println("error1;"+bue+"");
catch(SQLException sql)
out.println("error2;"+sql+"");
catch(Exception l)
out.println("error3;"+l+"");
</html>
Now I looking for to retrieve this footer section data available in multiple rows from footer table and present it in jsp page .
I am finding difficulties in how to show this multiple row data for dynamic no of rows .i.e. variable no. of rows.
I have able to show the data in Header portions of page in this ways
here i am adding the part of code which shows the data from header part of table i.e from Header table
<html>
<h2 align="center"><b>Indent Preparation</b></h2>
<div align="left">
<table width="849" border="0" cellspacing="3" cellpadding="3" align="center">
<tr>
<td ><div align="left"><b>Indent No.</b></div></td>
<td ><label>
<input name="indentno" type="text" id="indentno" size="15" value="" /><input type="hidden" name="no" id="no">
</label></td>
<td ><div align="center"><strong>Indent Date</strong></div></td>
<td ><label>
<div align="center">
<input name="dateindent" type="text" id="dateindent"value="<%=date1%>"/><input type="hidden" name="no" id="no">
</div>
</label></td>
<td> </td>
<td><div align="right"><strong>Entry No.</strong></div></td>
<%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
<td><input type="text" value="<%=hdrcode.get(3)%>" size="10"></td>
<%}else{%>
<td><input type="text" name="entryno" id="entryno" value="<%=entryNo%>"/></td>
<%}%>
<div align="right"></div>
</tr>
<tr>
<td><b>Division</b></td>
<%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
<td><input type="text" value="<%=hdrdetails.get(9)%>" size="20"</td>
<td><input type="hidden" name="div1" id="div1" value='<%=hdrcode.get(10)%>'></td>
<%}else{%>
<td><input type="text" name="div" id="div" /></td>
<td><input type="hidden" name="div1" id="div1" /> </td>
<%}%>
<td> </td>
<td> </td>
<td><div align="right"><strong>Unit</strong></div></td>
<%if(oper!=null && oper.equals("view") && hdrcode!=null && hdrdetails!=null){%>
<td><input type="text" value="<%=hdrdetails.get(14)%>" size="20"</td>
<td><input type="hidden" name="uni" id="uni" value='<%=hdrcode.get(12)%>'></td>
<%}else{%>
<td><input type="text" name="unit" id="unit" /></td>
<td><input type="hidden" name="uni" id="uni" /> </td>
<%}%>
</tr>
<tr>
</html>
Any suggestion on any above works is highly appreciated.
Thanks and regards
harshalToo much code. It's also not well intented nor formatted. I don't see a question either or it got lost in that heap of unformatted code.
I will only answer the question in the thread's subject:
How to retrieve multiple data from table and represent it in jsp pageTo retrieve, make use of HttpServletRequest#getParameterValues() and/or #getParameter().
To display, make use of JSTL's c:forEach. -
Need to find the Difference between two table
Hello ,
I have stucked in program as below scenario:-
I have two tables of huge data of same structure in a same schema.I need to find the difference exact values in tables.
By using MINUS we can find the difference between two table ,i need to find the what exact difference in the there values with colunm and value at that column.
Example TableA
Col1 col2 col3 col4 col5.... col50
10 ABC 2001 EE 444 TT
40 XYZ 3002 RR 445 TT3
80 DEF 6005 YY 446 YY8
TableB
Col1 col2 col3 col4 col5.... col50
10 ABC 2001 EE 444 TT
40 XYZ 3002 RR 445 TT3
81 DEF 6005 Yu 447 YY8
I need to the out put like this :-
The Diffence between two table is
TableA.COL1=80 TableB.Col1=81, Different
TableA.Col4=YY TableB.col4=Yu,Different
TableA.Col5=446TableB.col5=447,Different
Please suggest me to write the pl/sql program for the same
thanx in advance
KKThanx friends for all your efforts
I have a sample code for the same,this will compare the two tables for single row in each table .
what r the modification needed for the multiple rows of values in the two tables??
Please suggest!!
CREATE OR REPLACE PROCEDURE test_compare
IS
TYPE t_col
IS
TABLE OF VARCHAR2 (30)
INDEX BY PLS_INTEGER;
l_col t_col;
j NUMBER := 0;
l_sql VARCHAR2 (2000);
col1 VARCHAR2 (30);
col2 VARCHAR2 (30);
val1 NUMBER;
val2 NUMBER;
status VARCHAR2 (30);
CURSOR c1
IS
SELECT column_id, column_name
FROM all_tab_columns
WHERE table_name = 'TEST1';
BEGIN
FOR i IN c1
LOOP
j := j + 1;
l_col (j) := i.column_name;
END LOOP;
FOR k IN 1 .. j
LOOP
l_sql :=
'SELECT '
|| ''''
|| l_col (k)
|| ''''
|| ', '
|| 'TEST2.'
|| l_col (k)
|| ', '
|| ''''
|| l_col (k)
|| ''''
|| ', '
|| 'TEST1.'
|| l_col (k )
|| ', '
|| 'DECODE(TEST2.'
|| l_col (k)
|| ' -TEST1.'
|| l_col (k)
|| ', 0, ''NO CHANGE'', ''CHANGED'') FROM TEST2, TEST1';
EXECUTE IMMEDIATE l_sql INTO col1, val1,col2, val2, status;
IF status = 'CHANGED'
THEN
DBMS_OUTPUT.put_line( 'TEST2.'
|| col1
|| '='
|| val1
|| ', TEST1.'
|| col2
|| '='
|| val2
|| ', '
|| status);
END IF;
END LOOP;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Error:- ' || SQLERRM);
END;
/
Maybe you are looking for
-
Hi i have wriiten a update rule routine. in that routine i am fetching comp code ,GL Acct. from SKB1 table and match those records wth Data Package records. Data Package has both Open and Closed items. so i need to match the Comp Code and GL Account
-
How can I get the tablename from a known ViewObject?
I have created an entity and it's default viewobject in the BC4J business components package,and I have built a applictionmodule containing an instance of the viewobject. Now I can use the instance's name to visit the viewobject or the entity in Jdev
-
Outlook Contacts do not sort correctly under iCloud
I have recently started mucking around with iCloud (after the unfortunate discontinuation of MobileMe...). I use MS Outlook 2007 on my PC (Windows 7 64-bit) for my Contacts, Calendar & Tasks. Untill recently, I was syncing my Outlook Contacts & Cale
-
Urgent!! cant download file to motorola
hai there I have develop a wml site and i can access it from mobiles except motorola. As i click the link to download it is showing that no content found but i check the content in the specified location ant it is there. and it can be downloaded usin
-
Mail message viewer displays wrong message
Here's a strange one, started a couple of days ago: for most new messages, when I select the message in the upper pane, the message displayed in the viewing pane is not the one I selected. For example: a new message comes in from Joe, I click on it,