Need help with create trigger based on more then 1 table and join.
Hello,
Here i have 3 tables
1. Employee
PERSON_ID
1
1
N
NUMBER
None
ORG_ID
2
N
NUMBER
Frequency
LOC_ID
3
N
NUMBER
Frequency
JOB_ID
4
Y
NUMBER
Height Balanced
FLSA_STATUS_ID
5
Y
NUMBER
Frequency
FULL_NAME
6
N
VARCHAR2 (250 Byte)
Height Balanced
FIRST_NAME
7
N
VARCHAR2 (20 Byte)
Height Balanced
MIDDLE_NAME
8
Y
VARCHAR2 (60 Byte)
Height Balanced
LAST_NAME
9
N
VARCHAR2 (40 Byte)
Height Balanced
PREFERRED_NAME
10
Y
VARCHAR2 (80 Byte)
None
EMAIL
11
Y
VARCHAR2 (250 Byte)
None
MAILSTOP
12
Y
VARCHAR2 (100 Byte)
None
HIRE_DATE
13
N
DATE
None
2. ems_candidate
EMS_CANDIDATE_ID
1
1
N
NUMBER
None
EMS_JOB_ID
2
Y
NUMBER
Frequency
NAME
3
N
VARCHAR2 (255 Byte)
Frequency
EMAIL
4
Y
VARCHAR2 (255 Byte)
None
TELEPHONE
5
Y
VARCHAR2 (25 Byte)
None
EMS_SOURCE_ID
6
Y
NUMBER
Frequency
RECEIVED_DATE
7
Y
DATE
Frequency
COMMENTS
8
Y
VARCHAR2 (4000 Byte)
None
3. employee_resources
EMP_RES_ID
1
1
N
NUMBER
None
PERSON_ID
2
Y
NUMBER
Height Balanced
CANDIDATE_ID
3
Y
NUMBER
Frequency
EMP_START_DATE
4
Y
DATE
None
CUSTOM_RESOURCE_FLAG
5
Y
NUMBER (1)
None
RESOURCE_GROUP_ID
6
N
NUMBER
Frequency
RESOURCE_STATUS_ID
7
N
NUMBER
Frequency
GROUP_LOC_ID
8
N
NUMBER
Height Balanced
ASSIGNED_JIRA
9
Y
VARCHAR2 (250 Byte)
None
REVOKED_JIRA
10
Y
VARCHAR2 (250 Byte)
None
CREATED_DATE
11
Y
DATE
SYSDATE
None
UPDATED_DATE
12
Y
DATE
None
Now i want to create trigger when new record get inserted in employee table wanted to update person_id in employee_resources table.
So i want to match ems_candidate.name with employee.full_name , ems_candidate.ems_job_id with employee.ems_job_id. And if it matched then update person_id in employee_resources table else through an exception and insert record in temp table.
If anybody has an idea can u please help me.
Thanks,
Gayatri.
I created below trigger
CREATE TRIGGER emp_resources_upd_person_id
AFTER INSERT ON ems.employee
FOR EACH ROW
BEGIN
UPDATE ems.employee_resources
SET person_id = :new.person_id
WHERE candidate_id = (SELECT ems_candidate_id
FROM ems.ems_candidate cand, ems.employee emp
WHERE TRIM(UPPER(emp.first_name)) = TRIM(UPPER(SUBSTR (cand.name, 1, INSTR (cand.name, ' ') - 1)))
AND TRIM(UPPER(emp.last_name)) = TRIM(UPPER(SUBSTR (cand.name,INSTR (cand.name, ' ') + 1,DECODE (INSTR (SUBSTR (cand.name, INSTR (cand.name, ' ') + 1), ' '),0,LENGTH (cand.name),(INSTR (SUBSTR (cand.name, INSTR (cand.name, ' ') + 1), ' ') - 1)))))
AND emp.person_id = :new.person_id);
EXCEPTION
WHEN OTHERS THEN
INSERT INTO ems.update_person_id_exception(person_id,first_name,last_name,full_name) VALUES(:new.person_id,:new.first_name,:new.last_name,:new.full_name);
END;
Now when i am trying to insert row in ems.employee table it gives me an error
ORA-04091
table string.string is mutating, trigger/function may not see it
Cause: A trigger (or a user defined plsql function that is referenced in this statement) attempted to look at (or modify) a table that was in the middle of being modified by the statement which fired it.
Action: Rewrite the trigger (or function) so it does not read that table.
Can anybody please help me to come out from these error.
Thanks,
Gayatri.
Similar Messages
-
Need help with create page based on template
I created a template on my class computer and i created few
pages based on it.
Today i moved all the file&folders to my private
computer, and when i tried to create a new page based on the
template I got a messege:
Error accessing file: "c:\sigal\....\template_site.dwt"
sharing violation (error code 32)
What is wrong? What do I have to do?
Can anybody help me please???
10xPlease respond to your reply on the DW forum.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"michal2401" <[email protected]> wrote in
message
news:eds23r$nhp$[email protected]..
>I created a template on my class computer and i created
few pages based on
>it.
>
> Today i moved all the file&folders to my private
computer, and when i
> tried to
> create a new page based on the template I got a messege:
> Error accessing file: "c:\sigal\....\template_site.dwt"
sharing violation
> (error code 32)
>
> What is wrong? What do I have to do?
>
> Can anybody help me please???
>
> 10x
>
>
> -
Need help with creating trigger using instead of insert.
Hi all,
I am trying to create a trigger that can read the inserted Mail data from table1 and check if the Mail data matches the Mail data from table2. If the Mail data matches the Mail data from table2 it will get the EmpID from table2 and insert it into table1
column EmpID.
Here are table2 columns:
EmpID (int) Mail(varchar) Mail2(varchar)
101 [email protected] [email protected]
102 [email protected] [email protected]
table1 columns
EmpID (int)(primary key) Mail(varchar) Mail2(varchar)
If I insert [email protected] into table1 column Mail, I would like it to get the value for the EmpID from table2 before actually inserting the record into table1, by matching the Mail from table1 = Mail from table2.
I am using ASP.Net to insert the records into Mail and Mail2.
How can I achieve that?
I appreciate any help.There should be two SQL statements in the stored procedure in order to accomplish the task?
Ideally you need to include logic as a part of your insert procedure itself. You should have a standard insert stored procedure which should include this logic and should be used for all inserts.
Also if EmpID field has to have a non NULL value always you may better off creating a foreign key constraint from Table1 to Table2 on EmpID column to enforce the Referential Integrity.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
I need help with Creating Key Pairs
Hello,
I need help with Creating Key Pairs, I generate key pais with aba provider, but the keys generated are not base 64.
the class is :
import java.io.*;
import java.math.BigInteger;
import java.security.*;
import java.security.spec.*;
import java.security.interfaces.*;
import javax.crypto.*;
import javax.crypto.spec.*;
import au.net.aba.crypto.provider.ABAProvider;
class CreateKeyPairs {
private static KeyPair keyPair;
private static KeyPairGenerator pairGenerator;
private static PrivateKey privateKey;
private static PublicKey publicKey;
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.out.println("Usage: java CreateKeyParis public_key_file_name privete_key_file_name");
return;
createKeys();
saveKey(args[0],publicKey);
saveKey(args[1],privateKey);
private static void createKeys() throws Exception {
Security.addProvider(new ABAProvider());
pairGenerator = KeyPairGenerator.getInstance("RSA","ABA");
pairGenerator.initialize(1024, new SecureRandom());
keyPair = pairGenerator.generateKeyPair();
privateKey = keyPair.getPrivate();
publicKey = keyPair.getPublic();
private synchronized static void saveKey(String filename,PrivateKey key) throws Exception {
ObjectOutputStream out= new ObjectOutputStream(new FileOutputStream(filename));
out.writeObject(key);
out.close();
private synchronized static void saveKey(String filename,PublicKey key) throws Exception {
ObjectOutputStream out= new ObjectOutputStream( new FileOutputStream(filename));
out.writeObject(key);
out.close();
the public key is:
�� sr com.sun.rsajca.JSA_RSAPublicKeyrC��� xr com.sun.rsajca.JS_PublicKey~5< ~��% L thePublicKeyt Lcom/sun/rsasign/p;xpsr com.sun.rsasign.anm����9�[ [ at [B[ bq ~ xr com.sun.rsasign.p��(!g�� L at Ljava/lang/String;[ bt [Ljava/lang/String;xr com.sun.rsasign.c�"dyU�| xpt Javaur [Ljava.lang.String;��V��{G xp q ~ ur [B���T� xp ��ccR}o���[!#I����lo������
����^"`8�|���Z>������&
d ����"B��
^5���a����jw9�����D���D�)�*3/h��7�|��I�d�$�4f�8_�|���yuq ~
How i can generated the key pairs in base 64 or binary????
Thanxs for help me
Luis Navarro Nu�ez
Santiago.
Chile.
South America.I don't use ABA but BouncyCastle
this could help you :
try
java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
java.security.KeyPairGenerator kg = java.security.KeyPairGenerator.getInstance("RSA","BC");
java.security.KeyPair kp = kg.generateKeyPair();
java.security.Key pub = kp.getPublic();
java.security.Key pri = kp.getPrivate();
System.out.println("pub: " + pub);
System.out.println("pri: " + pri);
byte[] pub_e = pub.getEncoded();
byte[] pri_e = pri.getEncoded();
java.io.PrintWriter o;
java.io.DataInputStream i;
java.io.File f;
o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pub64"));
o.println(new sun.misc.BASE64Encoder().encode(pub_e));
o.close();
o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pri64"));
o.println(new sun.misc.BASE64Encoder().encode(pri_e));
o.close();
java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader("d:/pub64"));
StringBuffer keyBase64 = new StringBuffer();
String line = br.readLine ();
while(line != null)
keyBase64.append (line);
line = br.readLine ();
byte [] pubBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
br = new java.io.BufferedReader(new java.io.FileReader("d:/pri64"));
keyBase64 = new StringBuffer();
line = br.readLine ();
while(line != null)
keyBase64.append (line);
line = br.readLine ();
byte [] priBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
java.security.KeyFactory kf = java.security.KeyFactory.getInstance("RSA","BC");
java.security.Key pubKey = kf.generatePublic(new java.security.spec.X509EncodedKeySpec(pubBytes));
System.out.println("pub: " + pubKey);
java.security.Key priKey = kf.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(priBytes));
System.out.println("pri: " + priKey);
catch(Exception e)
e.printStackTrace ();
} -
I need help with creating PDF with Preview...
Hello
I need help with creating PDF documetns with Preview. Just a few days ago, I was able to create PDF files composed of scanned images (notes) and everything worked perfectly fine. However, today I was having trouble with it. I scanned my notebook and saved 8 images/pages in jpeg format. I did the usual routine with Preview (select all files>print>PDF>save as PDF>then save). Well this worked a few days ago, but when I tried it today, I was able to save it, but the after opening the PDF file that I have saved, only the first page was there. The other pages weren't included. I really don't see anything wrong with what I'm doing. I really need help. Any help would be greatly appreciated.I can't find it. I went into advanced and then document processing but no batch sequence is there and everything is grayed out.
EDIT: I realized that you cant do batch sequences in standard. Any other ideas? -
Need help with my usecase based on transient ViewObject
I am using 11.1.1.4.0 Jdev version. I need help with my usecase.Been trying it for 2 days but couldn't figure out the issue.
I have a transientVO . In this VO Rows will be populated programmatically. CountryId is an attribute of this VO. I have created a viewAccessor "CountriesVA" from Country VO of HR schema.
I have a LOV for the countryId which is based on this VA ,getting countries from CountryTable.
This is the model part which works fine.
Before the page load i have called a method to create a row for this transientVO.Once the row is created i can see the SOC in my page which i have created as below.
Now i want to insert a row in the transientVO if user selects a country and restrict duplicate entry . (As One row is already created 1st time there will be no rows created.after that rows will be inserted)
The issue is :: Suppose there are 2 countries. A & B .When user does the following actions :
Insert A . Done //as 1st entry
Insert B . Done //as 1st time entry
Insert A . duplicate not inserted
Insert B . getting inserted // the bug.
<af:selectOneChoice value="#{bindings.CountryId.inputValue}"
label="#{bindings.CountryId.label}"
required="#{bindings.CountryId.hints.mandatory}"
shortDesc="#{bindings.CountryId.hints.tooltip}" id="soc1"
immediate="true" autoSubmit="true"
valueChangeListener="#{pageFlowScope.managedBean.countryIdVC}">
public void countryIdVC(ValueChangeEvent valueChangeEvent) {
// Add event code here...
String oldValue=null;
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
boolean duplicate=true;
if(oldValue!=null){
rsi.getCurrentRow().setAttribute("CountryId", oldValue);
// Row row= rsi.findByKey(new Key(new Object[] { newValue}), 1)[0];
Key key =new Key(new Object[] { newValue});
Row row=rsi.getRow(key);
if(row==null){
System.err.println(duplicate);
duplicate=false;
}else{
rsi.setCurrentRow(row);
if(!duplicate){
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
//create a new row
Row newRow = rsi.createRow();
newRow.setAttribute("CountryId", newValue);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);I read the reply from Andrejus Baranovskis and thought of studying and implementing that in my useCase.Well it worked . I implemented the same Logic but rowIteration was done in AppModule.
Con-Fusion, Bugs, Facts &amp; Workarounds: Iterating through View Object RowIterator Bug.(NOT ADF BUG, Development B…
http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcservices.htm#sm0206
9.7.6 What You May Need to Know About Programmatic Row Set Iteration
The problem is solved ,the above links helped me solve the problem.
what i did is i have created a method in appmodule to iterate rows and all the method y operation bindings and my logic works fine ....
MY Advice to all Adf developers ,though i am not an expert but i can assure you to follow the above process for rowIteration.If you use the iterator binding in the manage bean to navigate the rows u'll face issues which are unexpected.
In AppModule :::::
public boolean createRow(String oldValue,String newValue){
System.err.println(oldValue+""+newValue);
ViewObjectImpl vo=getViewObj1();
boolean duplicate=false;
if(oldValue!=null){
RowSetIterator iter = vo.createRowSetIterator(null);
System.err.println("iterating rows ");
while (iter.hasNext()) {
Row r = iter.next();
System.err.println(iter.getRangeIndexOf(r)+" row is "+r.getAttribute("CountryId"));
if(r.getAttribute("CountryId").toString().equals(newValue)){
duplicate=true;
break;
// Do something with the current row.
// close secondary row set iterator
iter.closeRowSetIterator();
return duplicate;
In ManageBean :::::
public void countryIdVC(ValueChangeEvent valueChangeEvent) {
// Add event code here...
String oldValue=null;
System.err.println("Old Value"+valueChangeEvent.getOldValue());
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
//access the name of the iterator the table is bound to. Its "allDepartmentsIterator"
//in this sample
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
if(oldValue!=null){
rsi.getCurrentRow().setAttribute("CountryId", oldValue);
OperationBinding operation = bindings.getOperationBinding("createRow");
operation.getParamsMap().put("oldValue", oldValue);
operation.getParamsMap().put("newValue", newValue);
if(!(Boolean)operation.execute()){
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
//create a new row
Row newRow = rsi.createRow();
newRow.setAttribute("CountryId", newValue);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
System.err.println("Inserting row at index "+lastRowIndex+1);
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);
else{
System.err.println("Data found So not inserting,only setting current Row");
Key key =new Key(new Object[] { newValue});
rsi.setCurrentRow(rsi.getRow(key)); -
Need help with creating a brush
Hi guys,
I wanted to ask for help with creating a brush (even a link to a tutorial will be goon enough ).
I got this sample:
I've created a brush from it, and i'm trying to get this kind of result:
but it's only duplicates it and gives me this result:
Can someone help me please understand what i need to define in order to make the brush behave like a continues brush instead of duplicate it?
Thank you very much
shlomitwhat you need to do is make a brush that looks like the tip of a brush. photoshop has several already but you can make your own that will be better.
get a paintbrush and paint a spot kind of like what you did but dont paint a stroke. make it look kindof grungy. then make your brush from that, making sure to desaturate it and everything.
EDIT:
oh, and if you bring the fill down to like 10-20% your stroke will look better -
I need help with creating some formulas
I'm not sure if anyone around here can help me, but I'm trying to create a Numbers document and need some help with creating a formula/function.
I have a column of amounts and I would like to create a formula which deducts a percentage (11.9%) and puts the result in another column.
If anyone can help me, it would be greatly appreciated.Here is an example that shows one way to do this:
The original data is in column A. In column B we will store formulas to adjust the amounts:
1) select the cell where you want to formula (in this case cell B2)
2) Type the "=" (equal sign):
3) click cell A2:
4) now type the rest of the formula which is: "*(100-11.9)/100" that is asterisk, then open parenthesis, 100 minus eleven point nine close parenthesis forward slash one hundred
The Asterisk is the multiply operator (times) and the forward slash is the division operator (divide)
now hit return. select cell B2 and hover the cursor over the bottom edge of the cell:
drag the little yellow dot down to "fill" the formula down as needed. -
Need help with error: No bootable device -- insert boot disk and press any key
Hello, I need help will my laptop and the error, the message says "no bootable device ", I have tried taking out the hard drive but it still doesn't work. My laptop is a Satillite C55D-A5372. I need help with this; if you know about this ans know how to fix it please reply or email me @ [email protected]
If needed more clarifications ask me.
Thank you,
Jkmanoif you got into the bios/uefi and have determined that the hdd is being detected then that is good. At least the hdd is operating to some extent, although still may be corrupt OS or the like.
Eagle asked you what OS your using (i.e., Windows 8.1 64-bit, Windows 7 32-bit, etc.). I see that English is not your native language so we'll just have to work with that as best we can.
Did you make any changes to the operating system (OS) as a result of the link you posted, and what were they?
L305-S5955, T9300 Intel Core 2 Duo, 4GB RAM, 60GB SSD, Win 7 Ultimate 64-bit -
I need help with my iphone. For some reason is off completely and refusing to come on. I believe is not charging problem, because it was charge before that happen.
You have posted under MacBook Pro.
I have asked the administrators to relocate this post to the iPhone section where it is more likely to get a helpful response. -
Need help with creating custom form
hi all,
i'm working on creating a new form. it has 2 blocks for 2 tables. headers and lines tables. the headers table mostly have columns that are id's from other tables. i.e. customer_id, location_id etc.. in my screen, obviously i would not show the id's. i'll display the descriptions / names of the id's instead like customer_name for customer_id... but in order to do this i created a table that joins more than 2 tables. so in the block query data source name, i enter the name of this view.. then i add a ON-INSERT, ON-UPDATE, ON-DELETE triggers at block level and i call the corresponding package which does the insert, update and delete. i'm able to insert but update and delete causes a problem. "ORA-01445: cannot select ROWID from, or sample, a join.. ".. i'm thinking the reason is that when the form does an update or delete, it locks the record which causes the error.. also the reason i need the view is because i need to be able to query the customer_name in the screen instead of the customer_id... what i can't figure out is how i can make this work... or a work-around may be...
can anyone help.
thanksMatt Rasmussen wrote:
You're right that the form is locking the record so you just need to control how it locks the record with an on-lock trigger. From the Oracle Applications Developer's Guide:
page 3-9:
When basing a block on a view, you must code ON–INSERT, ON–UPDATE, ON–DELETE, and ON–LOCK triggers to insert, update, delete, and lock the root table instead of the view.
Most of the on-lock triggers I have written follow this template:
<pre> SELECT field1, field2, field3
INTO :block.field3, :block.field2, :block.field3
FROM view
WHERE rowid = :block.row_id
FOR UPDATE OF field1, field2, field3;</pre>
I think once you've added this trigger, your form will work the way you want it.hi,
i tried your suggestion but still get the same error.. anyways, here are the details of what i have so far.
here's my table.
CREATE TABLE XXPN_VR_VOL_HEADERS_ALL
VOL_HEADER_ID NUMBER,
CUSTOMER_ID NUMBER,
LEASE_ID NUMBER,
LOCATION_ID NUMBER,
VAR_RENT_ID NUMBER,
PERIOD_SET_NAME VARCHAR2(15 BYTE),
PERIOD_NAME VARCHAR2(15 BYTE),
IMPORT_FLAG VARCHAR2(1 BYTE),
IMPORT_DATE DATE,
CALC_TYPE VARCHAR2(30 BYTE),
PASSTHROUGH_FLAG VARCHAR2(1 BYTE),
COMMENTS VARCHAR2(2000 BYTE),
CREATED_BY NUMBER,
CREATION_DATE DATE,
LAST_UPDATED_BY NUMBER,
LAST_UPDATE_DATE DATE
);here's my view.
create or replace view xxpn_vr_vol_headers_v ( row_id
,vol_header_id
,customer_id
,customer_name
,lease_id
,lease_name
,lease_number
,location_id
,location_code
,var_rent_id
,var_rent_number
,period_set_name
,period_name
,import_flag
,import_date
,calc_type
,passthrough_flag
,created_by
,creation_date
,comments
,last_updated_by
,last_update_date )
as
select xvvha.rowid
,xvvha.vol_header_id
,xvvha.customer_id
,hp.party_name
,xvvha.lease_id
,pl.name
,pl.lease_num
,xvvha.location_id
,loc.location_code
,xvvha.var_rent_id
,pvr.rent_num
,xvvha.period_set_name
,xvvha.period_name
,xvvha.import_flag
,xvvha.import_date
,xvvha.calc_type
,xvvha.passthrough_flag
,xvvha.created_by
,xvvha.creation_date
,xvvha.comments
,xvvha.last_updated_by
,xvvha.last_update_date
from xxpn_vr_vol_headers_all xvvha
,hz_parties hp
,pn_leases_all pl
,pn_locations_all loc
,pn_var_rents_v pvr
where -1 = -1
and xvvha.customer_id = hp.party_id (+)
and xvvha.lease_id = pl.lease_id (+)
and xvvha.location_id = loc.location_id (+)
and xvvha.var_rent_id = pvr.var_rent_id (+);here's my ON-UPDATE trigger block level
begin
xxpn_vr_vol_data_pkg.update_vr_vol_hdr_data ( p_vol_header_id => :XXPNVRVOLHDRS.vol_header_id
,p_customer_id => :XXPNVRVOLHDRS.customer_id
,p_lease_id => :XXPNVRVOLHDRS.lease_id
,p_location_id => :XXPNVRVOLHDRS.location_id
,p_var_rent_id => :XXPNVRVOLHDRS.var_rent_id
,p_period_set_name => :XXPNVRVOLHDRS.period_set_name
,p_period_name => :XXPNVRVOLHDRS.period_name
,p_import_flag => :XXPNVRVOLHDRS.import_flag
,p_passthrough_flag => :XXPNVRVOLHDRS.passthrough_flag
,p_comments => :XXPNVRVOLHDRS.comments
,x_last_updated_by => :XXPNVRVOLHDRS.last_updated_by
,x_last_update_date => :XXPNVRVOLHDRS.last_update_date );
end;here's my code in ON-LOCK trigger block level
begin
select lease_id
,lease_name
,lease_number
,location_id
,location_code
,customer_id
,customer_name
,var_rent_id
,var_rent_number
,period_name
,comments
,period_set_name
,import_flag
,passthrough_flag
,created_by
,creation_date
,last_updated_by
,last_update_date
into :XXPNVRVOLHDRS.lease_id
,:XXPNVRVOLHDRS.lease_name
,:XXPNVRVOLHDRS.lease_number
,:XXPNVRVOLHDRS.location_id
,:XXPNVRVOLHDRS.location_code
,:XXPNVRVOLHDRS.customer_id
,:XXPNVRVOLHDRS.customer_name
,:XXPNVRVOLHDRS.var_rent_id
,:XXPNVRVOLHDRS.var_rent_number
,:XXPNVRVOLHDRS.period_name
,:XXPNVRVOLHDRS.comments
,:XXPNVRVOLHDRS.period_set_name
,:XXPNVRVOLHDRS.import_flag
,:XXPNVRVOLHDRS.passthrough_flag
,:XXPNVRVOLHDRS.created_by
,:XXPNVRVOLHDRS.creation_date
,:XXPNVRVOLHDRS.last_updated_by
,:XXPNVRVOLHDRS.last_update_date
from xxpn_vr_vol_headers_v
where rowid = :XXPNVRVOLHDRS.ROW_ID
for update of lease_id
,lease_name
,lease_number
,location_id
,location_code
,customer_id
,customer_name
,var_rent_id
,var_rent_number
,period_name
,comments
,period_set_name
,import_flag
,passthrough_flag
,created_by
,creation_date
,last_updated_by
,last_update_date;
end;properties for the block
Query Data Source Type: Table
Query Data Source Name: XXPN_VR_VOL_HEADERS_V
DML Target Type: Table
DML Target Name: XXPN_VR_VOL_HEADERS_V
i'd appreciate any help.
thanks -
Need help with creating template. Changes are not going through to index.html page
Hi all,
I have an issue with my template that I am creating and also a question about creating template Regions (Repeating and Editable).
Somehow my changes to my index.dwt are not changing my index.html page.
Also my other question is: For my top navigation bar and left navigation bar links, do I need to select and define each individual button or link as Repeating/Editable Region? or can I just select the whole navigation bar (the one on the top) etc...
Below are my steps for creating my template...I am kinda fairly new to using DW and this is my first attempt to making a template following the DW tutorial CD that came with DW CS3.
I appreciate any help with this...regards, Dano
-Open my index.html file
-File/save as template
-Save
-update links - yes
-Select Repeating and Editable Regions (I selected the whole top navigation bar and selected Repeating Region and Editable Region, same with the left side navigation links)
-File close all
-Open the index.dwt
-Save as and selected the index.html and chose to overide it..
When I make changes to my index.dwt it is not changing the index.html
I feel that I am missing some important steps here.....
Website address
www.defenseproshop.comFigured out
-
Need Help with Creating the SQl query
Hi,
SQL query gurus...
INFORMATION:
I have two table, CURRENT and PREVIOUS.(Table Defs below).
CURRENT:
Column1 - CURR_PARENT
Column2 - CURR_CHILD
Column3 - CURR_CHILD_ATTRIBUTE 1
Column4 - CURR_CHILD_ATTRIBUTE 2
Column5 - CURR_CHILD_ATTRIBUTE 3
PREVIOUS:
Column1 - PREV_PARENT
Column2 - PREV_CHILD
Column3 - PREV_CHILD_ATTRIBUTE 1
Column4 - PREV_CHILD_ATTRIBUTE 2
Column5 - PREV_CHILD_ATTRIBUTE 3
PROBLEM STATEMENT
Here the columns 3 to 5 are the attributes of the Child. Lets assume that I have two loads, One Today which goes to the CURRENT table and one yesterday which goes to the PREVIOUS table. Between these two loads there is a CHANGE in the value for Columns either 3/4/5 or all of them(doesnt matter if one or all).
I want to determine what properties for the child have changed with the help of a MOST efficient SQL query.(PARENT+CHILD is unique key). The Database is ofcourse ORACLE.
Please help.
Regards,
ParagHi,
The last message was not posted by the same user_name that started the thread.
Please don't do that: it's confusing.
Earlier replies give you the information you want, with one row of output (maximum) per row in current_tbl. There may be 1, 2 or 3 changes on a row.
You just have to unpivot that data to get one row for every change, like this:
WITH single_row AS
SELECT c.curr_parent
, c.curr_child
, c.curr_child_attribute1
, c.curr_child_attribute2
, c.curr_child_attribute3
, DECODE (c.curr_child_attribute1, p.prev_child_attribute1, 0, 1) AS diff1
, DECODE (c.curr_child_attribute2, p.prev_child_attribute2, 0, 2) AS diff2
, DECODE (c.curr_child_attribute3, p.prev_child_attribute3, 0, 3) AS diff3
FROM current_tbl c
JOIN previous_tbl p ON c.curr_parent = p.prev_parent
AND c.curr_child = p.prev_child
WHERE c.curr_child_attribute1 != p.prev_child_attribute1
OR c.curr_child_attribute2 != p.prev_child_attribute2
OR c.curr_child_attribute3 != p.prev_child_attribute3
, cntr AS
SELECT LEVEL AS n
FROM dual
CONNECT BY LEVEL <= 3
SELECT s.curr_parent AS parent
, s.curr_child AS child
, CASE c.n
WHEN 1 THEN s.curr_child_attribute1
WHEN 2 THEN s.curr_child_attribute2
WHEN 3 THEN s.curr_child_attribute3
END AS attribute
, c.n AS attribute_value
FROM single_row s
JOIN cntr c ON c.n IN ( s.diff1
, s.diff2
, s.diff3
ORDER BY attribute_value
, parent
, child
; -
Need help with creating B*Tree XMLIndex on a structured object-relational xmltype column
The following is my schema:
CREATE TABLE TST_AUDIT_TBL
NOTE VARCHAR2(25 CHAR) null,
CHANGE_HISTORY XMLTYPE not null,
CHANGE_HISTORY_EXT XMLTYPE null
XMLTYPE COLUMN CHANGE_HISTORY STORE AS OBJECT RELATIONAL XMLSCHEMA "http://www.oracle.com/a.xsd" element "A"
XMLTYPE COLUMN CHANGE_HISTORY_EXT STORE AS CLOB XMLSCHEMA "http://www.oracle.com/a.xsd" element "AX"
XML Schema for the above is defined as follows:
<schema targetNamespace="http://www.oracle.com/a.xsd"
xmlns:a="http://www.oracle.com/a.xsd"
xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<complexType name="AuditExtType">
<sequence>
<element name="C" maxOccurs="unbounded" minOccurs="0">
<complexType>
<sequence>
<element type="string" name="CN"/>
<element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
<element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<complexType name="AuditType">
<sequence>
<element type="string" name="M" maxOccurs="1" minOccurs="0"/>
<element type="string" name="O"/>
<element name="B" maxOccurs="1" minOccurs="0">
<complexType>
<sequence>
<element name="BC" minOccurs="1" maxOccurs="unbounded">
<complexType>
<sequence>
<element type="string" name="BN"/>
<element name="F" maxOccurs="unbounded" minOccurs="0">
<complexType>
<sequence>
<element type="string" name="FN"/>
<element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
<element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="T" maxOccurs="1" minOccurs="0">
<complexType>
<sequence>
<element name="TL" minOccurs="1" maxOccurs="unbounded">
<complexType>
<sequence>
<element type="string" name="TN"/>
<element name="C" maxOccurs="unbounded" minOccurs="0">
<complexType>
<sequence>
<element type="string" name="CN"/>
<element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
<element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="I" maxOccurs="1" minOccurs="0">
<complexType>
<sequence>
<element name="K" maxOccurs="unbounded" minOccurs="0">
<complexType>
<sequence>
<element type="string" name="N"/>
<element type="string" name="V"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<element name="A" type="a:AuditType"/>
<element name="AX" type="a:AuditExtType"/>
</schema>
I want to create a B*Tree XML Index on the above table for the following:
1. CN
2. TN
in the above schema.
Following the doc, this is what I am issuing:
SQL> CREATE INDEX audt_audit_idx1 ON TST_AUDIT_TBL(CHANGE_HISTORY) INDEXTYPE IS XDB.XMLINDEX PARAMETERS ('XMLTABLE IXTAB
2 XMLNAMESPACES(DEFAULT ''http://www.oracle.com/a.xsd''), ''/A'' COLUMNS COLUMN_NAME VARCHAR2(128) PATH ''A/T/TL/C/CN'' ');
CREATE INDEX audt_audit_idx1 ON TST_AUDIT_TBL(CHANGE_HISTORY) INDEXTYPE IS XDB.XMLINDEX PARAMETERS ('XMLTABLE IXTAB
ERROR at line 1:
ORA-29958: fatal error occurred in the execution of ODCIINDEXCREATE routine
ORA-19276: XPST0005 - XPath step specifies an invalid element/attribute name:
(A)
Not sure what is going wrong (and what would be a working xmlindex will look like?)Here goes...
1) Schema registration
begin
dbms_xmlschema.registerSchema(
schemaURL => 'http://www.oracle.com/a.xsd'
, local => true
, genTypes => true
, genTables => false
, enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_NONE
, schemaDoc =>
'<schema targetNamespace="http://www.oracle.com/a.xsd"
xmlns:a="http://www.oracle.com/a.xsd"
xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<complexType name="AuditExtType">
<sequence>
<element name="C" maxOccurs="unbounded" minOccurs="0">
<complexType>
<sequence>
<element type="string" name="CN"/>
<element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
<element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<complexType name="AuditType">
<sequence>
<element type="string" name="M" maxOccurs="1" minOccurs="0"/>
<element type="string" name="O"/>
<element name="B" maxOccurs="1" minOccurs="0">
<complexType>
<sequence>
<element name="BC" minOccurs="1" maxOccurs="unbounded">
<complexType>
<sequence>
<element type="string" name="BN"/>
<element name="F" maxOccurs="unbounded" minOccurs="0">
<complexType>
<sequence>
<element type="string" name="FN"/>
<element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
<element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="T" maxOccurs="1" minOccurs="0">
<complexType>
<sequence>
<element name="TL" minOccurs="1" maxOccurs="unbounded">
<complexType>
<sequence>
<element type="string" name="TN"/>
<element name="C" maxOccurs="unbounded" minOccurs="0">
<complexType>
<sequence>
<element type="string" name="CN"/>
<element type="string" name="OV" minOccurs="0" maxOccurs="1"/>
<element type="string" name="NV" minOccurs="0" maxOccurs="1"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
<element name="I" maxOccurs="1" minOccurs="0">
<complexType>
<sequence>
<element name="K" maxOccurs="unbounded" minOccurs="0">
<complexType>
<sequence>
<element type="string" name="N"/>
<element type="string" name="V"/>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<element name="A" type="a:AuditType"/>
<element name="AX" type="a:AuditExtType"/>
</schema>'
end;
2) Table creation
CREATE TABLE TST_AUDIT_TBL
NOTE VARCHAR2(25 CHAR) null,
CHANGE_HISTORY XMLTYPE not null,
CHANGE_HISTORY_EXT XMLTYPE null
XMLTYPE COLUMN CHANGE_HISTORY STORE AS OBJECT RELATIONAL XMLSCHEMA "http://www.oracle.com/a.xsd" element "A"
XMLTYPE COLUMN CHANGE_HISTORY_EXT STORE AS CLOB XMLSCHEMA "http://www.oracle.com/a.xsd" element "AX"
3) Retrieving the nested table and column related to the target element :
SQL> select dbms_xmlstorage_manage.xpath2TabColMapping(
2 owner_name => 'DEV'
3 , table_name => 'TST_AUDIT_TBL'
4 , column_name => 'CHANGE_HISTORY'
5 , xpath => '/A/T/TL/C/CN'
6 , namespaces =>'default ''http://www.oracle.com/a.xsd'''
7 )
8 from dual;
DBMS_XMLSTORAGE_MANAGE.XPATH2T
<Result>
<Mapping TableName="SYS_NTr0U7dPWyRu6OVvDN2f5HEg==" ColumnName="CN"/>
</Result>
4) Creating the index :
SQL> create index CHANGE_HISTORY_IX1 on "SYS_NTr0U7dPWyRu6OVvDN2f5HEg==" ("CN");
Index created
If you're going to create multiple indexes like this, you could really benefit from renaming all the nested tables to meaningful names. That can be done via DBMS_XMLSTORAGE_MANAGE as well. -
Help with creating a movie presentation using a theme and titles
I need to make a movie for a presentation for work and wanted to use the 007 theme or mission impossible on the iPad 2 however I've been told you can only do it on a Mac.? Or can it be done on iMovie I can't work it out on iMovie can anyone put me in the right direction I have seen someone do one using the indianna jones theme with titles but again it was on a Mac thanks Gail
Those themes are only on a Mac.
Maybe you are looking for
-
Unable to dismount Hybrid Karaoke CDG disk formats in Mac OS 10.5.6
Hi Everyone, Ran into a problem today, when I put in a karaoke CDG disks from a company called "All Star Karaoke", I see an Audio CD mounted as well as a "Untitled" cd mounted. I cannot unmount these CDs unless I reboot and hold down the touch pad bu
-
How to not lose proportion when importing AI objects using catality?
Hi all, I have a very annoing issue when i imoprt AI assets into Flex using Catalyst. When i import the AI object and do not resize them, they look ok, but when i import them and enlarge the width, they loose proportion: Does someone knows how to kee
-
제품 : ORACLE SERVER 작성날짜 : 2004-08-13 ORACLE8 OPS TUNING ==================== PURPOSE 이 자료는 OPS 환경에서의 db tuning에 대한 설명자료입니다. SCOPE Standard Edition 에서는 Real Application Clusters 기능이 10g(10.1.0) 이상 부터 지원이 됩니다. Explanation OPS 튜닝에 있어 단일 인스턴스에서의 튜닝 요소(bu
-
HT1476 i phone is not recognizing charger
my iphone 4 is not recognizing when it is plugged in. i powered it off and the battery charged over night however it is not being recognized by itunes or a charger when on
-
No reservations at apple store
how do I make an appointment in UK Apple store when it keeps saying "no reservations at apple store" when I try to book???