Updating column in table using forms...
Well guyz i had my presentation of the application today..every thing went fine ....but still they wanna add more features i.e wanna gift this application to various PM working in the company on various project ....initailly i was told that u gotta create this application for just our project now they are using my work to give it to other PMsss :( and take all the credit with no ackowledgement for me n u people who helped me a lot in building this application.... ... well they want me to create an application where in they can modify certain columns......i.e over write the existing value present in a column with a new value....
Now suppose i have col1,col2 in table paymast how should i proceed to create trigger for when i press the button the form gets updated for the particular employee number(i mean if enter the respective info for the particular emp as soon as i press the button the old values shud b replaced by new values..
One method that i noe is use DB wizard to create the form n then enter the value for in respective fields for the column to be updated n then press the F6 ......i dont wanna use this function...
i wanna update the application by pressing the button
cheers :)
Edited by: Suhail Faraaz on Nov 15, 2009 12:26 AM
Edited by: Suhail Faraaz on Nov 15, 2009 12:29 AM
Edited by: Suhail Faraaz on Nov 15, 2009 12:30 AM
Edited by: Suhail Faraaz on Nov 15, 2009 2:05 AM
hi
Examples:
SELECT TXNID INTO :TXNID FROM SAF
WHERE
NEXT_ATTEMPT=(SELECT MIN(NEXT_ATTEMPT)
FROM SAF
WHERE STATUS!='A' AND NEXT_ATTEMPT<=SYSDATE AND ATTEMPTS<10)
AND
STATUS!='A' AND ATTEMPTS<10 AND
ROWNUM=1 FOR UPDATE;
//processing==success
UPDATE SAF SET ATTEMPTS=ATTEMPTS+1, NEXT_ATTEMPT=NEXT_ATTEMPT+(10/(24*60*60))
WHERE TXNID=:TXNID;
commit;
else
rollback;
Create trigger trigg_name
After update of C on A
For each row
Is
declare
Pragma Autonomous_transaction;
New_val varchar2(27);
Begin
New_val := :new.C;
Dbms_output.put_line(New_val) ;
/* this outputs the new value when
evoking an update statement on Table A (Column C) */
If updating then
update A set D=:new.C where C=:old.C;
/* After compiling the trigger and evoking
an update statement on Table A (Column C)
the D column still not being updated */
Commit;
End;
update t1
Set t1.C1 = (Select t2.c1
From t2
Where t1.c3 = t2.c3),
t1.C2 = (Select t2.c2
From t2
Where t1.c3 = t2.c3)
update t2
Set t2.C1 = (Select t1.c1
From t1
Where t1.c3 = t2.c3),
t2.C2 = (Select t1.c2
From t1
Where t1.c3 = t2.c3)Its Correct/Helpful Please mark it.Thanks.
sarah
Similar Messages
-
How to find the columns and tables used in a stored procedure?
Hi,
Can someone suggest how to find the columns and tables used within a stored procedure?
Thanks
VBKFor example:
SQL> create or replace
2 procedure p1
3 is
4 cnt number;
5 begin
6 select count(*) into cnt from emp;
7 end;
8 /
Procedure created.
SQL> select referenced_owner,
2 referenced_name
3 from dba_dependencies
4 where owner = 'SCOTT'
5 and name = 'P1'
6 and referenced_type = 'TABLE'
7 /
REFERENCED_OWNER REFERENCED_NAME
SCOTT EMP
SQL> SY. -
I want to update the Custom table using the data available in ITAB.
Hi,
I want to updaste the Custom Table which is created by me (Ztable) using the data available in itab.(which i got from defferent standard tables)
I want to update the custom table using the itab data How is it possible?
Is any possible by using Modify ?
DPK.example here
modifying datbase table useing internal table
advises before updating this datbase table plz lock that table to avoid incosistency
write the logic for modifying
Modify the database table as per new dunning procedure
MODIFY fkkvkp FROM TABLE lt_fkkvkp .
and finally unlock the table
example
*To lock table for further operations
constants: lc_tabname TYPE rstable-tabname VALUE 'FKKVKP' . "FKKVKP
CALL FUNCTION 'ENQUEUE_E_TABLE'
EXPORTING
tabname = lc_tabname
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc EQ 0.
To fetch all the contract accounts for customers of the segment
Households/SME.
PERFORM fetch_contract_accounts using lc_tabname .
ENDIF. " IF sy-subrc EQ 0.
*wrote the logic
Modify the database table as per new dunning procedure from internal table
MODIFY fkkvkp FROM TABLE lt_fkkvkp .
*unlock the tbale
CALL FUNCTION 'DEQUEUE_E_TABLE'
EXPORTING
TABNAME = uc_tabname . -
Is it possible to insert tables using Form Central?
Is it possible to insert tables using Form Central?
Unfortuately Formscentral does not support tables at this time.
Andrew -
Updating A z table using sap xi
Hi,
I am new sap XI would like to update a z table using
sap xi.The dataset is a flat file as test exercise.Can
anyone tell me how to go about it .Hi Deepak,
You can also go for abap proxies (server)
http://help.sap.com/saphelp_nw04/helpdata/en/86/58cd3b11571962e10000000a11402f/frameset.htm
Hope it will be helpful.
Regards
Suraj -
How to point at a word table using forms Ole and Word Document
Hello.
I like to know how to position at a word table and send data from a forms module using ole. I have done something similar before using bookmarks.It's easy and it works. My requirement now is to send data from a forms module to a word document, but this time, the word document will have bookmarks and a word table needs to be filled from data from the database. Just don't know how to get , access, reference the word table from forms.
I'm still using forms6i in C/S mode.
Help will be greatly appreciated ...!.
Best regards, Luis ...!Hi Luis,
The VBA code for updating the cell found at row three, column two of the first table, of the active document is as follows:
ActiveDocument.Tables(1).Cell(3,2).Select
Selection.TypeText("Hello, world!")I haven't time to convert it to OLE2, but hopefully it will at least give you an idea.
Eric Adamson
Lansing, Michigan -
How do i update a db table using one JSP page
I created a JSP Form page and I want to update a db table when the user hit submit. Please help my job depends on it Send me small code example below is what I have (very new to JSP)
<%@ page language="java" import="java.sql.*" import="java.io.*" %>
<html>
<head><title>accessing database</title></head>
<body bgcolor="white">
<% Connection con =null;
try {
// Load Driver Class File
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//Make a connection to Data table
con = DriverManager.getConnection("jdbc:odbc:SportsbookTables", "developer", "developer");
Statement statement =con.createStatement();
String SQL = new String("INSERT INTO tblLines (gameID,leagueType) VALUES (5,'gam')");
statement.executeUpdate(SQL);
statement.executeUpdate("INSERT INTO tblLines (gameID,leagueType) VALUES (6,'lea')");
%>
<table border=1 cellspacing=1 cellpadding=1>
<form method="POST">
<p><font color="#800000" size="5">Enter your name:</font><input name="leagueType" size="4"></p>
<p><input type="submit" value="Submit"></p>
</form>
<%
catch (IOException ioe)
out.println("IO Exception:");
out.println(ioe.getMessage());
catch (SQLException sqle)
out.println("SQL Exception:");
out.println(sqle.getMessage());
catch (ClassNotFoundException cnfe)
out.println("Class Not Found Exception:");
out.println(cnfe.getMessage());
catch (Exception e)
out.println("General Exception:");
out.println(e.getMessage());
finally {
try
if (con!=null) {
con.close();
catch(SQLException sqle)
out.println(sqle.getMessage());
%>
</table>
</Body>
</HTML>First I would remove all the JDBC code you have in the JSP and place it in a servlet (or other Java) class, and have your form action call the servlet on submission. Then use the servlet API to extract the form data from the request and pass it to the JDBC in the servlet to update the DB. Once complete have it branch to another JSP/HTML to let the user know if they were successful or not.
Take a look at some of the online tutorials as they will be helpful with regards to code examples.
Depending on the size of your project, and deadlines naturally, you may also want to have a look at an MVC architecture and custom tags like Struts from Apache. These can make your job a lot eaiser. -
Update columns in Table A based on columns in Table B for more than 500K rows
Guys,
I need to update 9 columns in table A based on value from table B for for more than 500K rows.
So what is best way to achieve this. I am thinking of writing a Procedure with cursor to update the rows of table A.
When i googled about it, they say cursor will decrease the performance. So i have no clue how to go for this.
Rough code which i though
1) Procedure with no parameter
2) Will declare 9 variable to store value from cursor
3) cursor will fetch row by row based on join condition between table a and table b
4) i will pass column values from table B to variables
5) will make an update statement for table A
Please let me know if above method is correct or is there any other way to do this without using cursor.Guys,
Below is the rough code i wrote as per my requirement. Does it look correct? As of now i dont have any platform to test it so any help with the below code is highly appreciated. As i said i need to update more than 500K rows by matching Table
A and Table B. One more thing which i would like to add in below code, is to get log of all the rows that are in table B but not exist in table A. Table A already has more than million data in it.
Also not sure how the loop in below code willl run when @rowcount is become to zero?
Please let me know if i need to consider performance related impact while running the script.
GO
SET SERVEROUTPUT ON
CREATE PROCEDURE ONETIMEUPDATE
DECLARE @cnt INT;
SET @cnt = 1;
DECLARE @MSG varchar(255);
DECLARE @COUNT_VAR INT;
SET @COUNT_VAR=0;
WHILE @cnt > 0
BEGIN
Update TOP (50000) A
Set A.Col1=B.Col1,
A.COL2=B.COL2,
A.COL3=B.COL3,
A.COL4=B.COL4,
A.COL5=B.COL5,
A.COL6=B.COL6,
A.COL7=B.COL7
From TableA A
Inner Join TableB B
on A.ID = B.ID--ID
WHERE A.Col1 <> B.Col1
OR A.Col2 <> B.Col2;
SET @cnt = @@ROWCOUNT;
IF @@ROWCOUNT=25000
@COUNT_VAR=@COUNT_VAR + @@ROWCOUNT
SELECT @MSG = CONVERT(varchar, @COUNT_VAR) + "Rows Updated" -- I WANT TO DISPLAY UPDATE after EVERY 25000 ROWS
PRINT @MSG
IF @@ROWCOUNT=0
BEGIN
COMMIT
END
WAITFOR DELAY '00:00:01' --wait for a second before the next update
END;
END; -
Need to update column in table from joining the two tables
Hi
i want to update a table by joining two table but i m getting the below error
single row subquery returns more than one value.
i m using following query
update table2
set deposite_date=(select a.deposit_date from table1 a,table2 b
where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
table2
ban due_date cy_start_date deposite_date
100 5/6/2011 22/05/2011
101 7/11/2011 22/05/2011
102 5/25/2011 22/05/2011
table1
ban deposit_date
100 04/12/2011
100 04/15/2011
102 03/25/2011
101 04/26/2011
101 05/06/2011
101 07/26/2011
can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_date
ThanksHi,
Welcome to the forum!
876466 wrote:
Hi
i want to update a table by joining two table but i m getting the below error
single row subquery returns more than one value.Exactly!
( SELECT a.deposit_date
FROM ...returns all deposit_dates.
( SELECT MAX (a.deposit_date)
FROM ...would return only the latest one.
Also, you need to correlate the sub-query to the main query, so that it only looks for rows with the same ban.
i m using following query
update table2
set deposite_date=(select a.deposit_date from table1 a,table2 b
where a.ban=b.ban and (a.deposit_date between b.cy_start_date and b.due_date))
table2
ban due_date cy_start_date deposite_date
100 5/6/2011 22/05/2011
101 7/11/2011 22/05/2011
102 5/25/2011 22/05/2011
table1
ban deposit_date
100 04/12/2011
100 04/15/2011
102 03/25/2011
101 04/26/2011
101 05/06/2011
101 07/26/2011
can i insert latest deposit_date from table1 which lies between b.cy_start_date and b.due_datePerhaps you need something like this:
UPDATE table2 b
SET deposit_date =
( SELECT MAX (a.deposit_date)
FROM table1 a
WHERE a.ban = b.ban
AND a.deposit_date BETWEEN b.cy_start_date
AND b.due_date
;Notice that table1 is the only table in the FROM clause of the sub-query, but the sub-query is correlated to table2, so we can reference columns from table2 in the sub-query.
Whenever you have a problem, post CREATE TABLE and INSERT statements for your sample data.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
Always say which version of Oracle you're using.
Edited by: Frank Kulash on Aug 1, 2011 1:58 PM -
Create database table using Forms Developer 6/6i without using SQL*Plus
hello there,
I need help in creating tables in Oracle using Forms Developer 6/6i without using SQL*Plus interface.
your help is appreciated
email: [email protected]please use Forms_ddl package to create a table dynamically
from the Developer6/6i.
you can check the success or failure by using the
form_success builtin.
if u want to avoid using the Forms_ddl package
use stored procedure or create a sql querry record group.
regards
sriram. -
Create database table using Forms Developer 6/6i
Happy New Year everyone,
I hope your New Year is a happy one.
Listen, I am trying to create tables in Forme Builders without using SQL*Plus but it won't create the table in the database because I believe that the table it is created as a control block not as a data block.
Can someone help me on this my email is [email protected] your help is appreciated.I'm not sure I understand your question.
If you want to create a table in the database, you need to use the Database Objects node. If you do it in the block node, then you are creating a block in the Form, not a table in the database.
Regards,
Robin Zimmermann
Forms Product Management -
Updation of S tables using LIS
Hi Experts,
Can any how tell me the procedure of updating the S-tables through LIS..
Thanks in Advanceneed to create program and Configure it
-
How to Upload a PDF file into BLOB column in a table using Forms 9i
Can anyone tell me how to upload a PDF file from client system using File dialog window and store its content in BLOB column in a table. The file to be uploaded will be in client side.
Hi,
please, search a bit on the forum before do a question:
Just searching by "upload blob pdf" ...
How to batch upload PDF files into database BLOB
Regards,
Jose. -
How to Upload a PDF file into BLOB column in a table using Forms 6i
Can anyone tell me how to upload a PDF file from client and store its content in BLOB column in a table. The file will be genered using reports and win be stored in db.The file to be uploaded will be in client side.
Thank´s.If you are using version 9 or 10 use webutil.... Look in webutil.pll.
Use either one these two fuctions...
FUNCTION Client_To_DB( clientFile in VARCHAR2,
tableName in VARCHAR2,
columnName in VARCHAR2,
whereClause in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN;
FUNCTION Client_To_DB_With_Progress
( clientFile in VARCHAR2,
tableName in VARCHAR2,
columnName in VARCHAR2,
whereClause in VARCHAR2,
progressTitle in VARCHAR2,
progressSubTitle in VARCHAR2,
asynchronous in BOOLEAN default FALSE,
callbackTrigger in VARCHAR2 default NULL) return BOOLEAN; -
Updating an existing table using Create Table As
I want to update a table, because the schema has changed..
Example:
create table a (a number(2), b varchar(2) NOT NULL);
insert into a values (22, 'JA');
Suppose i want to ad a column c number(3) between a and b, and i want to increase datalength of b to 3,
the i perform the following
create table a_temp as (select a, cast(0 as number(3)) c, cast(b as varchar(3)) b from a);
drop table a;
rename a_temp to a;
But now all columns allow null... I want the last column to be NOT NULL!
How do i do this (within the statement)?
Then another question, the statement:
RENAME a_temp to a;
does not allow the owner name in it,
but how does it know which table it has to rename?
Cant you rename a table for another owner?
Is it true that owner==tablespace?
Thanks in advanceYou may find this article helpful:
http://www.dizwell.com/prod/node/63
It uses the online table redefinition capability to partition a table which previously wasn't partitioned. It's exactly the same principle adding a column, changing constraints, renaming columns, making columns longer and so on.
You might also find this article useful:
http://www.dizwell.com/prod/node/64
It discusses the issues surrounding renaming a table, including how I can rename your tables.
Generally, you might want to poke around the articles link at www.dizwell.com if you are in a learning sort of mood.
No, it's not true that owner=tablespace. A tablespace is a logical way of thinking of a set of physical data files. Those files can contain anything (index, cluster, table, materialized view) owned by anyone who happens to have the rights to store things there. Therefore, the tablespace representation of those files also contains lots of objects owned by lots of users.
The only relationship between an owner and a tablespace is that when I create you as a user, I state which tablespace will be used to store your objects **by default** -but that default can always be over-ridden, provided that you have been granted rights (that is, space quotas) on other tablespaces.
Maybe you are looking for
-
Need help with ipod to Computer transfer
-
Safari can't download file when trying to download movies
Safari responds with "safari can't download file' when I use download app to download movies . I don't have issues downloading apps or searching net. Would be grateful for assistance.
-
My Fonts change when opening an InDesign CS4 file with InDesign CS6
I've been experiencing strange behaviour when opening a InDesign CS4 file file with InDesign CS6: the kerning and spacing is all off: Original file: opened in InDesign CS6: Is this a conversion error? Is there a setting/pref I've got wrong?
-
Student license CreativeCloud, after recently buying student CS5.5
March 2012 i bought a stundent license cs 5.5.. Is it possible to upgrade or go to student Creative Cloud due to the fact i already bought a license this year ? Greetings, Armand_EDU_88 - Zuyd University
-
Kik isn't working help !!!
since yesterday my kik isnt orking good, I cant send message and can't see the message my friends send to me, please help me