One item used for insert and update
I'm still trying to learn APEX and need to understand how to use an item for both update and insert. Is the LOV part used for the insert and the SOURCE for the update? I have a WHERE clause I need to use for the insert but not the update. I have to display items when updating that would not show up in the insert b/c only active things should be in the insert whereas the update can contain retired values. Also one such item needs to display its value but hold on to it's ID. Also, I am displaying items from more than one table so I'm not sure if I can say it's a Database Column. AS you can see, I'm really confused and the doc doesn't usually explain these details and is not helping me. Can someone explain how to set up such items? Thank you!
I do actually have things working (I do have insert, update and delete processes) since I copied from another app, but there are some details that are not working well. For example, I have a linked field that pulls up a record (row fetch) and 2 of the fields do not pull up the values for that row (it's a select list and that's there but it doesn't highlight the correct value). For one of them, when inserting, the LOV (I think) should only show the active values but then, when the row is fetched, it needs to show a value from the table even if it's no longer active. I'm missing something and don't know what it is.
Similar Messages
-
Can we use both INSERT and UPDATE at the same time in JDBC Receiver
Hi All,
I would like to know is it possible to use both INSERT and UPDATE at the same time in one interface because I have a requirement in which I have to perform both the task.
user send the file which contains both new and old record and I need to save those in MS SQL database.
If the record exist then use UPDATE otherwise use INSERT.
I looked on sdn but didn't find any blog which perform both the things at the same time.
Interface Requirement
FILE -
> PI -
> JDBC(INSERT & UPDATE)
I am thinking to use JDBC Lookup but not sure if it good to use for bulk record.
Can somebody please suggest me something or send me the link of any blog or anything to solve this problem.
Thanks,Hi ,
If I have understood properly the scenario properly,you are not performing insert and update together. As you posted
"If the record exist then use UPDATE otherwise use INSERT."
Thus you are performing either an insert or an update which depends on outcome of a search if the records already exist in database or not. Obviously to search the tables you need " select * from ... where ...." query. If your query returns some results you proceed with update since this means there are some old records already in database. If your query returns no rows you proceed with "insert into tablename....." since there are no old records present in database.
Now perhaps the best method to do the searching, taking a decision to insert or update, and finally insert or update operation is to be done by a stored procedure in MS SQL database. A stored procedure is a subroutine available to applications accessing a relational database system. Here the application is PI server. If you need further help on how to write and call stored procedure in MS SQL you can look into these links
http://www.daniweb.com/web-development/databases/ms-sql/threads/146829
http://www.sqlteam.com/article/stored-procedures-parameters-inserts-and-updates
[ This part you can ignore, Since its not sure that you will face this situation
Still you might face some problems while your scenario runs. Lets consider this scenario, after the stored procedure searches the database it found no rows. Thus you proceed with an insert operation. If your database table is being accessed by multiple applications (or users) other than yours then it is very well possible that after the search operation completed with a null result, an insert/update operation has been performed by some other application with the same primary key. Now when you are trying to insert another row with same primary key you get an error message like "duplicate entry not possible for same primary key value". Thus you need to be careful in this respect. MS SQL has a feature called "exclusive locks ". Look into these links for more details on the subject
http://msdn.microsoft.com/en-us/library/aa213039(v=sql.80).aspx
http://www.mssqlcity.com/Articles/Adm/SQL70Locks.htm
http://www.faqs.org/docs/ppbook/r27479.htm
http://msdn.microsoft.com/en-US/library/ms187373.aspx
http://msdn.microsoft.com/en-US/library/ms173763.aspx
http://msdn.microsoft.com/en-us/library/e7z8d5hf(v=vs.80).aspx
http://mssqlserver.wordpress.com/2006/11/08/locks-in-sql/
http://www.mollerus.net/tom/blog/2008/03/using_mssqls_nolock_for_faster_queries.html
There must be other methods to avoid this problem. But the point is you need to be sure that all access to database for insert/update operations are isolated.
regards
Anupam -
My husband's iphone4 seems to have 2 apple ids. The one listed in the featured section of the App Store is the correct one. The one that asks to be signed into for purchase and updates is also mine, and the incorrect one. Hence, our devices are linked. How can I remove my apple Id from his phone so that there is no connection between the two?
I think it may be because he got his phone first and not seeing a future issue, I set his phone up to my already existing apple Id used for my iPod. If I connect his iPhone to our pc, can I create his own apple id account?
-
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 -
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 -
Technical Monitoring one template used for production and non-production system.
Dear All,
Is there a way to have one template in Solman Technical Monitoring for production system and non-production system with different alerts ? For example if it exceeds a threshold for production system it will trigger red alert or set automatically an incident and if it's non prod system it will go to yellow warning alert ?
Regards
Lukasz GoralHi Likasz,
You first create and customize the template, and then assign to a system.
If it was selecting a system and then customizing a template, then may be such functionality makes sense.
So, I don't think that is possible.
Better would be copy the template used for production to non-production and make the adjustment to it.
Regards,
Divyanshu -
Inserting and Updating records in ORACLE using WebDynpro Java
Hi All
I got connected to oracle backend (using my previous thread), but now i want to insert and update the records
i have created views for insert and update,
Thanks in advance
SushmaHi shusma..
chk this link..
<b><u>Creating Connection</u></b>
package com.sap.xirig;
import javax.naming.*;
import javax.sql.*;
import java.sql.*;
public class DBLookup {
String Conn_Status = "Not Connected";
String Language_Desc = "Empty";
String Language_Cd = "Empty";
Connection conn;
Context ctx;
DataSource ds;
//Constructor for the DBLookup object
public DBLookup {
try {
ctx = new InitialContext();
if (ctx == null) {
throw new Exception("Boom - No Context");
// If JDBC 2.0 connection is used please create the DataSource object as below
// ds = (DataSource) ctx.lookup("jdbc/ORACLEDATASOURCE");
// If JDBC 1.0 connection is used please create the DataSource object as below
// ds = (DataSource) ctx.lookup("jdbc/notx/ORACLEDATASOURCE");
if (ds == null) {
throw new Exception("Boom - No dataSource");
catch (Exception e) {
e.printStackTrace();
public String getLanguageDesc(String v_str) {
Statement stmt = null;
ResultSet rst = null;
try {
if (ds != null) {
conn = ds.getConnection();
Conn_Status = "Could not get connection to
datasource";
if (conn != null) {
Conn_Status = "Got Connection " +
conn.toString();
stmt = conn.createStatement();
rst = stmt.executeQuery("SELECT
LANGUAGE_DESC FROM LANGUAGETRANSLATION WHERE LANGUAGE_CD='" + v_str +
if (rst.next()) {
Language_Desc = rst.getString(1);
conn.close();
catch (Exception e) {
e.printStackTrace();
finally {
if (rst != null) {
try {
rst.close();
catch (Exception e) {
e.printStackTrace();
if (stmt != null) {
try {
stmt.close();
catch (Exception e) {
e.printStackTrace();
if (conn != null) {
try {
conn.close();
catch (Exception e) {
e.printStackTrace();
return Language_Desc;
http://e-docs.bea.com/wls/docs81/oracle/API_joci.html
Hope this will help u..
URs GS -
Hi All;
I want to find out all inserts and updates of a spesific table. For instance a package l,ke that
CREATE OR REPLACE PACKAGE BODY param_test IS
PROCEDURE ins_test IS
BEGIN
insert INTO parameter_value VALUES (2);
INSERT INTO parameter_value VALUES (9);
INSERT INTO
parameter_value VALUES (4);
insert INTO parameter_value VALUES (54);
END ins_test;
END param_test;I am querying user_source view. My query is below.
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as SYS
SQL> SELECT us1.NAME, us1.line, us1.text
2 FROM user_source us1,
3 (SELECT us2.line, us2.NAME, us2.text
4 FROM user_source us2
5 WHERE regexp_like(upper(us2.text), '[[:space:]]*PARAMETER_VALUE[[:space:]]*')) us3
6 WHERE us3.line - 1 = us1.line
7 AND us1.NAME = us3.NAME
8 AND regexp_like(upper(us1.text), '[[:space:]]*(INSERT[[:space:]]*INTO|UPDATE)[[:space:]]*')
9 /
NAME LINE TEXT
PARAM_TEST 9 insert INTO parameter_value VALUES (2);
PARAM_TEST 12 INSERT INTO
SQL> My question is "Are tehre any solutions to overcome this situation?"
Kindly Regards...You might be better off combining into your attack the use of user_dependencies. This will tell you what objects e.g., code is dependent on your table and then you can search the source of those modules for inserts and updates into the table. Even then you'll never be sure, especially if dynamic SQL is used as the statement may be pieced together from various bits if strings, as then user_dependencies won't contain the reference.
-
Hey there i downloaded apps using another apple id than the one am using right now and i need to update the apps they keep asking me for the old one that i dont have any more what to do please
Apps are permanently tied to the ID used to purchase them.
Go to https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/ and re-set th password for the old one.
Then, log into the app store with it and update the apps purchased with that ID. -
Hi
how to create a external content type for Read and Update data from two tables in sqlserver using sharepoint designer 2010
i created a bcs service using centraladministration site
i have two tables in sqlserver
1)Employee
-empno
-firstname
-lastname
2)EmpDepartment
-empno
-deptno
-location
i want to just create a list to display employee details from two tables
empid firstname deptno location
and same time update in two tables
adilWhen I try to create an external content type based on a view (AdventureWorks2012.vSalesPerson) - I can display the data in an external list. When I attempt to edit it, I get an error:
External List fails when attached to a SQL view
Sorry, something went wrong
Failed to update a list item for this external list based on the Entity (External Content Type) 'SalesForce' in EntityNamespace 'http://xxxxxxxx'. Details: The query against the database caused an error.
I can edit the view in SQL Manager, so it seems strange that it fails.
Any advice would be greatly GREATLY appreciated.
Thanks,
Randy -
I have one apple ID for purchases and then my mobile me ID where I use for email. So I have set my cloud with my mobile me name, while keeping my purchases the original name. Will my purchases be recognized as purchases when backup is finished.
Welcome to the Apple community.
So long as you are logged into the iTunes Store, using the correct ID and password (settings >store), then you will always have access to your apps, books, music, TV shows etc etc bought via the iTunes Store on that account. -
I accidentally set up two accounts. One account with my old e-mail address which I've been using for years and has all of my purchases on it. Now I have a new account with my current e-mail address. How do I disable this new account? I need to disable the new e-mail address account so that I can add it as an additional e-mail to my old account. THEN, how do I make this new e-mail address my primary e-mail for this old account?
Did yoo go to Settings>iTunes and App Stores and sign out and sign back in?
Next see:
Frequently Asked Questions About Apple ID -
Is there a way to consolidate two different Apple ID's into one. I have an old Apple ID that I used for Itunes and a new one I used to set up on my iphone.
You cannot merge accounts.
Why did you start a new account? -
My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!
Hi,
You could use FND_FLEX_LOADER_APIS.UP_VALUE_SET_VALUE to upload them from staging table (I suppose you mean value set values...).
You can find a sample scripts if you google around.
What do you mean "how to map any API to our staging table" ?
You should do at least the following mapping (which column(s) in the staging table will provide these information):
- the 3 value sets name which you're going to update/upload (I suppose these are existing value sets or which have been already created)
- the value set values and description
Try to start with something and if there is any issues the community could then help... but for the time being with the description of the problem you have provided, that's the best I can do... -
Why when I try to update certain app it require an old email address and password I have not used for years and I do I get to update them on my new details
Apps are tied to the Apple ID that was used to purchase them and you will always need to use that ID and password in order to update them.
Saying that you do get to update them on your new details makes no sense at all.
Maybe you are looking for
-
Ipod not showing up in itunes windows 8
after updating my iphone 3gs, which i now use an ipod, when i plug it up to my computer and open itunes, itunes does not recognize my device. help
-
Hi, is it possible to install Windows XP OEM without SP2, and after instalation upgrade it to SP2? I asking this because I have the 2002 version of XP. Thanks, Biga
-
Comes With Music and (Finnish) Music Store
I have a Nokia N97 mini Comes With Music. There was an upgrade in Finnish Music Store in yesterday (09.09.2010). After that, I can not choose free downloads anymore. Somehow the "Comes With Music" button has disappeared, and every mp3 has a price. I
-
Hi I'm an Oracle novice, but have been fault-finding with an application at work, built in Powerbuilder, which seems to have issues with the ODBC driver that ships with Oracle 8.1.7 Basically, some date/time fields in the application are totally inco
-
Hi, I need to create an view of another schema. How can I do so? And the same view need to placed in diffrent schema. How can I perform this.