Only updating specific rows.
How do I only update certain rows in an AdvancedDataGrid - to avoid updating the whole thing.
If it's any help, I want to update only the selected cells, or rows containing selected cells. (allowMultipleSelection="true").
One possible way is to convert selectedCells row and column values into references to the itemRenderer, and tell each itemRenderer to refresh. But If there is a more direct way - I'll take it. (Note that the documented AdvancedDataGrid.selectedItems property doesn't work).
Hi,
From your description, you have a list with Hyperlink/Picture column. When you change the Standard View to Datasheet View and perform bulk upload, the error occurs when there
are .jpg files.
I tried to reproduce via UI or code, all worked as expected.
Can this error occur if you upload the .jpg files in Standard View?
What if you upload one single .jpg file to this list in Datasheet View?
If the issue still exists, I suggest you do the same test on another clean list in case it is a list issue.
Feel free to reply with the test result if the issue still exists.
Best regards
Patrick Liang
TechNet Community Support
Similar Messages
-
Update Specific Rows In MySQL Database?
greetings all
i have MySQL database named library contains a table named books with the attributes:name,amount,price,cat_id
and i want to update all the names,amount,prices for specific cat_id
so i used the following query:
PreparedStatement ps = connection.prepareStatement("UPDATE books SET name = ?,amount = ?,price = ? Where cat_id = "+1);
and get the question marked values from the JTable named table_science
for(int i = 0 ; i< dtm_science.getRowCount(); i++){ ps.setString(1,(String)table_science.getValueAt(i,2)); ps.setInt(2,(Integer)table_science.getValueAt(i,1)); ps.setInt(3,(Integer)table_science.getValueAt(i,0)); ps.executeUpdate(); } ps.close(); connection.close();
the code doesn't work properly
it takes the values in the last row in the jtable and set them for all attributes with cat_id=1
meaning if you have 3 rows in the jtable named table_science which have cat_id=1 and the columns:
name,amount,price
abc,5,300
efg,6,400
mno,6,900
and when i exceute the update query all the fields in the database which have cat_id=1 would be set to mno,6,900
meaning that the table_science would be:
mno,6,900
mno,6,900
mno,6,900
is there's an error in the code?
or what's the problem?
thanks in advancethe database name:test
table name:books
attributes:name,amount,price,cat_id
description:several names may have the same cat_id
goal:when the user presses update button
all names,amounts,prices with cat_id=1 in the database is updated with the JTable values name,amount,price
problem:when changing values in the JTable and trying to update all names,amounts,prices with cat_id=1 is set to the last row values in the jtable?
here's the whole code:
import javax.swing.*;
import javax.swing.table.*;
import java.awt.Dimension;
import java.awt.*;
import javax.swing.JFrame;
import java.awt.event.*;
import javax.swing.JTable;
import java.sql.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSetMetaData;
import java.sql.ResultSet;
import java.sql.Statement;
class table_update extends JPanel {
static DefaultTableModel dtm1;
static JTable table1;
static JFrame frame;
public table_update() {
super(new GridLayout(1, 1));
dtm1 = new DefaultTableModel();
dtm1.addColumn("ID");
dtm1.addColumn("Name");
dtm1.addColumn("Amount");
dtm1.addColumn("Price");
table1 = new JTable(dtm1) {
public Class getColumnClass(int column) {
return getValueAt(0, column).getClass();
JScrollPane scrollPane1 = new JScrollPane(table1);
JButton Update = new JButton("Update");
table1.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
table1.setPreferredScrollableViewportSize(new Dimension(410, 160));
JPanel panel1 = new JPanel(new FlowLayout());
panel1.add(scrollPane1);
panel1.add(Update);
Update.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event20) {
update_db();
frame.dispose();
createAndShowGUI();
//reading from databse
try {
Class.forName("com.mysql.jdbc.Driver");
Connection c1 = DriverManager.getConnection("jdbc:mysql://localhost/test", "root", "");
Statement s1 = c1.createStatement();
ResultSet rs1 = s1.executeQuery("SELECT name,amount,price from books where cat_id=1");
int id1 = 0;
while (rs1.next()) {
id1++;
Object[] obj = {id1, rs1.getString("name"), rs1.getInt("amount"), rs1.getInt("price")};
dtm1.addRow(obj);
c1.close();
} catch (Exception e) {
e.printStackTrace();
table1.setModel(dtm1);
setLayout(new BorderLayout());
add(panel1, BorderLayout.CENTER);
public static void createAndShowGUI() {
frame = new JFrame("Update DB");
frame.setSize(500, 300);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(new table_update());
frame.setResizable(false);
frame.setVisible(true);
JTable table1 = new JTable();
table1.setModel(new DefaultTableModel(new Object[][][][]{}, new String[]{"id", "name", "amount", "price"}) {
Class[] types = new Class[]{
java.lang.Integer.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class
public Class getColumnClass(int columnIndex) {
return types[columnIndex];
public static void update_db() {
Connection c = null;
PreparedStatement ps = null;
try {
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost:3306/test?requireSSL=false&useUnicode=true&characterEncoding=utf8";
c = DriverManager.getConnection(url, "root", "");
ps = c.prepareStatement("UPDATE books SET name = ?,amount = ?,price = ? WHERE cat_id = 1 ");
for (int i = 0; i < dtm1.getRowCount(); i++) {
ps.setString(1, (String) table1.getValueAt(i, 1));
ps.setInt(2, (Integer) table1.getValueAt(i, 2));
ps.setInt(3, (Integer) table1.getValueAt(i, 3));
ps.executeUpdate();
ps.close();
c.close();
} catch (Exception ex) {
ex.printStackTrace();
public static void main(String[] args) {
createAndShowGUI();
} -
UPDATE of column in parent only UPDATEs first row in DENORMALIZED child table
In the Repositiry in Designer 6i, I denormalized DESC1 column to
pull the value of DESC1 in the parent table. The child table has
four (4) records with matching foreign keys. When I go into my
Form and update DESC1 in the parent, only the first of the four
child DESC1's are updated. Any ideas?
Thanks,
DanDan,
Sorry, known bug, but should be fixed in next release.
Have a look via metalink at article <Note:156833.1> this
explains in detail the problem and a fix.
The bug no was <1974122>
regards
David -
Hi,
I have a table (on a custom page) that includes MessageStyledText columns and a MessageCheckBox column, I would like to set the MessageCheckBox to Read Only if the value of the MessageStyledText column on the row is ‘XYZ’, could someone give me some pointers on how this can be achieved?
Oracle EBS: 12.1.3
JDEV: 10.1.3.3.0.3
Kind Regards
CarlSorted it using SPEL (as per https://forums.oracle.com/message/1815932#1815932).
-
Only update specific data between 2 ODS
I have 2 ODS ( with transfer rules between them).
I have DATE and period in the Source ODS1 , and I want to update only the register that the month of the date is equal to the period.
I create a rutine in the field DATE in the transfer rules:
<u><i><u>
if COMM_STRUCTURE-DOC_DATE+4(2) EQ COMM_STRUCTURE-/BIC/Z99PERCON.
result value of the routine
RETURNCODE = 0.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
endif.</u></i></u>
But it doent work. Becase the ods update all the data.
How can I do it? Is it correct in the transfer rules from the SourceODS to the second ODS?
thanks a lotHi,
try this.
if COMM_STRUCTURE-DOC_DATE+4(2) EQ COMM_STRUCTURE-/BIC/Z99PERCON.
RESULT = <thedate>.
RETURNCODE = 0.
ELSE.
RETURNCODE = 4.
ENDIF.
if you set the returncode to 4, the record will be skipped; is that your requirement?
hope that helps
Olivier.
if abort is not equal zero, the update process will be canceled
ABORT = 0. -
Update Trigger Assistance - Update Same Row More than Once?
Good morning,
I'm new to Triggers and am not understanding why this is not working. I've tried the web and none of the articles seem to answer my question. What I'm trying to do is clean a string and standardize some data the users input into a 1000 character
varchar field. I have a source table which has a trigger on it that inserts a limited number of columns that we'll use for reporting purposes. After the row has been inserted into the table (referred to as "destination" in the code block),
I'm looking to update the comments string, capitalizing the first character of the string, standardizing spacing after a colon, removing hyphens at the beginning of the string. The source and destination tables both have the comments field as a varchar
1000, not null data type with a key id between the source and destination tables. At another segment of our system, there were errors reporting nulls and when this was removed, everything cleared up. I can do a series of replace statements when
the data is required in reports but would rather have it clean in the destination table. The code is below:
CREATE TRIGGER [dbo].[destination_Update_trg]
ON [dbo].[destination]
AFTER UPDATE
AS
BEGIN
SET NOCOUNT ON;
IF EXISTS (SELECT *
FROM destination C
JOIN INSERTED I
ON I.PrimaryKeyID = C.PrimaryKey
WHERE I.Comments IS NOT NULL AND I.Comments <> '')
BEGIN
UPDATE T
SET T.Comments =
CASE
WHEN T.Comments <> '' AND LEFT(CAST(T.Comments AS VARCHAR (1000)), 2) LIKE '- %'
THEN SUBSTRING(T.Comments, 3, 1000)
END
FROM destination T
JOIN INSERTED I
ON T.primarykey = I.primarykey
WHERE T.primarykey = I.primarykey
UPDATE T
SET T.Comments = UPPER(LEFT(CAST(T.Comments AS VARCHAR (1000)), 1)) + SUBSTRING(CAST(T.Comments AS VARCHAR (1000)), 2, 1000)
FROM destination T
JOIN INSERTED I
ON T.primarykey = I.primarykey
WHERE T.primarykey = I.primarykey
UPDATE T
SET T.Comments = REPLACE(SUBSTRING(T.Comments, 1, 1000), ': ', ': ')-- '[A-9]: [A-9]'
FROM destination T
JOIN INSERTED I
ON T.primarykey = I.primarykey
WHERE T.primarykey = I.primarykey
AND SUBSTRING(T.Comments, 1, 1000) LIKE '%[A-Z]%: [A-Z]%'
END
RETURN
END;
GO
Perhaps there's a better way to accomplish the task. I appreciate your review and assistance. Thank you.First, the trigger only fires when you do an UPDATE. I'm not sure from your description whether or not you are expecting this trigger to fire when you do an insert on dbo.destination. If you want it to fire on INSERTs, then you need to specify
FOR INSERT (or FOR INSERT, UPDATE if you want it to fire on both inserts and updates).
More importantly, the first update in your trigger does
SET T.Comments =
CASE
WHEN T.Comments <> '' AND LEFT(CAST(T.Comments AS VARCHAR (1000)), 2) LIKE '- %' THEN SUBSTRING(T.Comments, 3, 1000)
END
When you do a CASE and you don't have an ELSE clause, there is an implicit ELSE NULL clause added. So your update is equivalent to
SET T.Comments =
CASE
WHEN T.Comments <> '' AND LEFT(CAST(T.Comments AS VARCHAR (1000)), 2) LIKE '- %' THEN SUBSTRING(T.Comments, 3, 1000)
ELSE NULL
END
So your very first update sets the Comments column to NULL in every row that was updated where the Comments column is not like '- %'. You want to change the case statement to be
SET T.Comments =
CASE
WHEN T.Comments <> '' AND LEFT(CAST(T.Comments AS VARCHAR (1000)), 2) LIKE '- %' THEN SUBSTRING(T.Comments, 3, 1000)
ELSE T.Comments
END
(Or you can put the test in the where clause so that you only update those rows where the Comments column is like '- %'. That would look like
UPDATE T
SET T.Comments = SUBSTRING(T.Comments, 3, 1000)
END
FROM destination T
JOIN INSERTED I
ON T.primarykey = I.primarykey
WHERE LEFT(CAST(T.Comments AS VARCHAR (1000)), 2) LIKE '- %'
(Note that you do not need to include the T.Comments <> '' because if T.Comments is Like '- %', then it cannot be the empty string and you do not need to include WHERE T.primarykey = I.primarykey because you know that is true since you did an inner
join on T.primarykey = I.primarykey.
Tom -
How to set a MessageTextInput to be Read Only for a specific row?
Hi,
In Benefits Self Service, particularly the Update Beneficiaries page, it lists all your eligible Beneficiaries including yourself. The table has the following columns displayed for each beneficiary: Beneficiary, Relationship, Social Security Number, Primary %, Contingent %, Clear. This is the page where you allocate the Primary % and the Contingent %. The Primary % and Contingent % are MessageText Input.
We have a requirement that we wouldn't want an employee to designate himself/herself as a beneficiary. However, the employee is being listed as a beneficiary along with all the other eligible beneficiaries. Oracle says it is an intended functionality to include the employee in the beneficiary. Is there a way thru Controller Object extension to set the Primary % and Contingent % as Read Only but only for the row corresponding to the employee to prevent the employee from accidentally allocating himself/herself as a beneficiary.
I know there is the SPEL functionality but this requires me to add a transient attribute to the View Object corresponding to that table. But everytime I make a change to the View Object either by adding a transient attribute or some other changes, I end up getting an error on the standard Relation attribute of that view object. The error is something like "Relation set attribute failed for View Object". I cannot get pass this error and I'm not sure what's causing this. I see other people in this forum have encountered the same problem when extending view objects but no specific solution was offered nor any clear explanation of the cause.
So I thought if there's any way this could be done thru Controller Object extension. If so, please let me know how. The challenge for me I think is finding the bean corresponding to those Message Text Input but only for a specific row in the table.
Thanks,
RonaldoHi,
I also tried extending the View Object but without changing anything to the SQL so it is exactly the same as the standard view object but I still get the "Attribute set for Relation in view object BeneficiaryPeopleVO1 failed". Based from this, extending the view object whether any change has been made or not affects the standard transient Relation attribute.
Here is the standard XML definition of the View Object if anyone is curious
<ViewObject
Name="BeneficiaryPeopleVO"
BindingStyle="Oracle"
CustomQuery="true"
RowClass="oracle.apps.ben.selfservice.enrollment.server.BeneficiaryPeopleVORowImpl"
ComponentClass="oracle.apps.ben.selfservice.enrollment.server.BeneficiaryPeopleVOImpl"
MsgBundleClass="oracle.jbo.common.JboResourceBundle"
FetchMode="FETCH_AS_NEEDED"
FetchSize="10"
UseGlueCode="false" >
<SQLQuery><![CDATA[
SELECT pcr.person_id person_id,
pen.prtt_enrt_rslt_id prtt_enrt_rslt_id,
con.first_name ||' '||con.last_name || ' ' || con.suffix Beneficiary,
con.national_identifier Ssn,
sum(decode(pbn.prmry_cntngnt_cd,'PRIMY',pbn.pct_dsgd_num,0)) primary_pct,
sum(decode(pbn.prmry_cntngnt_cd,'CNTNGNT',pbn.pct_dsgd_num,0)) contingent_pct,
con.person_id bnf_person_id,
con.business_group_id,
pen.per_in_ler_id,
pbn.pl_bnf_id pl_bnf_id,
pbn.object_version_number object_version_number,
pbn.effective_start_date,
pcr.contact_type contact_type,
con.full_name beneficiary_full_name,
sum(decode(pbn.prmry_cntngnt_cd,'PRIMY',pbn.pct_dsgd_num,0)) Db_Primary_pct,
sum(decode(pbn.prmry_cntngnt_cd,'CNTNGNT',pbn.pct_dsgd_num,0)) db_contingent_pct,
DECODE(pbn.pl_bnf_id, null, 'DeleteIconDisabled', 'DeleteIconEnabled') delete_switcher,
pen.pl_id pl_id,
pen.oipl_id oipl_id,
nvl((select 'Y' from dual where (to_date(:1 , 'rrrr/mm/dd') between
nvl(pcr.date_start,to_date(:2 , 'rrrr/mm/dd')) and
nvl(pcr.date_end,to_date(:3 , 'rrrr/mm/dd'))) and
(pil.lf_evt_ocrd_dt <= nvl(con.date_of_death,pil.lf_evt_ocrd_dt))), 'N') rel_exists_flag
FROM per_people_f con,
per_contact_relationships pcr,
ben_pl_bnf_f pbn,
ben_prtt_enrt_rslt_f pen,
ben_per_in_ler pil
WHERE pcr.personal_flag = 'Y'
AND (pbn.pl_bnf_id is not null or
(to_date(:4 ,'rrrr/mm/dd') between
nvl(pcr.date_start,to_date(:5 ,'rrrr/mm/dd'))
AND nvl(pcr.date_end,to_date(:6 ,'rrrr/mm/dd'))
and pil.lf_evt_ocrd_dt <= nvl(con.date_of_death,pil.lf_evt_ocrd_dt))) --Bug 4297137
AND pcr.contact_person_id = con.person_id
and pen.person_id = pcr.person_id
AND pbn.bnf_person_id (+) = con.person_id
AND to_date(:7 ,'rrrr/mm/dd') between pbn.effective_start_date (+)
AND pbn.effective_end_date (+)
AND pcr.person_id = :8
and pen.prtt_enrt_rslt_id = :9
and to_date(:10 , 'rrrr/mm/dd') between con.effective_start_date and con.effective_end_date
and to_date(:11 , 'rrrr/mm/dd') between pen.effective_start_date and pen.effective_end_date
and pil.per_in_ler_id = pen.per_in_ler_id
and pil.per_in_ler_stat_cd NOT IN('VOIDD', 'BCKDT')
and pbn.prtt_enrt_rslt_id (+) = :12
and ((to_date(:13 ,'rrrr/mm/dd') between
nvl(pcr.date_start,to_date(:14 ,'rrrr/mm/dd')) and
nvl(pcr.date_end,to_date(:15 ,'rrrr/mm/dd'))) or
((pcr.date_start = (select max(pcr2.date_start)
from per_contact_relationships pcr2
where pcr2.contact_person_id = pcr.contact_person_id
and pcr2.person_id = pcr.person_id
and pcr2.personal_flag = 'Y')) and
not exists (select null
from per_contact_relationships pcr3
where pcr3.contact_person_id = pcr.contact_person_id
and pcr3.person_id = pcr.person_id
and pcr3.personal_flag = 'Y'
and to_date(:16 ,'rrrr/mm/dd') between
nvl(pcr3.date_start,to_date(:17 ,'rrrr/mm/dd'))
and nvl(pcr3.date_end,to_date(:18 ,'rrrr/mm/dd')))
and (pbn.pl_bnf_id is null or
exists (select null from ben_per_in_ler pil2
where pil2.per_in_ler_id = pbn.per_in_ler_id
and pil2.per_in_ler_stat_cd not in ('VOIDD','BCKDT')))
GROUP BY pcr.person_id,
pen.prtt_enrt_rslt_id,
con.last_name,con.first_name,con.suffix,
con.full_name,
con.national_identifier,
pcr.contact_type,
con.date_of_birth,
con.person_id,
con.business_group_id,
pen.per_in_ler_id,
pl_bnf_id,
pbn.object_version_number,
pbn.effective_start_date,
pen.pl_id,
pen.oipl_id,
pcr.date_start,
pcr.date_end,
pil.lf_evt_ocrd_dt,
con.date_of_death
union
SELECT to_number(null) person_id,
pen.prtt_enrt_rslt_id prtt_enrt_rslt_id,
con.first_name ||' '||con.last_name || ' ' || con.suffix Beneficiary,
con.national_identifier Ssn,
sum(decode(pbn.prmry_cntngnt_cd,'PRIMY',pbn.pct_dsgd_num,0)) primary_pct,
sum(decode(pbn.prmry_cntngnt_cd,'CNTNGNT',pbn.pct_dsgd_num,0)) contingent_pct,
con.person_id bnf_person_id,
con.business_group_id,
pen.per_in_ler_id,
pbn.pl_bnf_id pl_bnf_id,
pbn.object_version_number object_version_number,
pbn.effective_start_date,
'SLF' contact_type,
con.full_name beneficiary_full_name,
sum(decode(pbn.prmry_cntngnt_cd,'PRIMY',pbn.pct_dsgd_num,0)) Db_Primary_pct,
sum(decode(pbn.prmry_cntngnt_cd,'CNTNGNT',pbn.pct_dsgd_num,0)) db_contingent_pct,
DECODE(pbn.pl_bnf_id, null, 'DeleteIconDisabled', 'DeleteIconEnabled') delete_switcher,
pen.pl_id pl_id,
pen.oipl_id oipl_id,
'Y' rel_exists_flag
FROM per_people_f con,
ben_pl_bnf_f pbn,
ben_prtt_enrt_rslt_f pen,
ben_per_in_ler pil
WHERE
pbn.bnf_person_id (+) = con.person_id
AND to_date(:19 ,'rrrr/mm/dd') between pbn.effective_start_date (+)
AND pbn.effective_end_date (+)
AND con.person_id = :20
and con.person_id = pen.person_id
and pen.prtt_enrt_rslt_id = :21
and to_date(:22 , 'rrrr/mm/dd') between con.effective_start_date and con.effective_end_date
and to_date(:23 , 'rrrr/mm/dd') between pen.effective_start_date and pen.effective_end_date
and pil.per_in_ler_id = pen.per_in_ler_id
and pil.per_in_ler_stat_cd NOT IN('VOIDD', 'BCKDT')
and (pbn.pl_bnf_id is not null or pil.lf_evt_ocrd_dt <= nvl(con.date_of_death,pil.lf_evt_ocrd_dt)) --Bug 4297137
and pbn.prtt_enrt_rslt_id (+) = :24
and (pbn.pl_bnf_id is null or
exists (select null from ben_per_in_ler pil2
where pil2.per_in_ler_id = pbn.per_in_ler_id
and pil2.per_in_ler_stat_cd not in ('VOIDD','BCKDT')))
GROUP BY pen.prtt_enrt_rslt_id,
con.last_name,con.first_name,con.suffix,
con.full_name,
con.national_identifier,
con.date_of_birth,
con.person_id,
con.business_group_id,
pen.per_in_ler_id,
pl_bnf_id,
pbn.object_version_number,
pbn.effective_start_date,
pen.pl_id,
pen.oipl_id
ORDER BY 3,14
]]></SQLQuery>
<DesignTime>
<Attr Name="_isCodegen" Value="true" />
<Attr Name="_version" Value="9.0.3.13.75" />
<Attr Name="_CodeGenFlagNew" Value="36" />
<Attr Name="_rowSuperClassName" Value="oracle.apps.fnd.framework.server.OAPlsqlViewRowImpl" />
<Attr Name="_objectSuperClassName" Value="oracle.apps.fnd.framework.server.OAPlsqlViewObjectImpl" />
</DesignTime>
<ViewAttribute
Name="PersonId"
IsQueriable="false"
IsPersistent="false"
Precision="15"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="PERSON_ID"
ColumnType="$none$"
Expression="'See the SQL...'"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="PrttEnrtRsltId"
IsQueriable="false"
IsPersistent="false"
Precision="15"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="PRTT_ENRT_RSLT_ID"
ColumnType="$none$"
Expression="'See the SQL...'"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="Beneficiary"
IsQueriable="false"
IsPersistent="false"
Precision="332"
Type="java.lang.String"
AliasName="BENEFICIARY"
ColumnType="$none$"
Expression="'See the SQL...'"
SQLType="VARCHAR" >
</ViewAttribute>
<ViewAttribute
Name="Ssn"
IsQueriable="false"
IsPersistent="false"
Precision="30"
Type="java.lang.String"
AliasName="SSN"
ColumnType="$none$"
Expression="'See the SQL...'"
SQLType="VARCHAR" >
</ViewAttribute>
<ViewAttribute
Name="PrimaryPct"
IsQueriable="false"
IsPersistent="false"
Precision="15"
Type="oracle.jbo.domain.Number"
AliasName="PRIMARYPCT"
ColumnType="$none$"
Expression="'See the SQL...'"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="ContingentPct"
IsQueriable="false"
IsPersistent="false"
Precision="15"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="CONTINGENTPCT"
ColumnType="$none$"
Expression="'See the SQL...'"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="BnfPersonId"
IsQueriable="false"
IsPersistent="false"
Precision="15"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="BNFPERSONID"
ColumnType="$none$"
Expression="'See the SQL...'"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="BusinessGroupId"
IsQueriable="false"
IsPersistent="false"
Precision="15"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="BUSINESSGROUPID"
ColumnType="$none$"
Expression="'See the SQL...'"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="PerInLerId"
IsQueriable="false"
IsPersistent="false"
Precision="15"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="PERINLERID"
ColumnType="$none$"
Expression="'See the SQL...'"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="PlBnfId"
IsQueriable="false"
IsPersistent="false"
Precision="15"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="PL_BNF_ID"
ColumnType="$none$"
Expression="PL_BNF_ID"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="ObjectVersionNumber"
IsQueriable="false"
IsPersistent="false"
Precision="9"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="OBJECT_VERSION_NUMBER"
ColumnType="$none$"
Expression="OBJECT_VERSION_NUMBER"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="EffectiveStartDate"
IsQueriable="false"
IsPersistent="false"
Type="oracle.jbo.domain.Date"
AliasName="EFFECTIVE_START_DATE"
ColumnType="$none$"
Expression="EFFECTIVE_START_DATE"
SQLType="DATE" >
</ViewAttribute>
<ViewAttribute
Name="ContactType"
IsQueriable="false"
IsPersistent="false"
IsNotNull="true"
Precision="30"
Type="java.lang.String"
AliasName="CONTACT_TYPE"
ColumnType="$none$"
Expression="CONTACT_TYPE"
SQLType="VARCHAR" >
<DesignTime>
<Attr Name="_DisplaySize" Value="30" />
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="BeneficiaryFullName"
IsQueriable="false"
IsPersistent="false"
Precision="240"
Type="java.lang.String"
AliasName="BENEFICIARY_FULL_NAME"
ColumnType="$none$"
Expression="BENEFICIARY_FULL_NAME"
SQLType="VARCHAR" >
<DesignTime>
<Attr Name="_DisplaySize" Value="240" />
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="DbPrimaryPct"
IsQueriable="false"
IsPersistent="false"
Type="oracle.jbo.domain.Number"
AliasName="DB_PRIMARY_PCT"
ColumnType="$none$"
Expression="DB_PRIMARY_PCT"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="DbContingentPct"
IsQueriable="false"
IsPersistent="false"
Type="oracle.jbo.domain.Number"
AliasName="DB_CONTINGENT_PCT"
ColumnType="$none$"
Expression="DB_CONTINGENT_PCT"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="Relation"
IsQueriable="false"
IsPersistent="false"
Type="java.lang.String"
AliasName="Relation"
ColumnType="$none$"
SQLType="VARCHAR" >
</ViewAttribute>
<ViewAttribute
Name="DeleteSwitcher"
IsPersistent="false"
Precision="30"
Type="java.lang.String"
AliasName="DeleteSwitcher"
ColumnType="VARCHAR2"
Expression="DeleteSwitcher"
SQLType="VARCHAR" >
</ViewAttribute>
<ViewAttribute
Name="PlId"
IsPersistent="false"
Precision="15"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="PlId"
ColumnType="VARCHAR2"
Expression="PlId"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="OiplId"
IsUpdateable="false"
IsPersistent="false"
Precision="15"
Scale="0"
Type="oracle.jbo.domain.Number"
AliasName="OiplId"
ColumnType="VARCHAR2"
Expression="OiplId"
SQLType="NUMERIC" >
</ViewAttribute>
<ViewAttribute
Name="RelExistsFlag"
IsQueriable="false"
IsPersistent="false"
Precision="30"
Type="java.lang.String"
AliasName="REL_EXISTS_FLAG"
ColumnType="VARCHAR2"
Expression="REL_EXISTS_FLAG"
SQLType="VARCHAR" >
</ViewAttribute>
</ViewObject>
Thanks,
Ronaldo -
Cursor only updates every second row
Hello Helpful Peoples
I have a table with a set of delivery dates, and am wanting to add a date on which a reminder flag should be raised by the system. The delivery dates are already populated and I'm wanting to add functionality where the end user can set how many days prior they are reminded.
I've opened a cursor to retrieve all the current due dates from my source table. When I loop through this cursor and update the reminder date and reminder text, my code is only updating every second row.
I can't work out why this code seems to skip a row every time it updates a record. Is anyone able to assist?
declare
v_date rep_delivery.reminderdate%type;
v_rownum number;
CURSOR reminder_cur
IS
SELECT DEL.DUEDATE
FROM REP_DELIVERY DEL
WHERE DEL.REP_ID = :P212_REP_ID:
FOR UPDATE OF DEL.REMINDERDATE;
begin
FOR x IN reminder_cur LOOP
FETCH reminder_cur INTO v_date;
EXIT WHEN reminder_cur%NOTFOUND;
v_date := v_date - to_number(:P212_REMDAYS);
UPDATE REP_DELIVERY DEL2
SET DEL2.REMINDERDATE = v_date
WHERE CURRENT OF reminder_cur;
UPDATE REP_DELIVERY DEL3
SET DEL3.REMINDERTEXT = :P212_DESCRIPTION
WHERE CURRENT OF reminder_cur;
END LOOP;
commit;
end;Oolite,
Use this code:
DECLARE
v_date rep_delivery.reminderdate%TYPE;
CURSOR reminder_cur
IS
SELECT ROWID, duedate
FROM rep_delivery
WHERE rep_id = :p212_rep_id
FOR UPDATE OF reminderdate;
BEGIN
FOR x IN reminder_cur
LOOP
v_date := x.duedate;
v_date := v_date - TO_NUMBER (:p212_remdays);
UPDATE rep_delivery del2
SET del2.reminderdate = v_date,
del2.remindertext = :p212_description
WHERE ROWID = x.ROWID;
END LOOP;
COMMIT;
END;and it will work for you.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
hi,
is there a way to only view certain rows in a resultset, i wanted to add a 1 out of 10 pages link on a jsp or servlet page along with the data that fits into that page. but i don't want to have to loop through the entire resultset picking out only what i need, is there a way to tell the resultset to only give me back rows 10-20 for example, if the resultant query returns 100 rows, if it depends on the database, i might be using access or mysql?
i tried the jdbc forum a few days ago and got no response, any ideas here?
Thank youI agree with the others that extracting all the data from the ResultSet into a collection is the way to go. It has the added benefit of not tying up db resources while your user is looking at data.
The way I have done this is to create a class called DataGrid, which is basically just a wrapper around a List of Lists. I created another class called ResultSetConverter that can create a DataGrid from a ResultSet. (ResultSetConverter actually extends DataGrid).
DataGrids can be displayed as a table by a GridView object. GridView has a toHtmlTable() method that will create the table and return it as a String. GridView has a subclass called PaginatedView that has properties like pageSize(), currentPage(), next(), previous(), etc, that allow viewing of one page of data at a time, and navigation thru those pages.
So the code to use this would look like:
class DataGrid {....
class ResultSetConverter extends DataGrid {...
class GridView { ...
class PaginatedView extends GridView {...
ResultSet rs = getResultSetFromSomewhere();
DataGrid grid = new ResultSetConverter( rs );
PaginatedView view = new PaginagedView( grid );
view.setPageSize( 10 );
String table = view.toHtmlTable(); -
Extract data on specific rows in Excel file and add it to different word document on specific rows
I was wondering about if it's possible to set up some kind of vba for this function. I have one worksheet with different data in. Where it is written the same thing like 1A & 2A And 1B & 2B
And if i could put this information on specific rows in a Word document.
I would like to have all of the different data on row 1 in one specific row in a word sheet for it self and the different data on on row 2 copied into different rows in a new word document if it's possible to do some kind of domino effect of this where it can
run 5000 diffrent rows with this kind of inputs,
Im sorry for the bad explanation i did not really know how to translate it as good as possible, write back if you have any question!
Cell 1A: Bmw Cell 1B: Automatic Cell 1C: Diesel Cell 1D: 2014
Cell 2A: Volvo Cell 2B: Manual Cell 2C: Bensin Cell 2D: 2010Run this code in Excel.
Sub PushToWord()
Dim objWord As New Word.Application
Dim doc As Word.Document
Dim bkmk As Word.Bookmark
sWdFileName = Application.GetOpenFilename(, , , , False)
Set doc = objWord.Documents.Open(sWdFileName)
objWord.activedocument.variables("BrokerFirstName").Value = Range("BrokerFirstName").Value
objWord.activedocument.variables("BrokerLastName").Value = Range("BrokerLastName").Value
ActiveDocument.Fields.Update
objWord.Visible = True
End Sub
You must add a few DocVariables to your Word document. See these links for more information.
http://word.tips.net/T000813_Understanding_Document_Variables.html
https://www.youtube.com/watch?v=aABYENF1bMI
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it. -
Programmatically refresh components inside a specific row of an af:table
How to programmatically refresh components inside a specific row of an af:table without refreshing the whole table ?_
I have an af:table displaying a read-only view object. There is an edit button inside the table calling an af:popup, where the user can update some informations and click a submit button to validate his changes.
The action property of this button is a method in a backing been where
- 1 : A stored procedure is called to update several tables (related to my read-only VO).
- 2 : The VO is re-queried (VO. refreshQueryKeepingCurrentRow() )
- 3 : The whole table is refreshed (AdfFacesContext.getCurrentInstance().addPartialTarget(myTable) )
Is it possible to programmatically refresh some components of the current row of the table without refreshing the whole table (point 3)?
I’ve tried to play with the “partialTrigger” property of af:outputText (table:column:outputText), without success.
Thanks
Nicolas"+do you happen to want to refresh following an action on the row? Like a link/button click?+" : NO
There is a table on my page. The user select a row and click on an edit button. This edit button call a popup where the user can modify some information (not directly on the viewObject. All fields in the popup are dummy fields bind to attributes in my backing bean) and then he click on a submit button.
The submit button action execute a method "submitInformation" in a backing been.
public String submitInformation(){
Map<String, Object> params = new HashMap<String, Object>();
params.put("pManNo", xManNo.getValue()); //xManNo is an attribute of the backing bean
params.put("pDate", xPeriod.getValue()); //xPeriod is an attribute of the backing bean
// Execute Operation
OperationBinding oper = ADFUtils.findOperation("serviceSubmitInfo");
oper.getParamsMap().putAll(params);
String results = (String)oper.execute();
// Close Popup & Refresh Row if OK
if(!StringUtils.isStringEmpty(results) && results.equals("TRUE")){
closePopup("pt1:popAbs");
refreshMyCol();
}The serviceSubmitInfo method is defined in my serviceImpl
public String serviceSubmitInfo (String pManNo, String pPeriod, ......){
String results =
callStoredFunction("? :=myDatabaseFunction(?, ?, ?, ?)",
new Object[] { pManNo, pPeriod, ...... });
// Commit
getDBTransaction().commit();
// Refresh VO (re-query & set currentRow)
getMyVO().refreshQueryKeepingCurrentRow();
return results; // TRUE if ok
}I want the " refreshMyCol()" method to refresh only the current row and not the whole table...
Regards
Nicolas -
Remove specif rows in a CSV with Powershell
Hi All,
I have the following script which tells me if an account is in AD, disabled or not present:-
$users = Import-Csv c:\migration\batches\AWTESTFILES\awtestfiles.csv
foreach($u in $users){
$Name = $u.name
$User = Get-ADUser -LDAPFilter "(sAMAccountName=$Name)"
If (($User -ne $Null) -and ($user.enabled-eq $False)){
# $outfile = (Join-Path $destination $errfilename)
Write-Host "$name is Disabled" -fore red
if ($User -eq $null){
Write-Host "$Name is not in Active Directory" -ForegroundColor Yellow
# $Name = "$($u.name) is not in Active Directory "
# Add-Content $outfile -Value $Name
If (($User -ne $null) -and ($User.enabled -eq $true)){
Write-Host "$name is in Active Directory and Enabled" -fore green
If the account is disabled or not present I wan to remove the entry from the csv file so that they are not migrated.
What is the easiest way to do this?
I know how to call up excel and manipulate some data but I'm not sure how to delete a specific row base on the name
TIA
AndyHi Andy,
I'd test the users in your input file and then create a new output file that only contains the enabled users. Are you able to use a second file or do you have to update the original?
Don't retire TechNet! -
(Don't give up yet - 12,830+ strong and growing) -
Update 100 Row Data In One Time against a Code
Dear Expert,
How can I update a Master Data Row Table record using a particular code. Like I write a query Update Table Set U_UDF = 'Value' Where Code = 2
U_UDF is the field of Master Data Row Table's field. There are 100 Row against code 2 & I want to update all row with same value but in one time only.
How can I do that ?
Plz help me.
RegardsHi,
Try this:
SAPbobsCOM.GeneralService oGeneralService = null;
SAPbobsCOM.GeneralData oGeneralData = null;
SAPbobsCOM.GeneralDataParams oGeneralParams = null;
SAPbobsCOM.CompanyService sCmp = null;
SAPbobsCOM.GeneralData oChild = null;
SAPbobsCOM.GeneralDataCollection oChildren = null;
sCmp = SBO_Company.GetCompanyService();
oGeneralService = sCmp.GetGeneralService("UDO");
// Get UDO record
oGeneralParams = ((SAPbobsCOM.GeneralDataParams)(oGeneralService.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams)));
oGeneralParams.SetProperty("Code", ContractCode);
oGeneralData = oGeneralService.GetByParams(oGeneralParams);
// Add lines on UDO Child Table
oChildren = oGeneralData.Child("CONTRACTDETAIL");
// Update an existing line
oChild = oChildren.Item(LineId - 1);
DateTime dt = DateTime.Now;
oChild.SetProperty("U_STATS", "Terminated");
oChild.SetProperty("U_Updated", dt);
oChild.SetProperty("U_Remarks", "Service Terminated");
//Update the UDO Record
oGeneralService.Update(oGeneralData);
I have given you the sample. Just change it accordingly.
Hope it helps.
Thanks & Regards
Ankit Chauhan -
How to select specific rows in rtf template for complex calculation
Hi,
I want custom calculation in my rtf template and for this i need to select specific cell's value OR specific row's value. Any one please suggest how can I get this. Below is the example i have plotted using excel. My target is to get field 8 and 9 using sum and minus. We can calculate column over column, is there any way to calculate row over row? If I use variables, then i have to create so many variables because I have more columns and rows to calculate (here i posted one sample table). Any one please help me how can I get expected result other than using variables! If "Using variables" is the only way then also give your valuable opinions.
Row No
Curr Qtr
PQtr1
PQtr2
3
B3
C3
D3
4
B4
C4
D4
5
B5
C5
D5
6
B6
C6
D6
7
B7
C7
D7
8
B8=SUM(B4:B7)
C8=SUM(C4:C7)
D8=SUM(D4:D7)
9
B9=B8-B5
C9=C8-C5
D9=D8-D5
Thanks.Hi AlexAnd,
Thanks for the reply, I got 0 using both codes. This is a dummy table and I plotted 3,4 to give an idea of row number (as like as excel). Rows are individual data sets combining different measures and dimensions with different values.
Account
Curr_Qtr
PQtr1
PQtr2
Deposit
10
15
20
Loan
15
20
25
Earning
20
25
30
Assets
25
30
35
Total
=SUM(15,20)
=SUM(20,25)
=SUM(25,30)
Expense
=SUM(15,20)-25
=SUM(20,25-30
=SUM(15,20)-25
Is there any way to identify the range or individual cell's value? Using variables I have to create lots of variables for each cells, I want to avoid that and want to use rows in calculation! Is that possible, Pls share your valuable opinions!
Thanks. -
How to apply the constraint ONLY to new rows
Hi, Gurus:
I have one question as follows:
We need to migrate a legacy system to a new production server. I am required to add two columns to every table in order to record who updates the row most recently through triggers, and I should apply not null constraint to the columns . However, since legacy system already has data for every table, and old data does not have value for the 2 new columns. If we apply the constraint, all of existing rows will raise exception. I wonder if there is possibility to apply the constraint ONLY to new rows to come in future.
Thanks.
SamWe need to migrate a legacy system to a new production server. I am required to add two columns to every table in order to record who updates the row most recently through triggers, and I should apply not null constraint to the columns .
The best suggestion I can give you is that you make sure management documents the name of the person that came up with that hair-brained requirement so they can be sufficiently punished in the future for the tremendous waste of human and database resources they caused for which they got virtually NOTHING in return.
I have seen many systems over the past 25+years that have added columns such as those: CREATED_DATE, CREATED_BY, MODIFIED_DATE, MODIFIED_BY.
I have yet to see even ONE system where that information is actually useful for any real purpose. Many systems have application/schema users and those users can modify the data. Also, any DBA can modify the data and many of them can connect as the schema owner to do that.
Many tables also get updated by other applications or bulk load processes and those processes use generic connections that can NOT be tied back to any particular system.
The net result is that those columns will be populated by user names that are utterly useless for any auditing purposes.
If a user is allowed to modify a table they are allowed to modify a table. If you want to track that you should implement a proper security strategy using Oracle's AUDIT functionality.
Cluttering up ALL, or even many, of your tables with such columns is a TERRIBLE idea. Worse is adding triggers that server no other purpose but capture useless infomation but, because they are PL/SQL cause performance impacts just aggravates the total impact.
It is certainly appropriate to be concerned about the security and auditability of your important data. But adding columns and triggers such as those proposed is NOT the proper solution to achieve that security.
Before your organization makes such an idiotic decision you should propose that the same steps be taken before adding that functionality that you should take before the addition of ANY MAJOR structural or application changes:
1. document the actual requirement
2. document and justify the business reasons for that requirement
3. perform testing that shows the impact of that requirement on the production system
4. determine the resource cost (people, storage, etc) of implementing that requirement
5. demonstrate how that information will actually be used EFFECTIVELY for some business purpose
As regards items #1 and #2 above the requirement should be stated in terms of the PROBLEM to be solved, not some preconceived notion of the solution that should be used.
Your org should also talk to other orgs or other depts in your same org that have used your proposed solution and find out how useful it has been for them. If you do this research you will likely find that it hasn't met their needs at all.
And in your own org there are likely some applications with tables that already have such columns. Has anyone there EVER used those columns and found them invaluable for identifying and resolving any actual problem?
If you can't use them and their data for some important process why add them to begin with?
IMHO it is a total waste of time and resources to add such columns to ALL of your tables. Any such approach to auditing or security should, at most, be limited to those tables with key data that needs to be protected and only then when you cannot implement the proper 'best practices' auditing.
A migration is difficult enough without adding useless additional requirements like those. You have FAR more important things you can do with the resources you have available:
1. Capture ALL DDL for the existing system into a version control system
2. Train your developers on using the version control system
3. Determining the proper configuration of the new server and system. It is almost a CERTAINTY that settings will get changed and performance will suffer even though you don't think you have changed anything at all.
4. Validating that the data has been migrated successfully. That can involve extensive querying and comparison to make sure data has not been altered during the migration. The process of validating a SINGLE TABLE is more difficult if the table structures are not the same. And they won't be if you add two columns to every table; every single query you do will have to specify the columns by name in order to EXCLUDE your two new columns.
5. Validating the performance of the app on the new system. There WILL BE problems where things don't work like they used to. You need to find those problems and fix them
6. Capturing the proper statistics after the data has been migrated and all of the indexes have been rebuilt.
7. Capturing the new execution plans to use a a baseline for when things go wrong in the future.
If it is worth doing it is worth doing right.
Maybe you are looking for
-
Hello! I have read the other posts about this issue but I want to make sure I understand it correctly. Do not mix 4 & 8gb RAM with 16gb and higher RAM. That part I get, but what I want to be sure of is that I can configure the RAM as follows... 2 slo
-
How can I change the order of my podcasts on my iPod?
I am adding a lot of new podcasts to my iPod. However they are being organized by most recent first and oldest last. I want to hear them in release order without having to go backwards. I can change the order in iTunes, but I can't seem to get my
-
OIM 11g R1 - Container for Roles
Hi, is it possible to create container for roles? For Example: Container1: RoleA, RoleB, RoleC Container2: RoleV, RoleY, RoleZ The reason is, i want to create authorization policies, which allows the user to assign specials roles. The problem is, tha
-
Start-up issues - system folder
Hey gang, I've got a bondi blue 233mhz G3 iMac. It has 160 mg of ram if I remember right (has 128mb chip in slot). Anyways, I got a hard drive from the guts of another imac we found... in a dumpster, of all places. The motherboard was fried on that o
-
Cannot find Launcher after completing trial download
Downloaded Primiere Pro Trial but cannot find the launcher. Tried to re-install from the adobe download assistant, encountered a message that said - either to ignore or quit installation and restart computer - tried both but kept on getting the same