Check sql statement status

Hi,
this is the code:
Statement stmt;
try {
    stmt = conn.createStatement();
    //do some stuff
    stmt.close();
catch( SQLException e ) {
     if(stmt.isClose()) {
           System.out.println( "The statement has been closed!" );
     else {
           System.out.println("The statement has not been closed!" );
           stmt.close();
}Sure, there is no method ( stmt.isClose() ).... I have read the api. But how do you check whether the statement has been closed or not???? I got temporary solution. By giving null value then check whether the stmt has null value or not.... but that is not elegant.
Thank you.

You don't need to worry about it. As per the javadocs, closing a closed Statement has no effect. That said, however, you should move your close() call outside both of those locations into a finally {} block at the end.

Similar Messages

  • Check SQL statement in BI

    Hi all.
    I've wrote some SQL statement against charcteristic Master Data table in Transfer Routine to get the result for attribute value. It seems to me my SQL statement doesn't work. Is where any transation/tool in BI to run/check SQL statements ?

    hi,
    you can always check the syntax after writing a routine.Also, you can put a break-point and debug to check the behavior of the code.
    Can u explain in more detail, what is the Statement that is giving problem?
    Regards,
    Srinivas Kamireddy.

  • Procedure not checking each sql statement.

    Hi All,
    I have created 2 tables names are A1 and B1. A1 table has some fields. Fields are no,sal,comm.,load_date. In A1 table NO (column) is the primary key.
    Second table is B1. this table has id,phone_no and load_date. In this table constraint
    ID column is the Not null.
    After that I have created 2 procedures one for A1 and one for B1. with in those procedures I used SQL insert statements.
    In procedures I used some valid sql statements and some invalid statements ( invalid statements means that I have specified constraint that’s why I specified duplicated and null values). While executing the procedures procedure shows error because of invalid statement and in that procedures I did not specify any Exceptions.
    If I specify Exceptions in procedures executing successfully some records are not loading procedure is comeing out. How do we mention server needs to be check and every insert sql startement.
    EX:
    If I give 6 records from 1 to 3 valid statements. I mentioned 4 th record copy of previos record( duplicated). 5 th record and 6 th valid records.
    Procedure executing successfully. Procedure loaded 1 to 4 records after that not loaded 5,6 and 7 records. How do we specify for record inserts 7. actually 7 th record is valid statement we should be insert this record. Please tell me how do we handle sql statements each and every one successfully or not.
    create or replace procedure a_proc as
    --declare
    begin
    insert into a1 values (100,2000,300,sysdate);
    insert into a1 values(200,1000,400,sysdate);
    insert into a1 values(300,3000,500,sysdate);
    insert into a1 values(400,6000,600,sysdate);
    insert into a1 values(400,900,700,sysdate);
    insert into a1 values(400,10000,1200,sysdate);
    insert into a1 values(900,11000,1300,sysdate);
    commit;
    EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR - '||sqlerrm);
    end a_proc;
    In B1 table colums are ID,PHONE_NO and Load_date. ID is not null column.
    For B1 population I have created one procedure
    create or replace procedure b_proc as
    --declare
    begin
    insert into b1 values(1,123456,sysdate); -- 1 record
    insert into b1 (phone_no,load_date) values (7896538,sysdate); --2 record
    insert into b1 (phone_no) values(6763723458); ----3 record
    insert into b1 (phone_no) values(453465778); --4 record
    insert into b1 values(400,72894894,sysdate); --5 record
    insert into b1 values(500,72894894,sysdate); --6 record
    commit;
    EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERROR - '||sqlerrm);
    end b_proc;
    if I execute above procedure procedure executing successfully but procedure inserting only first record not inserting 5th and 6th record. How do we exception for 5th and 6th records also.
    Thanks and Regards,
    Venkat

    {color:#808080}{color:#333300}Hi,
    Please find answer to your question below:{color}
    Venkat: Procedure executing successfully. Procedure loaded 1 to 4 records after that not loaded 5,6 and 7 records. How do we specify for record inserts 7. actually 7 th record is valid statement we should be insert this record. Please tell me how do we handle sql statements each and every one successfully or not.
    {color}
    {color:#0000ff}Guna: The procedure hits an exception after 4th record, and does not process anymore as it exits out of the procedure, I believe the data is not committed as well. You need handle exceptions if the processing has to continue. Same is the belwo case as well
    {color}{color:#333300}Regards,
    Guna{color}

  • Can normal sql statement check thru all occurance ?

    Hi ,
    i have the following sample data
    A)
    select * from tt_test11 ;
            IDX1     CREATION_DATE
    1     1     12/4/2006 11:00:23 AM
    2     1     12/1/2006 11:00:23 AM
    3     1     11/1/2006 11:00:23 AM
    B)
    select * from tt_test12
            IDX1     STARTTIME     ENDTIME
    1     1     12/4/2006 10:00:23 AM     12/5/2006 1:00:23 AM
    2     1     12/1/2006 10:00:23 AM     12/3/2006 1:00:23 AM
    3     1     11/1/2006 10:00:23 AM     11/5/2006 1:00:23 AM
    C)
    select  * from tt_test11 a
    where exists (select null from tt_test12 b
    where a.idx1 = b.idx1
    and a.creation_date not between b.starttime and b.endtime )
            IDX1     CREATION_DATE
    1     1     12/4/2006 11:00:23 AM
    2     1     12/1/2006 11:00:23 AM
    3     1     11/1/2006 11:00:23 AMwhat i want to acheive :
    i want to return all records from tt_test11 only when all records has been matched and there's no record that exists in the range from tt_test12
    if seems that from part C , that it'll return a record as long as record from tt_test11 is not matched against a record in tt_test12
    and i am now doing a function to check against all record in tt_test12 and return a flag to indicate whether the record from tt_test11 does not exist in tt_test12
    but how can i do that in using SQL statements alone ?
    pls advise
    tks & rgds

    I hope i have got your requirement right now. Is this what you want?
    SQL> create table tt_test11
      2  as
      3  (select 1 IDX1,to_date('12/4/2006 11:00:23 AM','dd/mm/yyyy hh:mi:ss AM') CREATION_DATE from dual
      4  union all
      5  select 1,to_date('12/1/2006 11:00:23 AM','dd/mm/yyyy hh:mi:ss AM') from dual
      6  union all
      7  select 1,to_date('11/12/2006 11:00:23 AM','dd/mm/yyyy hh:mi:ss AM') from dual
      8  )
      9  /
    Table created.
    SQL> create table tt_test12
      2  as
      3  (
      4  select 1 IDX1,to_date('12/4/2006 10:00:23','dd/mm/yyyy hh:mi:ss') STARTTIME,to_date('12/5/2006 1:00:23 AM','dd/mm/yyyy hh:mi:ss AM') ENDTIME
    from dual
      5  union all
      6  select 1,to_date('12/1/2006 10:00:23 AM','dd/mm/yyyy hh:mi:ss AM'),to_date('12/3/2006 1:00:23 AM','dd/mm/yyyy hh:mi:ss AM')  from dual
      7  union all
      8  select 1,to_date('11/1/2006 10:00:23 AM','dd/mm/yyyy hh:mi:ss AM'),to_date('11/5/2006 1:00:23 AM','dd/mm/yyyy hh:mi:ss AM')  from dual
      9  )
    10  /
    Table created.
    SQL> alter session set nls_date_format='dd/mm/yyyy hh:mi:ss AM'
      2  /
    Session altered.
    SQL> select * from tt_test11
      2  /
          IDX1 CREATION_DATE
             1 12/04/2006 11:00:23 AM
             1 12/01/2006 11:00:23 AM
             1 11/12/2006 11:00:23 AM
    SQL> select * from tt_test12
      2  /
          IDX1 STARTTIME              ENDTIME
             1 12/04/2006 10:00:23 AM 12/05/2006 01:00:23 AM
             1 12/01/2006 10:00:23 AM 12/03/2006 01:00:23 AM
             1 11/01/2006 10:00:23 AM 11/05/2006 01:00:23 AM
    SQL> select distinct idx1,CREATION_DATE
      2  from
      3  (
      4  select a.idx1,b.CREATION_DATE,a.STARTTIME,a.endtime,
      5         sum(case when b.CREATION_DATE between a.STARTTIME and a.endtime then 1 else 0 end )
      6         over(partition by a.idx1,b.CREATION_DATE) flag
      7  from tt_test12 a,tt_test11 b
      8  where a.idx1=b.idx1
      9  )
    10  where flag=0
    11  /
          IDX1 CREATION_DATE
             1 11/12/2006 11:00:23 AMMessage was edited by:
    Mohana

  • How can I write a SQL statement which checks if a table exists?

    How can I write a SQL statement which tells me whether a table exists?

    execute an sql query: select * from <tablename>
    catch the exception n check whether the erroe code
    matches the one that occurs for table doesn't exist
    that's itHow is your answer any different from the one given in the first reply?
    It isn't.
    As WorkForFood says DatabaseMetaData has a bunch of methods for getting information about tables but this is more useful when you don't know the names of any of the tables.. it sounds like you do so I would concur SELECT from table is probably the quickest way to go. If it helps the Xopen error should be either S1000 or 42S01 (I think) but I would try and see if there is a specific vendor code for table not found/not exists error and check for that.

  • Check the validity of a SQL statement before execution

    Hi everyone,
    In an applet I have created, I am allowing the user to create a SQL statement which will be sent to a servlet that in turn issues the JDBC request for the SQL statement. My concern is that since my GUI lets the user create more or less any kind of SQL statement (including an illegal one) I need to verify if the user has created the correct SQL. How can this be achieved?
    To recapitulate and summarize, I need to know how I can check the validity of a SQL statement without actually executing it and handling the SQLException. FYI, I am using the mm-mysql driver.
    Thanks,
    Alan

    jschell is correct. Unless you're writing something like an ISQL tool you want to be very careful doing this.
    Having said that Mimer SQL have SQL validators that may do what you want http://developer.mimer.com/validator/index.htm
    They've also got the SQL Validator running as a web service that you can use. Theres example code here showing how to use it.
    http://sqlvalidator.mimer.com/index.html
    At the risk of being accused of selfpromotion you can check out the SQL Validator plugin for SQuirreL SQL CLient. This is a fully functional example of using the Mimer SQL Validation web service. http://squirrel-sql.sourceforge.net/
    Col

  • SQL check result of the sql statement

    hello gurus, i have this sql statement:
    select MyTableColumn_PDF_File
    from Database.dbo.MyTableName
    where coalesce( MyTableColumn_PDF_File,' ') is null;
    so basically, it works fine on sql management studio.
    But what if I used this command on vb.net, how do I check whether the column is null or not?
    Any help is greatly appreciated.
    Thanks. :)
    Every second counts..make use of it. Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    IT Stuff Quick Bytes

    Dim con As New SqlClient.SqlConnection("connectionstring")
    Dim DR As SqlClient.SqlDataReader = Nothing
    Try
    con.Open()
    Dim cmd As New SqlClient.SqlCommand("select COUNT(*) AS TotalNull " & _
    "from Database.dbo.MyTableName " & _
    "where MyTableColumn_PDF_File is null", mSQLConnection)
    DR = cmd.ExecuteReader()
    If DR.Read Then
    '' found rows
    If CInt(DR.Item("TotalNull")) <> 0 Then
    '' We have more than 1 row that is not null
    End If
    Else
    '' not found nows
    End If
    Catch ex As Exception
    ''' oops
    Finally
    If Not IsNothing(DR) Then
    If Not DR.IsClosed Then DR.Close()
    DR = Nothing
    End If
    If Not IsNothing(con) Then
    If con.State = ConnectionState.Open Then con.Close()
    con = Nothing
    End If
    End Try
    This is a more complete example

  • Check the sql statement of view

    HI All
    I have a query that
    How can we check the SQL statement of any view in oracle 10.
    If any one knows then pls let me know

    SQL> select view_name,text from user_views where VIEW_NAME='HISTORY';
    VIEW_NAME
    TEXT
    HISTORY
    select
    Serial,
    0 State,
    Availablet At,
    AvailableD

  • Single SQL statement that does multiple column checks

    I have multiple sql statements (see below) that do value and format checking on different columns within the same table. I am trying to condense these checks into one SQL statement, anyone know how to do this?
    select colx, coly, col1 from table1 where col1 not in ('A','B','C')
    select colx, coly, col2 from table1 where col2 not in ('X','Y','Z')
    etc
    Note that I am looking for the value of the offending column (e,g col1 or col2) as the last of the three columns outputted,
    Thanks in advance

    Perhaps;
    SQL> create table t (colx number, coly number, col1 varchar2(1),
       col2 varchar2(1), col3 varchar2(1), col4 varchar2(1))
    Table created.
    SQL> insert all
       into t values(1,1,'A','D','G','J')
       into t values(1,2,'*','D','G','J')
       into t values(1,3,'A','D','G','J')
       into t values(1,4,'A','*','G','J')
       into t values(1,5,'A','D','G','J')
       into t values(1,6,'A','D','*','J')
       into t values(1,7,'A','D','G','J')
       into t values(1,8,'_','-','/','*')
    select * from dual
    8 rows created.
    SQL> select colx, coly,
       trim(regexp_replace('Col1' || col1,'(Col1)([^A|B|C])|(Col1)([A|B|C])', '\1 ') ||
            regexp_replace('Col2' || col2,'(Col2)([^D|E|F])|(Col2)([D|E|F])', '\1 ') ||
            regexp_replace('Col3' || col3,'(Col3)([^G|H|I])|(Col3)([G|H|I])', '\1 ') ||
            regexp_replace('Col4' || col4,'(Col4)([^J|K|L])|(Col4)([J|K|L])', '\1')) offending_column,
       trim(regexp_replace(col1,'([^A|B|C])|([A|B|C])', '\1 ') ||
            regexp_replace(col2,'([^D|E|F])|([D|E|F])', '\1 ') ||
            regexp_replace(col3,'([^G|H|I])|([G|H|I])', '\1 ') ||
            regexp_replace(col4,'([^J|K|L])|([J|K|L])', '\1')) offending_value
    from t
    where regexp_replace(col1||col2||col3||col4,
          '(A|B|C)(D|E|F)(G|H|I)(J|K|L)') is not null
          COLX       COLY OFFENDING_COLUMN     OFFENDING_VALUE    
             1          2 Col1                 *                  
             1          4 Col2                 *                  
             1          6 Col3                 *                  
             1          8 Col1 Col2 Col3 Col4  _ - / *            
    4 rows selected.Message was edited by:
    MScallion
    Added offending_value
    NOTE* this query only works on single character columns and requires modification for multi character columns

  • How check what kind od SQL statement procedure do

    I would like to check what kind of sql statement type (DML, DDL , Retrive) procedure do on objects.
    is it possible?

    You could try to parse the SQL in DBA_SOURCE for the procedure in question, but that probably doesn't help much...
    Note as well that procedures cannot do DDL unless they resort to dynamic SQL, in which case Oracle itself doesn't know what objects you're working with and what you're doing with them until runtime.
    Justin

  • Xi JDBC Adapter - Query SQL Statement & Update SQL Statement

    Hi!
    I configure the JDBC adapter sender (XI) to take data from Oracle database.
    I set the Query and Update SQL Statement in the Processing parameters of the communication channel in this way:
    Query SQL Statement :
    SELECT * FROM XI_TABLE WHERE STATUS = 'WAIT' ORDER BY ROW_NUM
    Update SQL Statement :
    UPDATE XI_TABLE SET STATUS = 'DONE', DATE = SYSDATE WHERE STATUS = 'WAIT'
    My question is :
    If a new record with the field STATUS = 'WAIT' is added to the table (xi_table) during the time between the execution of the query statement and the start of the update statement, what will happen to that record during the update?
    There is a way to avoid the update of that record? or to pass to the update statement only the record selected in the query statement?
    Please, may you give me some example?
    Thanks,
    Francesco

    hi,
    did you check "Isolation Level for Transaction"
    for the sender jdbc adapter?
    http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
    Regards,
    michal

  • Update SQL statement, date possibilities

    All,
    Is it possible to format the date in the update sql statement of the sender JDBC adapter ?
    the statement curdate() returns the date in this format 09-02-04.
    But, I would like to have it in this format 20090204.
    this is my update statement
       UPDATE table SET status = 'X', date = curdate()
    Anybody knows how to do this or via something else than curdate()
    Michel

    Hi Michel,
    I am sorry i misunderstood the question.. how are you getting the data from curdate() may i ask. What exactly is curdate()?
    Is it a field in the database that you are retrieving?
    What you could do is create another dummy field and maitain the current date in that field, in the format you want it to. Then you could use that field in the update statement as tableName.fieldName.
    Use this to manage your date checks. Only that you would have to modify the date in the database every day.
    Regards,
    Kshitij
    Edited by: Kshitij Sharma on Feb 4, 2009 9:31 AM
    Edited by: Kshitij Sharma on Feb 4, 2009 9:36 AM

  • Sql statement hanging in prod. fast in dev.

    Hi,
    Sql statement is hanging in production.
    In development it is executing in 2 secs.
    From explainplan , noticed that taking different indexes.
    I have posted the staement and explain plan (prod and dev) below.
    Statement:
    SELECT
    REP_V_SERVICE_REQUEST.SERVICE_REQ_ID,
    REP_V_ACTIVITY.EXTERNAL_REF,
    REP_V_ACTIVITY.VENUS_PROBLEM_START,
    REP_V_ACTIVITY.VENUS_ALERT_ISSUED,
    REP_V_ACTIVITY.VENUS_NOTIFIED,
    REP_V_ACTIVITY.ACTIVITY_ID,
    REP_V_ACTIVITY.CREATED_BY_WORKGROUP,
    REP_V_ACTIVITY.ABSTRACT,
    REP_V_ACTIVITY.TIME_TO_VENUS_ALERT,
    REP_V_ACTIVITY.TIME_TO_VENUS_ISSUE,
    REP_V_ACTIVITY.TIME_TO_VENUS_NOTIFIED,
    REP_V_SERVICE_REQUEST.TYPE,
    REP_V_SERVICE_REQUEST.SUB_TYPE,
    REP_V_SERVICE_REQUEST.CLASSIFICATION_TYPE,
    REP_V_SERVICE_REQUEST.CLASSIFICATION_SUB_TYPE,
    ( REP_V_SERVICE_REQUEST.TIME_OPENED ),
    REP_V_SERVICE_REQUEST.CREATED_BY_WORKGROUP,
    REP_V_ACTIVITY.VENUS_SENT_TO_SDN,
    SR_RESOLVER_WG.WORKGROUP
    FROM
    REP_V_SERVICE_REQUEST,
    REP_V_ACTIVITY,
    REP_V_WORKGROUP SR_RESOLVER_WG
    WHERE
    ( SR_RESOLVER_WG.WORKGROUP_ID=REP_V_SERVICE_REQUEST.RESOLUTION_GROUP_ID )
    AND ( REP_V_ACTIVITY.SERVICE_REQUEST_ROW_ID=REP_V_SERVICE_REQUEST.SERVICE_REQUEST_ROW_ID )
    AND (
    REP_V_ACTIVITY.PLANNED_START_TIME BETWEEN '01-JAn-2006' AND '19-Jun-2006'
    AND REP_V_ACTIVITY.VENUS_PROBLEM_STATUS NOT IN ('Information', 'Planned')
    AND REP_V_ACTIVITY.VENUS_ALERT_STATUS != 'Withdrawn'
    AND REP_V_ACTIVITY.CREATED_BY_WORKGROUP LIKE '%SSHD%'
    AND REP_V_ACTIVITY.STATUS != 'Cancelled'
    AND REP_V_ACTIVITY.CREATED_BY_WORKGROUP NOT LIKE 'GLO_SSHD_MTC'
    Exp. plan(prod)
    24 SELECT STATEMENT
    23 NESTED LOOPS (OUTER)
    21 NESTED LOOPS (OUTER)
    19 NESTED LOOPS
    16 NESTED LOOPS
    13 NESTED LOOPS
    10 NESTED LOOPS (OUTER)
    8 NESTED LOOPS
    5 NESTED LOOPS
    2 TABLE ACCESS (BY INDEX ROWID), S_ORG_EXT (SIEBEL)
    1 INDEX (FULL SCAN), S_ORG_EXT_F13 (SIEBEL)
    4 TABLE ACCESS (BY INDEX ROWID), S_BU (SIEBEL)
    3 INDEX (UNIQUE SCAN), S_BU_P1 (SIEBEL)
    7 TABLE ACCESS (BY INDEX ROWID), S_SRV_REQ (SIEBEL)
    6 INDEX (RANGE SCAN), S_SRV_REQ_U2 (SIEBEL)
    9 INDEX (UNIQUE SCAN), S_SRV_REGN_P1 (SIEBEL)
    12 TABLE ACCESS (BY INDEX ROWID), SERVICE_REQUEST (CRMREP_REP)
    11 INDEX (UNIQUE SCAN), PK_SR (CRMREP_REP)
    15 TABLE ACCESS (BY INDEX ROWID), S_EVT_ACT (SIEBEL)
    14 INDEX (RANGE SCAN), S_EVT_ACT_F14 (SIEBEL)
    18 TABLE ACCESS (BY INDEX ROWID), ACTIVITY (CRMREP_REP)
    17 INDEX (UNIQUE SCAN), PK_A (CRMREP_REP)
    20 INDEX (RANGE SCAN), S_EVT_MAIL_U1 (SIEBEL)
    22 INDEX (RANGE SCAN), S_EVT_ACT_X_U1 (SIEBEL
    Exp plan(Dev):
    24 SELECT STATEMENT
    23 NESTED LOOPS (OUTER)
    21 NESTED LOOPS (OUTER)
    19 NESTED LOOPS
    16 NESTED LOOPS
    13 NESTED LOOPS (OUTER)
    11 NESTED LOOPS
    8 NESTED LOOPS
    5 NESTED LOOPS
    2 TABLE ACCESS (BY INDEX ROWID), S_EVT_ACT (SIEBEL)
    1 INDEX (RANGE SCAN), S_EVT_ACT_M8 (SIEBEL)
    4 TABLE ACCESS (BY INDEX ROWID), S_SRV_REQ (SIEBEL)
    3 INDEX (UNIQUE SCAN), S_SRV_REQ_P1 (SIEBEL)
    7 TABLE ACCESS (BY INDEX ROWID), S_ORG_EXT (SIEBEL)
    6 INDEX (UNIQUE SCAN), S_ORG_EXT_U3 (SIEBEL)
    10 TABLE ACCESS (BY INDEX ROWID), S_BU (SIEBEL)
    9 INDEX (UNIQUE SCAN), S_BU_P1 (SIEBEL)
    12 INDEX (UNIQUE SCAN), S_SRV_REGN_P1 (SIEBEL)
    15 TABLE ACCESS (BY INDEX ROWID), SERVICE_REQUEST (REPORT)
    14 INDEX (UNIQUE SCAN), PK_SR (REPORT)
    18 TABLE ACCESS (BY INDEX ROWID), ACTIVITY (REPORT)
    17 INDEX (UNIQUE SCAN), PK_A (REPORT)
    20 INDEX (RANGE SCAN), S_EVT_MAIL_U1 (SIEBEL)
    22 INDEX (RANGE SCAN), S_EVT_ACT_X_U1 (SIEBEL)
    I checked the v$session_wait while it is hanging,
    It is waiting for table s_evt_act (prod. 1.6 crores,dev. 1 crore)
    In development it is accessing S_EVT_ACT_M8 (SINGLE COLUMN)index,in production
    it is accessing S_EVT_ACT_F14(COMBN. TWO COLUMNS BUT DIFFERENT FROM PRODUCTION).
    Thanks,
    kumar.

    This query is not executing for last 5 to 6 months.
    I am new to this issue.
    pls find the outof v$session_event for this session.
    It is waiting for db file sequential read and the wait is keep on increasing.
    SID EVENT TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED AVERAGE_WAIT MAX_WAIT TIME_WAITED_MICRO
    43 db file sequential read 141459 0 130565 1 66 1305647401
    43 db file scattered read 77437 0 54259 1 466 542587342
    43 direct path write 1222 0 867 1 26 8671937
    43 buffer busy waits 570 0 318 1 4 3175286
    43 SQL*Net message to client 339 0 0 0 0 866
    43 SQL*Net message from client 338 0 84716 251 32623 847156015
    43 latch free 14 12 6 0 2 59905
    43 direct path read 6 0 1 0 0 12290
    43 log file sync 1 0 0 0 0 2268

  • BR0301E SQL error -27140 at location db_connect-2, SQL statement: DB13

    Hello All,
    We have ECC 6 with
    Database Oracle: 10.2.0.2.0
    OS: HP-UX
    We are facing problem while running Check and Update Optimizer Statistics in DB13. The Job Log says
    Job started
    Step 001 started (program RSDBAJOB, variant &0000000000003, user ID LARJHD01)
    Execute logical command BRCONNECT On host madsappr
    Parameters: -u / -jid STATS20090519130903 -c -f stats -t ALL
    SXPG_COMMAND_EXECUTE(LONG)
    COMMANDNAME = BRCONNECT
    OPERATINGSYSTEM = ANYOS
    TARGETSYSTEM = madsappr
    DESTINATION =
    BR0801I BRCONNECT 7.00 (24)
    BR0805I Start of BRCONNECT processing: ceapnjyf.sta 2009-05-19 13.09.05
    BR0484I BRCONNECT log file: /oracle/PRD/sapcheck/ceapnjyf.sta
    BR0280I BRCONNECT time stamp: 2009-05-19 13.09.07
    BR0301E SQL error -27140 at location db_connect-2, SQL statement:
    'CONNECT /'
    ORA-27140: attach to post/wait facility failed
    BR0310E Connect to database instance PRD failed
    BR0280I BRCONNECT time stamp: 2009-05-19 13.09.07
    BR0301E SQL error -27140 at location db_connect-2, SQL statement:
    'CONNECT /'
    ORA-27140: attach to post/wait facility failed
    BR0310E Connect to database instance PRD failed
    BR0806I End of BRCONNECT processing: ceapnjyf.sta2009-05-19 13.09.07
    BR0280I BRCONNECT time stamp: 2009-05-19 13.09.07
    BR0804I BRCONNECT terminated with errors
    External program terminated with exit code 3
    BRCONNECT returned error status E
    Job finished
    Please throw some light on this error.
    =Alex Daniel=

    Hi,
    Please check below links.
    DB13 Jobs are Failing and Brconnect does not work
    Re: Error in CHECKDB
    http://ora-exp.blogspot.com/2006/12/solution-of-ora-27140-attach-to.html
    Thanks,
    Sushil

  • SSIS The parameterized sql statement yields metadata which does not match the main SQL statement

    Hi all,
    I'm getting the above error when trying to execute a custom lookup.  What I'm trying to do is lookup the minimum promotional price between date ranges.  The SQL executes fine in SSMS
    SELECT refTable.PRICE
    FROM ( SELECT MIN(PRICE) AS PRICE ,
    NAME ,
    ITEMRELATION ,
    FROMDATE ,
    TODATE
    FROM [dbo].[AllCustPrices]
    GROUP BY NAME ,
    ITEMRELATION ,
    FROMDATE ,
    TODATE
    ) [refTable]
    WHERE [refTable].[NAME] = ?
    AND [refTable].[ITEMRELATION] = ?
    AND ? BETWEEN [refTable].[FROMDATE]
    AND [refTable].[TODATE]
    but errors in SSIS?

    Apologies, totally forgot i posted a question on here.  I still haven't resolved this.  full error text is TITLE: Package Validation Error
    Package Validation Error
    ADDITIONAL INFORMATION:
    Error at Data Flow Task [Lookup MIN Price [440]]: The parameterized SQL statement yields metadata which does not match the main SQL statement.
    Error at Data Flow Task [SSIS.Pipeline]: "Lookup MIN Price" failed validation and returned validation status "VS_ISBROKEN".
    Error at Data Flow Task [SSIS.Pipeline]: One or more component failed validation.
    Error at Data Flow Task: There were errors during task validation.
     (Microsoft.DataTransformationServices.VsIntegration)
    BUTTONS:
    OK
    If I take off the MIN function and just put * SSIS is quite happy, it does not like MIN for some reason?
    I'm really stumped with this... checked metadata for third parameter which is W/C Date DT_DBTIMESTAMP which is same as FROMDATE, TODATE where i'm using BETWEEN...

Maybe you are looking for