SQL Statement error - Kindly help!

Been scratchin my head but still can't figure why it's failing ..Trying to populate the space usage for the relevant tablespaces: Get the below error. Kindly advice?
column free_space_mb format 9999999.999
column allocated_mb format 9999999.999
column used_mb format 9999999.999
column tablespace format a12
column filename format a20
select ts.name tablespace, trim(substr(df.name, 1,100)) filename,
df.bytes/1024/1024 allocated_mb,
((df.bytes/1024/1024) - nvl(sum(dfs.bytes)/1024/1024,0)) used_mb,
nvl(sum(dfs.bytes)/1024/1024,0) free_space_mb
from v$datafile df left outer join dba_free_space dfs
on df.file# = dfs.file_id join v$tablespace ts
on df.ts# = ts.ts#
on df.name# = ts.name#
and ts.name='DATA_TS'
or ts.name='INDEX_TS'
or ts.name='LOB_TS'
group by ts.name, df.name, dfs.file_id, df.file#, df.bytes
order by filename;
ERROR at line 8:
ORA-00933: SQL command not properly ended

Hi,
user568296 wrote:
select ts.name tablespace, trim(substr(df.name, 1,100)) filename,
df.bytes/1024/1024 allocated_mb,
((df.bytes/1024/1024) - nvl(sum(dfs.bytes)/1024/1024,0)) used_mb,
nvl(sum(dfs.bytes)/1024/1024,0) free_space_mb
from v$datafile df left outer join dba_free_space dfs
on df.file# = dfs.file_id join v$tablespace ts
on df.ts# = ts.ts#
on df.name# = ts.name#
and ts.name='DATA_TS'
or ts.name='INDEX_TS'
or ts.name='LOB_TS'
group by ts.name, df.name, dfs.file_id, df.file#, df.bytes
order by filename;
ERROR at line 8:
ORA-00933: SQL command not properly endedOn line 8 there is a 2nd ON clause for the same join. "AND" in place of "ON" would make syntaic sense, but filenames in v$datafile are usually superstrings of tablespace names in v$ablespace. That is, if ts.name (no # at the end) is 'DATA_TS', then df.name might be 'D:\ORACLE\ORADATA\DEVELOPMENT\DATA_TS01.DBF'.
I don't think you need that condition at all. Try:
select    ts.name                    tablespace,
       trim (substr (df.name, 1, 100))      filename,
       df.bytes/1024/1024                    allocated_mb,
       ( ( df.bytes / 1024 / 1024)
       - nvl ( sum (dfs.bytes) / 1024 / 1024
              , 0
       )                         used_mb,
       nvl ( sum (dfs.bytes) / 1024 / 1024
           , 0
           )                         free_space_mb
from                     v$datafile          df
left outer join      dba_free_space          dfs     on     df.file#     = dfs.file_id
join                   v$tablespace          ts     on     df.ts#          = ts.ts#
--                                   AND     df.name          = ts.name     -- AND, not ON
                                   and     ts.name          IN ( 'DATA_TS'
                                                     , 'INDEX_TS'
                                                     , 'LOB_TS'
group by  ts.name,
             df.name,
       dfs.file_id,
       df.file#,
       df.bytes
order by  filename;It's a bad idea to mix AND and OR at the same level in the same query. In this case, you can use the IN operator to avoid the need for OR. In other situations, use parentheses to isolate the ANDs from the ORs.

Similar Messages

  • ORA-00900: invalid SQL statement Error while Executing Procedure

    Hi:
    I am trying to execute following procedure through java code, but i am getting ORA-00900: invalid SQL statement error.
    Procedure is :
    <code>
    (vResult out int)
    as
    vCardId varchar2(16);
    vForacid varchar2(16);
    vApp_Entry_No varchar2(10);
    vSrNo number(6);
    vCardStatus char(1);
    vCardStat char(2);
    vExpiryDate date;
    Cursor cardCur1 is
    select u.card_number,trim(u.ACCOUNT_NUMBER),u.CARD_STATUS,to_char(u.EXPIRY_DATE,'dd-MM-yyyy')
    FROM DailyCardData u
    where default_indicator='1'
    and isprocessed = 'N'
    order by expiry_date;
    begin
    vSrNo := 0;
    vResult := 0;
    open cardCur1;
    Loop
    fetch cardCur1 into vCardId,vForacid,vCardStat,vExpiryDate;
    if cardCur1%NOTFOUND then
    exit;
    end if;
    if (vCardStat != null) then
    vCardStatus := 'H';
    elsif (vExpiryDate <= sysdate) then
    vCardStatus := 'E';
    else
    vCardStatus := null;
    end if;
    select a.app_entry_no into vApp_Entry_No from Application a,ApplicationLinkedAccounts l
    where l.foracid = vForacid and l.AcSrNo = '1'
    and a.app_entry_no = l.app_entry_no
    and a.cardid is null
    and a.DOWNLOADFILECREATIONFLAG = 'Y';
    update Application set CardId = vCardId,
    Card_Status = vCardStatus,APPLICATIONPROCESSEDFLAG = 'Y',
    APPLICATIONPROCESSEDdate = DOWNLOADFILECREATIONdate
    where App_Entry_No = vApp_Entry_No;
    commit;
    update DailyCardData set isprocessed = 'Y',app_entry_no = vApp_Entry_No
    where card_number = vCardId;
    commit;
    end Loop;
    close cardCur1;
    vResult := 1;
    end;
    </code>
    Can any body help me in that?
    Thank You,
    Anup

    First of all I don't see a procedure header.
    Secondly I see you commit inside your procedure. This is a bug.
    Thirdly I see you also commit inside a loop. This is also a bug, and needs to be removed asap.
    The error indicates a statement doesn't parse. As you don't post the error stack, nor a table definition no one can reproduce the problem.
    You need to isolate the statements, one by one, and run them through sql*plus to see what happens.
    Sybrand Bakker
    Senior Oracle DBA

  • I am getting "ORA-00900: invalid SQL statement"  error.?

    I did installed oracle 11gR2. and used "DBMS_METADATA_DIFF.COMPARE_ALTER('TABLE','TBL_A','TBL_A','USER1','USER2')"   to see the result like below,  but I am getting "ORA-00900: invalid SQL statement"  error.   Any idea?
    I am using:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> desc user1.tbl_a
    Name                                      Null?    Type
    FIELD_A1                                  NOT NULL NUMBER
    FIELD_A2                                           VARCHAR2(20)
    FIELD_A4                                  NOT NULL NUMBER(5,2)
    FIELD_A5                                           VARCHAR2(10)
    FIELD_A6                                  NOT NULL NUMBER(2)
    SQL> desc user2.tbl_a
    Name                                      Null?    Type
    FIELD_A1                                  NOT NULL NUMBER
    FIELD_A2                                           VARCHAR2(50)
    FIELD_A3                                           DATE
    FIELD_A4                                           NUMBER(5,2)
    FIELD_A5                                  NOT NULL VARCHAR2(10)
    SQL> select dbms_metadata_diff.compare_alter('TABLE','TBL_A','TBL_A','USER1','USER2') from dual
    expected result:
    DBMS_METADATA_DIFF.COMPARE_ALTER('TABLE','TBL_A','TBL_A','U1','U2')
    ALTER TABLE "U1"."TBL_A" ADD ("FIELD_A3" DATE)
      ALTER TABLE "U1"."TBL_A" DROP ("FIELD_A6")
      ALTER TABLE "U1"."TBL_A" MODIFY ("FIELD_A2" VARCHAR2(50))
      ALTER TABLE "U1"."TBL_A" MODIFY ("FIELD_A4" NUMBER(5,2) DEFAULT 0)
      ALTER TABLE "U1"."TBL_A" MODIFY ("FIELD_A4" NULL)
      ALTER TABLE "U1"."TBL_A" MODIFY ("FIELD_A5" NOT NULL ENABLE)

    Thanks for reply rp,
    I got result using "select dbms_metadata_diff.compare_alter('TABLE','TBL_A','TBL_A','USER1','USER2') from dual"

  • SQL Statement error

    Hi All,
    I was trying to execute a standard function module in which there is a sql statement where IN operator is used.
    The no of choices given for that field by the IN operator is 1065.
    The error displayed is  the SQL statement generated from the SAP Open SQL statement violates a restriction imposed by the underlying database system of the ABAP system.
    But when I am reducing the no of choices for that filed to 1000 the function modules executes smoothly.
    Now from all these I can understand that there is some restriction imposed by underlying database for the no of choices by IN operator in select statements. I want a way to override that restriction.
    The function module I was executing is 'K_PRCTR_VALUES_GET'. The error hits at line no 162 when the table t_selopt contains 1065 line items. Now this function modules gives us all the profit centers based on Profit-center group. So according to the current scenario for the respective profit-center group there are 1065 no. of profit centers. So there is no way that we can reduce the no. of profit centers for profit center group rather I have to find the other way out.
    I will really appreciate the inputs. Please help me out in with this problem. Points will be awarded for good answer.
    Thanks in advance.
    Regards,
    Piyush Kothari

    Indeed there is a limit to the SELECT-OPTIONS / RANGES with the IN operator. But unfortunately there is no way bypass this limitation.
    The only thing you can do (sort of workaround) is to call the function module several times for x-number of profit centers (if possible in your particular case).
    It might be an option to talk to one of your basis administrators, perhaps they have another solution for this. But from ABAP side there is nothing you can do about it.

  • 00900 Invalid SQL Statement error

    I'm teaching myself to write stored procedures, working in TOAD 10.5 with Oracle 10g. I keep getting error ORA-00900: invalid SQL Statement. Here's the code, cut down to bare minimum sample size. I can't see where I'm doing anything wrong.
    If I cut out the cursor (taking it down to just "Begin" and "End"), it does run, but I can't see anything wrong with the cursor.
    Any ideas?
    CREATE OR REPLACE PROCEDURE IN_PROCESS_CASES_BOS
    IS
    V_HELLO VARCHAR2(10);
    CURSOR C_MAIN IS
    SELECT 'HELLO' FROM DUAL;
    BEGIN
    OPEN C_MAIN;
    LOOP
    FETCH C_MAIN INTO V_HELLO;
    EXIT WHEN C_MAIN%NOTFOUND;
    END LOOP;
    CLOSE C_MAIN;
    END;
    END IN_PROCESS_CASES_BOS;
    /

    Hi,
    You've got 2 END statements, but only 1 BEGIN.
    It helps a lot if you indent your code, so that every END is right below its correspoding BEGIN, and all the code in between them is indented. The same goes for IF and LOOP statements.
    When posting any formatted text on this site (not just code), type these 6 characters:
    \(small letters only, inside curly brackets) before and after each section of formatted text, to preserve spacing.
    Try this:CREATE OR REPLACE PROCEDURE IN_PROCESS_CASES_BOS
    IS
    V_HELLO VARCHAR2(10);
    CURSOR C_MAIN IS
    SELECT 'HELLO' FROM DUAL;
    BEGIN
    OPEN C_MAIN;
    LOOP
         FETCH C_MAIN INTO V_HELLO;
         EXIT WHEN C_MAIN%NOTFOUND;
    END LOOP;
    CLOSE C_MAIN;
    END;                Lose this line
    END IN_PROCESS_CASES_BOS;

  • SQL Insert Error - Please help. RESOLVED

    I have a page with several VOs and search options. One of the search options is a list of Emp IDs which (when one is selected and user clicks 'search') results in an editable table of profiles for that Emp Id.
    I have in the Footer of the results table an input field and a button 'add' bound to a method that takes two params and inserts a 'new' profile for the searched Emp Id and the value entered in the input field.
    When I enter a value and click 'add' I get the following:
    JBO-29000: Unexpected exception caught: oracle.jbo.DMLConstraintException, msg=JBO-26048: Constraint "BADGE_ACCESS_EMP_FK" violated during post operation:"Insert" using SQL Statement "BEGIN INSERT INTO BADGE_ACCESS(EMPLOYEE_ID,BADGE,ROW_ID) VALUES (?,?,?) RETURNING ROW_ID INTO ?; END;".
    JBO-26048: Constraint "BADGE_ACCESS_EMP_FK" violated during post operation:"Insert" using SQL Statement "BEGIN INSERT INTO BADGE_ACCESS(EMPLOYEE_ID,BADGE,ROW_ID) VALUES (?,?,?) RETURNING ROW_ID INTO ?; END;".
    ORA-02291: integrity constraint (HR.BADGE_ACCESS_EMP_FK) violated - parent key not found ORA-06512: at line 1
    My Emp table is simple - just an ID, First and Last names with ID as PK. My profile table (called Badge_Access) has the EmpId as FK and it's own PK set by a DBSequence. The other column in Badge_Access is for the input value (number).
    I do not know how to debug in JDeveloper such that I can see the values that are being passed to the method. My 'add' button method is:
    public void createBadgeAccess(Number empId, Number badge) {
    BadgeAccessImpl ba = (BadgeAccessImpl)getDBTransaction().createEntityInstance(BadgeAccessImpl.getDefinitionObject(), null);
    ba.setEmployeeId(empId);
    ba.setBadge(badge);
    getDBTransaction().commit();
    I have the 'value' of the empId param = ${bindings.AccessByEmployeeEmployeeId.inputValue}
    This is the selectOneChoice field the user uses to search...
    and the 'value' of the badge param = ${bindings.Badge.inputValue}
    This is the input field the user fills in before clicking 'add'...
    The values I think I am passing are empId=106 and badge=102 - both are valid & the 'parent key' 106 is valid...
    any help will be greatly appreciated!!! Thanks
    Ginni
    Message was edited by:
    ginnim
    I found a Tip that described what was happening.

    Wrap some try/catch around the statements instead of trying to decipher the Java junk. Could be a problem in the PS, could be a number of things. At least figure where in the application the error takes place.

  • ORA-01555 caused by SQL statement below - Kindly assist

    Hi,
    Version 9.2.0.7
    I have been getting lots of ORA-01555 error logged into my alert log since 10 hours ago, happening every second till now.
    The ORA-01555 is strange compared to those that have occured in my database before. From the error logged into the alert log, the statement is reflected as "table_4_200_c432_0_0_0". Any experts can advise what's exactly happening? The duration stated below seems really long.
    ORA-01555 caused by SQL statement below (Query Duration=1225798260 sec, SCN: 0x077a.e8ab9ae8):
    Tue Nov 4 19:31:00 2008
    table_4_200_c432_0_0_0
    thanks

    That event trace is helpful only when you are getting ORA-01555 in trace files without a query.
    Of course, you cannot get the diagnostic information for something that occurred in past (when diagnostics were not in place); so you have to wait till the next occurrence (if any) of ORA-01555 under similar conditions.

  • SQL Statement Error on DB2

    Hi there!!!!, maybe somebody can help me with this.
    We configure a connection Pool to get access to DB2 DataBase, When WLS Starts
    the pool starts well, but when we try to make a SQL statement it sends an error
    to the output browser.
    It's important to say that the same thing it works well with Sybase instead.
    An Exception occurred:
    COM.ibm.db2.jdbc.net.DB2Exception: [IBM][JDBC Driver] CLI0601E Invalid statement
    handle or statement is closed. SQLSTATE=S1000
    at COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:340)
    at COM.ibm.db2.jdbc.net.DB2Statement.(DB2Statement.java:180)
    at COM.ibm.db2.jdbc.net.DB2Statement.(DB2Statement.java:188)
    at COM.ibm.db2.jdbc.net.DB2Connection.createStatement(DB2Connection.java:372)
    at COM.ibm.db2.jdbc.net.DB2Connection.createStatement(DB2Connection.java:358)
    at weblogic.jdbc.pool.Connection.createStatement(Connection.java:40)
    at examples.jdbc.pool.simpleselect.service(simpleselect.java:109)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:922)
    at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:886)
    at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
    at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
    at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    Thanks & Regards

    Hi Mauricio,
    Which version of Weblogic do you use?
    Regards,
    Slava Imeshev
    "Mauricio Del Moral" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hi there!!!!, maybe somebody can help me with this.
    We configure a connection Pool to get access to DB2 DataBase, When WLSStarts
    the pool starts well, but when we try to make a SQL statement it sends anerror
    to the output browser.
    It's important to say that the same thing it works well with Sybaseinstead.
    >
    >
    An Exception occurred:
    COM.ibm.db2.jdbc.net.DB2Exception: [IBM][JDBC Driver] CLI0601E Invalidstatement
    handle or statement is closed. SQLSTATE=S1000
    atCOM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_return_code(SQLExceptionGen
    erator.java:340)
    >
    at COM.ibm.db2.jdbc.net.DB2Statement.(DB2Statement.java:180)
    at COM.ibm.db2.jdbc.net.DB2Statement.(DB2Statement.java:188)
    atCOM.ibm.db2.jdbc.net.DB2Connection.createStatement(DB2Connection.java:372)
    >
    atCOM.ibm.db2.jdbc.net.DB2Connection.createStatement(DB2Connection.java:358)
    >
    atweblogic.jdbc.pool.Connection.createStatement(Connection.java:40)
    at examples.jdbc.pool.simpleselect.service(simpleselect.java:109)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
    :120)
    >
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:922)
    >
    atweblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
    l.java:886)
    >
    atweblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
    Manager.java:269)
    >
    atweblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
    >
    atweblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
    >
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
    Thanks & Regards

  • ORA-00900: invalid SQL statement error in procedure

    In procedure we referring only 2 tables
    Tables:
    1)     Edw_orders_ref
    2)     Change_pl
    Condisition:
    1)     whenever edw_orders_ref.product=change_pl.product and edw_orders_ref.opt=change_pl.opt condisition satisfied then update edw_orders_ref.pl with change_pl.pl column.
    2)     we pass table name and day values as arguments to the procedure.
    3)     Based on day column data only we update.
    4)     Heir day column means partisition values of the table
    Procedure is:
    create or replace procedure Proc_update_target(P_Day varchar2,p_tablename nvarchar2)
    as
    TYPE PlCurTyp IS REF CURSOR;
    Pl_cv PlCurTyp;
    --emp_rec  edw_orders_ref%ROWTYPE;
    pl_rec Edw_orders_ref.pl%type;
    product_rec Edw_orders_ref.product%type;
    opt_rec Edw_orders_ref.opt%type;
    sql_stmt varchar(3200);
    n number:=0;
    BEGIN
    sql_stmt := 'select lpl.opt,lpl.product,lpl.pl from minddba.change_pl lpl
    where exists ( select 1 from '|| p_tablename ||' where '||p_tablename||'.product=lpl.product and '||p_tablename||'.opt=lpl.opt
    and '||p_tablename||'.day='||P_Day||' )';
    dbms_output.put_line('hi');
    OPEN pl_cv FOR sql_stmt ;
    LOOP
    dbms_output.put_line('hello1');
    FETCH Pl_cv INTO pl_rec,product_rec,opt_rec;
    EXIT WHEN Pl_cv%NOTFOUND;
    dbms_output.put_line('hello');
    execute immediate
    'update '||p_tablename||' set pl=:rpl
    where product=:rproduct
    and opt=:ropt
    AND day=:day' using pl_rec, product_rec,opt_rec,P_Day;
    if Pl_cv%rowcount=10000 then
    commit;
    end if;
    END LOOP;
    CLOSE pl_cv;
    commit;
    exception
    when others then
    dbms_output.put_line('Error while updating target pl:'||SQLERRM);
    end;
    it is compile nad debug.
    but execution time this error was coming
    exec Proc_update_target('20110226','edw_orders_ref')
    hi
    hello1
    hello
    Error while updating target pl:ORA-00900: invalid SQL statement
    i think in that procedure updata statement is wrong,if any one corect them.

    Hi,
    This are details of table structure and my requirement for that procedure
    CREATE TABLE EDW_ORDERS_REF
    SO_ID VARCHAR2(20 BYTE) NOT NULL,
    SRC_SYS_KY NUMBER(19) NOT NULL,
    DAY VARCHAR2(8 BYTE) NOT NULL,
    FIN_CLOSE_DT VARCHAR2(8 BYTE) NOT NULL,
    SO_LN_ITM_ID VARCHAR2(12 BYTE) NOT NULL,
    EXT_EFF_TS VARCHAR2(26 BYTE) NOT NULL,
    EFF_FRM_GMT_TS VARCHAR2(26 BYTE) NOT NULL,
    CONTRA_FG VARCHAR2(1 BYTE) NOT NULL,
    FDW_TRAN_TYPE_CD VARCHAR2(1 BYTE) NOT NULL,
    SO4 VARCHAR2(4 BYTE),
    SO2 VARCHAR2(2 BYTE),
    PUR_AGMT VARCHAR2(20 BYTE),
    SF VARCHAR2(6 BYTE),
    V_BOX VARCHAR2(18 BYTE),
    PL VARCHAR2(30 BYTE),
    MCC_CD VARCHAR2(20 BYTE),
    OPT VARCHAR2(18 BYTE),
    ORDER_UNITS NUMBER(15,3),
    SO_OPT_QTY NUMBER(10,3),
    SO_DTL_EXT_QT NUMBER(15,3),
    ORDER_LIST_LCY NUMBER(18,4),
    ORDER_NET_LCY NUMBER(18,4),
    ORDER_NET_CLC NUMBER(18,4),
    ORDER_LIST_CLC NUMBER(18,4),
    CURRENCY_CD VARCHAR2(2 BYTE),
    SLS_CHNL_CD VARCHAR2(1 BYTE),
    CBN VARCHAR2(20 BYTE),
    GEOG_UNIT VARCHAR2(30 BYTE),
    PRODUCT VARCHAR2(18 BYTE),
    ORDER_NR VARCHAR2(20 BYTE),
    ORDER_LINE_NR VARCHAR2(12 BYTE),
    LOAD_DT DATE DEFAULT SYSDATE
    CREATE TABLE MINDDBA.CHANGE_PL
    PRODUCT VARCHAR2(18 BYTE) NOT NULL,
    OPT VARCHAR2(3 BYTE) NOT NULL,
    PL VARCHAR2(2 BYTE) NOT NULL
    1)     whenever edw_orders_ref.product=change_pl.product and edw_orders_ref.opt=change_pl.opt condisition satisfied then update edw_orders_ref.pl with change_pl.pl column.
    2)     we pass table name and day values as arguments to the procedure.
    3)     Based on day column data only we update.
    4)     Heir day column means partisition values of the table
    When executing this one I got one error like
    exec Proc_update_target('20110226','edw_orders_ref');
    hi
    hello1
    hello
    ORA-00900: invalid SQL statement

  • Dynamic sql giving error --please help

    Hi ,
    I have written the following code --
    CREATE OR REPLACE FUNCTION tabcount (
    tab IN VARCHAR2, field IN VARCHAR2 ,whr IN VARCHAR2)
    RETURN INTEGER
    IS
    retval INTEGER;
    BEGIN
    DBMS_OUTPUT.PUT_LINE ('whr' ||whr);
    DBMS_OUTPUT.PUT_LINE ('field1' ||field);
    EXECUTE IMMEDIATE
    ' SELECT COUNT(*) FROM ' || tab ||
    ' WHERE ' || field || 'like '/'%'||whr ||'%'/''
    INTO retval;
    DBMS_OUTPUT.PUT_LINE ('countis!' ||retVal);
    RETURN retval;
    END tabcount;
    It is giving the following error--
    ORA-00920: invalid relational operator
    ORA-06512: at "TABCOUNT", line 10
    ORA-06512: at line 2
    I am not sure how to enclose the like operator within the single quotes.Double quotes is not working for me.
    Thanx in advance,
    Ira

    Offhand, it looks like you may still have some syntax problems -- probably need a blank space before the WHERE --maybe some other stuff too.
    What you need to do to debug it is this (and this works just about anytime you are having trouble with dynamic SQL):
    1. store the sql statement in a variable.
    2. Use DBMS_OUTPUT to display your select statement BEFORE calling execute immediate.
    3. copy/paste that select into a separate window and run/debug it.
    4. Once you know what is wrong with that statement, go back and fix the code accordingly.
    Have fun,
    --scott                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Problems with SQL statement ..Urgent Help required

    Hi
    I have a table with something like this
    ::: inidicates column seperation
    col1 ::: col2 ::: col3 ::: col4
    ab,abc,abvfg,fghy ::: x1 ::: y1 ::: z1
    ba,mkl,huji,kill ::: x2 ::: y2 ::: z2
    I want to get something like this :
    col1 ::: col2 ::: col3 ::: col4
    ab ::: x1 ::: y1 ::: z1
    abc ::: x1 ::: y1 ::: z1
    abvfg ::: x1 ::: y1 ::: z1
    fghy ::: x1 ::: y1 ::: z1
    and so on......
    Either a procedure or a single sql statement is fine..
    PS: the first column can have any number of words separated with comma (,)
    Please advise
    Thanks in advance

    create table kris (
    a varchar2(200),
    b varchar2(20),
    c varchar2(20),
    d varchar2(20));
    insert into kris values('ab,abc,abvfg,fghy', 'x1','y1','z1');
    insert into kris values('ba,mkl,huji,kill', 'x2','y2','z2');
    select substr(','||a||',', instr(','||a||',', ',', 1, rn) +1,
         instr(','||a||',', ',', 1, rn+1) - instr(','||a||',', ',', 1, rn) -1)
         v,b,c,d
    from (select length(a) - length(translate(a, '1,', '1')) +1 L,
         a, b, c, d from kris) t, (select rownum rn from cat) c
         where c.rn <= t.L
    order by a, rn;
    V B C D
    ab x1 y1 z1
    abc x1 y1 z1
    abvfg x1 y1 z1
    fghy x1 y1 z1
    ba x2 y2 z2
    mkl x2 y2 z2
    huji x2 y2 z2
    kill x2 y2 z2

  • SQL Statement error - ORA-00903: invalid table name

    Hi
    I have written a sql script that gets executed from a form within e-business suite. Unfortunately, the script is falling over with an error:
    unknown command beginning "MERGE INTO..." - rest of line ignored.
    unknown command beginning "USING edop..." - rest of line ignored.
    unknown command beginning "ON (elw.ro..." - rest of line ignored.
    unknown command beginning "WHEN MATCH..." - rest of line ignored.
    For a list of known commands enter HELP
    and to leave enter EXIT.
          SET ELW.billed_flag          = t.billed_flag,
    ERROR at line 2:
    ORA-00903: invalid table name the actual statement that is causing the issue is:
    MERGE INTO edopaif.table1 elw
    USING edopaif.tablw2 t
    ON (elw.rowid = t.LOAD_WORKING_ROWID)
    WHEN MATCHED THEN
       UPDATE
          SET ELW.billed_flag          = t.billed_flag,
              ELW.last_bill_generated   = t.last_bill_generated,
              ELW.last_bill_type        = t.last_bill_type,
              ELW.load_month            = t.load_month,
              ELW.BILL_TRANSACTION_ID   = t.bill_transaction_id
    WHEN NOT MATCHED THEN
       INSERT(error_meaning)
       VALUES('ROWID error with ins_ptia');The version of e-business suite that we are using is: 11.5.10.2.
    The version of the Oracle database that we are using is:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE 9.2.0.6.0 Production
    TNS for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    Please note that I am able to successfully run the statement directly connected as the APPS schema in the database - the error only occurs when the script is run from the forms front-end (which is really confusing me).
    Many thanks
    Paul

    Hi
    I've modified the script to include only the statement that is erroring and it still errors when executed from the front end application.
    Next I re-wrote the statement to use PL/SQL instead of the MERGE statement, to do the update, and the script completes succesfully, i.e.:
    DECLARE
       CURSOR cu_lw IS
             SELECT t.billed_flag,
                    t.last_bill_generated,
                    t.last_bill_type,
                    t.load_month,
                    t.bill_transaction_id,
                    t.load_working_rowid
               FROM table2 t;
    BEGIN
       FOR rec_cu_lw IN cu_lw LOOP
          UPDATE table1 elw
             SET ELW.billed_flag           = rec_cu_lw.billed_flag,
              ELW.last_bill_generated      = rec_cu_lw.last_bill_generated,
              ELW.last_bill_type           = rec_cu_lw.last_bill_type,
              ELW.load_month               = rec_cu_lw.load_month,
              ELW.BILL_TRANSACTION_ID      = rec_cu_lw.bill_transaction_id
          WHERE elw.rowid                  = rec_cu_lw.load_working_rowid;
       END LOOP;
    END;
    /I am still unsure as to why the MERGE statement is failing when executed in the front end, but completes in the backend with no issues at all. Obviously I would prefer to use the MERGE statement instead of PL/SQL to do the update.
    Thanks
    Paul

  • SQL Statement error when running ETL from DAC

    Dear all,
    I installed and configured biapps 7.9.6.3, then I run the full load of Subject CRM - Loyalty in DAC. And I got the error of task fail, I check the Session log files in Informatica server.
    $ view SEBL_VERT_811.DATAWAREHOUSE.SDE_SBL_Vert_811_Adaptor.SDE_GeographyDimension_Business.log
    DIRECTOR> VAR_27028 Use override value [0] for user-defined workflow/worklet variable:[$$passInStatus].
    DIRECTOR> VAR_27028 Use override value [DataWarehouse] for session parameter:[$DBConnection_OLAP].
    DIRECTOR> VAR_27028 Use override value [SEBL_VERT_811] for session parameter:[$DBConnection_OLTP].
    DIRECTOR> VAR_27028 Use override value [SEBL_VERT_811.DATAWAREHOUSE.SDE_SBL_Vert_811_Adaptor.SDE_GeographyDimension_Business.log] for session parameter:[$PMSessionLogFile].
    DIRECTOR> VAR_27028 Use override value [1] for mapping parameter:[MPLT_LOAD_W_GEO_DS.$$DATASOURCE_NUM_ID].
    DIRECTOR> VAR_27028 Use override value [] for mapping parameter:[$$Hint1].
    DIRECTOR> VAR_27028 Use override value [] for mapping parameter:[$$Hint2].
    DIRECTOR> TM_6014 Initializing session [SDE_GeographyDimension_Business] at [Mon Jul 25 17:29:47 2011].
    DIRECTOR> TM_6683 Repository Name: [Oracle_BI_DW_Base]
    DIRECTOR> TM_6684 Server Name: [Oracle_BI_DW_Server]
    DIRECTOR> TM_6686 Folder: [SDE_SBL_Vert_811_Adaptor]
    DIRECTOR> TM_6685 Workflow: [SDE_GeographyDimension_Business] Run Instance Name: [] Run Id: [260]
    DIRECTOR> TM_6101 Mapping name: SDE_GeographyDimension_Business [version 1].
    DIRECTOR> TM_6963 Pre 85 Timestamp Compatibility is Enabled
    DIRECTOR> TM_6964 Date format for the Session is [MM/DD/YYYY HH24:MI:SS]
    DIRECTOR> TM_6827 [u01/app/oracle/biapps/dev/Informatica/9.0.1/server/infa_shared/Storage] will be used as storage directory for session [SDE_GeographyDimension_Business].
    DIRECTOR> CMN_1802 Session recovery cache initialization is complete.
    DIRECTOR> TM_6708 Using configuration property [DisableDB2BulkMode,Yes]
    DIRECTOR> TM_6708 Using configuration property [ServerPort,6325]
    DIRECTOR> TM_6708 Using configuration property [overrideMpltVarWithMapVar,Yes]
    DIRECTOR> TM_6708 Using configuration property [SiebelUnicodeDB,SIEBEL@ANSDEV dwhadmin@ANBDEV]
    DIRECTOR> TM_6703 Session [SDE_GeographyDimension_Business] is run by 64-bit Integration Service [node01_hkhgc01dvapp01], version [9.0.1 HotFix2], build [1111].
    MANAGER> PETL_24058 Running Partition Group [1].
    MANAGER> PETL_24000 Parallel Pipeline Engine initializing.
    MANAGER> PETL_24001 Parallel Pipeline Engine running.
    MANAGER> PETL_24003 Initializing session run.
    MAPPING> CMN_1569 Server Mode: [UNICODE]
    MAPPING> CMN_1570 Server Code page: [UTF-8 encoding of Unicode]
    MAPPING> TM_6151 The session sort order is [Binary].
    MAPPING> TM_6185 Warning. Code page validation is disabled in this session.
    MAPPING> TM_6156 Using low precision processing.
    MAPPING> TM_6180 Deadlock retry logic will not be implemented.
    MAPPING> TM_6187 Session target-based commit interval is [10000].
    MAPPING> TM_6307 DTM error log disabled.
    MAPPING> TE_7022 TShmWriter: Initialized
    MAPPING> DBG_21075 Connecting to database [ANBDEV], user [dwhadmin]
    MAPPING> CMN_1716 Lookup [MPLT_LOAD_W_GEO_DS.LKP_W_LST_OF_VAL_G] uses database connection [Relational:DataWarehouse] in code page [UTF-8 encoding of Unicode]
    MAPPING> CMN_1716 Lookup [MPLT_LOAD_W_GEO_DS.LKP_W_GEO_DS] uses database connection [Relational:DataWarehouse] in code page [UTF-8 encoding of Unicode]
    MAPPING> DBG_21694 AGG_COUNTRY_CITY_ZIPCODE Partition [0]: Index cache size = [1048576], Data cache size = [2097152]
    MAPPING> TE_7212 Increasing [Index Cache] size for transformation [AGG_COUNTRY_CITY_ZIPCODE] from [1048576] to [2402304].
    MAPPING> TE_7212 Increasing [Data Cache] size for transformation [AGG_COUNTRY_CITY_ZIPCODE] from [2097152] to [2097528].
    MAPPING> TE_7029 Aggregate Information: Creating New Index and Data Files
    MAPPING> TE_7034 Aggregate Information: Index file is [u01/app/oracle/biapps/dev/Informatica/9.0.1/server/infa_shared/Cache/PMAGG14527_3_0_260.idx]
    MAPPING> TE_7035 Aggregate Information: Data file is [u01/app/oracle/biapps/dev/Informatica/9.0.1/server/infa_shared/Cache/PMAGG14527_3_0_260.dat]
    MAPPING> TM_6007 DTM initialized successfully for session [SDE_GeographyDimension_Business]
    DIRECTOR> PETL_24033 All DTM Connection Info: [<NONE>].
    MANAGER> PETL_24004 Starting pre-session tasks. : (Mon Jul 25 17:29:47 2011)
    MANAGER> PETL_24027 Pre-session task completed successfully. : (Mon Jul 25 17:29:47 2011)
    DIRECTOR> PETL_24006 Starting data movement.
    MAPPING> TM_6660 Total Buffer Pool size is 36000000 bytes and Block size is 128000 bytes.
    LKPDP_2> DBG_21097 Lookup Transformation [MPLT_LOAD_W_GEO_DS.LKP_W_GEO_DS]: Default sql to create lookup cache: SELECT CITY,COUNTRY,ZIPCODE,STATE_PROV FROM W_GEO_DS ORDER BY CITY,COUNTRY,ZIPCODE,STATE_PROV
    LKPDP_1> DBG_21312 Lookup Transformation [MPLT_LOAD_W_GEO_DS.LKP_W_LST_OF_VAL_G]: Lookup override sql to create cache: SELECT W_LST_OF_VAL_G.VAL AS VAL, W_LST_OF_VAL_G.R_TYPE AS R_TYPE FROM W_LST_OF_VAL_G
    WHERE
         W_LST_OF_VAL_G.R_TYPE LIKE 'ETL%' ORDER BY R_TYPE,VAL
    LKPDP_1> TE_7212 Increasing [Index Cache] size for transformation [MPLT_LOAD_W_GEO_DS.LKP_W_LST_OF_VAL_G] from [1048576] to [1050000].
    LKPDP_2> TE_7212 Increasing [Index Cache] size for transformation [MPLT_LOAD_W_GEO_DS.LKP_W_GEO_DS] from [20000000] to [20006400].
    LKPDP_2> TE_7212 Increasing [Data Cache] size for transformation [MPLT_LOAD_W_GEO_DS.LKP_W_GEO_DS] from [20000000] to [20004864].
    READER_1_1_1> DBG_21438 Reader: Source is [ANSDEV], user [SIEBEL]
    READER_1_1_1> BLKR_16051 Source database connection [SEBL_VERT_811] code page: [UTF-8 encoding of Unicode]
    READER_1_1_1> BLKR_16003 Initialization completed successfully.
    WRITER_1_*_1> WRT_8146 Writer: Target is database [ANBDEV], user [dwhadmin], bulk mode [ON]
    WRITER_1_*_1> WRT_8106 Warning! Bulk Mode session - recovery is not guaranteed.
    WRITER_1_*_1> WRT_8221 Target database connection [DataWarehouse] code page: [UTF-8 encoding of Unicode]
    WRITER_1_*_1> WRT_8124 Target Table W_GEO_DS :SQL INSERT statement:
    INSERT INTO W_GEO_DS(CITY,CONTINENT,COUNTRY,COUNTY,STATE_PROV,ZIPCODE,DATASOURCE_NUM_ID,X_CUSTOM) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?)
    WRITER_1_*_1> WRT_8020 No column marked as primary key for table [W_GEO_DS]. UPDATEs Not Supported.
    WRITER_1_*_1> WRT_8270 Target connection group #1 consists of target(s) [W_GEO_DS]
    WRITER_1_*_1> WRT_8003 Writer initialization complete.
    READER_1_1_1> BLKR_16007 Reader run started.
    WRITER_1_*_1> WRT_8005 Writer run started.
    WRITER_1_*_1> WRT_8158
    *****START LOAD SESSION*****
    Load Start Time: Mon Jul 25 17:29:47 2011
    Target tables:
    W_GEO_DS
    READER_1_1_1> RR_4029 SQ Instance [SQ_S_ADDR_ORG] User specified SQL Query [SELECT  DISTINCT
    S_ADDR_ORG.CITY,
    S_ADDR_ORG.COUNTRY,
    S_ADDR_ORG.COUNTY,
    S_ADDR_ORG.PROVINCE,
    S_ADDR_ORG.STATE,
    S_ADDR_ORG.ZIPCODE,
          '0' AS X_CUSTOM
    FROM
    V_ADDR_ORG S_ADDR_ORG
    READER_1_1_1> RR_4049 SQL Query issued to database : (Mon Jul 25 17:29:47 2011)
    READER_1_1_1> CMN_1761 Timestamp Event: [Mon Jul 25 17:29:47 2011]
    READER_1_1_1> RR_4035 SQL Error [
    ORA-00942: table or view does not exist
    Database driver error...
    Function Name : Execute
    SQL Stmt : SELECT DISTINCT
    S_ADDR_ORG.CITY,
    S_ADDR_ORG.COUNTRY,
    S_ADDR_ORG.COUNTY,
    S_ADDR_ORG.PROVINCE,
    S_ADDR_ORG.STATE,
    S_ADDR_ORG.ZIPCODE,
    '0' AS X_CUSTOM
    FROM
    V_ADDR_ORG S_ADDR_ORG
    Oracle Fatal Error
    Database driver error...
    Function Name : Execute
    SQL Stmt : SELECT DISTINCT
    S_ADDR_ORG.CITY,
    S_ADDR_ORG.COUNTRY,
    S_ADDR_ORG.COUNTY,
    S_ADDR_ORG.PROVINCE,
    S_ADDR_ORG.STATE,
    S_ADDR_ORG.ZIPCODE,
    '0' AS X_CUSTOM
    FROM
    V_ADDR_ORG S_ADDR_ORG
    Oracle Fatal Error].
    READER_1_1_1> CMN_1761 Timestamp Event: [Mon Jul 25 17:29:47 2011]
    READER_1_1_1> BLKR_16004 ERROR: Prepare failed.
    WRITER_1_*_1> WRT_8333 Rolling back all the targets due to fatal session error.
    WRITER_1_*_1> WRT_8325 Final rollback executed for the target [W_GEO_DS] at end of load
    WRITER_1_*_1> WRT_8035 Load complete time: Mon Jul 25 17:29:47 2011
    LOAD SUMMARY
    ============
    WRT_8036 Target: W_GEO_DS (Instance Name: [W_GEO_DS])
    WRT_8044 No data loaded for this target
    WRITER_1__1> WRT_8043 ****END LOAD SESSION*****
    MANAGER> PETL_24031
    ***** RUN INFO FOR TGT LOAD ORDER GROUP [1], CONCURRENT SET [1] *****
    Thread [READER_1_1_1] created for [the read stage] of partition point [SQ_S_ADDR_ORG] has completed. The total run time was insufficient for any meaningful statistics.
    Thread [TRANSF_1_1_1] created for [the transformation stage] of partition point [SQ_S_ADDR_ORG] has completed. The total run time was insufficient for any meaningful statistics.
    Thread [TRANSF_1_2_1] created for [the transformation stage] of partition point [AGG_COUNTRY_CITY_ZIPCODE] has completed. The total run time was insufficient for any meaningful statistics.
    Thread [WRITER_1_*_1] created for [the write stage] of partition point [W_GEO_DS] has completed. The total run time was insufficient for any meaningful statistics.
    MAPPING> CMN_1791 The index cache size that would hold [0] aggregate groups of input rows for [AGG_COUNTRY_CITY_ZIPCODE], in memory, is [0] bytes
    MAPPING> CMN_1790 The data cache size that would hold [0] aggregate groups of input rows for [AGG_COUNTRY_CITY_ZIPCODE], in memory, is [0] bytes
    MAPPING> CMN_1793 The index cache size that would hold [0] rows in the lookup table for [MPLT_LOAD_W_GEO_DS.LKP_W_LST_OF_VAL_G], in memory, is [0] bytes
    MAPPING> CMN_1792 The data cache size that would hold [0] rows in the lookup table for [MPLT_LOAD_W_GEO_DS.LKP_W_LST_OF_VAL_G], in memory, is [0] bytes
    MAPPING> CMN_1793 The index cache size that would hold [0] rows in the lookup table for [MPLT_LOAD_W_GEO_DS.LKP_W_GEO_DS], in memory, is [0] bytes
    MAPPING> CMN_1792 The data cache size that would hold [0] rows in the lookup table for [MPLT_LOAD_W_GEO_DS.LKP_W_GEO_DS], in memory, is [0] bytes
    MANAGER> PETL_24005 Starting post-session tasks. : (Mon Jul 25 17:29:47 2011)
    MANAGER> PETL_24029 Post-session task completed successfully. : (Mon Jul 25 17:29:47 2011)
    MAPPING> TE_7216 Deleting cache files [PMLKUP14527_524289_0_260L64] for transformation [MPLT_LOAD_W_GEO_DS.LKP_W_LST_OF_VAL_G].
    MAPPING> TE_7216 Deleting cache files [PMLKUP14527_524293_0_260L64] for transformation [MPLT_LOAD_W_GEO_DS.LKP_W_GEO_DS].
    MAPPING> TM_6018 The session completed with [0] row transformation errors.
    MANAGER> TE_7216 Deleting cache files [u01/app/oracle/biapps/dev/Informatica/9.0.1/server/infa_shared/Cache/PMAGG14527_3_0_260.idx] for transformation [AGG_COUNTRY_CITY_ZIPCODE].
    MANAGER> TE_7216 Deleting cache files [u01/app/oracle/biapps/dev/Informatica/9.0.1/server/infa_shared/Cache/PMAGG14527_3_0_260.dat] for transformation [AGG_COUNTRY_CITY_ZIPCODE].
    MANAGER> PETL_24002 Parallel Pipeline Engine finished.
    DIRECTOR> PETL_24013 Session run completed with failure.
    DIRECTOR> TM_6022
    SESSION LOAD SUMMARY
    ================================================
    DIRECTOR> TM_6252 Source Load Summary.
    DIRECTOR> CMN_1740 Table: [SQ_S_ADDR_ORG] (Instance Name: [SQ_S_ADDR_ORG])
         Output Rows [0], Affected Rows [0], Applied Rows [0], Rejected Rows [0]
    DIRECTOR> TM_6253 Target Load Summary.
    DIRECTOR> CMN_1740 Table: [W_GEO_DS] (Instance Name: [W_GEO_DS])
         Output Rows [0], Affected Rows [0], Applied Rows [0], Rejected Rows [0]
    DIRECTOR> TM_6023
    ===================================================
    DIRECTOR> TM_6020 Session [SDE_GeographyDimension_Business] completed at [Mon Jul 25 17:29:48 2011].
    After review the log, I found the select statement was fail, the SQL below was wrong:
    SELECT DISTINCT
    S_ADDR_ORG.CITY,
    S_ADDR_ORG.COUNTRY,
    S_ADDR_ORG.COUNTY,
    S_ADDR_ORG.PROVINCE,
    S_ADDR_ORG.STATE,
    S_ADDR_ORG.ZIPCODE,
    '0' AS X_CUSTOM
    FROM
    V_ADDR_ORG S_ADDR_ORG
    There is no table V_ADDR_ORG but S_ADDR_ORG in the Siebel transaction database. So I don't know why it generate this sql when transfering data to OBAW. This is the out of box bi application.
    Experts! How could I fix this problem?? Please help, thank you very much!!
    Best regards,
    Ryan

    Ryan,
    Yes you missed to create views for source tables. so in dac design>> tables tab, select any table and right clieck on it then click on change capture scripts>> generate view scripts. it will ask you whether it can generate script for all the tables. so it will generate view script for you. now run the entire esript in source database. then your problem will be solved.
    if this answered your question . make my answer correct.
    Thanks
    Jay.

  • ORA-00900: invalid SQL statement error while running jobs in APEX 4.2

    Hi,
    the following procedure compiled successfully in Apex 4.2:
    create or replace procedure "DEVLOE" AS
    L_TEMPLATE VARCHAR2(32000);
    L_base_TEMPLATE VARCHAR2(32000);
    begin
    l_base_template := '<html>
    <head>
    <title>HTML Editor Sample Page</title>
    </head>
    <body>
    <p>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span class="plsql-literal" style="line-height: 14.65625px; white-space: nowrap;">Hi #Contact#,</span></span></span></p>
    <p>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span class="plsql-literal" style="line-height: 14.65625px; white-space: nowrap;">This is a notification message to inform you that <strong>Development </strong>effort </span><span class="plsql-literal" style="line-height: 14.65625px; white-space: nowrap;">and milestones are yet to be updated for ECR: </span><span class="plsql-operator" style="line-height: 14.65625px; white-space: nowrap;"></span><span class="plsql-word" style="line-height: 14.65625px; white-space: nowrap;">#ECR_NAME#. This ECR has priority #p#. </span></span></span></p>
    <table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
    <tbody>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="color: rgb(255, 0, 0);"><span style="font-family: verdana, geneva, sans-serif;"><u><strong>Department</strong></u></span></span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(255, 0, 0);"><u><strong><span style="background-color: rgb(255, 255, 255);">Contact Name</span></strong></u></span></span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Product Management Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#pdm#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">PMO Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#PMO#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Dev Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#Dev#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">QA Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#QA#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Infodev Contact</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#Info#</span></span></td>
    </tr>
    </tbody>
    </table>
    <p>
     </p>
    <span fckbookmark="1" style="display: none;"> </span><span fckbookmark="1" style="display: none;"> </span>
    <table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
    <tbody>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">Team</span></span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">Start Date</span></span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">End Date</span></span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">Effort(in person days)</span></span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Development</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#d1#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#e1#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#L1#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Quality Assurance</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#d2#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#e2#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#L2#</span></span></td>
    </tr>
    <tr>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Information Development</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#d3#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#e3#</span></span></td>
    <td>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#L3#</span></span></td>
    </tr>
    </tbody>
    </table>
    <p>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">The ECR application is located</span> at </span>: https://apex.oraclecorp.com/pls/apex/f?p=1472:1<span fckbookmark="1" style="display: none;"> </span></p>
    <span fckbookmark="1" style="display: none;"> </span>
    <p>
    <span style="font-family: verdana, geneva, sans-serif; font-size: 14px;">Regards,</span></p>
    <p>
     </p>
    <p>
    <span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">ECR Team</span></span></p>
    </body>
    </html>
    FOR c1 IN (select ECR_NAME,PMO_CONTACT, QE_LOE,INFODEV_LOE, DEV_START_DATE, DEV_END_DATE, QE_CONTACT,QE_START_DATE,INFODEV_START_DATE,INFODEV_END_DATE, QE_END_DATE, INFODEV_CONTACT, PDM_CONTACT, DEV_LOE,ECR_PRIORITY, DEV_CONTACT from ECR_NAME WHERE DEV_LOE IS NULL AND ECR_STATUS = 'Effort Estimation is in Progress' AND ECR_PRIORITY <=5)
    LOOP
    l_template := l_base_template;
    l_template:= replace(l_template, '#Contact#', c1.DEV_CONTACT);
    l_template:= replace(l_template, '#ECR_NAME#', c1.ECR_NAME);
    l_template:= replace(l_template, '#p#', c1.ECR_PRIORITY);
    l_template:= replace(l_template, '#PMO#', c1.PMO_CONTACT);
    l_template:= replace(l_template, '#pdm#', c1.PDM_CONTACT);
    l_template:= replace(l_template, '#Dev#', c1.DEV_CONTACT);
    l_template:= replace(l_template, '#QA#', c1.QE_CONTACT);
    l_template:= replace(l_template, '#Info#', c1.INFODEV_CONTACT);
    l_template:= replace(l_template, '#d1#', c1.DEV_START_DATE);
    l_template:= replace(l_template, '#L1#', c1.DEV_LOE);
    l_template:= replace(l_template, '#e1#', c1.DEV_END_DATE);
    l_template:= replace(l_template, '#d2#', c1.QE_START_DATE);
    l_template:= replace(l_template, '#L2#', c1.QE_LOE);
    l_template:= replace(l_template, '#e2#', c1.QE_END_DATE);
    l_template:= replace(l_template, '#d3#', c1.INFODEV_START_DATE);
    l_template:= replace(l_template, '#L3#', c1.INFODEV_LOE);
    l_template:= replace(l_template, '#e3#', c1.INFODEV_END_DATE);
    htmldb_mail.Send(p_to => '[email protected]',
    p_cc => '[email protected]',
    p_from => '[email protected]',
    p_body => l_template,
    p_body_html => l_template,
    p_subj => 'cxxxx:' ||c1.ECR_NAME );
    END LOOP;
    end;
    the when I ran:
    begin
    devloe();
    end;
    I received the mail as well.
    However, when I try to schedule this in the job:
    declare
    JobNo user_jobs.job%TYPE;
    begin
    dbms_job.submit(JobNo, 'BEGIN
    DEVLOE();
    END;', sysdate, 'sysdate + 1/24/60'); commit; end;
    The job status shows failures every minute.
    dbms_job.run(job_no);
    It gave : ORA-00900: invalid SQL statement

    First of all I don't see a procedure header.
    Secondly I see you commit inside your procedure. This is a bug.
    Thirdly I see you also commit inside a loop. This is also a bug, and needs to be removed asap.
    The error indicates a statement doesn't parse. As you don't post the error stack, nor a table definition no one can reproduce the problem.
    You need to isolate the statements, one by one, and run them through sql*plus to see what happens.
    Sybrand Bakker
    Senior Oracle DBA

  • Documaker 12.1 - ODBC - SQL Setup Error - Need  Help

    Hi
    We are facing issues while trying to checkout/read the resources from the SQL tables. We are getting an error "An error occured getting the file". We use "ODBC" driver for connecting to SQL database and the ODBC test connection seems to run succesfully. This doesn't seems to be a connectivity issue as we are able to see that the resources are listed in IDE.
    Studio somehow is not able to read/load the data from the application data table. Do we need to set-up any access privileges for the database and tables to enable the DMStudio to access it.
    Thanks in Advance.

    Hi,
    When you run the Create New Workspace wizard in Documaker Studio and select your DBMS type it tries to deploy the tables through our ODBC connection.
    If successful it will then create the workspace with some minumum resources and query for other info like Font Cross-reference file, etc. and when done you have a complete workspace which includes INI, DFD configuration files specific to your choice of DBMS type. This workspace and it configuration files (e.g. fsiuser.ini, fsisys.ini, deflib\carfile.dfd, etc.) are needed for access to the workspace properly.
    If the wizard is unsuccessful (for reasons such as permissions, access, etc.) it will let you generate a DDL and pass it off to the qualified personnel but it expects you to either leave the studio running and continue from there or to re-run the create workspace to complete the task and configuration. If you stop at the DDL stage and don't complete the task but try and use internal defaults for the configuration files the resource may appear to deploy but they will not load upon studio preview or attempt by the publishing engine to process with them because the internal configuration does not use the appropriated datatype for the database. This situation would be classified as improper or incomplete workspace creation.
    I suspect you hit this problem. Going back and configuring a workspace to just talk to the database is not appropriate and can have undefined results.
    Hope this helps,
    -Steve

Maybe you are looking for