Asking help for INSERT, DELETE, UPDATE, SELECT
I have to build a program that is like a bridge from the dabase hsqldb and the final user.
So the user has the options of SERCH, EDIT, INSERT or DELETE a register/field/row whatever.
Remember that the values are entered by the user, so I don't know the field to be edited, deleted, etc...
I would thank a lot if you could put some code to do all these operations.
But please, if you won't post the codes please don't post nothing else.
I need the example codes!
Thanks if you can give me a hand.
I Just need to understand what's wrong with my code:
// call this when user presses insert button...
public void insertRegister() {
String title = "Inserting new register...";
String tempId = JOptionPane.showInputDialog(null, "Enter ID Client:", title, 3);
int id = Integer.parseInt(tempId);
String name = JOptionPane.showInputDialog(null, "Enter name Client:", title, 3);
String tel = JOptionPane.showInputDialog(null, "Enter tel Client:", title, 3);
try {
// Setting up the PreparedStatement
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO CLIENTS (id_client, name_client, tel_client) VALUES(?,?,?)");
// Now we insert the real values for PreparedStatement and execute it!
preparedStatement.setInt(1, id);
preparedStatement.setString(2, name.toUpperCase());
preparedStatement.setString(3, tel);
preparedStatement.executeUpdate();
catch(SQLException s) { s.printStackTrace(); }
// call this when user presses delete button...
public void deleteRegister() {
try {
// Setting up the PreparedStatement
PreparedStatement preparedStatement = connection.prepareStatement("DELETE FROM CLIENTS WHERE id_client = ?");
String tempId = JOptionPane.showInputDialog(null, "Enter ID Client to be deleted:", "Deleting register...", 3);
int id = Integer.parseInt(tempId);
preparedStatement.setInt(1, id);
preparedStatement.executeUpdate();
catch(SQLException s) { s.printStackTrace(); }
// Of couse I don't want anyone coding for me...
// But if I'm not asking too much, just please someone tell me what's wrong with my code, and how to fix it. That's all.
Similar Messages
-
Stored proecedure tutorial for insert, delete, update,select
I want to integrate the stored procedure in my project
i am using jsp,
any one suggest me, stored proecedure tutorial for insert, delete, update,select
thanx.Whether you are using JSP or not should not affect your decision (though I would recommend checking out the MVC pattern, and recommend against doing data access code from your JSP's).
You simply need one tutorial on how to invoke a stored procedure. The stored procedure you write can have INSERT, SELECT, UPDATE, DELETE, whatever. You simply have to master the concepts involved in java.sql.CallableStatement. (And then you can get more fancy with vendor-specific extensions).
However, I am a bit confused. You want a tutorial on stored procedures, but then you indicate very normal DML statements like INSERT, UPDATE and DELETE. All of these (queries, DML and stored procedures) fall under the general umberella of JDBC. So, it is always a good place to start with a plain ole JDBC tutorial.
java.sun.com/docs/books/tutorial/jdbc/index.html
www.onjava.com/pub/a/onjava/2003/08/13/stored_procedures.html
- Saish -
Asking help for insert anydataset(CLOB type) into anydataset col please.
I am using anydataset as a column type. after referring to the demo anydset.sql:
can run then following correctly:
declare
as1 Sys.AnyDataSet;
at1 Sys.AnyType ;
cl1 clob ;
begin
Sys.AnyDataSet.BeginCreate(DBMS_TYPES.TYPECODE_CLOB,at1,as1);
for i in 1..2 loop
as1.AddInstance();
cl1 := to_clob(rpad('Clob',i*10,'Clob')) ;
as1.SetClob(cl1) ;
end loop ;
as1.EndCreate();
--anydataset_display_value(as1);
end ;
while if just added one sql to update the cell value to as1 as following:
declare
as1 Sys.AnyDataSet;
at1 Sys.AnyType ;
cl1 clob ;
begin
Sys.AnyDataSet.BeginCreate(DBMS_TYPES.TYPECODE_CLOB,at1,as1);
for i in 1..2 loop
as1.AddInstance();
cl1 := to_clob(rpad('Clob',i*10,'Clob')) ;
as1.SetClob(cl1) ;
end loop ;
as1.EndCreate();
--anydataset_display_value(as1);
update dumatmp.tbad set colanydataset1 = as1 where id = 0;
end ;
I got :
ERROR at line 1:
ORA-22370: incorrect usage of method AnyData Insert
ORA-06512: at line 14
why? I know that we did not support embedded LOBs in anydata, is it the same for anydataset and documented?
Thanks a lot, hope can got response asap, happy Christmas!Also, you should always close your resources in finally blocks. So not this:
try {
st.executeUpdate(query);
st.close();
} catch (SQLException ex) {
Logger.getLogger(Parqueadero.class.getName()).log(Level.SEVERE, null, ex);
}because if executeUpdate throws an exception, the close() method is not called. Do this instead:
try {
st.executeUpdate(query);
} catch (SQLException ex) {
Logger.getLogger(Parqueadero.class.getName()).log(Level.SEVERE, null, ex);
} finally {
st.close();
}That way the close method is always called no matter what happens.
I'm also a bit confused by a method which closes a resource which it didn't create. The general rule of thumb is that if you (some piece of code) create a resource, you should also close it. But your statement object is being created by a static method from some other class. For all I know that could be getting a statement from a "statement pool" of some kind and you shouldn't be closing it in this method.
Of course there are plenty of exceptions to that rule of thumb, but I'm not convinced that this code is one of them.
And it is completely normal for new programmers to finish a project and then immediately want to improve it by rewriting and redesigning. And that's not limited to new programmers, either. Management advice of the form "Be prepared to throw away the first version" dates back at least to the 1970's. However, you should beware of the "second system effect" which is described in [The Mythical Man-Month|http://en.wikipedia.org/wiki/The_Mythical_Man-Month]. -
ORA-01456 : may not perform insert/delete/update operation
When I use following stored procedure with crystal reports, following error occurs.
ORA-01456 : may not perform insert/delete/update operation inside a READ ONLY transaction
Kindly help me on this, please.
My stored procedure is as under:-
create or replace
PROCEDURE PROC_FIFO
(CV IN OUT TB_DATA.CV_TYPE,FDATE1 DATE, FDATE2 DATE,
MSHOLD_CODE IN NUMBER,SHARE_ACCNO IN VARCHAR)
IS
--DECLARE VARIABLES
V_QTY NUMBER(10):=0;
V_RATE NUMBER(10,2):=0;
V_AMOUNT NUMBER(12,2):=0;
V_DATE DATE:=NULL;
--DECLARE CURSORS
CURSOR P1 IS
SELECT *
FROM FIFO
WHERE SHARE_TYPE IN ('P','B','R')
ORDER BY VOUCHER_DATE,
CASE WHEN SHARE_TYPE='P' THEN 1
ELSE
CASE WHEN SHARE_TYPE='R' THEN 2
ELSE
CASE WHEN SHARE_TYPE='B' THEN 3
END
END
END,
TRANS_NO;
RECP P1%ROWTYPE;
CURSOR S1 IS
SELECT * FROM FIFO
WHERE SHARE_TYPE='S'
AND TRANS_COST IS NULL
ORDER BY VOUCHER_DATE,TRANS_NO;
RECS S1%ROWTYPE;
--BEGIN QUERIES
BEGIN
DELETE FROM FIFO;
--OPENING BALANCES
INSERT INTO FIFO
VOUCHER_NO,VOUCHER_TYPE,VOUCHER_DATE,TRANS_QTY,TRANS_AMT,TRANS_RATE,
SHOLD_CODE,SHARE_TYPE,ACC_NO,SHARE_CODE,TRANS_NO)
SELECT TO_CHAR(FDATE1,'YYYYMM')||'001' VOUCHER_NO,'OP' VOUCHER_TYPE,
FDATE1-1 VOUCHER_DATE,
SUM(
CASE WHEN
--((SHARE_TYPE ='S' AND DTAG='Y')
SHARE_TYPE IN ('P','B','R','S') THEN
TRANS_QTY
ELSE
0
END
) TRANS_QTY,
SUM(TRANS_AMT),
NVL(CASE WHEN SUM(TRANS_AMT)<>0
AND
SUM
CASE WHEN SHARE_TYPE IN ('P','B','R','S') THEN
TRANS_QTY
ELSE
0
END
)<>0 THEN
SUM(TRANS_AMT)/
SUM
CASE WHEN SHARE_TYPE IN ('P','B','R','S') THEN
TRANS_QTY
ELSE
0
END
) END,0) TRANS_RATE,
MSHOLD_CODE SHOLD_CODE,'P' SHARE_TYPE,SHARE_ACCNO ACC_NO,
SHARE_CODE,0 TRANS_NO
FROM TRANS
WHERE ACC_NO=SHARE_ACCNO
AND SHOLD_CODE= MSHOLD_CODE
AND VOUCHER_DATE<FDATE1
--AND
--(SHARE_TYPE='S' AND DTAG='Y')
--OR SHARE_TYPE IN ('P','R','B'))
group by TO_CHAR(FDATE1,'YYYYMM')||'001', MSHOLD_CODE,SHARE_ACCNO, SHARE_CODE;
COMMIT;
--TRANSACTIONS BETWEEND DATES
INSERT INTO FIFO
TRANS_NO,VOUCHER_NO,VOUCHER_TYPE,
VOUCHER_DATE,TRANS_QTY,
TRANS_RATE,TRANS_AMT,SHOLD_CODE,SHARE_CODE,ACC_NO,
DTAG,TRANS_COST,SHARE_TYPE
SELECT TRANS_NO,VOUCHER_NO,VOUCHER_TYPE,
VOUCHER_DATE,TRANS_QTY,
CASE WHEN SHARE_TYPE='S' THEN
NVL(TRANS_RATE-COMM_PER_SHARE,0)
ELSE
NVL(TRANS_RATE+COMM_PER_SHARE,0)
END
,TRANS_AMT,SHOLD_CODE,SHARE_CODE,ACC_NO,
DTAG,NULL TRANS_COST,SHARE_TYPE
FROM TRANS
WHERE ACC_NO=SHARE_ACCNO
AND SHOLD_CODE= MSHOLD_CODE
AND VOUCHER_DATE BETWEEN FDATE1 AND FDATE2
AND
((SHARE_TYPE='S' AND DTAG='Y')
OR SHARE_TYPE IN ('P','R','B'));
COMMIT;
--PURCHASE CURSOR
IF P1%ISOPEN THEN
CLOSE P1;
END IF;
OPEN P1;
LOOP
FETCH P1 INTO RECP;
V_QTY:=RECP.TRANS_QTY;
V_RATE:=RECP.TRANS_RATE;
V_DATE:=RECP.VOUCHER_DATE;
dbms_output.put_line('V_RATE OPENING:'||V_RATE);
dbms_output.put_line('OP.QTY2:'||V_QTY);
EXIT WHEN P1%NOTFOUND;
--SALES CURSOR
IF S1%ISOPEN THEN
CLOSE S1;
END IF;
OPEN S1;
LOOP
FETCH S1 INTO RECS;
EXIT WHEN S1%NOTFOUND;
dbms_output.put_line('OP.QTY:'||V_QTY);
dbms_output.put_line('SOLD:'||RECS.TRANS_QTY);
dbms_output.put_line('TRANS_NO:'||RECS.TRANS_NO);
dbms_output.put_line('TRANS_NO:'||RECS.TRANS_NO);
IF ABS(RECS.TRANS_QTY)<=V_QTY
AND V_QTY<>0
AND RECS.TRANS_COST IS NULL THEN
--IF RECS.TRANS_COST IS NULL THEN
--dbms_output.put_line('SOLD:'||RECS.TRANS_QTY);
--dbms_output.put_line('BAL1:'||V_QTY);
UPDATE FIFO
SET TRANS_COST=V_RATE,
PUR_DATE=V_DATE
WHERE TRANS_NO=RECS.TRANS_NO
AND TRANS_COST IS NULL;
COMMIT;
dbms_output.put_line('UPDATE TRANS_NO:'||RECS.TRANS_NO);
dbms_output.put_line('OP.QTY:'||V_QTY);
dbms_output.put_line('SOLD:'||RECS.TRANS_QTY);
dbms_output.put_line('TRANS_NO:'||RECS.TRANS_NO);
dbms_output.put_line('BAL2:'||TO_CHAR(RECS.TRANS_QTY+V_QTY));
END IF;
IF ABS(RECS.TRANS_QTY)>ABS(V_QTY)
AND V_QTY<>0 AND RECS.TRANS_COST IS NULL THEN
UPDATE FIFO
SET
TRANS_QTY=-V_QTY,
TRANS_COST=V_RATE,
TRANS_AMT=ROUND(V_QTY*V_RATE,2),
PUR_DATE=V_DATE
WHERE TRANS_NO=RECS.TRANS_NO;
--AND TRANS_COST IS NULL;
COMMIT;
dbms_output.put_line('UPDATING 100000:'||TO_CHAR(V_QTY));
dbms_output.put_line('UPDATING 100000 TRANS_NO:'||TO_CHAR(RECS.TRANS_NO));
INSERT INTO FIFO
TRANS_NO,VOUCHER_NO,VOUCHER_TYPE,
VOUCHER_DATE,TRANS_QTY,
TRANS_RATE,TRANS_AMT,SHOLD_CODE,SHARE_CODE,ACC_NO,
DTAG,TRANS_COST,SHARE_TYPE,PUR_DATE
VALUES
MCL.NEXTVAL,RECS.VOUCHER_NO,RECS.VOUCHER_TYPE,
RECS.VOUCHER_DATE,RECS.TRANS_QTY+V_QTY,
RECS.TRANS_RATE,(RECS.TRANS_QTY+V_QTY)*RECS.TRANS_RATE,RECS.SHOLD_CODE,
RECS.SHARE_CODE,RECS.ACC_NO,
RECS.DTAG,NULL,'S',V_DATE
dbms_output.put_line('INSERTED RECS.QTY:'||TO_CHAR(RECS.TRANS_QTY));
dbms_output.put_line('INSERTED QTY:'||TO_CHAR(RECS.TRANS_QTY+V_QTY));
dbms_output.put_line('INSERTED V_QTY:'||TO_CHAR(V_QTY));
dbms_output.put_line('INSERTED RATE:'||TO_CHAR(V_RATE));
COMMIT;
V_QTY:=0;
V_RATE:=0;
EXIT;
END IF;
IF V_QTY>0 THEN
V_QTY:=V_QTY+RECS.TRANS_QTY;
ELSE
V_QTY:=0;
V_RATE:=0;
EXIT;
END IF;
--dbms_output.put_line('BAL3:'||V_QTY);
END LOOP;
V_QTY:=0;
V_RATE:=0;
END LOOP;
CLOSE S1;
CLOSE P1;
OPEN CV FOR
SELECT TRANS_NO,VOUCHER_NO,VOUCHER_TYPE,
VOUCHER_DATE,TRANS_QTY,
TRANS_RATE,TRANS_AMT,SHOLD_CODE,B.SHARE_CODE,B.ACC_NO,
DTAG,TRANS_COST,SHARE_TYPE, B.SHARE_NAME,A.PUR_DATE
FROM FIFO A, SHARES B
WHERE A.SHARE_CODE=B.SHARE_CODE
--AND A.SHARE_TYPE IS NOT NULL
ORDER BY VOUCHER_DATE,SHARE_TYPE,TRANS_NO;
END PROC_FIFO;
Thanks and Regards,
LuqmanCopy from TODOEXPERTOS.COM
Problem Description
When running a RAM build you get the following error as seen in the RAM build
log file:
14:52:50 2> Updating warehouse tables with build information...
Process Terminated In Error:
[Oracle][ODBC][Ora]ORA-01456: may not perform insert/delete/update operation inside a READ ONLY transaction
(SIGENG02) ([Oracle][ODBC][Ora]ORA-01456: may not perform insert/delete/update operation inside a READ ONLY transaction
) Please contact the administrator of your Oracle Express Server application.
Solution Description
Here are the following suggestions to try out:
1. You may want to use oci instead of odbc for your RAM build, provided you
are running an Oracle database. This is setup through the RAA (relational access
administrator) maintenance procedure.
Also make sure your tnsnames.ora file is setup correctly in either net80/admin
or network/admin directory, to point to the correct instance of Oracle.
2. Commit or rollback the current transaction, then retry running your
RAM build. Seems like one or more of your lookup or fact tables have a
read-only lock on them. This occurs if you modify or add some records to your
lookup or fact tables but forget to issue a commit or rollback. You need to do
this through SQL+.
3. You may need to check what permissions has been given to the relational user.
The error could be a permissions issue.
You must give 'connect' permission or roll to the RAM/relational user. You may
also try giving 'dba' and 'resource' priviliges/roll to this user as a test. Inorder to
keep it simple, make sure all your lookup, fact and wh_ tables are created on
a single new tablespace. Create a new user with the above privileges as the
owner of the tablespace, as well as the owner of the lookup, fact and wh_
tables, inorder to see if this is a permissions issue.
In this particular case, the problem was resolved by using oci instead of odbc,
as explained in suggestion# 1. -
How do I insert/Delete/Update a row to the DB Table from Business Component Browser
I am using the wizard and created a project containing Business component which contain some table.
When I run the project I could see "Oracle Business Component Browser(local)" and when I select some table from "View Object Member" I get a window displaying all the field of that table and I could browse all the info.
My Problem is when I try to insert a new record/Delete the existing record or update some record it never gets reflected to the DataBase.
When I try to insert a new row I did save and there was a dialog box displayed saying "Transaction ID is 1". But finally It's not reflected in the Database.
Can some one guide me how can I do insert/delete/update operation from Oracle Component Business Browser so that the changes reflect to the Original DataBase.
Thanks in advance
JitendraJitendra,
This may be a problem of caching. If you do an update,insert, or delete, and do not receive an error, then the transaction should indeed be posted.
I assume you are hitting the Save icon after your changes if you are getting a transaction ID. Are you checking for the updates through another session (i.e. SQL*Plus), or do you then requery the View Object in the tester? Do you exit the tester and come back in and not see the changes? -
Single Page Spry Tabbed Insert - Delete - Update
Hi Guys
I like to make a page with three Spry Tabs.
* Using ( PHP - Mysql )
* Example ( Table of "Users" Fields ID, Name, Age )
( First Tab )
List of all people with navigation dividing table by ten rows
each time.
On each row Delete & Update This person.
When Clicked on Delete [ Delete This Person and update the
list ]
When clicked on Update [ Go to third tab and update this
exact person ]
( Second Tab )
Insert new person to Mysql
( Third Tab )
Update the person who was send here to be updated from tab
one
Can I have all list - Insert - Delete - Update in one page
under different Spry Tabs? How can I send these info from one tap
to another. How should I go about this?It was never possible to have more than one of those
behaviours on a page
using the standard behaviours in previous versions. You
always had to write
your own scripts.
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"Sanj" <[email protected]> wrote in message
news:enjulr$qma$[email protected]..
> Hi,
>
> Prior to Dreamweaver 8.02 it was possible to have more
than 1
> Insert/delete/update however this is no longer the case
- is there a way
> around this?
>
> Thanks!
>
> Sanj
> -
Help me in creating a Trigger for Insert and Update Options
Hi
Please help me in creating a Trigger .
My requirement is that after insert or update on a Table , i want to fire an event .
I have started this way ,but doesn't know how to fully implement this .
say i have a dept table
CREATE TRIGGER DepartmentTrigger
AFTER INSERT ON Dept
BEGIN
INSERT INTO mytable VALUES("123","Kiran");
END DepartmentTrigger;
Please tell me how can i put the Update option also .
Thanks in advance .Please tell me how can i put the Update option also .Add "Or Update". ;-)
Here are a few suggestions, but you definitely need to refer to the manual page that the previous poster suggested.
CREATE OR REPLACE TRIGGER DepartmentTrigger
AFTER INSERT Or Update ON Dept
BEGIN
INSERT INTO mytable VALUES(:new.Dept,'DEPT ADDED OR CHANGED');
END DepartmentTrigger;
The "Or Replace" means you can replace the trigger while you're developing without having to type in a drop statement every time. Just change and rerun your script, over and over until you get it right.
Adding "Or Update" or "Or Delete" makes the trigger fire for those events too. Note, you may want seperate triggers in different scripts and with different names for each event. You have to decide if your design really does the same thing whether it's an insert or an update.
:new.Dept is how you would refer to the changed vale of the Dept column (:old.Dept is the prior value). I changed the double quotes on the string in the VALUES clause to single quotes.
Andy -
HGrid inserting deleting updating Requirement
Hi All,
the following is the statement from OAF Dev Guide....
Consider using a HGrid instead of a Tree when you want your users to either:
* Manipulate the objects in the hierarchy (add, delete, move, reorder, etc.). Note that in certain cases,*
you may want your users to navigate from a Tree to a HGrid to perform these actions. This is done by
providing a button that switches to an "update" or "edit" mode, which displays a HGrid instead of a
Tree.
I have a requirement to create/insert/delete/read the data at 3 levels..
Parent Level
--------Child Level
--------------------Sub Child Level
can you please suggest the approach to meet this requirement.
Regards
SridharFor insert it's easy:
CREATE TRIGGER [HumanResources].[tr_HumanResources_AfterInsert]
ON [AdventureWorks2012].[HumanResources].[Department]
AFTER INSERT
AS
BEGIN
SET NOCOUNT ON;
Insert INTO AdventureWorks2012_new.HumanResources.Department
(DepartmentID, Name, GroupName, ModifiedDate)
SELECT DepartmentID, Name, GroupName, ModifiedDate
FROM Inserted;
END
I didn't verify column names, so you may need to make sure to use correct column names for that table.
Setting replication is a bit advanced topic although BOL is clear and you may start here
http://technet.microsoft.com/en-us/library/ms151198.aspx
If it will be complicated for you, you can ask extra questions in the MSDN Replication forum.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles -
Icons for Insert/Delete Pages to Adobe Acrobat Pro 9.
I want to add icons for Insert Pages and Delete Pages so that I have quicker access than clicking on the Document option or the Navigation Panel. Used to have this on my old version of Adobe, but it was recently updated at work and I can't figure out how to put them back.
Hi Eggy72,
If I understand correctly, you want to customize the toolbars in Acrobat 9 to include the Insert Pages and Delete Pages options?
If so, please see Show and Hide Toolbar Elements in chapter 2 of the Acrobat 9 Help: http://help.adobe.com/archive/en_US/acrobat/9/professional/acrobat_pro_9.0_help.pdf
I hope that answers your question!
Best,
Sara -
Search help for A field in select option which doesnt have search help in c
u have table in QM which is QMFE in whihc field FECOD which doesnt have search help , but my requirement is that in select option in report to have users to see its search help, anyone there to help me
Hi sridhar loganathan,
For this goto SE11 and create a ZFECOD Search help for that field. In Defination Tab enter table name
QMFE and Enter Z_F4_FECOD_EXIT in Search help Exit.
Then create a FM in SE37 as Z_F4_FECOD_EXIT under a FG. And then write code as follows for example:
FUNCTION Z_F4_REG_EXIT.
""Local Interface:
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCR_TAB_T
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" VALUE(SHLP) TYPE SHLP_DESCR_T
*" VALUE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
TYPES: begin of ty_code,
dam_code type QMFE-FECOD ,
end of ty_code.
DATA : tw_code type ty_code,
ta_code type table of ty_code.
IF "callcontrol-step <> 'SELONE' AND
callcontrol-step <> 'SELECT' AND
callcontrol-step <> 'DISP'.
EXIT.
ENDIF.
IF callcontrol-step = 'SELECT'.
CALL FUNCTION 'F4UT_PARAMETER_ALLOCATE'
EXPORTING
PARAMETER = 'FECOD'
TABLES
SHLP_TAB = shlp_tab
RECORD_TAB = record_tab
CHANGING
SHLP = shlp
CALLCONTROL = callcontrol
EXCEPTIONS
OTHERS = 3.
ENDIF.
IF callcontrol-step = 'DISP'.
Get the Region
CALL FUNCTION 'F4UT_PARAMETER_VALUE_GET'
EXPORTING
PARAMETER = 'FECOD'
FIELDNAME = 'FECOD'
TABLES
SHLP_TAB = shlp_tab
RECORD_TAB = record_tab
RESULTS_TAB = ta_code
CHANGING
SHLP = shlp
CALLCONTROL = callcontrol
EXCEPTIONS
PARAMETER_UNKNOWN = 1
OTHERS = 2.
IF SY-SUBRC = 0.
SORT TA_CODE BY DAM_CODE.
Deleting duplicate damage codes in Internal Table ta_code
DELETE ADJACENT DUPLICATES FROM TA_CODE COMPARING DAM_CODE.
Passing changed Internal table to FM
CALL FUNCTION 'F4UT_PARAMETER_RESULTS_PUT'
EXPORTING
PARAMETER = 'REGION'
FIELDNAME = 'REGION'
TABLES
SHLP_TAB = shlp_tab
RECORD_TAB = record_tab
SOURCE_TAB = ta_code
CHANGING
SHLP = shlp
CALLCONTROL = callcontrol
EXCEPTIONS
PARAMETER_UNKNOWN = 1
OTHERS = 2.
ENDIF.
ENDIF.
ENDFUNCTION.
Revert me for any clarifications.
Regards,
Suneel G. -
Need help for record deletion from custom table
Hi friends
I have to write a custom program which will be generic to delete any table record with date field.
This program needs to be generic (should be able to delete records from any custom table) in nature with selection screen parameters as:
Table Name and Number of Days prior to which records are deleted, both mandatory.
Program Flow:
1. From number of days calculate date before which records are deleted, ( current date u2013 no. of days = past date).
2. Custom table have date field, delete records prior to that date.
3. Program may be scheduled for background job, put default values for both fields. No. of days should not be less than 60.
4. Classical Report output with number of records deleted.
My query is how will I know the name of the Date field so that I can write a DELETE query.
If I use 'DDIF_FIELDINFO_GET' it gives me all field names but how to filter out?
with regards
samikhyaHi
I have added field on the selection screen as p_fieldname and got the F4 help for it , so that the user will get the field name run time as per the table name.
Now I am facing problem while writing the DELETE query.
I wrote like
DELETE (fp_tab)
where (fp_fieldname) LE date
It is not working. I also tried with taking a string to concatenate fp_fieldname, LE and date to l_string
when I write like this:
DELETE (fp_tab)
where (l_string) , sy-subrc is getting 4 and no records are getting deleted.
I do not understand where the dynamic Delete is failing??
with reagards
Samikhya -
UserExit - In CO02 - For insert & delete component
In CO02 --> component overview (F6).
I want to restrict the users to add or delete the components.
I tried to search the user exit in Report - SAPLCOKO1 but unable to reach.
Can you help me on it?Hi Check these user exits
PPCO0009 Enhancement in goods movements for prod. process order
PPCO0010 Enhancement in make-to-order production - Unit of measure
PPCO0012 Production Order: Display/Change Order Header Data
PPCO0013 Change priorities of selection crit. for batch determination
PPCO0015 Additional check for document links from BOMs
PPCO0016 Additional check for document links from master data
PPCO0017 Additional check for online processing of document links
PPCO0018 Check for changes to production order header
PPCO0019 Checks for changes to order operations
PPCO0021 Release Control for Automatic Batch Determination
PPCO0022 Determination of Production Memo
PPCO0023 Checks Changes to Order Components
PPCO0008 Enhancement in the adding and changing of components
STATTEXT Modification exit for formatting status text lines
CCOWB001 Customer exit for modifying menu entries
COIB0001 Customer Exit for As-Built Assignment Tool
COZF0001 Change purchase req. for externally processed operation
COZF0002 Change purchase req. for externally procured component
PPCO0001 Application development: PP orders
PPCO0002 Check exit for setting delete mark / deletion indicator
PPCO0003 Check exit for order changes from sales order
PPCO0004 Sort and processing exit: Mass processing orders
PPCO0005 Storage location/backflushing when order is created
PPCO0006 Enhancement to specify defaults for fields in order header
PPCO0007 Exit when saving production order -
Insert,delete,update in oracle Rac11g2
hi all.
i am using oracle grid 11g R2,oracle database 11g R2 and oracle Linux Enterprise 5.5.
i tried to use insert,update and delete in oracle Rac but wihout commit iit did not delete,update and insert in Node2.
plz can anyone help me that how to insert,delete and update without issuing commit in node1 and perform the action
on node2 as well?
KellyHi Kelly,
Now I get it, but unfortunately there is no way to do it. TAF can allow only session failover, or query failover (a running query will continue in the other node). But anyway, there is no way to failover a transaction. The transaction will be rolled back automatically (no question or any other option) and the session will get an error. However, the session will be connected to the other node and can continue working or retry the operation.
HTH
Liron -
Default values for Insert and Update
What is the best way to default the current sysdate for a date column on a table when doing an insert or update through a form? And related to this, what is the best way to default the current user (APP_USER) for a varchar2 column when doing an insert or update through a form?
For these columns, I want to display them on a report, but they should be hidden on the form because I would like to have the app default the values to sysdate and APP_USER. However, when I have tried to use the table default values in "user interface defaults" and using either :APP_USER or &APP_USER or SYSDATE, it only shows this literal value on the form (item is not hidden while I debug this). It does not show the actual value I'd want, such as "user1". Does this make sense?
Thanks for your help.
-ReidI think triggers are the best device.
Scott -
Creating a search help for a field in selection screen
Hi All,
There are 3 fields in the selection screen. They are
WERKS
DATE
MATNR
Enter a value WERKS = 2465.
When I press the drop down menu for MATNR, it should only give the material number available for 2465.
I think, I should create a search help for it.
Kindly help me to create a search help for the material number based on the above condition.
Thanks in advance.Hi
i am sending you a sample code where i had implemented a search help
for my req you can understand very easyly and write for ur req
<b>reward if usefull for ur req</b>
TYPES : BEGIN OF ST_OBJID_SH,
OTYPE TYPE HRP1000-OTYPE,
OBJID TYPE HRP1000-OBJID,
END OF ST_OBJID_SH.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_OBJID-LOW.
IF S_OBJID IS NOT INITIAL.
SELECT OTYPE OBJID FROM HRP1000
INTO TABLE IT_OBJID_SH
WHERE OTYPE = 'D'.
IF SY-SUBRC EQ 0.
SEARCH HELP FOR QUALIFICATION.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'OBJID'
PVALKEY = ' '
DYNPPROG = SY-REPID
DYNPNR = SY-DYNNR
DYNPROFIELD = 'S_OBJID'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = IT_OBJID_SH
FIELD_TAB =
RETURN_TAB = RETURN_TAB
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
Maybe you are looking for
-
Can't share TV shows with Intel based Macs
I have an iMac G5 that I'm using as a media server. I also have a Mac Mini that's hooked up to my LCD TV. I want to use the Mac Mini to view TV shows I've downloaded through iTunes, that are on the iMac, thru Front Row. However, most of the time Fron
-
Trying to find the number of rows in a ResultSet
I am trying to find the number of rows in a ResultSet, using the following code: rs = st.executeQuery(query); rs.last(); // to move the cursor to the last row System.out.println(rs.getRow()); However, I am getting this error: java.sql.SQLException: [
-
How to Display Multiple Rows in Business Logic Editor
Hi Friends, I took the standard BAPI: BAPI_MATERIAL_GETLIST and followed the SAP- xMII documentation. It is not showing any records. Does any one have good example. Please let me know. If I run the same BAPI from R3 system, it is showing 7 records.
-
In FlashBuilder 4, Data/Services dialog, right click on a Data Type node in the tree, click on "Configure Return Type" you get a dialog titled: "No operation selected" And the text reads: Currently no operation in selected in the view Please select a
-
Installation's annoying leftover
After reinstalling Photoshop, Illustrator and InDesign (CS, CS2, CS5) on a Win XP machine, I am left with an annoying blemish: startup ends with opening the \Program Files\Adobe\Adobe directory with a single listing \AdobePatchFiles subdirectory.