Relation between record in a form and insert statement written in button
hi all,
i am using Forms [32 Bit] Version 6.0.8.24.1 (Production).
i have a master detail form with relation
A is master of B, B is master of C and a button which resides on control block(other than A,B,C).
so i will insert a one record into the block 'A' and i will press button which will insert particular record into particular table.
so when i try to move to next record('A' block) it is asking for database change. when i give 'yes' everything is ok. but when i give 'no'(w.r.t that record) and moves to next record and inserts the record and insert record throguh button also, at this time user press 'yes' then the first record is not saving but what ever i have inserted through the insert statement is not rolling back.
How can i control insert statement with the respect to datablock change in the block.
The block 'C' data is going to the other table through insert statement the block 'C' i am posting. So due to 'post' the block is not getting cleared so insert statement is also firing.
In other words i want to unpost the posted data when user press 'no' in the database message.
I know there is nothing to do with the forms message. But is its possible to control when user press 'no' then the insert statement should not gets saved into the table.
Please help.
Thanks..
Edited by: GD on Jun 27, 2011 5:38 AM
First off, you need to understand how Oracle Forms interacts with an Oracle database. Forms natively handles all DML transactions for you. Meaning, if you have a Forms data block based on a database table, Forms will generate all the necessary DML to handle any changes that occur in that block. You do not need to write your own DML statements in code.
so i will insert a one record into the block 'A' and i will press button which will insert particular record into particular table.Is Block "A" based on a table? How are you inserting the record into the table? If you are writting your own DML to insert the record this would explain why you are being prompted to save when you change records. As I mentioned, if your block is based on a table, Forms will know if you change a value within the block.
How can i control insert statement with the respect to datablock change in the block.If your blocks are based on tables, let Forms handle the DML! don't do it yourself.
In other words i want to unpost the posted data when user press 'no' in the database messageIf your block is based on a table, when you are prompted to save changes - answering 'NO' will automatically clear the current record of the data block (in essence - rollback the change).
Craig...
Similar Messages
-
Delete record from the form and from the database
hi,
i want delete record from the form and the database ,but the record is only delete from the from !!!
this is my code :
if //condition then
delete_record;
commit;
end if ;
Any solutions ??
thnxYou have unique key field(s) on the table you are trying to insert which actually restricts you from inserting the same value again.
When you are deleting the record and issue commit there is a record to be inserted in the table which is a duplicate that's why you are getting this unique error.
As oracle is not able to insert your commit fails and stops your deletion of record from table -
Relation between the BP on EBP and BP on ROS
Where is can i see relation between the BP on EBP and BP on ROS besides Supplier Monitor?
What's table?
I saw BP ROS number in BP on EBP (u201CVendor Datau201D tab, "Link to Backend System" view), but it disappear.Hi
For BP on EBP
Go to SE16 : Enter BUT* Press F4 ..
All the BP related tables will appear
Regards
G.Ganesh Kumar -
Relation between R3 kernel version 640 and 4.6B, C D
Hi,
What is the relation between R3 Kernel 640 version and SAP 4.6B, C, D versions. Based on R3 kernel version how to identify the sap version e.g. 4.6B, C D etc.
Thanks.
Anirudh,Hello Anirudh,
Every SAP release will have its own set of kernel releases
SAP Kernel 7.00 is valid for ECC 6.0.
SAP kernel 640 is actually valid from SAP R/3 Enterprise 4.7. it is also valid for ECC 5.0
For 4.6 C kernel release 46D is available.
For 4.6B SAP Kernel 4.6B and 4.6 C are available.
For 4.6A 4.6A,4.6B and 4.6C are available.
This is what is available in marketplace however I have heard about something called downward compatability of kernels which means lower releases can have higher kernels.
You must always go for the highest available kernel patch.
However kernel is OS bit size specific
Regards.
Ruchit. -
Help needed in forming dynamic insert statement
HI,
I am trying to construct a insert statement as given below.
Please help me as to how to form this and where am i going wrong?
i want the columns names to be auto populated when a table name is given.
output should be like:
==============
insert into tablename
col1,col2,col3..coln)
values
(col1, col2, col3..coln);
declare
v_sql varchar2(5000);
cnt number :=0;
col_count number;
name varchar2(5000);
TYPE string_assarrtype IS TABLE OF VARCHAR2 ( 25 ) INDEX BY VARCHAR2 ( 20 );
arr string_assarrtype;
BEGIN
select count(column_name) into col_count from user_tab_columns
where
table_name = 'PS_D_RE_BCSREGIONMAPPING';
v_sql:='insert into tablename (' ;
for i in 1..arr(col_count)
loop
v_sql:='v_sql' ||' '||arr(i);
DBMS_OUTPUT.PUT_lINE(v_sql);
END LOOP;
END;Below is the actual code which i am trying to write:
Since the below trigger logic is same for around 25/30 tables i wanted to construct a generic procedure which will take input parameter as tablename and auit_table and form the insert statement which will populate the column names which are different for different tables.
Please guide...
CREATE OR REPLACE PROCEDURE make_trigger( tablename in VARCHAR2,
auditable in VARCHAR2
AS
v_sql varchar(10000);
begin
v_sql := 'DROP TRIGGER TRD_D_AUDIT_D'||tablename;
dbms_output.put_line (v_sql );
v_sql:='CREATE OR REPLACE TRIGGER TRG_D_AUDIT_D_'||tablename||' '||
'BEFORE INSERT OR UPDATE OR DELETE ON 'tablename||' '||' REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW';
dbms_output.put_line (v_sql );
v_sql:= 'DISABLE
DECLARE
v_Operator psoprdefn.oprid%type;
v_Sysdate Date;
v_Actn varchar2(1);
V_AUDIT_RECNAME PSRECDEFN.RECNAME%type;
BEGIN';
dbms_output.put_line (v_sql );
v_sql:= 'If (Inserting) Then
v_Actn :='||'''||'A'||'''||';'||
'Insert into '||auditable||'
('||
AUDIT_RECNAME,
AUDIT_ACTN,
AUDIT_OPRID,
AUDIT_STAMP,
D_USER_GROUP,
D_GROUP_DESC,
D_BCS_ID,
D_UBR_ID,
D_FILTER_ID,
D_NAME_ACCESS_TYPE,
D_GLOBAL_EMP_LIST
Values
V_AUDIT_RECNAME,
v_Actn,
v_Operator,
v_Sysdate,
:NEW.D_USER_GROUP,
:NEW.D_GROUP_DESC,
:NEW.D_BCS_ID,
:NEW.D_UBR_ID,
:NEW.D_FILTER_ID,
:NEW.D_NAME_ACCESS_TYPE,
:NEW.D_GLOBAL_EMP_LIST
end if;
end;Edited by: user11942774 on Oct 5, 2012 11:46 AM
Edited by: user11942774 on Oct 5, 2012 8:09 PM
Edited by: user11942774 on Oct 5, 2012 8:10 PM -
Use of the "updlock" hint with update and insert statements
I have inherited some stored procedures and am trying to figure out why the developers decided to use the "updlock" hint on many of the update and insert statements. I have looked around everywhere and have found only one explanation of why "update...with
(updlock)" can be useful, namely when a table has no clustered index:
http://www.sqlnotes.info/2012/10/10/update-with-updlock/ I have found nothing yet that mentions why "insert into...with (updlock)" might be used. I understand why the hint
might be useful on select statements in some cases, but if all of the tables have clustered indexes, is there any good reason to use it on update and insert statements?
Thanks,
Ron
Ron RiceThis form of deadlock error can occur on a table which has a clustered index.
If you are doing updates on a table which has a clustered index and that table also has a nonclustered index and the nonclustered index is used to find the row to update you can see this type of deadlock. For example create a table with a clustered
primary key index and a nonclustered index by running
Create Table Foo(PK int primary key identity, OtherKey varchar(10), OtherData int);
go
Insert Foo Default Values;
go 10000
Update Foo Set OtherKey = 'C' + Cast(PK As varchar(10))
Create Unique Index FooIdx On Foo(OtherKey);
That creates a table with 10000 rows, a clustered index and a nonclustered index. Then run
Begin Transaction
Update Foo Set OtherData = 1 Where OtherKey = 'C5'
That will use the FooIdx index to find the row that needs to be updated. It will get a U lock on the index row in the FooIdx index, then an X lock on the row in the clustered index, update that row, then free the U lock on FooIdx, but keep the X lock
on the row in the clustered index. (There is other locking going on, but to simplify things, I'm only showing the locks that lead to the deadlock).
Then in another window, run
Begin Transaction
Update Foo Set OtherData = 2 Where OtherKey = 'C5'
This will get a U lock on the index row in the FooIdx index, then try to get an X lock on the row in the clustered index. But that row is already exclusively locked, so this second window will wait holding a U lock on FooIdx row and is waiting for
an X lock on the clustered index row.
Now go back to the first window and run
Update Foo Set OtherData = 3 Where OtherKey = 'C5'
This will once again try to get the U lock on the FooIdx row, but it is blocked by the U lock the second window holds. Of course the second window is blocked by the X lock on the clustered index row and you have a deadlock.
All that said, I certainly do not routinely code my updates with UPDLOCK. I try to design databases and write code so that deadlocks will be rare without holding excessive locks. The more locks you hold and the longer you hold them, the more
blocking you will get and the slower your system will run. So I write code that if a deadlock exception occurs, it is properly handled. Then if too many deadlocks occur, that is the time to go back to the code to see what changes are needed to
decrease the number of deadlocks (one way to do that may be to get locks earlier and/or hold them longer.
But I wouldn't worry much about this form of deadlock. It is, in my experience, vary rare. I don't recall ever seeing it in a production environment.
Tom -
Represinting my data and relations between records in a diagram not by the hierarchic
hi all ,
if there is a group of people in one table and the other table contains another group of people, and there is a relation between those groups, how to create a form or a report representing diagram for this relation. This diagram should be dynamic, when we change in the records of these people.
Which tool can I use instad of "creating a hierarchical tree" ?
Is there anyone who could help me? My email address is
[email protected]
or [email protected]Check out Graphics Builder, which you can incorporate into forms.
-
Represinting my data and relations between records in diagram " not by the hierarchic
hi all ,
if there is a group of people in one table and the other table contains another group of people, and there is a relation between those groups, how to create a form or a report representing diagram for this relation. This diagram should be dynamic, when we change in the records of these people.
Which tool can I use instad of "creating a hierarchical tree" ?
Is there anyone who could help me? My email address is
[email protected]
or [email protected]Check out Graphics Builder, which you can incorporate into forms.
-
Scan through the records in the Form and display the message!
Hello Everyone,
We have a requirement, I do not know how to achieve it.
In a Forms 6i, 2 fields Type, Comment.
Type is a list of Values (1,2,3)
Comment - Free Text Field.
User can enter as much rows of data, but while user saves the data we have to validate that all the records of Same Type(Say 1). If not we have to display a Message.
So how to achieve this? How to scan through the records in the Form. Any comments on it would be great.
Thanks.User can enter as much rows of data, but while user saves the data we have to validate that all the records of Same Type(Say 1). If not we have to display a Message.I am assuming that you want to check from the first record. Suppose in first record the user coosed 1 and you will check for all the entries for 1.
Couple of ways to do this.
1. While user is entering first record. You can keep that selected type value in GLOBAL variable and while he is entering further records you can match type with that global variable. If it is not matching then you can display message.
2. On KEY-COMMIT trigger you can start loop from first record and can check for all the records one by one. Like.
DECLARE
vVal DATATYPE;
BEGIN
GO_BLOCK('BLOCK_NAME');
FIRST_RECORD;
vVal:=:FORM_TYPE_FIELD;
LOOP
IF vVal!=:FORM_TYPE_FIELD THEN
MESSAGE(..);
EXIT;
END IF;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
NEXT_RECORD;
END LOOP;
END;I would go for earlier approach and will use WHEN-VALIDATE-ITEM / PRE-INSERT for type field for this purpose. Because in KEY-COMMIT the system is doing same thing again.
-Ammad
Edited by: Ammad Ahmed on May 15, 2010 12:23 AM
changes not equal sign to != -
Select records from one database and insert it into another database
Hi
I need to write a statement to select records from one database which is on machine 1 and insert these records on a table in another database which is on machine 2. Following is what I did:
1. I created the following script on machine 2
sqlplus remedy_intf/test@sptd @load_hrdata.sql
2. I created the following sql statements in file called load_hrdata.sql:
rem This script will perform the following steps
rem 1. Delete previous HR data/table to start w/ clean import tables
rem 2. Create database link to HR database, and
rem 3. Create User Data import table taking info from HR
rem 4. Drop HRP link before exiting
SET COPYCOMMIT 100
delete from remedy.remedy_feed;
commit;
COPY FROM nav/donnelley@hrp -
INSERT INTO remedy.remedy_feed -
(EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR) -
USING SELECT EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR -
FROM ps_rrd_intf_medium -
where empl_status IN ('A', 'L', 'P', 'S', 'X')
COMMIT;
EXIT;
However, whenever I run the statement I keep getting the following error:
SP2-0498: missing parenthetical column list or USING keyword
Do you have any suggestions on how I can fix this or what am I doing wrong?
Thanks
AliThis doesn't seem to relate to Adobe Reader. Please let us know the product you are using so we may redirect you or refer to the list of forums at http://forums.adobe.com/
-
Relations between SAP AII, ONS, PML and Savant???
The EPCGlobal provides a standard EPC-Network containing the EPC-Code and infrastruture-components like the RFID-Tag and -Reader, the ONS-Server, the PML-Server and a RFID-Middleware called Savant.
On the one hand I found a couple of articles where the SAP Auto-Id Infrastructure (SAP AII) is said to be a "RFID-Middleware". On the other hand I found a lot of presentation sheets with illustrations of the SAP AII architecture where the SAP AII is connected to Savant by the device controller and to the ONS/PML Servers by SAP XI.
Can anybody inform me about the relationship between the SAP AII, the ONS/PML Servers and Savant? Is the SAP AII a substitute for Savant? Which component of the SAP Auto-ID Infrastructure asks the ONS-Server for the URL to a PML Server where further information about an object which is identified by the EPC code are located? Are product information stored on a PML-Server anyway? Or are information only stored in the ERP-Backendsystem?
Thank you for your reply.hi.Dirk
1)SAP AII is a "RFID-Middleware", but mostly it is a RFID Middleware for business process. It focus on business more than RFID readers. So it is not a RFID Reader manager(Device connector, or something like that)
2)Savant is a specification or a product release by EPC global. You can download the savant specification on EPC global .
http://www.epcglobalinc.org/about/AutoID_Archive/documents/6_auto_id_savant-1_0.pdf
Savant is also a product, many company IBM, SUN make their RFID Middleware follow the EPC savant specification. And also EPC has a RFID-Middleware call savant.
Savant is design to manager RFID readers, filter RFID tag information, and log events.
3)The relation between AII and savant is they are on the diferrent layer of RFID Middleware, they should be work together.
4)ONS is another EPC RFID issue, it is design to record RFID tag data. On EPC's idea, all the data about RFID tag should be record on ONS server. I do not know if it will come true in the future.
5) On SAP solution, Most of the data is still stored in SAP backend-system(R3,SCM,BW......), and information about RFID, e.g. RFID tag, RFID device, tag event is stored in SAP AII. And you can use BW in AII, if mass data is generated.
6) PML is just a RFID XML.
Regards
Sheng -
Relation between Sales Organization, Sales Office and Sales Group in SAP
Hi!
I want to know the relation between Sales Organization( VAKPA -VKORG), Sales Office( VAKPA-VKBUR) and Sales Group ( VAKPA-VKGRP) in SAP.
Relation in the sense, does One-to-One or One-to-Many relation exist between them..or do they form an hierarchy??
ThanksSales Org---->sales office: 1:N (routed through sales area i.e sales organization,distribution channel and division)
each sales office belongs to only one sales org.
each sales office may consists, many sales groups:
Sales office to Sales Group: 1:N (each sales group belongs to only one sales office- sales group means group of people)
Thanks
Chidambaram -
How to receive parameters from a form and insert values in db using servlet
Hi friends,
My first question here.
I'm trying to create a Servlet that takes input from a form and process it and insert it in database.tablename.
My MAIN ISSUE IS WITH THE NUMBER OF COLUMNS THAT WOULD BE DYNAMIC AND THUS CANT RECEIVE THE PARAMETERS IN STATIC CODE.
Here is the form code
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<form action="Test" method="post" />
<table width="90%" border="1" cellspacing="1" cellpadding="1">
<tr>
<th scope="col">Student Name</th>
<th scope="col">RollNo</th>
<th scope="col">Java</th>
<th scope="col">J2ee</th>
</tr>
<tr>
<td><input type="text" name="studentname" /></td>
<td><input type="text" name="rollno" /></td>
<td><input type="text" name="java" /></td>
<td><input type="text" name="j2ee" /></td>
</tr>
<tr>
<td><input type="text" name="studentname" /></td>
<td><input type="text" name="rollno" /></td>
<td><input type="text" name="java" /></td>
<td><input type="text" name="j2ee" /></td>
</tr>
<tr>
<td><input type="text" name="studentname" /></td>
<td><input type="text" name="rollno" /></td>
<td><input type="text" name="java" /></td>
<td><input type="text" name="j2ee" /></td>
</tr>
</table>
<input type ="submit" value="insert values in the database now"/>
</form>
</html>
And here is the Servlet
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
import java.io.*;
public class Test extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String title = "Module: Process Result Values from previous page";
out.println("<html>\n" +
"<head><title>" + title + "</title></head>\n" +
"<body>");
try
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/","root", "root");
Statement s = con.createStatement();
ResultSet res = s.executeQuery("SELECT * FROM dbname.tablename");
ResultSetMetaData rmeta=res.getMetaData();
int noofcolumns=rmeta.getColumnCount();
if(!con.isClosed())
catch(Exception e)
System.out.println("Exception"+e);
out.println(e);
if(connectionFlag==1)
out.println("</body></html>");
doGet(request, response);
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
This is the basic code structure and I'm trying to figure out this special case with handling the multiple parameters:
1. I dont' want to use String []a=request.getParameterValues("studentname"); as hard code. The reason being the number of rows will be diyamic and I would like to get the column name and then then use an array of string to take values. But how can I connect these to form a query so that the rows goes on inserted one after other.
Thanks,
MashallThank you for your help.
I'm something close to it but this segment of code throws a NullPointerException Error. I counted number of rows and columns using the methods getColumnCount() and getColumnName(i).
ResultSetMetaData md = res.getMetaData(); //Get meta data for the resultset
int noofcolumns=md.getColumnCount();
out.println("<br />Number of columns in table (including name and roll number) :::: "+noofcolumns+"<br />");
for(int i=1;i<=noofcolumns;i++) // access column 1....n
String columnname = md.getColumnName(i); // get name of column 1....n
out.println("<br />Current column name ::: "+columnname+"<br />"); //check if the name appear correct.
String []columndata = request.getParameterValues(columnname); //Get raw value in array
for(int j=1;j<=rows;j++) // here rows is number of rows in each column
out.println("To be inserted: <b>"+columndata[j]+"</b> in Row ::: "+j+"<br />");
//The line above thows null pointer exception.
} -
Is there a relation between the Engineering Change Management and MM
Hi SAP MM Gurus,
Is there a relation between Engineering Change Management and Materials Management? I know we get the versions changes updated in Material Master. But do not know where is the origin for ECM. Step by step configuration is appreciable.
Thanking in Advance.
with regards
Ravi BabuHi ,
I have created an application and have created end users also who will be using this application. For each of these users i have to give access to application in such a way that they will be able to see only their area a work. So how do i do this ..this needs to done based on the login user_name..my question now is how or from where will i get the current session details like user_name, current session id ,current session date and time?
Thanks in advance,
Bhargavi -
Relation between QuickTime 7.1.1 and AirPort problems
I've read a few thread talking of relations between
the last QuickTime 7.1.1 update and problems with AirPort
in one way or the opposite.
As this looked quite hard to explain I thoroughly checked
the QuickTime 7.1.1 update package and I can tell everyone for
sure:
it doesn't include a bit that could interfere with the
AirPort driver or software
You could double check it for yourself with the following
steps:<pre>
1. within "Software Update...", select "QuickTime 7.1.1"
and select "Update > Download Only"
2. in a Terminal or xterm window, type the following
commands:
my_mac$ cd /Library/Packages/QuickTime711.pkg/Contents
my_mac$ gzcat Archive.pax.gz | pax | egrep -i 'air|802'
my_mac$ cd Resources
my_mac$ egrep -i 'air|802' cleanup-list InstallationCheck
my_mac$</pre>
Then, if your AirPort was "apparently" broken or repaired
just after the QuickTime 7.1.1 update, this was simply
due to the restart of your system.
danIf you've got quicktime pro working with 7.1.3, count yourself lucky considering all the reports about 7.1.5 problems. I was about to download QT Pro when I started reading the reviews. Most of them were bad. Is it working for you with 7.1.3, especially on creating media files? Do you use it with Final Cut Pro? I'd appreciate your feedback.
Maybe you are looking for
-
Why is BT incompetent and unable to resolve a simp...
This has been an on-going issue with BT for a number of months in which BT has made multiple failing and I am now beginning to lose patience. The issue began when I moved house and took my BT services with me. During the house move I requested that t
-
HT201320 How can you figure out the password for college email providers?
I'm trying to configure my mail account. I want to use my college email but I don't know the provider password. How can I find that out?
-
I have a FLA that has a call to my remote server. When I select Debug Movie I always get the error dialog box that says that the Flash player has stopped a potentially unsafe operation and that it is trying to communicate with an internet location, t
-
Iphone wifi connection problem
I just bought an Iphone and when it attempts a wifi connection It asks for a password to my network which I have totally forgotten. When I tried to access the setup site (192.168.1.1) a dialog box popped up with the following message "A username and
-
Currency rate in purchase order
Hi, I have a case. In standard system foreign currency rate in PO is calculated based on purchase order date. System takes last actual currency rate to calculation. I need to customize it in this way that system will take to calculation currency rate