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()

Similar Messages

  • Getting the last inserted row

    Hi
    I want to get the ID for the last inserted row in another view (not the ones I have in my page), to pass it to a web service. How can I get it?
    This returns the first ID in the table: ${bindings.myIterator.RequestId}
    This one doesn’t work either: ${bindings.myIterator.currentRow.RequestId}
    It shows the following exception
    1. JBO-29000: Unexpected exception caught: java.lang.RuntimeException, msg=javax.servlet.jsp.el.ELException: Unable to find a value for "RequestId" in object of class "model.Travel_ViewRowImpl" using operator "."
    2. javax.servlet.jsp.el.ELException: Unable to find a value for "RequestId" in object of class "model.Travel_ViewRowImpl" using operator "."
    What does ${bindings.myIterator.currentRow.dataProvider} returns?

    Hi,
    while this is close to the correct syntax it is not complete
    ${bindings.myIterator.currentRow.RequestId}
    this would attempt to call set/get RequestId on the Row class, which doesn't have this property. It has a property getAttribute() but this doesn't allow you to pass an argumentbecause of EL limitations.
    Work around: Create an attribute binding for the "RequestId" attribute and call it with
    #{bindings.RequestId.inputValue}
    ADF always ensures that the currentRow's RequestId is the one obtained from the Attribute binding
    Frank

  • How to get the last inserted record from a table ?

    :-) Hiee E'body
    I work on Oracle 8i and need to get the last
    record inserted in a table.
    I have tried using rownum and rowid pseudo-columns
    but that doesn't work.
    Can you please help me out ?
    :-) Have a nice time
    Vivek Kapoor.
    IT, Atul Ltd.,
    India.

    I'm not sure about 8i features.
    I assume here that you don't have 'Date-Time' stamp columns on the table which is the easiest way to determine the last inserted row in the table.
    If not try the following :-
    select address, piece, SQL_TEXT
    from V$SQLTEXT
    where upper(sql_text) like '%INSERT INTO TABLE_NAME%'
    Substiute the TABLE_NAME with the name of the actual table.
    Have fun.
    Regards,
    Shailender
    :-) Hiee E'body
    I work on Oracle 8i and need to get the last
    record inserted in a table.
    I have tried using rownum and rowid pseudo-columns
    but that doesn't work.
    Can you please help me out ?
    :-) Have a nice time
    Vivek Kapoor.
    IT, Atul Ltd.,
    India.

  • How to get the last inserted Autoincrement value in Java for Pervasive DB

    Hi, I need to get the last inserted auto incremented value after the record is inserted IN JAVA For ex. consider we have 4 columns for the myTable in the PERVASIVE DATABASE V10 autoid - identity column (auto increment column) userID userName pageID insertSqlExpression = insert into myTable (userID , userName, pageID) values( ? ,? ,?); prepareInsert = connection.prepareStatement(insertSqlExpression); prepareInsert .excuteUpdate; After inserting the new record how can I get the autoid value (last inserted value) in the Java. Please help me.
    Thanks in advance. Arthik

    JavaArthikBabu wrote:
    I dont have privileges to write new stored procedures in database.I need to do in the Java side only. In many databases that irrelevant. The same way you would do it in a proc can be done with the correctly conceived statement (singular.)
    For ex &#150; if we insert and then the select record's identity value as a single transaction and would this guarantee that what is returned by the select would not include inserts that another might have made?Please do not take that path unless you are absolutely certain that your database does not support any other way to do it.

  • How to get the number of rows in a repeating frame ?

    Hi all,
    When I launch a report from forms then sometimes there are data in the report and sometimes there are no data. And the problem is that when there are no data then the frame containing the repeating frame is still displaying and a blank page displays on the report.
    So I want to get the number of rows from the repeating frame so that I can code a format trigger on the frame to display or not the enclosing frame depending on the existence of data from the repeating frame.
    Thank you very much indeed.

    Dear Friend,
    You can achieve this. Define a summary column (say cnt). Select summary type as "COUNT". select any one of columns that are getting displayed in your repeating frame as summary column and provide "reset at" group name (or set this to report if you are defining this field at report level) . This "cnt" variable will contain how many records that will be fetched for your repeating frame (i.e. Group of Repeating frame). You can use this "CNT" variable in your format trigger.
    In this case there is no need to write before report trigger or anything.
    Regards,
    Manish Trivedi

  • How to get the number of rows in a DB-Cursor

    When i open a database cursor i do not know how much rows are stored in the cursor. To solve this problem i have to send a 'select count(1) ...' to get the number of rows before i set up the cursor. I think that this is not very clever and could possibly cause performance problems. But i need the num of rows to show the percentage of processed rows. Is there any other way to get the num of rows? May be by checking the cursor directly?
    Please help!
    Thanx a lot

    In order to find out how may rows are going to be processed, oracle has to visit every row. So with a cursor, there is no property that will accurately reflect the number of rows until you get to the last one. That said, you could use
    select count(*) over() as row_count, <rest of your columns> FROM <your table>
    which will give you the total row count agaist each row in the result set. There are performance penalties involved but they will be less than issuing the query twice, once to get the count and once to get the rows.
    Have a look on asktom for some very usefull info about all this.
    HTH

  • How to get the number of rows in a ResultSet

    Hello,
    I'm an intern and I'm trying to get the number of rows from result set in oracle using rs.last() and rs.beforeFirst() methods
    but I got an error. Could Below is my sample code:
    import java.sql.*;
    public class SarueckConnect {
    public static void main(String[] args) {
    Connection con = null;
    Statement stmt = null;
    ResultSet re = null;
    String[] ParamArray;
    ParamArray = new String[24];
    //Properties logon;
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver"); //Loading the Oracle Driver.
    con = DriverManager.getConnection
    ("jdbc:oracle:thin:@258.8.159.215:1521:test_DB","data","data"); //making the connection DB.
    stmt = con.createStatement ();// Sending a query string to the database
    //stmt.executeUpdate("UPDATE test_table set steuk = 6 WHERE steuk = 5");
    ResultSet rs = stmt.executeQuery("SELECT mandt,kokrs,werks,arbpl,aufnr,vornr,ile01,"+
    "lsa01,ism01,ile02,lsa02,ism02,ile03,lsa03,ism03,ile04,lsa04,ism04,steuk,matnr,budat,"+
    "kostl,pernr,rueckid FROM test_table where steuk =6");
    //Print the result out.
    rs.last(); //This is the line which gives an error.
    int rows = rs.getRow();
    rs.beforeFirst();// I presume this is wrong to.
    ParamArray = new String[24*rows];
    int counter=0;
    while (rs.next()) {
    for (int i = 1; i <= 24; i++){
    ParamArray[i-1+(counter*24)] = rs.getString(i);
    System.out.print(rs.getString(i) + '\t');
    System.out.println();
    counter++;
    } catch(Exception e) {
    e.printStackTrace();
    } finally {
    try
    if(stmt != null) stmt.close();
    if(con != null) con.close();
    } catch (Exception exception) {
    exception.printStackTrace();
    TryBapi sap = new TryBapi(ParamArray);
    }When I run the code I do have the following ERROR Message:
    java.sql.SQLException: Invalid operation for forward only resultset : last
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.driver.BaseResultSet.last(BaseResultSet.java:91)
    at SarueckConnect.main(SarueckConnect.java:28)Please could any body Help me out here to figure out how to correct this?
    Any Help would be highly apprecited.

    make your result set scrollable...Not such a good idea. With Oracle, the JDBC driver will read and cache all the ResultSet in memory (with other DBMSs/drivers the behavior will probably be different, but you will still have some unnecessary overhead).
    You can do the caching yourself if you think it's worth it. If the piece of code you posted is why you need this for, then use a List or Vector and you won't need to know the size upfront.
    Alin,
    The jTDS Project.

  • How to get the number of rows written to the header of the spool file.

    Hi
    I need to create a header line for the spool file .
    the header line should include fixed length values .
    The header should include the number of records found in the table with a maximum begin date (begin_date is the column of the table)
    To get the header in the spool file , i wrote a select query has :-
    --SPOOL 'C:\Documents and Settings\abc\Desktop\output.TXT'
    select 'W'||to_char(sysdate,'MM/DD/YYYYMi:HH:SS')||lpad(max(rownum),9,'000000000') ||'R'||max(to_char(school_from_date,'MM/DD/YYYY')) ||
    rpad(' ',76,' ')
    from dad.school
    group by sysdate;
    SPOOL OFF
    which gets me all the rows in the table , but i only want the rows with the latest school_begin_date .
    how can i achieve that ...
    I know that a subquery should be written in the from clause to get the number of rows found with a maximum school_begin_date.
    select 'W'||to_char(sysdate,'MM/DD/YYYYMi:HH:SS')||lpad(max(rownum),9,'000000000') ||'R'||max(to_char(school_from_date,'MM/DD/YYYY')) ||
    rpad(' ',76,' ')
    from dad.school where
    select rownum from dad.school
    where school_begin_date = max(school_begin_date) ;
    the error i get is
    ORA-00934: group function is not allowed here
    I NEED HELP ..IN GETTING THE ROWNUM JUST FOR THE LATEST BEGIN_DATE ?
    PLS HELP ME IN WRITING THE QUERY .
    THANKS IN ADVANCE .

    Try this:
    select 'W'||to_char(sysdate,'MM/DD/YYYYMi:HH:SS')||lpad(max(rownum),9,'000000000')||'R'||max(to_char(school_from_date,'MM/DD/YYYY')) || rpad(' ',76,' ')
      from dad.school
    where school_begin_date = (select max(school_begin_date)
                                  from dad.school);

  • How to get the number of rows in a report region

    Hi all,
    Is there a way to get the number of rows returned in a report region, without issuing an additional "select count(*) from some_table"?
    I mean something like the substitution string #ROW_NUM# but for the total rows.
    Thanks,
    Pedro.

    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/ui.htm#CHDDGGEG
    For classic report regions, the region footer supports the following substitution strings:#ROWS_FETCHED# shows the number of rows fetched by the Oracle Application Express reporting engine (the page size). You can use these substitution strings to display customized messages to the user. For example:
    Fetched #ROWS_FETCHED# rows in #TIMING# seconds.
    *#TOTAL_ROWS# displays the total number of rows that satisfy a SQL query used for a report.*
    #FIRST_ROW_FETCHED# and #LAST_ROW_FETCHED# display the range of rows displayed. For example:
    Row(s) #FIRST_ROW_FETCHED# through #LAST_ROW_FETCHED# of #ROWS_FETCHED# displayed>
    Ta,
    Trent

  • How to retrieve the last inserted row

    This may be a question with a very known answer but I couldn't find any within this forum.
    What is the proper way to retrieve the just inserted record ?
    I'm accessing the DB from external Java and at this moment I use a timestamp column in order to retrieve the inserted row. So I generate an unique timestamp ('20020615184524356') which I inserted during the insert operation. I retrieve the just inserted row using "select * from fooTable where(timestamp='20020615184524356')".
    Is this the general idea or am I totally wrong ?

    hi Shaik Khaleel,
    Just wanted to clarify my doubts regarding rowid.
    Please refer the subject as "abt rowid" in previous posting and ur reply for that was
    "its an unique number throughout the database, its an hexadecimal number. it assigns the rowid of the deleted row in future , but not to the immediate insertation row."
    As u have mentioned the rowid of the deleted row can be assigned to a new row in future,
    wont the following query fail.
    select * from temp where rowid=(select max(rowid) from temp); -- in oracle. ~chandru

  • How to get the number of rows returned by a report?

    Hi,
    I'm developing my first application in APEX and so far everything seems fine, except I can't figure out this very simple thing: I have a report based on a PL/SQL block returning an SQL string. I'd like to have a message (something like "X rows returned") just before the report. The closest thing I could find was "X to Y out of Z" in the pagination styles, but that's not what I want. Also I don't think running the same query to get COUNT() is wise.
    Any help would be appreciated.
    Thanks,
    Konstantin

    My guess is that it only shows the number of rows it has retrieved. I believe the defailt is for it to only retrieve 50 rows and as you page through your report it retrieves more. So this would just tell you how many rows was retireved, but probably not how many rows the report would contain if you pages to the end. Oracle doesn't really have a notion of total number of rows until the whole result set has been materialized.

  • How to get the duplicate(exist) rows in Oracle?

    Good morning,
    I want to write the query to find the duplicate rows in the table.
    SELECT ITEM, MFT_ITEM, MFT, DESC FROM ITEM
    In the item table,if MFT_ITEM is coming more than or equal to twice ,it is a duplicate rows.MFT_ITEM is a unique.
    ITEM    MFT_ITEM   MFT              DESC
    4647 4648 C6253 TOOLS
    4647 4648 A0237 TOOLS
    10PS 10PS A0027 KITS
    10PS 11PS A0028 COVER
    12LN 12LN A0034 NUTS
    12LN 12LN A0035 NUTS
    12LN 13LN A0036 SCREW
    4310 4311 00462 POWER
    4310 4311 31645 POWER
    4310 4311 81205 POWER
    I want the results like
    ITEM    MFT_ITEM   MFT              DESC
    4647 4648 C6253 TOOLS
    4647 4648 A0237 TOOLS
    12LN 12LN A0034 NUTS
    12LN 12LN A0035 NUTS
    4310 4311 00462 POWER
    4310 4311 31645 POWER
    4310 4311 81205 POWER
    Please reply

    Nicole Thanks for your advise,
    I try the below query , I am getting 0 rows.
    With t As
    Select 4647 ITEM,4648 MFG_ITEM, 'C6253' MFG ,'Tools' Descrip From dual Union All
    Select 4647 ,4648 , 'A0237' ,'Tools' From dual Union All
    Select 1088 ,1088 , 'A0027' ,'Kits' From dual Union All
    Select 1088 ,1188 , 'A0028' ,'Covers' From dual Union All
    Select 1245 ,1245 , 'A0034' ,'Nuts' From dual Union All
    Select 1245 ,1245 , 'A0035' ,'Nuts' From dual Union All
    Select 1245 ,1345 , 'A0036' ,'Screw' From dual Union All
    Select 4310 ,4313 , 'A0046' ,'Power' From dual Union All
    Select 4310 ,4313 , 'A3164' ,'Power' From dual Union All
    Select 4310 ,4313 , 'A0462' ,'Power' From dual
    )Select ITEM, MFG_ITEM,MFG,DESCRIP From
    Select ITEM, MFG_ITEM,MFG,DESCRIP,
    Count(MFG_ITEM) over (Partition By ITEM Order By ITEM) cnt
    From t
    ) Where cnt > 1;
    I should get the results like below
    ITEM     MFG_ITEM     MFG     DESCRIP
    4647     4648     C6253     Tools
    4647     4648     A0237     Tools
    1245     1245     A0034     Nuts
    1245     1245     A0035     Nuts
    4310     4313     A0046     Power
    4310     4313     A3164     Power
    4310     4313     A0462     Power
    Please reply

  • How to get the total record count in ODI

    Hi
    I have the interface the are file to DB.
    The format is like this..
    HEADER
    DETAIL
    TRAILER
    Now will write the contains of file to DB,
    But i have to insert the total count ie numberof record written from file to DB in my Trailer record.
    can you tell me how can i get the total count of records in file and write it to trailer?
    Also, I want the interface to rollback the data if something fails will loading the data from file., ie. if there are 100 records in file and 50 got transfer and something fails i want to rollabck the 50 records from DB.???
    Thanks :)

    Hi
    You can design a flow for Full load flow and incremental flow from flat file to Table.
    Create a table at target database like.. (create table with last_execution and palce the V_FULL_LOAD value and LAST_EXECUTION_DT columns in last_execution table)
    Add faltfile as table in model, create a variable as V_FULL_LOAD and make sure that the default values is 01-01-1900
    Create one more variable like V_LAST_EXECUTION_DATE (in this variable write a case statement that if V_FULL_LOAD value is 'Y" then full load should happen and same time you should check that V_FULL_LOAD column is balnk then write insert statment else write update statement to update last_execution_dt column, similar for 'N')
    please provide your *personal mail ID*, i will send a doc file realted to your query.
    we have to tables present in work repository (SNP_STEP and STEP_LOG tables) using tables we can get how many records are inserted/updated and we can find how many records are not transfer and gor error.
    Thanks
    Phani

  • URGENT:how to get the error table populated in ODI

    Hello all,
    I am working on an interface of ODI where mapping is from a XML file to the database tables. I want, when there is any bad data (having length size greater than the target table's column length or data type mismatch) the bad data should get rejected or separated.
    I am using LKM, CKM, and IKM knowledge modules, but the erroneous record is not getting populated in even in the error table.
    when I try to insert lets say 4 records and 2nd record is erroneous then it is only inserting the 1st record. i want that the erroneous record should get inserted in the error table.
    Please suggest, if anybody is having any related information to get this done. That would be really helpful.
    Thanks in advance!

    Hello Phil,
    Thanks for your update.
    The option which you have mentioned having cloumn as char 4000, I can not do that as my target tables are seeded tables.
    I have also tried to get the data atleast in C$ tables having their length as varchar 4000. but it is not allowing to insert in C$ tables also.
    In my case I am getting data for ex: date_of_birth in VARCHAR datatype from the source XML and I have converted it ot DATE while mapping it to target column having DATE as the datatype.
    what if the DATE in xml source is invalid? its giving me the error while execution "Invalid datetime format". how would I identify that this error is for a particular record. If I can get this erroneous record atleast in C$ table I can find a work around for this correction then.
    I hope you have solution for this problem :)
    Thanks.

  • How to get the number of rows in a HTML table in some other page

    Hi,
    I am incrementing HTML table rows on button click and saving number of rows in a javascript variable. But on submitting that page I need that number of row value in the following page
    example:
    HTML table is in the page first.jsp
    and the javascript variable having the current row number is row_number
    on submitting it goes to second.jsp page. There i need that row_number value.
    Can anyone help me to solve this?
    regards,
    carry

    function buttonClick()
    var table = profileTable;
    var lnRow = table.rows.length;
    var insertedRow = table.insertRow(parseFloat(lnRow));
    var cell1 = insertedRow.insertCell();
    cell1.innerHTML ="<tr><td><Input type=\"hidden\" >>>name=\"rowNum\" value="+cnt"+></td></tr>";
    document.profileform.submit;
    on submit it goes to the second page, but the value i got using >>>System.out.println("row number from text >>>box"+request.getParameter("rowNum")); is null. What is wrong with >>>my coding. Can anyone solve this.HI carry
    Check the value of bold data
    function buttonClick()
    var table = profileTable;
    var lnRow = table.rows.length;
    var insertedRow = table.insertRow(parseFloat(lnRow));var cnt=inRow
    var cell1 = insertedRow.insertCell();
    cell1.innerHTML ="<tr><td><Input type=\"hidden\" >>>name=\"rowNum\" value="+cnt+"></td></tr>";
    document.profileform.submit;
    }try with it

