Sender JDBC.....pick data from table view?
Hi Experts,
working on JDBC for first time, so have few questions.
data base guys want to create a table view and we need to pick the data from table view.
my question is can we import the structure form data view?
if i am not able to import, so i need to create the structure same as in data base table view and is it case sensitive?
they dont want to update the data base table view, very time the SQL query will pick all the records form data base.
the records will be less then 10,000.
my question is as we are not updating the table view, what we need to write in update query as it is mandatory?
Regards,
Chinna
Hello,
i hope below option help in update query
In place of the SQL statement, you can also enter <TEST>. Once the data determined from Query SQL Statement has been successfully sent, the data in the database remains unaltered.
This is recommended if the data has not only been read, but also changed by a stored procedure entered under Query SQL Statement.
Similar Messages
-
Sending email with data from table
Hi,
I have search for many site but i didn't find any answer about this. How to send an email with a content from row of a table (I mean select a record from table and put in the email body and sent it)?
Should i give some code here?
ThanksHi,
This link has an example using utl_smtp package, [Sending email from the database with the Utl_Smtp package|http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html]. Also check this [utl_mail|http://www.psoug.org/reference/utl_mail.html]
Regards,
Edited by: Walter Fernández on Jul 14, 2009 12:29 AM - Adding other example... -
Read data from Table at XI during Mapping
Hi experts
How we can pick data from one database table during Mapping, the table is at XI system.
when we are picking data from table at R/3, we are using RFC Function Module/ BPM, can we pick data from XI database table during mapping ?
what will be the steps to pick it ?
Please Help.
Regards,
Study SAPhi Study Sap
You may use RFC lookup
kindly follow these links for RFC lookup
RFC Lookup.
Look ups.
/people/francesco.bersani/blog/2007/03/05/data-lookup-optimized
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
/people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function
Use this crazy piece for any RFC Mapping Lookups!
/people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
SAP XI Lookup API
/people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
Lookups in XI made simpler
/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
regards
Sandeep Sharma
PS if helpful kindly reward points -
Hi Experts,
Iam doing File-xi-File senario in which sender Adapter have to pick data from three different folders.How should i give the path in comunication channel,how to do this senario.
Regards,
Kumarif it is multiple directories then use <i>Advanced Selection for Source File</i> feature - http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
Else in case it is multiple files ref - http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm -
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. -
Is possible to represent data from a view in MapViewer?
I have tried to represent data from a view instead a table with the Java-Beans API but I couldn't beacause it doesn't represent any geometry referenced by the view. I think it should be implemented because is very common to use views. Are there any way to represent them in MapViewer?
Thanks.Like a table, you also need to register the view in spatial metadata (user_sdo_geom_metadata). Did you register the view and its spatial column there?
-
Why do we get the data from a view to a report.
hi
why do we get the data from a view to a report. is it possible to get the data from a view in all the cases?hi Jyotssna,
Suppose you are planning to get the data from multiple tables then you got to specify seveal condtions and make use of joins which results in poor performance in fetching the data . In order to improve the performance we make use of views where the conditions of different tables are defined and the data is fetched accordingly.
Regards,
Santosh -
Hi,
trying to update data from a view with:
- Company (table)
- Products (table)
In a form, the user wants to update
e.g: both products.product_name and Company.company_name.
Is there a way to update a view records built on 2 tables ?
Any idea will be really appreciated
ThksAn other question on INSTEAD OF Trigger:
Base Tables:
1.
SQL> desc pcs_companies;
Name Null? Type
COMPANY_ID NOT NULL NUMBER(12)
COUNTRY VARCHAR2(350)
COMPANY_NAME VARCHAR2(320)
COMPANY_PHONE VARCHAR2 (320)
COMPANY_FAX VARCHAR2(320)
COMPANY_URL VARCHAR2(150)
UPDATED_DATE DATE
2.
SQL> desc pcs_individuals;
Name Null? Type
INDIVIDUAL_ID NOT NULL NUMBER(12)
COMPANY_ID NUMBER(12)
FIRST_NAME VARCHAR2(320)
LAST_NAME VARCHAR2(320)
LOB VARCHAR2(300)
JOB_ROLE VARCHAR2(300)
TITLE VARCHAR2(300)
GENDER VARCHAR2(3)
EMAIL VARCHAR2(720)
FAX VARCHAR2(720)
PHONE_NO VARCHAR2(720)
UPDATED_DATE DATE
COUNTRY VARCHAR2(150)
ADDRESS_1 VARCHAR2(720)
ADDRESS_2 VARCHAR2(720)
ADDRESS_3 VARCHAR2(720)
CITY VARCHAR2(720)
3. pcs_individuals.COMPANY_ID = FK, ref pcs_companies.
4.
SQL> CREATE VIEW V_PCS_COMPANY_IND
AS
SELECT
i.INDIVIDUAL_ID,
c.company_id,
c.country,
c.Company_name,
c.company_phone,
i.Company_id indiv_company_id,
i.gender,
i.first_name,
i.last_name,
i.lob,
i.job_role,
i.title,
i.email_address,
i.fax,
i.phone_no ,
i.address_1,
i.address_2,
i.address_3,
i.city
FROM
pcs_individuals i,
pcs_companies c
WHERE
i.company_id = c.company_id
5.
CREATE OR REPLACE TRIGGER PCS_ADMIN.PCS_COMP_IND_UPDATE_TR
INSTEAD OF UPDATE ON PCMS_ADMIN.V_PCS_COMPANY_IND
FOR EACH ROW
begin
update PCS_COMPANIES
set
Company_name = nvl(:new.company_name,company_name),
company_phone = nvl(:new.company_phone,company_phone)
where company_id = :new.company_id;
update PCS_INDIVIDUALS
set
gender = nvl(:new.gender,gender),
first_name = nvl(:new.first_name,first_name),
last_name = nvl(:new.last_name,last_name),
lob = nvl(:new.lob,lob),
title = nvl(:new.title,title),
email_address = nvl(:new.email_address,email_address),
phone_no = nvl(:new.phone_no,phone_no),
fax = nvl(:new.fax,fax),
country = nvl(:new.country,country),
address_1 = nvl(:new.address_1,address_1),
address_2 = nvl(:new.address_2,address_2),
address_3 = nvl(:new.address_3,address_3),
city = nvl(:new.city,city)
where company_id = :new.company_id;
end PCMS_COMP_IND_UPDATE_TR;
6.
CREATE OR REPLACE TRIGGER PCS_ADMIN.NEW_COMPANY_ID_INSERT
INSTEAD OF INSERT ON PCS_ADMIN.V_PCS_COMPANY_IND
DECLARE
ID number;
BEGIN
INSERT INTO pcs_companies (org_id)
select v_pcs_comp_id_seq.nextval
into ID
from dual;
:new.company_id = ID;
INSERT INTO pcs_individuals (company_id)
select v_pcs_comp_id_seq.nextval
into ID
from dual;
:new.company_id = ID;
end;
My question
On point 6:
Assumption:
- Company_id is PK of pcs.Company and FK in pcs.individuals
- It should be feed by sequence (v_pcs_comp_id_seq)
Now how can i insert the same value for company_id (current.v_pcs_comp_id_seq) in both pcs_companies and pcs_individuals ? I've tested it in the above INSTEAD OF Trigger.It failed.
Thks for any advice,
lamine -
How Can i Read data From Maintainance View
I Want read data from Maintainance View. i written select query
SELECT *
FROM J_1yyyyV
INTO TABLE GT_BUSPLACE.
WHERE BUPLA = LV_BUPLA.
this is giving following error
"J_1yyyyV" is not defined in the ABAP Dictionary as a table,
projection view, or database view.
Can you help me Please.
Thanks in Advance.
Regards,
Raj.Hi raj,
maintainance view is a nothing but combinations of table using join on some fields..
see the relation ship between the joins..
if you want to write selection query ..go to se11 -->enter view name >and open tab>
Table/Join conditions--> see the table's involved and join conditons between tables.
and write the select query same as like the Table/Join conditions in se11..now you can acheive the
table maintainance fields..
Prabhudas -
How to retrieve data from a view.
HI,
I want to retrieve the values of the <b>Field MNTXT from the view V_T530</b>.
Please let me know how i can retrieve data from this view.The Select statement doesnt work on a view.
Regards,
BhavikaHi kumar,
By using select stattement you can fetch from view.
Here viaufkst is view.
For it is working. please check.
select (g_selfields_tab) from viaufkst
into corresponding fields of table order_itab
for all entries in order
where "(g
aufnr in order and
equnr in equip and
priok in prior and
iphas = '3' and
ilart in acttyp and
qmnum in notif and
werks = plant and
auart in ortyp and
getri in date.
please try.
with Regards, -
How to extraxct data from a view.
hi,
i'm tying to extrct data from a view vbdka, with select. but i;m getting a syntax error that it anot a DB Table or DB view, pls tell me how to extract data from that view.
thanks.hi,
just check out if u have declared the table or not n see if it is not a structure also
madhuri. -
Is it possible to retrieve the data from maintainance view?
Hi experts,
Am facing one problem.
Is it possible to retrieve the data from Maintainance View ,If yes how?
IF it is not possible then Y?
While am trying to retrieve data from maintainance view it's showing message like
"it is not a database view or table".
Can u pls give me ans.
Thanks&Regards,
Arun.Hi Arun,
It is not possible to retrieve the data from Maintenance view. Maintenance View is different and Database View is different.
Maintenance view : Maintenance view permits you to maintain the data of an application object together.The data is automatically distributed in the underlying database tables.
A standardized table maintenance transaction is provided (SM30), permitting you to maintain the data from the base tables of a maintenance view together.
In other words, Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system.
Database View: Data about an application object is often distributed on several database tables. A database view provides an application-specific view on such distributed data.A database view is automatically created in the underlying database when it is activated.Database views implement an inner join.If the database view only contains a single table, the maintenance status can be used to determine if data records can also be inserted with the view. If the database view contains more than one table, you can only read the data.
Database views should be created if want to select logically connected data from different tables simultaneously. Selection with a database view is generally faster than access to individual tables. When selecting with views, you should also ensure that there are suitable indexes on the tables contained in the view.
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa -
Problem while retrving data from a view
Hi Friends
i have a problem while retriving data from a view <b>v_t685a</b>.
the error message is :""" "V_T685A" is not defined in the ABAP Dictionary as a table, projection view or database view."""
i wrote : select single VTEXT1 from V_T685A into w_cst_jin1 where
KSCHL = 'JIN1' and
KAPPL = 'V'.
how to retrive the data.
waiting for quick response
Regards
MukeshHi
This is a Maintenance View, not a Database View
SO can't fetch data using select statement.
You can use the Table <b>T685</b> directly to fetch the condition Types data straight away instead of the view. write the same select for this table and use.
Regards
Anji
Message was edited by:
Anji Reddy Vangala -
Doubt in Fetching data from a View
Hi all,
I want a data from a view v_tvko.How to use a view in program for fetching data from that.
Please help.
Thanks in advance.
Nithin.Hi Nitin,
We can't directly refer a view to get data.
We need to refer the tables using which a view has been created.
Using those tables, we can fetch the data as per our requirement.
For suppose, if you go to a view in SE11, then click on Tables tab, there you can get the reference tables.Then you need to check for the fileld in those tables for which you require the data.
Post the query directly on the table instead of view.
Hope this will help you.
Regards,
Anand.
Maybe you are looking for
-
I believe what I must do is install a driver but I don't know where the drivers are indexed at in apple. Itunes is up to date, and I am using the USB that came with the Ipod.
-
Deleting a row from the item table
Hi All, I have a requirement where I need to put a button to delete the selected row from the item table and for this I have written the following code: DATA lo_nd_t_bseg TYPE REF TO if_wd_context_node. DATA lo_el_t_bseg TYPE REF TO if_wd_context
-
I've been trying to get drill down reporting working in a map report I've created an can't seem to get things to behave properly. So far, I've done everything I've read in several posts, but yet drill don still isn't functional. Here's what I've done
-
{Solved} any way to recover deleted user
Hi, I had comitted a terible mistake. I have deleted user with userdel (name) command and now I cannot access my home directory. Permission denied. I can access it as root, so no problem, all the files are there. But, is there any way to recover the
-
Before downloading the Adobe Reader 9 software, the web page says 33.5 MB; but, after downloading my computer says 204 MB which is confirmed. What is going on?