It gives me a compilation error pls-000103..on line1

create or replace procedure sys_logon1
authid current_user
as
CURSOR sys_sess IS SELECT sid,username,osuser,logon_time FROM v$session WHERE username<>' ';
CURSOR sys_chk(mSID number) IS SELECT sid from sys_logon WHERE sid=mSID;
mSID v$session.sid%type;
mUSERNAME v$session.username%type;
mOSUSER v$session.osuser%type;
mLOGON v$session.logon_time%type;
mSID_view number(10);
BEGIN
OPEN sys_sess;
LOOP
FETCH sys_sess INTO mSID,mUSERNAME,mOSUSER,mLOGON;
EXIT WHEN sys_sess%NOTFOUND;
OPEN sys_chk (mSID);
FETCH sys_chk INTO mSID_view;
IF sys_chk%NOTFOUND THEN
INSERT INTO sys_logon VALUES(mSID,mUSERNAME,mOSUSER,mLOGON);
END IF;
CLOSE sys_chk;
END LOOP;
CLOSE sys_sess;
COMMIT;
END;
LINE/COL ERROR
4/20 PL/SQL: SQL Statement ignored
4/63 PL/SQL: ORA-00942: table or view does not exist
6/14 PLS-00201: identifier 'V$SESSION' must be declared
6/14 PL/SQL: Item ignored
7/14 PLS-00201: identifier 'V$SESSION' must be declared
7/14 PL/SQL: Item ignored
8/14 PLS-00201: identifier 'V$SESSION' must be declared
8/14 PL/SQL: Item ignored
9/14 PLS-00201: identifier 'V$SESSION' must be declared
9/14 PL/SQL: Item ignored
14/16 PL/SQL: SQL Statement ignored
14/36 PLS-00320: the declaration of the type of this expression is
incomplete or malformed
16/16 PL/SQL: SQL Statement ignored
16/30 PLS-00320: the declaration of the type of this expression is
incomplete or malformed
19/20 PL/SQL: SQL Statement ignored
19/72 PLS-00320: the declaration of the type of this expression is
incomplete or malformed
19/72 PL/SQL: ORA-00904: "MLOGON": invalid identifier
Message was edited by:
shakil_zubair

It seems you have not the grant of select on v$session view.
SYSTEM@DEMO102> conn scott
Enter password: *******
Connected.
SCOTT@DEMO102> create or replace procedure sys_logon1
  2  authid current_user
  3  as
  4  CURSOR sys_sess IS SELECT sid,username,osuser,logon_time FROM v$session WHERE username<>' ';
  5  mSID v$session.sid%type;
  6  mUSERNAME v$session.username%type;
  7  mOSUSER v$session.osuser%type;
  8  mLOGON v$session.logon_time%type;
  9  mSID_view number(10);
10  BEGIN
11  OPEN sys_sess;
12  LOOP
13  FETCH sys_sess INTO mSID,mUSERNAME,mOSUSER,mLOGON;
14  EXIT WHEN sys_sess%NOTFOUND;
15  dbms_output.put_line(mSID);
16  END LOOP;
17  CLOSE sys_sess;
18  END;
19  /
Warning: Procedure created with compilation errors.
SCOTT@DEMO102> show err
Errors for PROCEDURE SYS_LOGON1:
LINE/COL ERROR
4/20     PL/SQL: SQL Statement ignored
4/63     PL/SQL: ORA-00942: table or view does not exist
5/6      PL/SQL: Item ignored
5/6      PLS-00201: identifier 'V$SESSION' must be declared
6/11     PL/SQL: Item ignored
6/11     PLS-00201: identifier 'V$SESSION' must be declared
7/9      PL/SQL: Item ignored
7/9      PLS-00201: identifier 'V$SESSION' must be declared
8/8      PL/SQL: Item ignored
8/8      PLS-00201: identifier 'V$SESSION' must be declared
13/1     PL/SQL: SQL Statement ignored
LINE/COL ERROR
13/21    PLS-00320: the declaration of the type of this expression is
         incomplete or malformed
15/1     PL/SQL: Statement ignored
15/22    PLS-00320: the declaration of the type of this expression is
         incomplete or malformed
SCOTT@DEMO102> conn / as sysdba
Connected.
SYS@DEMO102> grant select on v_$session to scott;
Grant succeeded.
SYS@DEMO102> conn scott
Enter password: *******
Connected.
SCOTT@DEMO102> create or replace procedure sys_logon1
  2  authid current_user
  3  as
  4  CURSOR sys_sess IS SELECT sid,username,osuser,logon_time FROM v$session WHERE username<>' ';
  5  mSID v$session.sid%type;
  6  mUSERNAME v$session.username%type;
  7  mOSUSER v$session.osuser%type;
  8  mLOGON v$session.logon_time%type;
  9  mSID_view number(10);
