How to compare the values of 2 select queires in two diff DB's
Hi,
I need help in building the logic to achieve this :
A program is needed to get reference data from ABC database in ORACLE and update our reference tables with any changes in DEF database in SYBASE.
Pls give me an example where i can compare the select queires from different databases one exsiting in oracle and one in sybase .
Any help will appreciated.
Thanks
PLS HELP.
I have no idea on how to do
2) Using your specific requirements, determine how to know if there is a "new row" or a "missing row" or a row , which has a different description
Say Table A in oracle looks like this
Sno Description
1 Out Of Order
2 Shipped
3 Back Order
Say Table B in Sybase looks like this
Type Text
1 Out/Order
2 Shipped
4 Not manufactured
I have to see to that the rows present in Table A in oracle , should be same as rows in Table B in sybase
If not , we have to update , insert and delete the row which is not present in Table A in oracle in Table B in sybase.
In the table example i gave , In the first row of Table B in Sybase , the Text is different from that of Description in Table A for that Sno "1"
So we should update the description.
Row 4 has Sno "4" which is not their in table A , so delete that row from table A.
And In table A , Sno "3" row exists , so we should insert that record in table B.
I know how to query the tables , and get the rows into Result Set ..after that how can i compare and take the steps to update , insert and delete?
Similar Messages
-
How to get the values from html:select? tag..?
i tried with this, but its not working...
<html:select styleClass="text" name="querydefs" property="shortcut"
onchange="retrieveOptions()" styleId="firstBox" indexed="true">
<html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
</html:select>
<td align="left" class="rowcolor1">
<script language="javascript" type="text/javascript">
function retrieveOptions(){
var sel = document.querydefs.options;
var selectedOption = sel[sel.selectedIndex].value;
document.write(selectedOption);
</script><td align="left" class="rowcolor1">
<script language="javascript" type="text/javascript">
function retrieveOptions(){
var sel = document.querydefs.options;
var selectedOption = sel[sel.selectedIndex].value;
document.write(selectedOption);
</script>This java script is not working at all..its not printing anything in document.write();
This is code..
<td class="rowcolor1" width="20%">
<html:select styleClass="text" name="querydefs" property="shortcut"
onchange="retrieveSecondOptions()" styleId="firstBox"
indexed="true">
<html:options collection="advanced.choices" property="shortcut"
labelProperty="label" />
</html:select>i tried with this also. but no use..i'm not the getting the seleced option...
function retrieveOptions(){
firstBox = document.getElementById('firstBox');
if(firstBox.selectedIndex==0){
return;
selectedOption = firstBox.options[firstBox.selectedIndex].value;
}actually , how to get the values from <html:select> ...?
my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window -
How to compare the value of a specied attribute to a string
I am looking for an example of how to compare the value of an attribute to a string. (I think)
I have been trying to:
if (attrs.get("title")== "Vampire") -- you already know this did not work.
How can I check to see if the title="Vampire"?
The code below will get me the title of admin (which should be Vampire)
import javax.naming.Context;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.DirContext;
import javax.naming.directory.Attributes;
import javax.naming.NamingException;
import java.util.Hashtable;
class Giles {
public static void main(String[] args) {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://192.168.1.55:389/o=sunnydale");
try {
DirContext ctx = new InitialDirContext(env);
Attributes attrs = ctx.getAttributes("cn=admin");
System.out.println("Title: " + attrs.get("title").get());
ctx.close();
} catch (NamingException e) {
System.err.println("Problem getting attribute: " + e);
Thank you!!
SteveI guess, you are looking for searching for attributes of an user object.
Here is the sample code to list all the attributes of an 'user' objectclass.
Tell me if it helps or not.
import java.util.Hashtable;
import javax.naming.ldap.*;
import javax.naming.directory.*;
import javax.naming.*;
public class GetAttributes
public static void main (String[] args)
Hashtable env = new Hashtable();
//Must use either the userPrincipalName or samAccountName,
//Cannot use the distinguished name
String adminName = "cn=abcd,cn=Users,dc=ssotest,dc=com";
String adminPassword = "DEF1234";
String ldapURL = "ldap://pni3w067:389";
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,adminName);
env.put(Context.SECURITY_CREDENTIALS,adminPassword);
//connect to my domain controller
env.put(Context.PROVIDER_URL,ldapURL);
try {
// Create the initial directory context
DirContext ctx = new InitialLdapContext(env,null);
// Create the search controls
SearchControls searchCtls = new SearchControls();
//Specify the search scope
searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
//specify the LDAP search filter
String searchFilter = "(&(objectClass=user))";
//Specify the Base for the search
//cn=policygroup,ou=policyusers,ou=ssoanay,;
//String searchBase = "ou=policyusers,ou=ssoanay,dc=ssotest,dc=com";
String searchBase = "cn=abcd,cn=users,dc=ssotest,dc=com";
//initialize counter to total the results
int totalResults = 0;
// Search for objects using the filter
NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
//Loop through the search results
while (answer.hasMoreElements()) {
SearchResult sr = (SearchResult)answer.next();
totalResults++;
System.out.println("\nName of Object : " + sr.getName());
// Print out some of the attributes, catch the exception if the attributes have no values
Attributes attrs = sr.getAttributes();
//System.out.println("6");
if (attrs != null) {
try {
/*NamingEnumeration enum = attrs.getIDs();
while(enum.hasMore()) {
System.out.println("IDs:"+enum.next().toString());
NamingEnumeration enum2 = attrs.getAll();
while(enum2.hasMore()) {
System.out.println("Attribute - "+enum2.next().toString());
catch (Exception e) {
System.out.println("Exception:" +e.getMessage());
else {
System.out.println("attribute is null");
System.out.println("Total results: " + totalResults);
ctx.close();
catch (NamingException e) {
System.err.println("Problem searching directory: " + e);
//return 0;
} -
How to compare the values stored in the list
Hi,
I am having the requirement that i want to compare the values stored in the list.How to store the values in the list and compare the list values stored inside it.
Regards,
Ahamadhttp://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#sort(java.util.List)
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#sort(java.util.List,%20java.util.Comparator)
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Comparator.html
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Comparable.html -
How to trace the value passed by select list
Hi,
Is it possible to know what value is passed by the select list.
eg:
:p1_testid -- is the select list name .
if select list contains 3 values ... value1, value2, and value3. and I select value2 from the select list.
I want to confirm it that the value I selected is the same value passed to the query.
- select * from Test where Testid=:p1_testid;
How to trace the value of :p1_testid before query execution.
Thanks.check your session state to see what value the select list has..
From developer tools at bottom of running page, select session, then look for the value associated with your select list..
Thank you,
Tony Miller
UTMB/EHN -
How to get the value of multi-select in the Dashboard Prompt
I have a multi-select prompt in the Dashboard Prompt, what I want is, how do I know that user has choose one value,
for examle, for some reasons, if user didn't choose any value, then I will set one column in answer as "customer office" , if user choose one value, then the column in answer will be "customer name".
any comments, thanks.Hi,
first define the presentation variable for the required column prompt. ex: PV
Then in report level set the filter for that column = @{PV}{customer office}. here u have to give default value as "customer office", so by default the report in dashboard will show customer office even though the user does not select any value from dashboard prompt.
Mark If Helpful/correct.
Thanks. -
Report With Multiple Radio Button ,How to reset the values of when selected
Reaching out to the experts here. I have a report which i created a radio group which saves the value rownum when the radio buton is selected to a hidden item based on an on click event. There are currently 3 radio button , i need to be able to "reset" the value of the other items when more than of the button are selected .I.E. There are 3 buttons, user clicks button one , but then decides they need to click button two , then realizes they really wanted to perform button 3 , I want to be able to "reset" the value of the 1st two hidden items so the only value populated is the 3rd hidden item. I am new to working with these features and scenarios so any and help would be appreciated.
Here is the report
SELECT APEX_ITEM.RADIOGROUP(1, ROWNUM, NULL,NULL,'onclick="javascript:$x(''P5_HIDDEN1'').value=' || ROWNUM|| '"') UPDATE_RECORD
,APEX_ITEM.RADIOGROUP(1, ROWNUM, NULL,NULL,'onclick="javascript:$x(''P5_HIDDEN2'').value=' || ROWNUM|| '"') DELETE_RECORD
,APEX_ITEM.RADIOGROUP(1, ROWNUM, NULL,NULL,'onclick="javascript:$x(''P5_HIDDEN3'').value=' || ROWNUM|| '"') SET_PRIMARY
,papf.first_name
,papf.last_name
,hl.meaning
,pp.phone_number
,case when phone_type is not null then (select meaning from hr_lookups where lookup_type ='PHONE_TYPE' and pp.phone_type=lookup_code)
end as phone_type
,emrg.primary_contact_flag
from hr.per_all_people_f papf
,apps.hr_lookups hl
,apps.per_contact_relationships pcr
,apps.per_phones pp
,(select contact_person_id,primary_contact_flag
from apps.per_contact_relationships pcr
where pcr.person_id = :P5_PERSON_ID
and contact_type = 'EMRG') emrg
where pcr.contact_person_id in emrg.contact_person_id
and pcr.personal_flag='Y'
and contact_type <> 'EMRG'
and trunc(sysdate) between date_start and NVL(date_end,'31-DEC-4712')
and pcr.contact_type = hl.lookup_code
and hl.lookup_type='CONTACT'
and pcr.contact_person_id = papf.person_id
and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and pcr.contact_person_id = pp.parent_id
and pp.phone_type in (select lookup_code from hr_lookups where lookup_type ='PHONE_TYPE')Related thread here How to Pass values from SQL Report into TEXT ITEM ?
Regards, -
How to access the value of fiedl ( select list with redirect )
WE created one report and form. When i click in the edit button of the report
for the specific record ; the system go automatically in the form
and show me all the information. In my form ia have some fields ( select list with redirect ) in this way i store the key but i can see the description.
I want to control the delete operation in checking the value of some field
in my form. How can i do that. When i verfy the content with SESSION
my variable are empty
Thanks
Marc FortinHello Larry,
You can use a select list with submit and create a branch to the page you want to go to.
Hope that helps.
Regards,
Dimitri
http://dgielis.blogspot.com/
http://www.apex-evangelists.com/
http://www.apexblogs.info/ -
How to compare the value of a cell before changing and after changing.
Hey there,
Now I want to implement a JTable. And the requirement is that users can edit a cell in the Table only once. I think there are two possible ways. One is that after user edited a cell, I will set this cell read only. Another way is to compare the vaule before and after the changing. If it is different, then write back the previous value.
But I did not know how to implement in Java. Can anybody help me?
Thanks alot!
Shellyinevitably, you will have to save a before copy of
the data, what this many times amounts to is that you
will need to have 2 identical data structures before
you start or some type of locking mechanism for each
piece of data.Why is this inevitable? I don't see it as inevitable at all. In fact, it's quite simple to implement a TableModel that returns false when isEditable(int, int) is invoked for any cell that has already had setValueAt(Object, int, int) inovked on it, for example. Depending on the requirements and implementation a different methodology may be needed for determining when the edit has taken place, such as a custom editor that notifies the TableModel when stopCellEditing() is invoked. Heck, overriding editingStopped() in JTable to do it might even work.
So, create a TableModel that returns isEditabe(int, int) as true only if the cell hasn't been edited yet. The only problem to solve from there is how you know when it's been edited. I've already given you a few leads on that, it's not particularly hard but depending on your exact implementation it may require different solutions. -
How to get the values of last selected row in Table?
Hi,
I have one editable table , where i have Create, Delete and Commit operation on it.
When i am clicking on Create button it add new row to my table.
But I want the value of my last selected row from the table in my Bean.
Can anyone suggest me please....... its urgent
Jdev:- 11.1.1.0.3
Thanks,
Ramitjust get this code empTable is the table binding
RowKeySet rks = new RowKeySetImpl();
CollectionModel model = (CollectionModel)empTable.getValue();
RowKeySet selectedRowKeys = empTable.getSelectedRowKeys();
if (selectedRowKeys != null)
Iterator iter = selectedRowKeys.iterator();
if (iter != null && iter.hasNext())
empTable.setRowKey(iter.next());
model.setRowIndex(empTable.getRowIndex());
Object key = model.getRowKey();
rks.add(key);
empTable.setSelectedRowKeys(rks);
AdfFacesContext.getCurrentInstance().addPartialTarget(empTable);
public void setEmpTable(RichTable empTable) {
this.empTable = empTable;
public RichTable getEmpTable() {
return empTable;
} -
How to replace the values in variable selection Screen urgent plz
Hi all,
I am having a requirement. where the user need pass the value in the variable, Here v r having option like '1' and '2' which represent 'month' and 'ytd'.
While selecting user view as 1,2 .Now my requirement is to replace the value 1=monthly and 2=ytd while the user passing the value to avoid the confusion.
Is it possible if so plz let me know
RegardsDear Venkat.
You please try the following steps:
1. Say the InfoObject is 0EMPLOYEE against which you have created the variable, which user is trying to select value against, when they execute the report.
2. Goto RSA1-> InfoObject tab-> Select InfoObject 0EMPLOYEE.
3. Selcet the following options:
Query Execution Filter Val. Selectn - 'Only Posted Value for Navigation'
Filter Value Repr. At Query Exec. - 'Selector Box Without Values'
Please let me know if there is any more issue. Feel free to raise further concern
Thnx,
Sukdev K -
How to compare the value node of a for-each-group with other for-each-group
Hello!
I have a report in Oracle BI Publisher (10.1.3.2) with several data set. My XML schema is something like
<DATA>
<PARAMETERS>
<MY_PARAMETERS>
<A_ID>12345</A_ID>
<DESCRIPTION>ABC</DESCRIPTION>
<VALUE>111111</VALUE>
</MY_PARAMETERS>
<MY_PARAMETERS>
<A_ID>12345</A_ID>
<DESCRIPTION>DEF</DESCRIPTION>
<VALUE>222222</VALUE>
</MY_PARAMETERS>
<MY_PARAMETERS>
<A_ID>67890</A_ID>
<DESCRIPTION>ABC</DESCRIPTION>
<VALUE>333333</VALUE>
</MY_PARAMETERS>
</PARAMETERS>
<NAMES>
<MY_NAMES>
<A_ID>12345</A_ID>
<NAME>ASDF</NAME>
</MY_NAMES>
<MY_NAMES>
<A_ID>67890</A_ID>
<NAME>EFGH</NAME>
</MY_NAMES>
</NAMES>
<VALUES>
<MY_VALUES>
<A_ID>12345<A_ID>
<VALUE>10987</VALUE>
<DESCRIPTION>ASDFG</DESCRIPTION>
</MY_VALUES>
<MY_VALUES>
<A_ID>12345<A_ID>
<VALUE>26385</VALUE>
<DESCRIPTION>EFGHI</DESCRIPTION>
</MY_VALUES>
<MY_VALUES>
<A_ID>67890<A_ID>
<VALUE>24355</VALUE>
<DESCRIPTION>ASDFG</DESCRIPTION>
</MY_VALUES>
</VALUES>
</DATA>
I'm trying to build a rtf template in Word using this XML schema. The "A_ID" nodes in each group in my data have the same value. I want for each "A_ID" take the respective values in /DATA/VALUES/MY_VALUES.
<?for-each-group:MY_PARAMETERS;./A_ID?>
<?for-each:current-group()?>
<?choose:?><?when: DESCRIPTION='ABC'?>
<?VALUE?>
<?end when?><?end choose?>
<?end for-each?>
<?for-each:current-group()?>
<?choose:?><?when: DESCRIPTION='DEF'?>
<?VALUE?>
<?end when?><?end choose?>
<?end for-each?>
<?/DATA/NAMES/MY_NAMES/VALUE?>
<?for-each-group:/DATA/VALUES/MY_VALUES;./A_ID?>
<?for-each:current-group()?>
<?choose:?><?when: DESCRIPTION='ASDFG'?>
<?VALUE?> <---------------- I obtain for this node the '24355' and '10987' values
<?end when?><?end choose?>
I want to know how to obtain only '24355' value, this is, the value for A_ID (/DATA/VALUES/MY_VALUES) = A_ID (/DATA/PARAMETERS/MY_PARAMETERS).
Can someone help me?CREATE OR REPLACE TRIGGER "TEST_TRG"
BEFORE UPDATE OF "STATUS"
ON "TABLE1"
FOR EACH ROW
BEGIN
IF (:NEW.status = 'HOLD')
THEN
INSERT INTO table2
(status
VALUES (:NEW.status
END IF;
END;You should learn how to write PL/SQL code.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
Hi All,
I have two tables - TABLE1 & TABLE2 and both the tables are having STATUS column. The requirement is like if the STATUS column of TABLE1 is updated as "HOLD" then the same value has to be updated to the STATUS column of TABLE2.
create or replace trigger "TEST_TRG"
BEFORE
update of "STATUS" on "TABLE1"
for each row
begin
if(:new.STATUS ='HOLD')then
insert into TABLE2 (STATUS)
value (:new.STATUS);
end if;
end;
COMPILATION ERROR:
Compilation failed, line 3 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
PLS-00103: Encountered the symbol "{" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "{" was ignored. Compilation failed, line 7 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
PLS-00103: Encountered the symbol "}" when expecting one of the following: ( begin case declare else elsif end exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "}" was ignored.
I am getting the compilation errors as above when the trigger is compiled. Can anyone please help me to correct it.
Thanks and Regards,
SuhasCREATE OR REPLACE TRIGGER "TEST_TRG"
BEFORE UPDATE OF "STATUS"
ON "TABLE1"
FOR EACH ROW
BEGIN
IF (:NEW.status = 'HOLD')
THEN
INSERT INTO table2
(status
VALUES (:NEW.status
END IF;
END;You should learn how to write PL/SQL code.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
How to add the values of all selected columns in a table and display it ?
Hi all,
I am using jdeveloper 11.1.1.6.0
Page:
my page jsff page contains one ADF table and one textbox
DB:
i have two database tables A & B ,
i need 2 columns from each table . say (A.product_no ,A.product_name,B.prodeuct_price ,B.confirm)
here product_no is primary key and present in both tables.
i need to create a VO combining these two tables and put it as ADF table in a jspx page
Functionality :
my 'confirm' field is a checkbox field in table . whenever the checkbox is selected,
the corresponding price will be getting added and display it in a textbox.
Eg:
if my first 4 price values are 3000 , 2000 ,4000,2000
and if i select first 3 values , then the text box should contain 9000 value.
i need help ...
Problem:
i need help in creating VO and functionality partHi,
it is easy: create an entity object for every table and one view object where you select your both entity objects and join them in your select statement.
Your desired 'confirm' functionality could be achieved with helpp of view object transient attributes - for more information see: http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcquerying.htm#CHDHJHBI
Regards
Pavol -
How to get the values of a selected row and edit it
hi all,
i am using a table component.I am populating it from the database.i used static text to display the data .i have a edit button in the last column. when i click on it that particular rows data should be shown in a text field in that row itself,so that i should be able to edit it and then if i save it it that row should change to statictext with the updated data.
please provide a solution for this...
regards,
rpkHi Andrea,
If you are using ADFBC, the easiest way is to drop the attribute(Say Name) from the data control palette as outputText component and add partialTriggers property of it to point to table id(to refresh the outputText whenever the row is selected in table)
Sireesha
Maybe you are looking for
-
Purchased CC for business and can only assign one user. How can I assign more users to have it on all 4 computers in the office?
-
Forgot my security question answers and when it sends the email I never get it
Forgot my security questions answers and every time they send the email I never get it
-
Being the only real editing capability, I've been using Google docs alot. I'm having several usability issues: Text selection issues: similar to my Evernote problem, selecting text doesn't work very well at all. Double-tap doesn't work and press and
-
Information on the API specification pages shows that to iterate through an ArrayList requires synchronization to avoid ConcurrentModificationException. I have written the code (also found in the Java tutorial) and get a type require or } missing err
-
FROM FCP X TO COMPRESSOR 4 HD FILE SETTINGS HELP!
Hello everyone. I just created my account out of dispair. I have been trying for over a week to find a solution but nothing... I need your expert help. The situation is as follows: I have a 135 min hd project in fcpx, with many effects and transition