Master / Details validation insert row details before master
Hi,
I have the following scenario:
I have a form with a master details input.
When I click on 'New' to add a record in the details, the validation of the input in the master alerts me that I should fill the inputText.
If I fill the Master then the details, it will works.
But, if I fill the details before the master, I got the validation to fill the records.
What I want:
- to be able to fill the details without firing the validation of the master inputText since the button I clicked was for adding a new record and NOT to commit the master details ...
I tried to copy some code ..
maybe it will help.
I tried partialSubmit, partialTriggers ...
All attributes don't work. Maybe I did an error in my design page or my organazation of forms.
Please give me a detailed example that works for my situation
<af:panelHeader text="Visitors" id="ph1">
<af:panelFormLayout id="pfl1" partialTriggers="newVisitdetail">
<af:inputText value="#{bindings.Name.inputValue}"
label="#{tasdeequiBundle['m_name']}"
required="#{bindings.Name.hints.mandatory}"
columns="#{bindings.Name.hints.displayWidth}"
maximumLength="#{bindings.Name.hints.precision}"
shortDesc="#{bindings.Name.hints.tooltip}" id="it234"
partialTriggers="test"
autoSubmit="false">
<f:validator binding="#{bindings.Name.validator}"/>
</af:inputText>
</af:panelFormLayout>
</af:panelHeader>
<af:panelHeader text="Visitors" id="ph2">
<af:toolbar flex="0" id="toolbar1">
<af:spacer width="10" height="5" id="spacer1"/>
<af:commandToolbarButton text="#{tasdeequiBundle['global.button.New']}"
icon="/images/new_ena.png"
partialSubmit="false"
id="newVisitdetail"
actionListener="#{bindings.CreateInsert.execute}"
disabled="#{!bindings.CreateInsert.enabled}"
partialTriggers="t1 ph2">
</af:commandToolbarButton>
<af:spacer width="5" height="5" id="spacer3"/>
</af:toolbar>
<af:table rows="#{bindings.TsVisitdetailsVO2.rangeSize}"
fetchSize="#{bindings.TsVisitdetailsVO2.rangeSize}"
emptyText="#{bindings.TsVisitdetailsVO2.viewable ? 'No data to display.' : 'Access Denied.'}"
var="row"
value="#{bindings.TsVisitdetailsVO2.collectionModel}"
rowBandingInterval="0"
selectedRowKeys="#{bindings.TsVisitdetailsVO2.collectionModel.selectedRow}"
selectionListener="#{bindings.TsVisitdetailsVO2.collectionModel.makeCurrent}"
filterVisible="true" varStatus="vs"
width="100%" inlineStyle="width:100%"
rowSelection="single" id="t1"
summary="Visitdetails List"
editingMode="clickToEdit">
<af:column headerText="#{tasdeequiBundle['d_fullname']}"
rowHeader="false"
sortProperty="Name" sortable="false" id="c8">
<af:inputText value="#{row.bindings.Name.inputValue}"
label="#{bindings.TsVisitdetailsVO2.hints.Name.label}"
required="#{bindings.TsVisitdetailsVO2.hints.Name.mandatory}"
columns="#{bindings.TsVisitdetailsVO2.hints.Name.displayWidth}"
maximumLength="#{bindings.TsVisitdetailsVO2.hints.Name.precision}"
shortDesc="#{bindings.TsVisitdetailsVO2.hints.Name.tooltip}" id="ot15">
<f:validator binding="#{row.bindings.Name.validator}"/>
</af:inputText>
</af:column>
</af:table>
</af:toolbar>
</af:panelHeader>
Regards,
Hi,
did you see this part of the documentation
http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadveo.htm#CEGJAFCF
Frank
Similar Messages
-
How to Commit before Insert Row when Press Create Insert Button ?
Hi all;
I'm Using JDev 11.1.1.2.0
How to Commit before Insert Row when Press Create Insert Button in ADF11g?
<af:commandButton actionListener="#{bindings.CreateInsert.execute}"
text="CreateInsert"
disabled="#{!bindings.CreateInsert.enabled}"
id="cb8" />
best regards;You need to do a custom method eather in managed bean or in Application module to do that.
in managed bean it would be something like:
public void CommitAndInsert(ActionEvent actionEvent) {
OperationBinding opCommit = ADFUtils.findOperation("Commit");
opCommit.execute();
OperationBinding opCreateInsert = ADFUtils.findOperation("CreateInsert");
opCreateInsert.execute();
In page bindings Commit and CreateInsert must exist
then the button actionListener will be
<af:commandButton actionListener="#{backing.CommitAndInsert}" -
How to preserve database user details before cloning
Hi Experts,
How to preserve database user details before cloning,
I am cloning the test database with the prod database, so my concern is how to preserve the users details which they have in TEST database( like roles, privilges, profiles , passwords, etc.....). Because that all gone after cloning from PROD.
Thanks
Samuse the following script to take the backup of roles,pwd & other details of DEV . after cloning execute the scripts back in DEV to restore the old values....
set head off
set lines 200
set pages 9999
col owner for a20
col db_link for a30
col username for a15
col host for a40
col created for a12
spool db_details.lst
select * from global_name;
select * from dba_db_links;
select name from v$controlfile;
select member from v$logfile;
select file_name from dba_data_files;
select file_name from dba_temp_files;
spool off
spool create_db_links.lst
select 'create DATABASE LINK '||owner#||'.'||NAME|| ' connect to '|| userid || ' identified by '|| password || ' using '||''''|| host ||''''||'; ' FROM sys.link$ order by owner#;
select username,user_id from dba_users where user_id in (select distinct owner# from link$);
spool off
spool alter_user.lst
select ' alter user '||username||' identified by values ' || chr(39)||password||chr(39) || ';' from dba_users;
spool off
Set verify off
Set space 0
set feedback off;
set echo off;
set pages 1000;
set lines 150;
spool create_synonym.sql
Select 'CREATE SYNONYM '||owner||'.'||synonym_name||' FOR '||table_owner||'.'||table_name||'@'||db_link||';' from dba_synonyms where db_link is not null and table_owner is not null;
Select 'CREATE SYNONYM '||owner||'.'||synonym_name||' FOR '||table_name||'@'||db_link||';' from dba_synonyms where db_link is not null and table_owner is null;
spool off;
Spool profile.sql
select ' alter user '||username||' profile '||PROFILE||';' from dba_users;
spool off -
Do I have to give my bank details before I can Sky...
Do I have to give my bank details before I can Skype to Skype. See my contacts etc..
some Skype services such as Skype-to-Skype calls, conference calls, chat and group chat, 1-on-1 video calls are indeed free of charge. However, some services such as Skype-to-mobile/landline number, group video calls, voicemail, SMS, online number, etc requires credits or subscriptions.
The support/user guide section offers a mode detailed descriptions - https://support.skype.com/en/
Moreover, you need to install Skype first in your computer or device. First go to the downloads section of Skype.com (http://www.skype.com/en/download-skype/) and download the installer for your computer or mobile device. Then after installing it, you can use the basic and advance features of Skype such as calls, video calls, chat, etc, etc.
Visiting the user guide section might also help -
https://support.skype.com/en/user-guides
IF YOU FOUND OUR POST USEFUL THEN PLEASE GIVE "KUDOS". IF IT HELPED TO FIX YOUR ISSUE PLEASE MARK IT AS A "SOLUTION" TO HELP OTHERS. THANKS!
ALTERNATIVE SKYPE DOWNLOAD LINKS | HOW TO RECORD SKYPE VIDEO CALLS | HOW TO HANDLE SUSPICIOS CALLS AND MESSAGES -
I have 0.01$ in my account and it's not allowing to change my country detail before I spend. There is nothing I can spend 0.01$ on. Please help, what can I do?
gee hong wrote:
I have 0.01$ in my account and it's not allowing to change my country detail before I spend. There is nothing I can spend 0.01$ on. Please help, what can I do?
Contact iTunes Customer Service and request assistance
Use this Link > Apple Support iTunes Store Contact -
Step progression not inserting row in Jobdata panel
I am trying to research step progression in Peoplesoft 9 & did all the setup.I can see the employee in review wage progression page with Approved status.As the final step, i ran HR_WP_ADV App Engine. .But is not inserting row into jobdata & giving error "Cannot Job data CI for employee 'emplid' ".
Any help please!!
ThanksThanks for the reply.
The Project was in version 11.1.3 before I migrated. I had the issue above so I migrated to 11.1.1.4 then to 11.1.1.5 then to the New GREAT 11.1.2 to go by the matrix of support The issue is still there.
Basic Page layout:
SEARCH-MASTER-PANELTABBED LAYOUT (Hold all the CHILDREN RECORDS)
PANEL TAB is made of ; SHOW DETAIL ITEM- PANEL COLLECTION- TABLE.
the panel collection has a toolbar with 2 buttons in it.
My issue varies:
Hit create insert==> record count goes up one but the table does not render (it goes all blank even if records existed in it)
Hit undo budo ==>table still not rendering. (click next on master record then click previous to come back, the table renders correctly.)
other tables do the following:
Hit Create insert == > table shows normally and I can enter new record.
Hit undo ==> table count goes down but table does not render at all anymore.
for this issue i noticed if i set cache results to false the table works after hitting undo
IF I CREATE A NEW SHOW DETAIL ITEM and put exactly what the other tabs have in them and use the same layouts and buttons the new table works great!!!!!!!!!!!!???????????????????? WTF?!?!?!?!
NO ERROR MESSAGES even at finest level are thrown.
I HAD NO ISSUES IN THE PREVIOUS VERSIONS OF JDEV IS THIS A JSF 2.0 BUG????
BY THE WAY JDEV 11.1.2 sometimes CRASHES or Hangs when viewing the Binding of Page when you click on Binding straight from the Design view. I have to open the Binding Page separate to view it. FYI
Edited by: Nottallah on Jul 11, 2011 9:48 AM
Edited by: Nottallah on Jul 11, 2011 9:51 AM -
Programming insert row VO,but inner-table no data show?
We have Master-Detail-Detail ViewObject,when programming insert row three ViewObject,why inner-table UI no data show?
[Source Code ZIP files|http://docs.google.com/leaf?id=0B1l5uiKPTIr_ZTQwYTQ1MTMtZWFlMS00YWQ1LWFiZWQtYzNmODIwNDRlZWJk&hl=zh_TW]
1.SmpTest0PG.xml click button.
2.SmpTest0CO.java call MyTestAMImpl.java create Method insert row three ViewObject.
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("Test") != null)
String key = "1";
Serializable aserializable1[] = { key };
String quote_id = (String)am.invokeMethod("create", aserializable1);
if (!quote_id.equals(null))
pageContext.setForwardURL("OA.jsp?page=/smp/oracle/apps/pos/test/webui/SmpTestPG&Key="+key,
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null,
null,
true, // Retain AM
OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
OAWebBeanConstants.IGNORE_MESSAGES);
3.SmpTest0CO.java Forward SmpTestPG.xml.
4.SmpTestPG.xml Show Data.
MyTestAMImpl.java
public String create(String key)
int vendor_id = 0;
String vendor_name = null;
int contact_id = 0;
int site_id = 0;
String quote_id = null;
OADBTransaction trx = (OADBTransaction)((OAApplicationModuleImpl)this).getDBTransaction();
SmpPoHdVOImpl hdvo = getSmpPoHdVO();
SmpPoDlVOImpl dlvo = getSmpPoDlVO();
SmpPoDkVOImpl shvo = getSmpPoDkVO();
if (!hdvo.isPreparedForExecution())
hdvo.setWhereClause("1 = 0");
hdvo.setMaxFetchSize(0);
hdvo.executeQuery();
if (!dlvo.isPreparedForExecution())
dlvo.setWhereClause("1 = 0");
dlvo.setMaxFetchSize(0);
dlvo.executeQuery();
if (!shvo.isPreparedForExecution())
shvo.setWhereClause("1 = 0");
shvo.setMaxFetchSize(0);
shvo.executeQuery();
String s = key;
Serializable aserializable[] = { s };
SmpViewPoHdVOImpl quhdvo = getSmpViewPoHdVO();
if(quhdvo != null)
quhdvo.invokeMethod("initQuery", aserializable);
SmpViewPoDlVOImpl qudlvo = getSmpViewPoDlVO();
// insert hd
quhdvo.setRangeSize(-1);
Row quhdrow[] = quhdvo.getAllRowsInRange();
for(int i = 0; quhdrow != null && i < quhdrow.length; i++)
Row hdrow = hdvo.createRow();
hdrow.setAttribute("DocNum","200");
hdvo.insertRow(hdrow);
hdrow.setNewRowState(Row.STATUS_NEW);
quote_id = hdrow.getAttribute("HEADER_ID").toString();
// insert dl
RowIterator dlIter = (RowIterator)quhdrow.getAttribute("SmpViewPoDlVO");
dlIter.setRangeSize(-1);
Row qudlrow[] = dlIter.getAllRowsInRange();
int line_seq = 0;
for(int j = 0; qudlrow != null && j < qudlrow.length; j++)
Row dlrow = dlvo.createRow();
line_seq ++;
dlrow.setAttribute("LineNum",String.valueOf(line_seq));
dlrow.setAttribute("ItemNo",qudlrow[j].getAttribute("ItemNo"));
dlrow.setAttribute("Qty",qudlrow[j].getAttribute("Qty"));
dlvo.insertRow(dlrow);
dlrow.setNewRowState(Row.STATUS_NEW);
// insert shipment
RowIterator shipIter = (RowIterator)qudlrow[j].getAttribute("SmpViewPoDkVO");
shipIter.setRangeSize(-1);
Row shipRow[] = shipIter.getAllRowsInRange();
int ship_seq = 0;
for(int k = 0; shipRow != null && k < shipRow.length; k++)
ship_seq ++;
Row shrow = shvo.createRow();
shrow.setAttribute("ShipmentNum",String.valueOf(ship_seq));
shrow.setAttribute("Qty",shipRow[k].getAttribute("Qty"));
shvo.insertRow(shrow);
shrow.setNewRowState(Row.STATUS_NEW);
return quote_id;
Edited by: Tony_Huang on Apr 10, 2010 3:59 PMpublic class SmpTestCO extends OAControllerImpl
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
OATableBean oatablebean = (OATableBean)webBean.findChildRecursive("SmpPoDlVORN");
OATableBean oatablebean1 = (OATableBean)webBean.findChildRecursive("SmpPoDkVORN");
if (oatablebean != null)
oatablebean.setAttributeValue(UIConstants.ALL_DETAILS_ENABLED_ATTR, ((Object) (Boolean.TRUE)));
oatablebean.setAttributeValue(OAWebBeanConstants.VIEW_LINK_NAME, "SmpPoDlDkVL1");
if (oatablebean1 != null)
oatablebean1.setAttributeValue(OAWebBeanConstants.VIEW_LINK_NAME, "SmpPoDlDkVL1");
oatablebean1.setInsertable(true);
oatablebean1.setAutoInsertion(true);
} -
Need help with inserting rows in ResultSet and JTable
hello Guru!
i have inserted a row in my result set and i want that my table shows this row promptly after i have inserted it in my result set...
but when i use following code for my resultset:
rs.moveToInsertRow();
rs.updateInt(1,nr);
rs.updateString(2, name);
rs.insertRow();
Record are inserted in resultset and database but not shown in my JTable??
Anyone a Clue to without reexecuting the query how can i display inserted row in JTable
http://download-west.oracle.com/docs/cd/A87860_01/doc/java.817/a83724/resltse7.h
I have refrered the following links but still clue less help Guruuuuuuu
i m really in trobble??????i am just near by the Solution using the Database Metadata
by couldn't get the ideaaaa
==================================================
http://download-west.oracle.com/docs/cd/A87860_01/doc/java.817/a83724/resltse7.htm
Seeing Database Changes Made Internally and Externally
This section discusses the ability of a result set to see the following:
its own changes (DELETE, UPDATE, or INSERT operations within the result set), referred to as internal changes
changes made from elsewhere (either from your own transaction outside the result set, or from other committed transactions), referred to as external changes
Near the end of the section is a summary table.
Note:
External changes are referred to as "other's changes" in the Sun Microsystems JDBC 2.0 specification.
Seeing Internal Changes
The ability of an updatable result set to see its own changes depends on both the result set type and the kind of change (UPDATE, DELETE, or INSERT). This is discussed at various points throughout the "Updating Result Sets" section beginning on , and is summarized as follows:
Internal DELETE operations are visible for scrollable result sets (scroll-sensitive or scroll-insensitive), but are not visible for forward-only result sets.
After you delete a row in a scrollable result set, the preceding row becomes the new current row, and subsequent row numbers are updated accordingly.
Internal UPDATE operations are always visible, regardless of the result set type (forward-only, scroll-sensitive, or scroll-insensitive).
Internal INSERT operations are never visible, regardless of the result set type (neither forward-only, scroll-sensitive, nor scroll-insensitive).
An internal change being "visible" essentially means that a subsequent getXXX() call will see the data changed by a preceding updateXXX() call on the same data item.
JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
boolean ownDeletesAreVisible(int) throws SQLException
boolean ownUpdatesAreVisible(int) throws SQLException
boolean ownInsertsAreVisible(int) throws SQLException
Note:
When you make an internal change that causes a trigger to execute, the trigger changes are effectively external changes. However, if the trigger affects data in the row you are updating, you will see those changes for any scrollable/updatable result set, because an implicit row refetch occurs after the update.
Seeing External Changes
Only a scroll-sensitive result set can see external changes to the underlying database, and it can only see the changes from external UPDATE operations. Changes from external DELETE or INSERT operations are never visible.
Note:
Any discussion of seeing changes from outside the enclosing transaction presumes the transaction itself has an isolation level setting that allows the changes to be visible.
For implementation details of scroll-sensitive result sets, including exactly how and how soon external updates become visible, see "Oracle Implementation of Scroll-Sensitive Result Sets".
JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
boolean othersDeletesAreVisible(int) throws SQLException
boolean othersUpdatesAreVisible(int) throws SQLException
boolean othersInsertsAreVisible(int) throws SQLException
Note:
Explicit use of the refreshRow() method, described in "Refetching Rows", is distinct from this discussion of visibility. For example, even though external updates are "invisible" to a scroll-insensitive result set, you can explicitly refetch rows in a scroll-insensitive/updatable result set and retrieve external changes that have been made. "Visibility" refers only to the fact that the scroll-insensitive/updatable result set would not see such changes automatically and implicitly.
Visibility versus Detection of External Changes
Regarding changes made to the underlying database by external sources, there are two similar but distinct concepts with respect to visibility of the changes from your local result set:
visibility of changes
detection of changes
A change being "visible" means that when you look at a row in the result set, you can see new data values from changes made by external sources to the corresponding row in the database.
A change being "detected", however, means that the result set is aware that this is a new value since the result set was first populated.
With Oracle8i release 8.1.6 and higher, even when an Oracle result set sees new data (as with an external UPDATE in a scroll-sensitive result set), it has no awareness that this data has changed since the result set was populated. Such changes are not "detected".
JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
boolean deletesAreDetected(int) throws SQLException
boolean updatesAreDetected(int) throws SQLException
boolean insertsAreDetected(int) throws SQLException
It follows, then, that result set methods specified by JDBC 2.0 to detect changes--rowDeleted(), rowUpdated(), and rowInserted()--will always return false with the 8.1.6 Oracle JDBC drivers. There is no use in calling them.
Summary of Visibility of Internal and External Changes
Table 12-1 summarizes the discussion in the preceding sections regarding whether a result set object in the Oracle JDBC implementation can see changes made internally through the result set itself, and changes made externally to the underlying database from elsewhere in your transaction or from other committed transactions.
Table 12-1 Visibility of Internal and External Changes for Oracle JDBC
Result Set Type Can See Internal DELETE? Can See Internal UPDATE? Can See Internal INSERT? Can See External DELETE? Can See External UPDATE? Can See External INSERT?
forward-only
no
yes
no
no
no
no
scroll-sensitive
yes
yes
no
no
yes
no
scroll-insensitive
yes
yes
no
no
no
no
For implementation details of scroll-sensitive result sets, including exactly how and how soon external updates become visible, see "Oracle Implementation of Scroll-Sensitive Result Sets".
Notes:
Remember that explicit use of the refreshRow() method, described in "Refetching Rows", is distinct from the concept of "visibility" of external changes. This is discussed in "Seeing External Changes".
Remember that even when external changes are "visible", as with UPDATE operations underlying a scroll-sensitive result set, they are not "detected". The result set rowDeleted(), rowUpdated(), and rowInserted() methods always return false. This is further discussed in "Visibility versus Detection of External Changes".
Oracle Implementation of Scroll-Sensitive Result Sets
The Oracle implementation of scroll-sensitive result sets involves the concept of a window, with a window size that is based on the fetch size. The window size affects how often rows are updated in the result set.
Once you establish a current row by moving to a specified row (as described in "Positioning in a Scrollable Result Set"), the window consists of the N rows in the result set starting with that row, where N is the fetch size being used by the result set (see "Fetch Size"). Note that there is no current row, and therefore no window, when a result set is first created. The default position is before the first row, which is not a valid current row.
As you move from row to row, the window remains unchanged as long as the current row stays within that window. However, once you move to a new current row outside the window, you redefine the window to be the N rows starting with the new current row.
Whenever the window is redefined, the N rows in the database corresponding to the rows in the new window are automatically refetched through an implicit call to the refreshRow() method (described in "Refetching Rows"), thereby updating the data throughout the new window.
So external updates are not instantaneously visible in a scroll-sensitive result set; they are only visible after the automatic refetches just described.
For a sample application that demonstrates the functionality of a scroll-sensitive result set, see "Scroll-Sensitive Result Set--ResultSet5.java".
Note:
Because this kind of refetching is not a highly efficient or optimized methodology, there are significant performance concerns. Consider carefully before using scroll-sensitive result sets as currently implemented. There is also a significant tradeoff between sensitivity and performance. The most sensitive result set is one with a fetch size of 1, which would result in the new current row being refetched every time you move between rows. However, this would have a significant impact on the performance of your application.
how can i implement this using
JDBC 2.0 DatabaseMetaData objects include the following methods to verify this. Each takes a result set type as input (ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_SENSITIVE, or ResultSet.TYPE_SCROLL_INSENSITIVE).
boolean deletesAreDetected(int) throws SQLException
boolean updatesAreDetected(int) throws SQLException
boolean insertsAreDetected(int) throws SQLException -
Runtime error when inserting rows in hrp1018 and hrt1018 tables
Hi All,
I have a requirement to insert row in hrp1018 and hrt1018 tables.These tables are interlinked.So, I have used FM 'RH_INSERT_INFTY'. The exact code which I have used is as follows.
*****************************************code***************************************************************
<< Please post only the relevant portion of the code >>
The runtime error which is coming is as follows:
Error analysis
An internal error in the database interface occurred during access to
the data of table "HRT1018 ".
The situation points to an internal error in the SAP software
or to an incorrect status of the respective work process.
For further analysis the SAP system log should be examined
(transaction SM21).
For a precise analysis of the error, you should supply
documents with as many details as possible.
Please let me know why this error is coming.I am not able to find out mistake in the FM and form used in the code.
Thanks in advance,
BBKrishna.
Edited by: Rob Burbank on Jun 9, 2009 1:31 PMI am adding the code once again.Please let me know why the error is coming up.
lv_mproj = 'BLDNG'.
wa_p1018-mandt = sy-mandt.
wa_p1018-otype = '9M'.
wa_p1018-objid = '50009650'.
wa_p1018-begda = '20090608'.
wa_p1018-endda = '99991231'.
wa_p1018-infty = '1018'.
wa_p1018-plvar = '01'.
wa_p1018-otype = '9M'.
wa_p1018-istat = '1'.
append wa_p1018 to it_p1018.
repid = sy-repid.
*Updating hrp1018 and hrt1018 tables
CALL FUNCTION 'RH_INSERT_INFTY'
EXPORTING
FCODE = 'INSE'
VTASK = 'D'
AUTHY = ' '
REPID = repid
FORM = 'FILL_TABS'
TABLES
INNNN = it_p1018
EXCEPTIONS
NO_AUTHORIZATION = 1
ERROR_DURING_INSERT = 2
REPID_FORM_INITIAL = 3
CORR_EXIT = 4
BEGDA_GREATER_ENDDA = 5
OTHERS = 6
IF SY-SUBRC <> 0.
CALL FUNCTION 'BALW_BAPIRETURN_GET'
EXPORTING
TYPE = SY-MSGTY
CL = sy-msgid
NUMBER = SY-MSGNO
PAR1 = ' '
PAR2 = ' '
PAR3 = ' '
PAR4 = ' '
LOG_NO = ' '
LOG_MSG_NO = ' '
IMPORTING
BAPIRETURN = return_rec
EXCEPTIONS
ONLY_2_CHAR_FOR_MESSAGE_ID = 1
OTHERS = 2
IF SY-SUBRC <> 0.
lv_mproj = text-011
ELSE.
ii_return = return_rec.
CONCATENATE ii_return-type '-' ii_return-message
INTO lv_err_msg SEPARATED BY SPACE.
ENDIF.
ENDIF.
*RHCD_TAB-PROZT
FORM fill_tabs TABLES ins_tab
USING ins_set ins_index.
DATA : BEGIN OF set.
INCLUDE STRUCTURE wplog.
DATA : END OF set.
DATA: BEGIN OF h_pt1018. "to initialize INS_TAB
INCLUDE STRUCTURE pt1018.
DATA: END OF h_pt1018.
REFRESH ins_tab.
set = ins_set.
CASE set-infty.
WHEN '1018'.
h_pt1018-posnr = lv_mproj.
h_pt1018-prozt = '100.00'.
IF NOT ( h_pt1018 IS INITIAL ).
CLEAR ins_tab.
ins_tab+36(8) = lv_mproj. "h_pt1018.
ins_tab+134(5) = '100.00'.
APPEND ins_tab.
ENDIF.
ENDCASE.
ENDFORM. -
Insert row into database table via dynamic form -
I have developed a portlet via Portal. I used a dynamic page. I replaced the default "<ORACLE>select * from scott.emp</ORACLE>" text to call a package procedure that uses HTP.P to render the web page. My goal is to show all rows in a table and allow edits to any row, and also add a checkbox on each row to allow the user to mark for delete. I am successfully using a FOR loop and showing all of the data in a grid. My problem - How do I update and delete the data? I have a submit button with nothing behind it currently. I would ideally like to use pl/sql code to do the updates and/or deletes as marked on the page by the user, but I'm not sure how to hook the submit button to calling a procedure to execute the updates/deletes.
Any help would be appreciated -
Thanks -
KentHi Patrick - Thanks for your response! I have browsed your page quickly - very informative and I will look in more detail. My form design looks as below (using a simple example with emp id and emp name columns) - perhaps this will have to change, but I wanted the user to be able to insert using html fields id_add and name_add, then update (or mark for deletion) any of the existing rows (they are rendered with for loop in pl/sql - eg, id_1/name_1, id_2/name_2, etc for each row in the table). I was hoping the submit action would call a pl/sql that would look at all rows, and then act if an update or delete were required. This makes it difficult to use parms, I believe - I may be able to change the design to show an "update row" below the current "insert row" so that, as in your example, when the user highlights a row, it populates in the update area where changes can be made, and an update button used to effect the changes to a single row at a time.
Thanks again, I appreciate your input!
Kent
______________ _________________ <insert_button>
Emp Id (textbox) Emp Name (textbox) Del_Checkbox
______________ _________________ ___ <SUBMIT_BUTTON>
------------------------- ----------------------------- ------ -
ORA-01840 error on inserting row trough object browser
Dear Oracle Community,
I'm getting the ORA-01840: Input value not long enough for date format error when I try to insert a row with the date value 24-MAY-10 with my object browser.
This is the problem column:
Column Name | Data Type| Nullable| Default | Primary Key
SIGNUPDATE |DATE |No | - | -
Now this will look like I'm using the wrong date format so I have googled and found that I should use the following query to check for the correct date format my database uses.
select * from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
This returns the DD-MON-RR format so I think I'm inserting the correct date format here.
What am I doing wrong?
I have already tried inserting with the following formats and tried replacing the - sign with the / sign.
DD-MON-RR
DD-MON-YY
DD-MON-YYYY
I have also tried using the SYSDATE is in the DD-MON-RR format trough the SQL commandline.
I'm feeling like an idiot this should be simple right?
Please help me out here this is frustrating, many thanks in advance.
J Nijmanusing the SYSDATE is in the DD-MON-RR format trough the SQL commandlineIn sqlplus try:
insert into <tablename> ( <date columnname> [, ... ] ) values ( sysdate [, ...] );
To get a sysdate date value added. Or specify the format string with a to_date expression:
insert into <tablename> ( <date columnname> [, ... ] ) values ( to_date( '24-may-10', 'dd-mon-yy') [, ... ] );
The engine isn't picky about separators agreeing with the format string, most any character in place of the '-' dash is acceptable.
Now to get an ora-1840 out of the object browser (Table/Data/Insert Row), I'm not having any luck trying to duplicate that. With the default nls_date_format 'DD-MON-YY' even trying bad dates (i.e. 30-feb-10 or 30-feb-2010, or even 31-apr-10) it either does an ora-1839: date not valid for month specified, or with a four digit year it gives an ora-1830: date format picture ends before converting entire input string.
Any RDBMS presents programmers with date and datetime challenges, its not just an oracle-frustration thing ;) -
Is it possible to insert row with timestamp field without to TO_TIMESTAMP
hello
is it possible to insert row with timestamp column without using to_timestamp unction
somthing like insert into app.master values (3,333, 'inser tmstmp', 6.7, '2010-11-10 15:14', 'f','9','2010-12-22')784633 wrote:
hello
is it possible to insert row with timestamp column without using to_timestamp unction
somthing like insert into app.master values (3,333, 'inser tmstmp', 6.7, '2010-11-10 15:14', 'f','9','2010-12-22')If you don't like the answers in your previous thread (Re: how can i set timestamp format don't expect to get different answers just because you start a new thread. -
Unexpected PX_TXN insert row Error?
The following error prints, at random, on my uix page. Has anyone experienced it or know how to redirect it from the Browser:
oracle.jbo.PCollException: JBO-28030: Could not insert row into table PS_TXN, collection id 19,028, persistent id -1
void oracle.jbo.PCollException.throwException(java.lang.Class, java.lang.String, java.lang.Object[], java.lang.Exception)
PCollException.java:39
void oracle.jbo.pcoll.OraclePersistManager.insert(long, long, int, oracle.jbo.pcoll.PCollKeyInfo[], byte[])
OraclePersistManager.java:1609
boolean oracle.jbo.pcoll.PCollNode.passivateElem(oracle.jbo.pcoll.PCollPersistable, oracle.jbo.pcoll.PCollNode, oracle.jbo.pcoll.PCollection, long)
PCollNode.java:543
boolean oracle.jbo.pcoll.PCollNode.passivate()
PCollNode.java:674
boolean oracle.jbo.pcoll.PCollNode.passivateBranch()
PCollNode.java:617
long oracle.jbo.pcoll.PCollection.passivate()
PCollection.java:429
int oracle.jbo.server.DBSerializer.passivateRootAM(int, byte[])
DBSerializer.java:256
int oracle.jbo.server.DBSerializer.passivateRootAM(byte[])
DBSerializer.java:239
int oracle.jbo.server.ApplicationModuleImpl.passivateState(byte[])
ApplicationModuleImpl.java:3848
void oracle.jbo.common.ampool.ApplicationPoolImpl.doFailover(oracle.jbo.ApplicationModule, oracle.jbo.common.ampool.SessionCookie, boolean)
ApplicationPoolImpl.java:2423
void oracle.jbo.common.ampool.ApplicationPoolImpl.doFailover(oracle.jbo.ApplicationModule, oracle.jbo.common.ampool.SessionCookie)
ApplicationPoolImpl.java:2375
void oracle.jbo.common.ampool.ApplicationPoolImpl.doManagedCheckin(oracle.jbo.common.ampool.SessionCookie, boolean)
ApplicationPoolImpl.java:1657
void oracle.jbo.common.ampool.ApplicationPoolImpl.releaseApplicationModule(oracle.jbo.common.ampool.SessionCookie, int)
ApplicationPoolImpl.java:1031
void oracle.jbo.common.ampool.SessionCookieImpl.releaseApplicationModule(int, long)
SessionCookieImpl.java:576
void oracle.jbo.http.HttpSessionCookieImpl.releaseApplicationModule(int, long)
HttpSessionCookieImpl.java:216
void oracle.jbo.common.ampool.SessionCookieImpl.releaseApplicationModule(boolean, boolean, long)
SessionCookieImpl.java:524
void oracle.jbo.common.ampool.SessionCookieImpl.releaseApplicationModule(boolean, boolean)
SessionCookieImpl.java:506
void oracle.cabo.data.jbo.servlet.RootAppModuleRegistryImpl$ReleaseRootAppModule.unbindValue()
void oracle.cabo.share.util.BindableNamespaceMap.unbindAll()
void oracle.cabo.servlet.BaseBajaContext.dispose()
oracle.cabo.servlet.Page oracle.cabo.servlet.PageBrokerHandler.handleRequest(oracle.cabo.servlet.BajaContext)
void oracle.cabo.servlet.UIXServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void oracle.cabo.servlet.UIXServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
HttpServlet.java:760
void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
HttpServlet.java:853
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
ServletRequestDispatcher.java:721
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
ServletRequestDispatcher.java:306
boolean com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.ApplicationServerThread, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
HttpRequestHandler.java:767
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(java.lang.Thread)
HttpRequestHandler.java:259
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run()
HttpRequestHandler.java:106
void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
PooledExecutor.java:803
void java.lang.Thread.run()
Thread.java:484
## Detail 0 ##
java.sql.SQLException: ORA-00001: unique constraint (EPIC.PS_TXN_PK) violatedORA-06512: at line 1
void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)
DBError.java:187
void oracle.jdbc.ttc7.TTIoer.processError()
TTIoer.java:241
void oracle.jdbc.ttc7.Oall7.receive()
Oall7.java:543
void oracle.jdbc.ttc7.TTC7Protocol.doOall7(byte, byte, int, byte[], oracle.jdbc.dbaccess.DBType[], oracle.jdbc.dbaccess.DBData[], int, oracle.jdbc.dbaccess.DBType[], oracle.jdbc.dbaccess.DBData[], int)
TTC7Protocol.java:1477
int oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(oracle.jdbc.dbaccess.DBStatement, byte, byte[], oracle.jdbc.dbaccess.DBDataSet, int, oracle.jdbc.dbaccess.DBDataSet, int)
TTC7Protocol.java:888
void oracle.jdbc.driver.OracleStatement.executeNonQuery(boolean)
OracleStatement.java:2004
void oracle.jdbc.driver.OracleStatement.doExecuteOther(boolean)
OracleStatement.java:1924
void oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout()
OracleStatement.java:2562
int oracle.jdbc.driver.OraclePreparedStatement.executeUpdate()
OraclePreparedStatement.java:452
boolean oracle.jdbc.driver.OraclePreparedStatement.execute()
OraclePreparedStatement.java:526
void oracle.jbo.pcoll.OraclePersistManager.insert(long, long, int, oracle.jbo.pcoll.PCollKeyInfo[], byte[])
OraclePersistManager.java:1593
boolean oracle.jbo.pcoll.PCollNode.passivateElem(oracle.jbo.pcoll.PCollPersistable, oracle.jbo.pcoll.PCollNode, oracle.jbo.pcoll.PCollection, long)
PCollNode.java:543
boolean oracle.jbo.pcoll.PCollNode.passivate()
PCollNode.java:674
boolean oracle.jbo.pcoll.PCollNode.passivateBranch()
PCollNode.java:617
long oracle.jbo.pcoll.PCollection.passivate()
PCollection.java:429
int oracle.jbo.server.DBSerializer.passivateRootAM(int, byte[])
DBSerializer.java:256
int oracle.jbo.server.DBSerializer.passivateRootAM(byte[])
DBSerializer.java:239
int oracle.jbo.server.ApplicationModuleImpl.passivateState(byte[])
ApplicationModuleImpl.java:3848
void oracle.jbo.common.ampool.ApplicationPoolImpl.doFailover(oracle.jbo.ApplicationModule, oracle.jbo.common.ampool.SessionCookie, boolean)
ApplicationPoolImpl.java:2423
void oracle.jbo.common.ampool.ApplicationPoolImpl.doFailover(oracle.jbo.ApplicationModule, oracle.jbo.common.ampool.SessionCookie)
ApplicationPoolImpl.java:2375
void oracle.jbo.common.ampool.ApplicationPoolImpl.doManagedCheckin(oracle.jbo.common.ampool.SessionCookie, boolean)
ApplicationPoolImpl.java:1657
void oracle.jbo.common.ampool.ApplicationPoolImpl.releaseApplicationModule(oracle.jbo.common.ampool.SessionCookie, int)
ApplicationPoolImpl.java:1031
void oracle.jbo.common.ampool.SessionCookieImpl.releaseApplicationModule(int, long)
SessionCookieImpl.java:576
void oracle.jbo.http.HttpSessionCookieImpl.releaseApplicationModule(int, long)
HttpSessionCookieImpl.java:216
void oracle.jbo.common.ampool.SessionCookieImpl.releaseApplicationModule(boolean, boolean, long)
SessionCookieImpl.java:524
void oracle.jbo.common.ampool.SessionCookieImpl.releaseApplicationModule(boolean, boolean)
SessionCookieImpl.java:506
void oracle.cabo.data.jbo.servlet.RootAppModuleRegistryImpl$ReleaseRootAppModule.unbindValue()
void oracle.cabo.share.util.BindableNamespaceMap.unbindAll()
void oracle.cabo.servlet.BaseBajaContext.dispose()
oracle.cabo.servlet.Page oracle.cabo.servlet.PageBrokerHandler.handleRequest(oracle.cabo.servlet.BajaContext)
void oracle.cabo.servlet.UIXServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void oracle.cabo.servlet.UIXServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
HttpServlet.java:760
void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
HttpServlet.java:853
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
ServletRequestDispatcher.java:721
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
ServletRequestDispatcher.java:306
boolean com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.ApplicationServerThread, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
HttpRequestHandler.java:767
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(java.lang.Thread)
HttpRequestHandler.java:259
void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run()
HttpRequestHandler.java:106
void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
PooledExecutor.java:803
void java.lang.Thread.run()
Thread.java:484The error itself is a BC4J question you should post on the jdev forum. If you want to shield users from seeing these you can use the try and displayException beans.
-
How to get the Interface inserted rows fom ODI Reporsitory
hi,
I need select query that will select the Interface inserted rows
(Count) from ODI repository tables. because I want to maintain these records into another Oracle tables?????import datetime
import sys
import optparse
document = []
def docprint(string):
document.append('%s' % string)n
def docprintnocr(string):
document.append('%s' % string)
p = optparse.OptionParser()
p.add_option('-a','--server',dest='server',default='XXX',help='The server with the ODI_W catalog')
p.add_option('-b','--beginningday',dest='beginningday',type=int,default=1,help='The day to begin retrieval')
p.add_option('-e','--endingday',dest='endingday',type=int,default=0,help='The day to end retrieval')
p.add_option('-n','--session',dest='session',default='',help='Session to retrieve')
p.add_option('-s','--step',dest='step',action='store_true',help='Print the step data')
p.add_option('-t','--task',dest='task',action='store_true',help='Print the task data')
p.add_option('-x','--recipientlist',dest='recipientlist',default='XXX',help='report recipient(s)')
p.add_option('-y','--mailserver',dest='mailserver',default='XXX',help='mail server')
p.add_option('-z','--mailuser',dest='mailuser',default='XXX',help='mail user')
p.add_option('-p','--printonly',dest='printonly',action='store_true',help='Print, no e-mail')
options,args = p.parse_args()
docprint( '%s %s' \
'\n\tserver=%s' \
'\n\tbeginningday=%s' \
'\n\tendingday=%s' \
'\n\tsession=%s' \
'\n\tstep=%s' \
'\n\ttask=%s' \
'\n\tprintonly=%s'
sys.argv[0]
,datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
,options.server
,options.beginningday
,options.endingday
,options.session
,options.step
,options.task
,options.printonly
if options.server.upper() in ('XXX','YYY'):
catalog = 'ODI_W'
elif options.server in ('WWW','ZZZ'):
catalog = 'SNP_W'
else:
print 'Unknown server %s' % options.server
sys.exit(1)
TimeEnd = datetime.datetime.now() - datetime.timedelta(options.endingday)
TimeBegin = datetime.datetime.now() - datetime.timedelta(options.beginningday)
TimeFormat = '%Y-%m-%d %H:%M:%S'
if options.task:
options.step = True
docprint( '\n%s between %s and %s' %(
options.server
,TimeBegin.strftime(TimeFormat)
,TimeEnd.strftime(TimeFormat)
OptionString = ''
if options.session:
OptionString = '\nPrinting session %s' % options.session
else:
OptionString = '\nPrinting all sessions'
if options.step:
OptionString = '%s %s' % (OptionString,'with step detail')
if options.task:
OptionString = '%s %s' % (OptionString, 'and task detail')
docprint(OptionString)
import pyodbc
ConnectString = 'DRIVER={SQL SERVER};SERVER=%s;DATABASE=%s;Trusted_Connection=yes' % (options.server.upper(),catalog)
try:
Connection = pyodbc.connect(ConnectString,autocommit=False)
Cursor = Connection.cursor()
except Exception, e:
raise RuntimeError, '%s %s connect failed\n%s' % (options.server,catalog,e)
SelectSession = """
select
S.SESS_NO
,S.SESS_NAME
,S.SESS_BEG
,S.SESS_END
,coalesce(S.SESS_DUR,0)
,S.SESS_STATUS
,S.CONTEXT_CODE
from SNP_SESSION as S
where S.SESS_BEG between ? and ?
and S.SESS_BEG = (
select max(SESS_BEG)
from SNP_SESSION
where SESS_NAME = S.SESS_NAME)
order by S.SESS_BEG ASC
SelectSessionHistory = """
select Top 3
SESS_NO
,SESS_NAME
,SESS_BEG
,SESS_END
,coalesce(SESS_DUR,0)
,SESS_STATUS
,CONTEXT_CODE
from SNP_SESSION
where SESS_NAME = ?
and SESS_NO <> ?
order by SESS_BEG DESC
SESS_NO = 0
SESS_NAME = 1
SESS_BEG = 2
SESS_END = 3
SESS_DUR = 4
SESS_STATUS = 5
CONTEXT_CODE = 6
SelectStep = """
select
LOG.STEP_BEG
,LOG.STEP_END
,coalesce(LOG.STEP_DUR,0)
,LOG.STEP_STATUS
,coalesce(LOG.NB_ROW,0)
,coalesce(LOG.NB_INS,0)
,coalesce(LOG.NB_UPD,0)
,coalesce(LOG.NB_DEL,0)
,coalesce(LOG.NB_ERR,0)
,STEP.STEP_NAME
,STEP.NNO
from SNP_STEP_LOG LOG
inner join SNP_SESS_STEP STEP
on STEP.SESS_NO = LOG.SESS_NO
and STEP.NNO = LOG.NNO
WHERE LOG.SESS_NO = ?
ORDER BY STEP.NNO
STEP_BEG = 0
STEP_END = 1
STEP_DUR = 2
STEP_STATUS = 3
NB_ROW = 4
NB_INS = 5
NB_UPD = 6
NB_DEL = 7
NB_ERR = 8
STEP_NAME = 9
STEP_NO = 10
SelectTask = """
select
LOG.TASK_BEG
,LOG.TASK_END
,coalesce(LOG.TASK_DUR,0)
,LOG.TASK_STATUS
,coalesce(LOG.NB_ROW,0)
,coalesce(LOG.NB_INS,0)
,coalesce(LOG.NB_UPD,0)
,coalesce(LOG.NB_DEL,0)
,coalesce(LOG.NB_ERR,0)
,TASK.TASK_NAME3
from SNP_SESS_TASK_LOG LOG
inner join SNP_SESS_TASK TASK
on TASK.SESS_NO = LOG.SESS_NO
and TASK.NNO = LOG.NNO
and TASK.SCEN_TASK_NO = LOG.SCEN_TASK_NO
WHERE LOG.SESS_NO = ?
AND LOG.NNO = ?
ORDER BY LOG.SCEN_TASK_NO
TASK_BEG = 0
TASK_END = 1
TASK_DUR = 2
TASK_STATUS = 3
TASK_ROW = 4
TASK_INS = 5
TASK_UPD = 6
TASK_DEL = 7
TASK_ERR = 8
TASK_NAME = 9
SessionStatuses = {'M':'Warning','E':'Err','D':'Done','R':'Run'}
StepStatuses = {'M':'Warn','E':'Err','D':'Done','W':'Wait','R':'Run'}
SessionRows =Cursor.execute(SelectSession,(TimeBegin,TimeEnd)).fetchall()
for SessionRow in SessionRows:
if options.session and options.session.upper() != SessionRow[SESS_NAME].upper():
# Not requested
continue
if SessionRow[SESS_NAME] in ('SOCKETSERVER','PROCESSHUB'):
# Skip these utilities
continue
if SessionRow[SESS_STATUS] == 'R':
# Still running, nothing to print(
docprint( '\n%s, status %s' % (
SessionRow[SESS_NAME]
,SessionStatuses[SessionRow[SESS_STATUS]]
continue
if SessionRow[SESS_END]:
SessionEnd = SessionRow[SESS_END].strftime(TimeFormat)
else:
SessionEnd = ' '
SessionHistories = Cursor.execute(SelectSessionHistory,(SessionRow[SESS_NAME],SessionRow[SESS_NO])).fetchall()
docprintnocr( '\n%-20s\n\t%s / %s %6i secs %s' % (
SessionRow[SESS_NAME][:20]
,SessionRow[SESS_BEG].strftime(TimeFormat)
,SessionEnd
,SessionRow[SESS_DUR]
,SessionStatuses[SessionRow[SESS_STATUS]]
for SessionHistory in SessionHistories:
if SessionHistory[SESS_END]:
SessionHistoryEnd = SessionHistory[SESS_END].strftime(TimeFormat)
else:
SessionHistoryEnd = ' '
docprintnocr( '\t%s / %s %6i secs %s' % (
SessionHistory[SESS_BEG].strftime(TimeFormat)
,SessionHistoryEnd
,SessionHistory[SESS_DUR]
,SessionStatuses[SessionHistory[SESS_STATUS]]
if not options.step:
# Step detail not requested
continue
docprint( '\n %-22s %5s %4s %8s %8s %8s %8s %8s' % (
,'Secs'
,'Stat'
,'Rows'
,'Inserts'
,'Updates'
,'Deletes'
,'Errors'
for StepRow in Cursor.execute(SelectStep,SessionRow[SESS_NO]).fetchall():
try:
docprint( ' %-22s %5i %-4s %8i %8i %8i %8i %8i' % (
StepRow[STEP_NAME][:22]
,StepRow[STEP_DUR]
,StepStatuses[StepRow[STEP_STATUS]]
,StepRow[NB_ROW]
,StepRow[NB_INS]
,StepRow[NB_UPD]
,StepRow[NB_DEL]
,StepRow[NB_ERR]))
except Exception, e:
docprint(e)
continue
if not options.task:
# Task detail not requested
continue
try:
for TaskRow in Cursor.execute(SelectTask,(SessionRow[SESS_NO],StepRow[STEP_NO])).fetchall():
docprint( ' %-21s %5i %-4s %8i %8i %8i %8i %8i' % (
TaskRow[TASK_NAME][:21]
,TaskRow[TASK_DUR]
,TaskRow[TASK_STATUS]
,TaskRow[TASK_ROW]
,TaskRow[TASK_INS]
,TaskRow[TASK_UPD]
,TaskRow[TASK_DEL]
,TaskRow[TASK_ERR]
except Exception, e:
docprint( e )
docprint( '\nEnd of report')
Connection.close()
if options.printonly:
for line in document:
print line
sys.exit(0)
import smtplib
Message = """From: %s
To: %s
MIME-Version: 1.0
Content-type: text/html
Subject: %s
<font face="courier" size="4"><b>%s</b></font>
options.mailuser
,options.recipientlist
,'Session Report'
,'<br>'.join(document).replace('\n','<br>').replace('\t',' ').replace(' ',' ')
server = smtplib.SMTP(options.mailserver)
server.sendmail(options.mailuser,options.recipientlist,Message)
server.quit() -
Insert row using db_link
Hi All,
I am trying to insert data from one DB to another DB via db_link between them.
insert into table@xyz
select
col 1, col2 , ... coln from table wher id = 123;
the error is : ORA-02019: connection description for remote database not found
But i am sure the connection description is good and healthy working fine.
I checked it by
select count(*) from table@xyz;
And this resulted the # of rows.
Before this the error message was to set global name to true and then i changed the db_link name to global name..
I am using 10.2.0.5
Need help to fix this !!
Thanks,
AAGHi,
Just Check the TNSNAMES.ORA file that you have added the connection description for the remote database.
1.The TNSNAMES.ORA file will be in ORACLe_HOME\ora81\network\ADMIN.
2. Then try creating the link for the same..
Login as SYSDBA..
create database link "Link_name" connect to "REMOTE_USER_NAME"identified by "remote-db-pwd" using 'DBNAME';
Then, Just Check from you database the link is working by select statement to remote db..
select * from remote_user_name.table_name@link_name;
Once if you get, the link is fine and correct..
So,you can proceed with your Insert statement as
insert into your_table select * from remote_user_name.table_name@link_name;
Information:
There is a need to Perform a commit, if you perform even a select query from the remote database.
Edited by: Shankar Viji on May 10, 2012 2:52 AM
Maybe you are looking for
-
How to allow domain users to customize Adobe PDF printer page size in Printer Preferences
Hi I am able to customize Adobe PDF printer page size in Printer Preferences in admin login but not able to customize Adobe PDF printer page size in domian users login... can I have a solution to customize Adobe PDF printer page size in domin u
-
New hard drive, how to put my music back using ipod
my computer broke (its a dell) and since its fairly new, my computer guy had to replaced the memory and hard drive. everything was wiped out, my documents, pictures, and my itunes library. i had to install itunes again, but i still had my account but
-
How to clear invoices with different house banks
Hi, i have posted 3 invoices to one vendor now i want to clear 2 invoices from one house bank ( citi bank) and 1 invoice from another house bbank (abn amro ) how can i make settings in fbzp ? thanks inadvance for ur answer points wil b assigned Regar
-
Can I Integrate ADF Mobile with (BPEL or BPM)
I want to know if I can Integrate ADF Mobile with (BPEL or BPM) and can I open my worklist App from ADF Mobile.
-
I can't get the All You, facebook and Tweeter off my Ipad. I deleted them from the home screen but they show up in the settings.