Maybe you are looking for

  • Processo de Importacao com NFe - DANFE de Entrada

    Estamos tentando automatizar o processo de importacao em compras, e uma das necessidades é gerar a DANFE de entrada (propria). Como o standard a DANFE de entrada esta colocando no lugar do Issuer o Fornecedor e no lugar do Parceiro de negocio a propr

  • File not found error (no error number or file identified)

    Hi, I am getting a file not found error when trying to render a project. The message box does not identify which file is not found nor is there an error message number. I by trial and error tracked the file to a video connected to the PAL_Projector M

  • Internal flow of v3 update

    hi     i am suresh     in v3 update 4 types are there 1)serialized                                    2)direct delta                                    3)qued delta                                    4) un serialized      i want internal data flow de

  • US7ASCII Characterset - Need to support Special Characters & Symbols

    Dear All, My database characterset is 'US7ASCII' Some of Special Characters / Symbols are not supported by 'US7ASCII'. But those symbols need to be supported by 'US7ASCII'. Do we have any option to make 'US7ASCII' Characterset to support such Symbols

  • Organizer shows all thumbnails when opening, but if one selected it opens on that when re-opened???

    The two books I have neithor offererend an explanation of how to get back to all thumbnails instead of the last one shown before closing. Help, Help... Don Wright