10  BEGIN
11  OPEN sys_sess;
12  LOOP
13  FETCH sys_sess INTO mSID,mUSERNAME,mOSUSER,mLOGON;
14  EXIT WHEN sys_sess%NOTFOUND;
15  dbms_output.put_line(mSID);
16  END LOOP;
17  CLOSE sys_sess;
18  END;
19  /
Procedure created.
SCOTT@DEMO102> Nicolas.

Similar Messages

  • JRE 6 update 10 : Webstart give Microsoft JScript compilation error

    We had some problem yesterday with our application that is launch from webstart. Everyone that upgraded to JRE 6 update 10 had the problem. This morning we don't have the problem. We are all on Windows Xp 32 bit, english or french and we all use a proxy.
    I suspect that the problem is related to how update 10 handle the proxy responses.
    here a screenshot that I took yesterday.
    the workflow was this :
    we had a jnlp and when we click on it.. javaws starts and we got this popup. We can close it, and the application will download, and before the application starts.. we had the popup again.. close it again.. and the application run perfectly.
    here a screenshot of my proxy setting in IE and firefox : (the default browser is FF)

    I found the problem. I am using a proxy auto config script, which works fine in ie and ff but not javaw which inherits proxy settings from ie.
    I narrowed it down to a regular expression literal that ends with an escaped forward slash: /\//. I think it's valid, the forward slash is escaped (works in ie and ff). You can reproduce this by configuring ie to use the following pac script:
    function FindProxyForURL(url, host)
         var retVal;
         try
              retVal = /\//.test("/") ? "DIRECT" : "PROXY localhost:80";     
         catch (e)
              retVal = "PROXY localhost:80";
         return retVal;
    }I debugged it in ie and it works with no errors or exceptions.

  • C# compiling error: 'System.Array' does not contain a definition for 'Select' and no extension method 'Select' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)

    Hello experts,
    I'm totally new to C#. I'm trying to modify existing code to automatically rename a file if exists. I found a solution online as follows:
    string[] allFiles = Directory.GetFiles(folderPath).Select(filename => Path.GetFileNameWithoutExtension(filename)).ToArray();
            string tempFileName = fileName;
            int count = 1;
            while (allFiles.Contains(tempFileName ))
                tempFileName = String.Format("{0} ({1})", fileName, count++); 
            output = Path.Combine(folderPath, tempFileName );
            string fullPath=output + ".xml";
    However, it gives the following compilation errors
    for the Select and Contain methods respectively.:
    'System.Array' does not contain a definition for 'Select' and no extension method 'Select' accepting a first argument of type 'System.Array' could be found
    (are you missing a using directive or an assembly reference?)
    'System.Array' does not contain a definition for 'Contains' and no extension method 'Contains' accepting a first argument of type 'System.Array' could be
    found (are you missing a using directive or an assembly reference?)
    I googled on these errors, and people suggested to add using System.Linq;
    I did, but the errors persist. 
    Any help and information is greatly appreciated.
    P. S. Here are the using clauses I have:
    using System;
    using System.Data;
    using System.Windows.Forms;
    using System.IO;
    using System.Collections.Generic;
    using System.Text;
    using System.Linq;

    Besides your issue with System.Core, you also have a problem with the logic of our code, particularly your variables. It is confusing what your variables represent. You have an infinite loop, so the last section of code is never reached. Take a look 
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.IO;
    namespace consAppFileManipulation
    class Program
    static void Main(string[] args)
    string fullPath = @"c:\temp\trace.log";
    string folderPath = @"c:\temp\";
    string fileName = "trace.log";
    string output = "";
    string fileNameOnly = Path.GetFileNameWithoutExtension(fullPath);
    string extension = Path.GetExtension(fullPath);
    string path = Path.GetDirectoryName(fullPath);
    string newFullPath = fullPath;
    string[] allFiles = Directory.GetFiles(folderPath).Select(filename => Path.GetFileNameWithoutExtension(filename)).ToArray();
    string tempFileName = fileName;
    int count = 1;
    //THIS IS AN INFINITE LOOP
    while (allFiles.Contains(fileNameOnly))
    tempFileName = String.Format("{0} ({1})", fileName, count++);
    //THIS CODE IS NEVER REACHED
    output = Path.Combine(folderPath, tempFileName);
    fullPath = output + ".xml";
    //string fullPath = output + ".xml";
    UML, then code

  • Getting compilation error while writing standalone for ddi_get8

    Hi All,
    I have already posted a thread regarding ddi_regs_map_setup solaris system call guidance.
    [Previous Query|https://forums.oracle.com/forums/thread.jspa?threadID=2314211&tstart=0]
    I am writing a standalone to use this system call.
    Below is my partial standalone where i have only the declaration part:
    #include <stdio.h>
    #include <sys/dditypes.h>
    #include <sys/conf.h>
    #include <sys/ddi.h>
    #include <sys/sunddi.h>
    int main()
    dev_info_t *dip;
    uint_t rnumber;
    ushort_t *dev_addr;
    offset_t offset;
    offset_t len;
    ushort_t dev_command;
    ddi_device_acc_attr_t dev_attr;
    ddi_acc_handle_t handle;
    dev_attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
    dev_attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
    dev_attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
    return 0;
    The standalone give the following compilation errors:
    ddiSystemcall.c: In function `main':
    ddiSystemcall.c:15: error: `ddi_device_acc_attr_t' undeclared (first use in this function)
    ddiSystemcall.c:15: error: (Each undeclared identifier is reported only once
    ddiSystemcall.c:15: error: for each function it appears in.)
    ddiSystemcall.c:15: error: syntax error before "dev_attr"
    ddiSystemcall.c:16: error: `ddi_acc_handle_t' undeclared (first use in this function)
    ddiSystemcall.c:17: error: `dev_attr' undeclared (first use in this function)
    ddiSystemcall.c:17: error: `DDI_DEVICE_ATTR_V0' undeclared (first use in this function)
    ddiSystemcall.c:18: error: `DDI_STRUCTURE_LE_ACC' undeclared (first use in this function)
    ddiSystemcall.c:19: error: `DDI_STRICTORDER_ACC' undeclared (first use in this function)
    Please let me know where am i going wrong.
    Thanks in advance.

    Hi,
    there is a WebCenter forum for WebCenter releated questions: WebCenter Portal
    Frank

  • I try to generate a chm file over the net and I get a compiling error message

    Hi all,
    I am trying to generate chm files over the net, and the same project when I am generating the same chm locally works fine, however when I am attempting to generate the same chm on a network location, it gives me a compiling error and aborts the generation. It is also keeping the chm file open afterwards, so I have to reboot the machine.
    It is RH7 working on a Windows XP Pro 32 bit.
    Thank you

    It is not a project issue. RoboHelp is just not designed to work that way but like a lot of things, some people can use them outside what they were designed for. However, just because some people can work that way, it does not follow everyone can.
    I've seen people with projects on a network and they say have been doing it for years so it must be OK. A while later they come back and say the problem is fixed since moving it locally.
    Sorry but it looks like you are stuck with working the way you do or getting your colleague to do it. It might be as simple as he is on a different bit of your network.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Compilation errors with store procedure

    Hi guys, I just started SQL so forgive me if I ask any real stupid questions. This is the problem I have right now as said in my title.
    This is my procedure.sql
    CREATE OR REPLACE PROCEDURE verify IS
    no_of_duplicates NUMBER:=0;
    BEGIN
    SELECT COUNT(*) INTO no_of_duplicates
    FROM EMPLOYEE
    WHERE E# =
    (sELECT E# FROM DRIVER
    WHERE EXISTS
    (SELECT E# FROM MECHANIC
    WHERE DRIVER.L# = MECHANIC.L#));
    IF no_of_duplicates:=0 THEN dbms_output.put_line('OK');
    ELSE
    SELECT E#,NAME FROM EMPLOYEE
    WHERE E# =
    (SELECT E# FROM DRIVER
    WHERE EXISTS
    (SELECT E# FROM MECHANIC
    WHERE DRIVER.L# = MECHANIC.L#));
    END IF;
    END verify;
    While trying to create the procedure, it gives me the compilation errors. I have been stuck with this for hours and can't seem to find anything wrong with it. Can anyone point me in the right direction? Thanks!

    Hi,
    Once again, post your code.  The error occurs when you call the procedure, but you haven't posted the code that calls the procedure and causes the error.
    When I do this in SQL*Plus:
    SET  SERVEROUTPUT  ON  FORMAT WRAPPED
    EXEC  verify;
    The procedure you posted runs perfectly (that is, is displays the e# only, exactly as it was designed to do).
    One way to display both the e# and the name is to BULK COLLECT both the e# and name into separate collections, like this:
    CREATE OR REPLACE PROCEDURE verify IS 
        TYPE  e#_table  IS TABLE OF employee.e#%TYPE;
        e#_list    e#_table;
        TYPE  name_table  IS TABLE OF employee.name%TYPE;
        name_list  name_table;
    BEGIN 
        SELECT            e#,       name
        BULK COLLECT INTO e#_list,  name_list
        FROM              employee 
        WHERE   e# IN (
                          SELECT  d.e#
                          FROM    driver    d
                          JOIN    mechanic  m  ON  d.e#  = m.e# 
        IF  e#_list.COUNT  = 0
        THEN
            dbms_output.put_line ('OK, there are no illict duplications');
        ELSE     -- that is, e#_list.COUNT <> 0
            dbms_output.put_line ('The following employees are both drivers and mechanics:');
            FOR j IN 1..e#_list.COUNT LOOP    -- i in parentheses sometimes displays wrong on the OTN site
                dbms_output.put      ( TO_CHAR ( e#_list (j)
                                               , '999999999999'
                dbms_output.put      ('   ');
                dbms_output.put_line (name_list (j)); 
            END LOOP; 
        END IF; 
    END verify; 
    SHOW ERRORS
    Here's the output I get when I run the procedure above with your sample data:
    The following employees are both drivers and mechanics:
                1   John Smith
    You'll notice I made several other changes in your code, sometimes because they are clearly better practices, and sometimes just to show you different ways to do the same thing, which you may or may not want to use in this problem.
    For example, you were doing the same query (with only very slight differences) 2 times: once to get no_of_duplicates, and then a second time to get the actual data.  I don't know if that's the most efficient way to do what you need.  Say there are 1000 rows in the result set.  You'll fetch all 1000 once just to get the total number, (which you don't need, if all you care about at this point is if there are any), and then to get the data.  When you do a BULK COLLECT, you automatically get the COUNT anyway, so why not do the BULK COLLECT first, then use that COUNT to see what you have to do next.  If the COUNT is more than 0, then you've already got the data, and you don't need to fetch it again.  Also, repeating (essentially) the same code is a maintenance problem.  If you ever need to make a change, you need to make the same change in multiple places.  At best, that's a pain; but this is the exactly the kind of mistake that is easy to miss in in testing, and you might have code running for weeks in Production before you notice that sometimes it's giving the wrong results.
    Another example: e# is a NUMBER.  While it is possible to convert NUMBERs into VARCHAR2s, and then store those VARCHAR2s in a VARCHAR2 collecction, wouldn't it make more sense just to store them in a NUMBER collection?

  • Why does plsql give compilation error for select statement?

    When I run following plsql program, it gives compilation error. Could somebody please point me out what could be wrong here? I am running it from system user.
    create or replace procedure drop_user_proc (iname in varchar2) is
    uname varchar2(100);
    begin
    select username into uname from dba_users where username = upper(iname);
    end drop_user_proc;
    select username from dba_users where username = upper('newuser');
    When I run it, I get following error. dba_users is there that is the reason it works outside plsql block, but it doesn't from inside block.
    SQL> @t4
    Warning: Procedure created with compilation errors.
    USERNAME
    NEWUSER
    SQL> show err
    Errors for PROCEDURE DROP_USER_PROC:
    LINE/COL ERROR
    4/3 PL/SQL: SQL Statement ignored
    4/35 PL/SQL: ORA-00942: table or view does not exist

    Role based grants are not available within the stored procedures.
    Only explicit grants are recognized when compiling stored code.
    You need to grant select on that table to the user where you are creating this procedure.

  • USING STRUTS2 DOJO PLUGIN TAGS GIVES COMPILER ERROR (JDev 10.1.3.3)

    Hi.
    Using Struts 2.1.2 dojo plugin tags gives compiler error:
    Error(9): Couldn't instantiate tag sx:head (class: null). Be sure that the tag class is available...
    (translated from spanish)
    So I can't run the application.
    When configured, tags can be chosen from the component palette and the normal struts tags (not the dojo ones) do compile and run ok.
    From service request:
    Examining Jdeveloper's console message, its apparent that the tag library is not compatible with JDeveloper because of
    the following warning:
    oracle.jsp.logger.JspMessages.warningInvalidTldVersion:J2EE JSP-0033
    Someone has any workaroun or solution?
    ### Steps to Reproduce ###
    1.- Create new application and project
    2.- Copy Struts 2.1.2 jar libs including dojo somewhere (for example in WEB-INF/lib)
    3.- Associate the jars to the project (Libraries option in Project Properties)
    4.- Create a JSP
    5.- Use a dojo tag in the JSP
    <%@ taglib uri="/struts-dojo-tags" prefix="sx"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
    <title>index</title>
    <sx:head/>
    </head>
    <body></body>
    </html>
    6.- Compile

    Hi did you solved this problem? I have same

  • Urgent: Form Compilation Error using frmcmp.sh on OAS 10.1.2, pls help..

    Hi All,
    I am upgrading from OAS 9.0.4 to 10.1.2 where Forms 10g application is deployed.
    When I try to recompile with frmcmp.sh :
    frmcmp.sh userid=system/oracle123@odb module_type=FORM module=menu1.fmb
    I get errors :
    Compiling Procedure GET_PATH...
    Compilation error on procedure GET_PATH:
    PL/SQL ERROR 201 at line 4, column 32
    Identifier 'APPS_MENU1_DET' must be declared
    PL/SQL ERROR 0 at line 4, column 3
    SQL Statement ignored
    Compilation error have occured.
    Form not created
    What cause this error ?
    FYI, on the above compilation I connect to different database/schema, not the one
    which is used by the Form, is this the reason of th error ?
    During compilation, Do I have to connect to the database/schema I used when develop the form ?
    DO I have to create all tables in the schema first before compilation ?
    Tnank you for your hwlp,
    xtanto
    PS. When I compile the same Form with F90genm.sh on OAS 9.0.4, NO ERROR.

    From my experience it's a really bad idea to install OCS into a AS IM. When it comes to upgrades and patches you'll pull your hair out!
    Why not install OCS first and then install the BI into the OCS AS server... I have not checked the certification matrix but that might be a better solution to look into.

  • "asant build" for bookstore1 example in j2ee tutorial gives "compile error"

    Hello everybody,
    I am trying to run "asant build" command to build package for bookstore1 example given in j2ee tutorials.
    I installed my j2ee tutorial 1.4 in "c:\java\j2eetutorial14" and my example is in "c:\java\j2eetutorial\examples\web\bookstore1".
    My j2ee SDK with appliation server is installed in C:\sun\appserver.
    When i run the "asant build" command in "c:\java\j2eetutorial\examples\web\bookstore1" directory i get compile error with last few lines as follows.
    [javac] location: class servlets.ShowCartServlet
    [javac] } catch (BookNotFoundException ex) {
    [javac] ^
    [javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
    :136: cannot resolve symbol
    [javac] symbol : class ShoppingCartItem
    [javac] location: class servlets.ShowCartServlet
    [javac] ShoppingCartItem item = (ShoppingCartItem) i.next();
    [javac] ^
    [javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
    :136: cannot resolve symbol
    [javac] symbol : class ShoppingCartItem
    [javac] location: class servlets.ShowCartServlet
    [javac] ShoppingCartItem item = (ShoppingCartItem) i.next();
    [javac] ^
    [javac] C:\Java\j2eetutorial14\examples\web\bookstore1\src\servlets\ShowCartServlet.jav
    :137: cannot resolve symbol
    [javac] symbol : class BookDetails
    [javac] location: class servlets.ShowCartServlet
    [javac] bd = (BookDetails) item.getItem();
    [javac] ^
    [javac] 69 errors
    BUILD FAILED
    file:C:/Java/j2eetutorial14/examples/web/bookstore1/build.xml:68: Compile failed; see the compiler error output for details.
    Total time: 2 seconds
    Can some one please help me.
    thanks

    When i run the "asant build" command in
    "c:\java\j2eetutorial\examples\web\bookstore1"
    directory i get compile error with last few lines as
    follows.Did you package the bookstore common files as described in Chapter 3? My guess is that you didn't include bookstore.jar from <INSTALL>/j2eetutorial14/examples/build/web/bookstore/dist/.
    -Ian Evans
    Sun Microsystems
    J2EE Tutorial team

  • Compilation error in PL/SQL

    Hi All,
    Please find the strange query situation in PLSQL.
    If i run the query without PLSQL block (i.e. declar begin end) it runs well and insert data
    in table but if put the same query in PLSQL block it gives compilation error.
    Following is the spool
    SQL> select * from v$version;
    BANNER                                                                                                                                     
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production                                                                                 
    PL/SQL Release 8.1.7.4.0 - Production                                                                                                      
    CORE     8.1.7.0.0     Production                                                                                                                  
    TNS for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production                                                                           
    NLSRTL Version 3.4.1.0.0 - Production                                                                                                      
    SQL> insert into smcbom_load_hours_temp
      2  select data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date) v_period,sum(v_hr),-1,sysdate,-1,sysdate
      3  from (
      4  select plan_level,sp.data_set_name,
      5  sp.value1,smcbom_flex_budget.calculate_period_days(sp.period1),inweight ,
      6  usagerate ,operationseq,percent,
      7  sbov.group_id,sp.alloy,sp.planner_code,
      8  sbov.days,sbov.totaloffsetdays,deptclass,dept,
      9  decode(plan_level,1,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate *
    10  (SELECT MAX(INWEIGHT)
    11  FROM  SMCBOM_BOM_OPERATION_VIEW
    12  WHERE ALLOY=sbov.alloy
    13  AND   PLANNER_CODE=sbov.planner_code
    14  AND   PLAN_LEVEL = 0
    15  AND   GROUP_ID = sbov.group_id ),
    16  0,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate ,
    17  1) v_hr,
    18  smcbom_flex_budget.get_start_date(sp.period14)+sbov.totaloffsetdays v_date,
    19  sum(-sbov.totaloffsetdays)
    20  over (partition by sp.alloy,sp.planner_code,sbov.group_id
    21  order by plan_level asc,operationseq desc)  new_offset
    22  from smcbom_bom_operation_view sbov,smcbom_sales_prod_forecasts sp
    23  where sbov.alloy= sp.alloy
    24  and   sbov.planner_code=sp.planner_code
    25  and group_id=521136
    26  )
    27  group by data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date);
    23 rows created.
    SQL> commit;
    Commit complete.
    SQL> declare
      2  begin
      3  insert into smcbom_load_hours_temp
      4  select data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date) v_period,sum(v_hr),-1,sysdate,-1,sysdate
      5  from (
      6  select plan_level,sp.data_set_name,
      7  sp.value1,smcbom_flex_budget.calculate_period_days(sp.period1),inweight ,
      8  usagerate ,operationseq,percent,
      9  sbov.group_id,sp.alloy,sp.planner_code,
    10  sbov.days,sbov.totaloffsetdays,deptclass,dept,
    11  decode(plan_level,1,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate *
    12  (SELECT MAX(INWEIGHT)
    13  FROM  SMCBOM_BOM_OPERATION_VIEW
    14  WHERE ALLOY=sbov.alloy
    15  AND   PLANNER_CODE=sbov.planner_code
    16  AND   PLAN_LEVEL = 0
    17  AND   GROUP_ID = sbov.group_id ),
    18  0,(sp.value14/smcbom_flex_budget.calculate_period_days(sp.period14)) * (percent/100) * inweight * usagerate ,
    19  1) v_hr,
    20  smcbom_flex_budget.get_start_date(sp.period14)+sbov.totaloffsetdays v_date,
    21  sum(-sbov.totaloffsetdays)
    22  over (partition by sp.alloy,sp.planner_code,sbov.group_id
    23  order by plan_level asc,operationseq desc)  new_offset
    24  from smcbom_bom_operation_view sbov,smcbom_sales_prod_forecasts sp
    25  where sbov.alloy= sp.alloy
    26  and   sbov.planner_code=sp.planner_code
    27  and group_id=521136
    28  )
    29  group by data_set_name,deptclass,dept,smcbom_flex_budget.get_period(v_date);
    30  end;
    31  /
    (SELECT MAX(INWEIGHT)
    ERROR at line 12:
    ORA-06550: line 12, column 2:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ( - + mod not null others <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string>
    ORA-06550: line 22, column 6:
    PLS-00103: Encountered the symbol "(" when expecting one of the following:
    , from
    SQL> spool off;

    In some versions of Oracle (certainly all of the 8.x versions and earlier, and possibly some of the earlier 9 versions) the SQL parsers in the SQL engine and in the PL/SQL engine were different. Some features that worked directly in SQL did not work in PL/SQL. Scalar sub-queries were one of those things.
    You have three options. You can try to re-write the insert statement to eliminate the PL/SQL unimplemented feature. You can create a view in the database for the SELECT part of the insert statement then use that view in the insert. finally, and least desirable, you can build the whole statment as a string, and use EXECUTE IMMEDIATE to run it in PL/SQL.
    HTH
    John

  • Hard coded SQL string doesn't run with error PLS-00103

    I have created a package with 34 stored procedures [pre]to create some materialized view with hard coded SQL [pre]string (client required for this hard coding). The [pre]first part with 21 simple create statements has
    [pre]worked fine. 2nd part with 11 complicated create [pre]statements, only first one has worked. all others [pre]have  not worked.
    [pre]
    I used dbms_output.put_line (sql_string) to check the [pre]individual create statement, it has looked fine. I [pre]have run individual SP within package. I have got [pre]error message as ORA-06550: line 1, column 45:
    [pre]PLS-00103: Encountered the symbol "end-of-file" when [pre]expecting one of the following: ; [pre]
    <an identifier> <a double-quoted delimited-identifier> [pre]The symbol ";" was substituted for "end-of-file" to [pre]continue.
    [pre]I have checked SQL string between 1st part and 2nd [pre]part. They are the same and all with ';' to end SQL [pre]string and END SP name in the end. Please help me to [pre]identify where the problems are. Thanks. Followings [pre]are some sample SQL string:
    [pre]PROCEDURE sp_1st_string
    [pre]IS
    [pre]BEGIN
    [pre]    EXECUTE IMMEDIATE 'CREATE MATERIALIZED VIEW
    [pre]mv_name1 TABLESPACE space_name PARALLEL ( DEGREE [pre]DEFAULT INSTANCES DEFAULT ) BUILD IMMEDIATE REFRESH [pre]COMPLETE ON DEMAND WITH PRIMARY KEY AS SELECT col1, [pre]col2,col3, col4, col5 FROM tableone A, table_two B [pre]WHERE A.id = B.id';
    [pre]COMMIT;
    [pre]END sp_1st_string;
    [pre]PROCEDURE sp_2nd_string
    [pre]IS
    [pre]BEGIN
    [pre]   EXECUTE IMMEDIATE ' CREATE MATERIALIZED VIEW
    [pre]mv_name2 TABLESPACE PDE_DATA PARALLEL ( DEGREE [pre]DEFAULT INSTANCES DEFAULT ) BUILD IMMEDIATE REFRESH [pre]COMPLETE ON DEMAND WITH PRIMARY KEY AS select col1 .. [pre]col10 from tableone a, tabletwo b, tablethree c, [pre]tablefour d, tablefive e, tablesix f where clause;
    [pre]COMMIT;
    [pre]END sp_2nd_string;
    Message was edited by:
            citicbj
    Message was edited by:
            citicbj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    stevencallan:
    Thanks for your advice. I have been thinking the above problem may be [pre]caused by this. If I run 'Create MV statement' in SQL PLUS or Toad, single quote [pre]will work. But when I put hard coded SQL string in package and stored [pre]procedure, it will cause compiling error. After I took off single quote, SP will be [pre][pre]compiled successfully. When I run package.sp, it will cause the problem. [pre]Here is the sample code:[pre]
    [pre]CREATE MATERIALIZED VIEW my_mv TABLESPACE space_name [pre][pre]PARALLEL (DEGREE DEFAULT INSTANCES DEFAULT) BUILD IMMEDIATE [pre]REFRESH COMPLETE ON DEMAND WITH PRIMARY KEY AS select A.ID , [pre]A.CNTL_NUM, C.XX_CODE, D.FIRST_NAME, D.MDL_NAME, [pre]D.LAST_NAME, H.XX_DESC, TO_DATE(TO_CHAR(C.CREAT_TS, [pre]'MM/DD/YYYY'),'MM/DD/YY'), F.STATE, CASE WHEN A.XX_CODE IS NOT NULL [pre]THEN X END, E.X_DESC  from TABLE1 A, TABLE2 B, TABLE3 C, TABLE4 [pre]D, TABLE5 E, TABLE6 F, TABLE7 G, TABLE8 H
    [pre]where D.X_SW = 'X' and B.X_SW = X' and G.X_SW = 'X' and B.CNTL_ID = [pre]A.CNTL_ID and B.CNTL_ID = D.CNTL_ID and B.X_ID = C.X_ID and B.X_ID = [pre]G.X_ID and B.X_ID = F.X_ID and G.X_CD = H.X_CD and B.X_CD = E.X_CD [pre]and E.X_CD = '25' and C.ENRLMT_ID NOT LIKE 'O%'; [pre]
    [pre]When I hard coded this statement in package and sp, I have to take off single [pre]quote ' ' form 'MM/DD/YYYY', 'MM/DD/YY', X_SW ='X', X_CD = '25' AND NOT [pre]LIKE 'O%', Then I can compile whole package successfully. This is why I [pre]mentioned that 1st part 21 simple create statement work because they don't have [pre]these single quote in the statement. In 2nd part with 13 complicated create [pre]statements, some of them have no single quote in the statement. They will [pre]run. Some of them with single quote in statement. They will have the problem [pre]to run if I take off single for compiling. [pre]
    [pre]Please give me some idea what is the reason. Thanks a lot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Compilation error when used SET or MULTISET operator on nested tables

    Dear All,
    I am getting Compilation error when used SET or MULTISET operator on nested tables inside a procedure.
    This is working fine in other DB installations of 10g but does not work in another 10g DB.
    it says "wrong number of parameter or datatype used in SET"
    Can any one suggest what went wrong here?
    Thanks in advance.

    Hi,
    Thanks for ur reply...
    Since MULTISET and SET operators are the new additions in base 10g release for manipulation of nested tables data, I am surprised that same is working in similar 5 DBs installations with 10.2.0.1.0 version, but does not work in the sixth.
    SET and MULTISET operators are used inside the PL/SQL procedure which is getting compiled in the above mentioned 5 DBs but not in sixth DB.
    it gives
    On line: 3112
    PLS-00306: wrong number or types of arguments in call to 'SET'
    Hope this clarifies the issue...

  • Error PLS-00355 occurs when open cursor in procedure

    Hello everybody,
    I have a problen that really drives me mad:
    Whenever I try to compile the following procedure, the Error "PLS-00355: use of pl/sql table not allowed in this context" occurs but I can't see what is wrong. I hope the wisdome of the community will help to solve the problem.
    Here is the code:
    CREATE or REPLACE PROCEDURE data_year(study_year IN NUMBER) AS
    sep CONSTANT CHAR := ';';
    CURSOR cursor_year(year_of_interest NUMBER) IS
    select
    BBS_CONDITIONS.COUNTRYNUM as country,
    BBS_CONDITIONS.STATENUM as state,
    BBS_CONDITIONS.ROUTE as route,
    BBS_ROUTES.LATITUDE as lat,
    BBS_ROUTES.LONGITUDE as lon,
    BBS_SUMMARY.AOU as aou,
    BBS_SPECIES.ENGLISH_COMMON_NAME as name,
    BBS_SPECIES.MIGRATION_TYPE as migtype,
    BBS_SUMMARY.SPECIESTOTAL as count,
    BBS_CONDITIONS.MONTH as smonth,
    BBS_CONDITIONS.STARTTIME as starttime,
    BBS_CONDITIONS.ENDTIME as endtime,
    BBS_CONDITIONS.RPID as rpid,
    BBS_CONDITIONS.ASSISTANT as assistant
    from BBS_SPECIES,
    BBS_ROUTES,
    BBS_SUMMARY,
    BBS_CONDITIONS
    where BBS_ROUTES.ROUTE = BBS_CONDITIONS.ROUTE
    and BBS_ROUTES.STATENUM = BBS_CONDITIONS.STATENUM
    and BBS_ROUTES.COUNTRYNUM = BBS_CONDITIONS.COUNTRYNUM
    and BBS_SPECIES.AOU = BBS_SUMMARY.AOU
    and BBS_CONDITIONS.YEAR = BBS_SUMMARY.YEAR
    and BBS_CONDITIONS.ROUTE = BBS_SUMMARY.ROUTE
    and BBS_CONDITIONS.STATENUM = BBS_SUMMARY.STATENUM
    and BBS_CONDITIONS.COUNTRYNUM = BBS_SUMMARY.COUNTRYNUM
    and BBS_SPECIES.CLASS_ID = 0
    and BBS_CONDITIONS.YEAR = year_of_interest
    order by country, state, route, migtype, aou;
    rec_year cursor_year%ROWTYPE;
    i NUMBER := 1;
    TYPE table_year_type IS TABLE OF cursor_year%ROWTYPE;
    table_year table_year_type;
    BEGIN -- Begin of procedure data_year
    table_year := table_year();
    OPEN cursor_year(study_year);
    LOOP
    FETCH cursor_year into rec_year;
    EXIT WHEN cursor_year%NOTFOUND;
    table_year.EXTEND(1);
    table_year(i) := rec_year;
    i := i+1;
    END LOOP;
    CLOSE cursor_year;
    DBMS_OUTPUT.PUT_LINE('country' || sep || 'state' || sep || 'route' || sep || 'lat' || sep || 'lon'
    || sep || 'aou' || sep || 'name' || sep || 'migtype' || sep || 'count' || sep || 'month' || sep
    || 'starttime' || sep || 'endtime' || sep || 'rpid' || sep || 'assistant');
    FOR i in table_year.FIRST..table_year.LAST LOOP
    DBMS_OUTPUT.PUT_LINE(TO_CHAR(table_year(i).country) || sep || TO_CHAR(table_year(i).state) ||
    sep || TO_CHAR(table_year(i).route) || sep || TO_CHAR(table_year(i).lat) || sep ||
    TO_CHAR(table_year(i).lon) || sep || TO_CHAR(table_year(i).aou) || sep ||
    table_year(i).name || sep || TO_CHAR(table_year(i).migtype) || sep ||
    TO_CHAR(table_year(i).count) || sep || TO_CHAR(table_year(i).smonth) || sep ||
    TO_CHAR(table_year(i).starttime) || sep || TO_CHAR(table_year(i).endtime) || sep ||
    TO_CHAR(table_year(i).rpid) || sep || TO_CHAR(table_year(i).assistant));
    END LOOP;
    END; -- End of procedure data_year
    Thanks ahead, TC

    Does it give a line number? I'm wondering if it might be
    table_year := table_year();
    that's causing the problem. Try removing it and see.
    Even better, change your code to
       TYPE table_year_type IS TABLE OF cursor_year%ROWTYPE INDEX BY BINARY_INTEGER;
       table_year     table_year_type;
    BEGIN        
        OPEN cursor_year (study_year);
        FETCH cursor_year BULK COLLECT INTO table_year;
        CLOSE cursor_year;
    ...Edited by: Dave Hemming on Nov 21, 2008 9:51 AM

  • Compilation error-creating jar file

    Hi
    Can somebody pls help me out
    Whenever i run scomp filename.xsd out filename.jar
    it gives me the following error
    SBU~1\LOCALS~1\Temp\javac63818 error=2
    null
    java.io.IOException: CreateProcess: C:\xmlbean\xkit\schemas\javac @C:\DOCUME~1\B
    UGSBU~1\LOCALS~1\Temp\javac63818 error=2
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    at java.lang.ProcessBuilder.start(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at org.apache.xmlbeans.impl.tool.CodeGenUtil.externalCompile(CodeGenUtil
    .java:229)
    at org.apache.xmlbeans.impl.tool.SchemaCompiler.compile(SchemaCompiler.j
    ava:1114)
    at org.apache.xmlbeans.impl.tool.SchemaCompiler.main(SchemaCompiler.java
    :367)
    BUILD FAILED
    whereas scomp is working perfectly fine.
    Pls help me!!!

    Hi,
    Make sure that the XMLBEANS_HOME env variable is set and the PATH variable is updated to contain XMLBEANS_HOME\bin
    -Raj
    Refer to http://xmlbeans.apache.org/documentation/conInstallGuide.html for more info

Maybe you are looking for

  • Balance Carry Forward field in Line Item Reports

    Hi Gurus The requirement from the client side in my case is to have opening balance in Tr code ZFBL1N, ZFBL3N and ZFBL5N. I got the Tables where i could find the Vendor and Customer Opening Balance but i also want Opening  Balance for GL. and my 2nd

  • Count function inside a decode function,

    Hi All, I've a requirement where I've to fetch a value depending on the count of a column. In that query, I'm using multiple table joins. For example, if more than one employee's is working for a particular department, then I've to say 'Yes' otherwis

  • Using Firewire Adapter With iPod Classic 80gb

    I have an iPod Classic, 80GB. I have a car adapter that uses a firewire cord. The firewire plugs into the lighter and then the other end plugs into the iPod. Can I use the firewire even though the iPod came with the usb cord? Just wondering as the wa

  • Bug in pdf conversion?

    Every time I convert a word document to pdf, a paragraph number 1.1 appears randomly throughout the pdf.  Anyone know what causes this? Thanks in advance, Christopher

  • [JS] ScriptUI window unefficient in binary mode :-(

    Hi, I have a fully functional scriptUI window. If I export the script as binary, the window appears suddenly then close. Usually, this problem is solved by #targetengine session But this line does exists in the script. So it seems that the matter rea