Compiling pl/sql

I think this area needs to be improved.
I open an sql worksheet and run the following :
create or replace package my_test_pkg
as
v_test number := t est;
end;
I get a reponse saying :
package my_test_pkg compiled.
The compiler erros should be show in the compiler log or on the sql worksheet window.

It has already been mentioned in this forum and has been logged that the tool does not report "with errors".
-kris

Similar Messages

  • Code runs correctly when compiled by SQL developer but not SQL Plus

    I have a rather large package body I need to deploy and compile ... It's big and complex (I inherited the project). Our it dept is huge and scripts are deployed by the dba team and they seem to only use sql plus. My code deploys and runs fine when compiled in sql developer. Once I compile it from SQL plus it stops working. It runs and using debug statements I can see the values are correct but it no longer inserts the data into the proper tables. I get ZERO errors or warnings when this is compiled in SQL Plus and no errors are generated from the code at run time. I've diffed the extracts of the code from the DB after each deployment and the only difference is the blank lines which SQL Plus strips out when you load the file. Has anyone run into anything remotely similar and if so how did you solve it? I've tried modifying the code to no avail, adding in comments to preserve the white space makes no difference. The thing that really kills me is that there is no error at all.

    Ok this is the problem area.... vReplyMessage is a clob. I've replaced it in this section of processing with a varchar2(32000). And now it works. I still would like to know why though. Nothing is changed when I load it though sqlplus or sql developer but this line " update swn_recip_response_t set SWN_RECIP_RESPONSE = vTextReply where notification_id = v_notification_id; " would never execute with the clob. Logging showed that the clob had the correct value though. I am puzzled.
    begin
    call_SWNPost('http://www.sendwordnow.com/usps/getNotificationResults',vMessageText, vReplyMessage, v_status_code, v_status_phrase, '');
    exception
    when others then
    raise eJavaException;
    end;
    vTextReply := dbms_lob.substr( vReplyMessage, 32000, 1 );
    if (vDebug) then
    update PEMS_PROD_2.SWN_POST_LOG set response = 'notif_id == '|| v_notification_id || 'status code == '|| v_status_code|| ' '||vTextReply where log_pk = vLogPK;
    commit;
    end if;
    IF v_status_code = 200 then
    v_has_error := 'N';
    ELSE
    v_has_error := 'Y';
    END IF;
    -- we handle all exceptions below in case something goes wrong here.
    -- this area can die silently.
    vTextReply := replace(vTextReply,'<getNotificationResultsResponse xmlns="http://www.sendwordnow.com/usps">', '<getNotificationResultsResponse xmlns:xyz="http://www.sendwordnow.com/usps">');
    begin
    insert into swn_recip_response_t(notification_id) values (v_notification_id);
    exception
    when others then
    if (vDebug) then
    err_num := SQLCODE;
    err_msg := SUBSTR(SQLERRM, 1, 100);
    insert into PEMS_PROD_2.SWN_POST_LOG (LOG_PK, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
    'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
    commit;
    else
    null;
    end if;
    end;
    commit;
    begin
    update swn_recip_response_t
    set SWN_RECIP_RESPONSE = vTextReply
    where notification_id = v_notification_id;
    exception
    when others then
    if (vDebug) then
    err_num := SQLCODE;
    err_msg := SUBSTR(SQLERRM, 1, 100);
    insert into PEMS_PROD_2.SWN_POST_LOG (log_pk, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
    'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
    commit;
    else
    null;
    end if;
    end;
    commit;
    -- parse through the XML document and update the notification and recipient records
    -- parse the clob into an xml dom object
    begin
    vReplyMessage := vTextReply;
    ...

  • Native Compiled PL/SQL - Missing ORAPLS9.LIB (9i Release 2)

    In configuring the Natively Compiled PL/SQL feature of Oracle 9i, the library file ORAPLS9.LIB file can't be found. I tried generating it with:
    LIB /DEF:ORAPLS9.DLL
    but got the following warnings which didn't quite look right, and the resultant orapls9.lib file is rather small and doesn't work (unresolved externals).
    Is the ORAPLS9.LIB file supposed to be installed with 9i Release 2 for Windows 2000, or am I generating it incorrectly?
    BTW, the snpc_makefile.mk file is installed with 9i Release 2 for Windows, but not with 9i Release 1 for Windows.
    Thanks,
    Kevin Runner
    [email protected]
    Runner Technologies, Inc.
    561-395-9322
    OUTPUT
    E:\oracle\ora92\bin>lib /def:orapls9.dll
    Microsoft (R) Library Manager Version 6.00.8447
    Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
    LIB : warning LNK4068: /MACHINE not specified; defaulting to IX86
    orapls9.dll : warning LNK4017: MZI statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: $ statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: &&`j statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: -? statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: &E&#9658; statement not supported for the target platform; ignored
    orapls9.dll : warning LNK4017: -jF&#9668;oC&#9830;&#9829;-^kC&#9830;[os]+IIIIIIIIIIIUo8b8&#8593;oM6SVoG7 Wu&#9827;o~Hd6weI statement not supported for the target platfo
    rm; ignored
    orapls9.dll : warning LNK4017: jK&#9668;[]IIIIIIIIUo8So]&#9792;VWoC&#9830;o&#8252;o+-?&#9829;t statement not supported for the target platform; ignored
    Creating library orapls9.lib and object orapls9.exp

    Have you managed to resolve this problem?
    I'm having exactly the same experience (it's very frustrating, as I'm trying to run a benchmark at the moment).
    Hope to hear.
    Regards,
    T.
    Message was edited by:
    terenceo

  • Native Compiled PL/SQL on WindowsXP (Visual Studio)

    Has anyone tried to native compile PL/SQL packages on Windows XP using Visual Studio?
    Please give me your values for PLSQL* initialization parameters and a makefile that works.
    /Hakan

    Hi,
    Sorry to bump this thread, but I would like to validate something.
    Is it possible, or does it make sens, to have a database that has both native and interpreted?
    Our PLSQL_CODE_TYPE is set to interpreted but everthing else is configured for native.
    When i do the bellow query:
    select type, plsql_code_type, count(*)
    from dba_plsql_object_settings
    where plsql_code_type is not null
    group by type, plsql_code_type
    order by type, plsql_code_type
    We have bunch of functions in native/interpreted, same thing for package, package body, procedure, trigger, type, type body.
    Thank you,
    Felix

  • Error while compiling pl/sql programm

    Hi,
    I am new to oracle, i am writing a procedure which return userId checking the userlogin table, but when i compile i am getting some wierd error, if any help to solve or tell me why this type error is happening, will be really helpfull.
    thanks in advance
    vijay
    here is the procedure
    create or replace procedure CheckLogin (
    name in varchar2,
    passwd in varchar2,
    checkPasswd in number,
    userId out number
    is
    count number;
    userId number;
    inactiveStatus number;
    pswd varchar2(100);
    userId number;
    begin
    select count(*) into count from OrgUsers where login = name;
    if (count = 0) then
    raise NO_USER_ERROR;
    endif;
    if ( count > 1) then
    raise MORE_THAN_ONE_ERROR;
    endif;
    if (checkPasswd = 1) then
    select password into pswd from OrgUsers where login = name;
    if (passwd != pswd) then
    raise PASSWD_ERROR;
    endif;
    endif;
    select CheckLogin.userId into userId from OrgUsers where login = name;
    return (userId);
    exception
    when NO_USER_ERROR THEN
    RAISE_APPLICATION_ERROR(-20101, 'No user with the given name');
    when MORE_THAN_ONE_ERROR then
    RAISE_APPLICATION_ERROR(-20101, 'More than one user');
    when passwd_error then
    RAISE_APPLICATION_ERROR( -20101, "Password mismatch", true );
    end;
    Error message
    LINE/COL ERROR
    33/1 PLS-00103: Encountered the symbol "EXCEPTION" when expecting one
    of the following:
    begin declare else elsif end exit for goto if loop mod null
    pragma raise return select update while <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall
    <a single-quoted SQL string>
    41/0 PLS-00103: Encountered the symbol "end-of-file" when expecting
    one of the following:
    LINE/COL ERROR
    begin function package pragma procedure form

    You have a number of errors in your procedure:
    1) ENDIF should be END IF
    2) Local variables with the same name as parameters
    3) Reserverd word as variable (count)
    4) User exceptions not declared (no_user_error, etc.)
    I would suggest simplifying this as:
    create or replace procedure CheckLogin
      p_login         in  orgusers.login%type,
      p_password      in  orgusers.password%type,
      p_checkpassword in  pls_integer,
      p_userid        out orgusers.userid%type
    is
      v_password        orguser.password%type;
      e_password_error  exception;
    begin
      select password, userid
        into v_password, p_userid
        from OrgUsers
       where login = p_login;
      if     (p_checkpassword = 1)
         and (p_password <> v_password) then
        raise e_password_error;
      end if;
    exception
      when no_data_found then
        raise_application_error(-20101, 'No user with the given name');
      when too_many_rows then
        raise_application_error(-20102, 'More than one user');
      when e_password_error_error then
        raise_application_error(-20103, 'Password mismatch', true );
    end;
    /

  • Problem compiling PL/SQL code

    I am having problmes compiling the following piece of pl/sql
    code:
    declare
    v_servicekey services.servicekey%type;
    v_tmodelkey tmodels.tmodelkey%type;
    l_bindingid bindingtemplates.bindingid%type;
    i_rowlimit number(28);
    begin
    select bindingid
    into l_bindingid
    from
    (select b.bindingid as bindingid,
    b.bindingkey,
    nvl(b.accesspointurltype,''),
    nvl(b.accesspointurl,''),
    nvl(b.hostingredirector,''),
    b.updated
    from bindingtemplates b, services s
    where s.serviceid=b.serviceid
    and s.servicekey=v_servicekey
    and (b.bindingid in (select i.bindingid
    from instances
    i,tmodels t
    where
    t.tmodelid=i.tmodelid
    and
    t.tmodelkey=v_tmodelkey)
    or (b.hostingredirector is not
    null
    and b.hostingredirector in
    (select bindingkey
    from bindingtemplates
    where bindingid in (select i.bindingid
    from instances i,tmodels t
    where t.tmodelid = i.tmodelid
    and t.tmodelkey = v_tmodelkey))))
    order by b.updated)
    where rownum <= i_rowlimit;
    end;
    I get the compilation error
    ERROR at line 30:
    ORA-06550: line 30, column 27:
    PLS-00103: Encountered the symbol "ORDER" when expecting one of
    the following:
    ) * & = - + < / > in mod not rem with an exponent (**)
    <> or != or ~= >= <= <> and or like between group having
    intersect minus start union where connect is null is not ||
    is dangling year DAY_
    The symbol ")" was substituted for "ORDER" to continue.
    ORA-06550: line 30, column 45:
    PLS-00103: Encountered the symbol ")" when expecting one of the
    following:
    . ( , * @ % & - + ; / for mod rem an exponent (**) asc desc
    ||
    Obviously there is only one SQL and it is complaining about the
    ORDER BY clause. Please ignore the values for the host variables.
    The same SQL when run from the SQL prompt with values
    substituted for the host variables runs perfectly well. Am I
    missing something or is there a catch with Oracle PL/SQL.
    Please enlighten.
    Thanks

    see
    http://forums.oracle.com/forums/message.jsp?id=500260
    I want to know that if there is any PL/SQL commad for compiling the code?
    My problem is, I am working in an environment where we are using a Database tool named TOAD of QUEST Software. Every body can look into the code. I just want to hide this code from others. A Quick reply in this regard will be really very helpful.

  • Connection Reset when compiling PL/SQL Package

    Recently a strange issue appeared on my office PC. When I try To compile a PL/SQL package on specific Oracle instance I get an error message:
    Error: Io exception: Connection reset by peer: socket write error
    And the connection is reset. I even cannot reconnect to database schema. To open connection again I have to restart SQL Developer. In spite of this issue I can execute SELECT queries in SQL worksheet and view data in tables. Error message appears only when compiling packages in any schema on database instance in our local network and only on my PC. Other office PCs works fine without any errors. I am able to compile packages on remote database from my PC.
    Same error message shows up in different SQL Developer versions and also in JDeveloper. SQL Developer restart, Windows restart, database instance restart doesn't help.
    Used software:
    SQL Developer versions: 1.2.1 and 1.1
    JDeveloper version: 10.1.3.2
    Oracle Database on local network: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit
    Remote Oracle Database: Oracle Database 10g Release 10.2.0.3.0 - Production
    OS: Windows XP Pro SP2
    Thanks,
    Raymond

    I am trying to convert the values in a selected
    column into 1 and 0 so that I can display all 1s in
    one column, all 0s in another. I am doing this in a
    PL/SQL package. However ORACLE compiler does not
    like the CASE construct.
    Does anyone know how to group values in a column into
    several new columns. If CASE WHEN construct is not
    doable in PL/SQL, what alternatives are there?
    Thanks.
    CURSOR v_Cursor IS
    SELECT A.D_CODE, A.M_CODE, TEST_START ,
    , C.C_NAME,C.P_ID,
    SUM(CASE WHEN MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 >
    40 AND MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 <85 ANDB.B_CODE IN '11.1','222.2','272.4') THEN 1 ELSE 0
    END) QUALIFIEDUse the Decode function. This has been around in oracle SQL for ages and works like a case construct.
    You would do something like
    select ...
    sum( decode (MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 >
    40 AND MONTHS_BETWEEN(SYSDATE, D.P_DOB)/12 <85 AND
    B.B_CODE IN ('11.1','222.2','272.4') 1,0 )

  • Compile PL/SQL with JDEV 11g TP4 - Compile button missing ?

    Hi
    I have been working through the database development with Jdeveloper tutorial:
    http://www.oracle.com/technology/obe/obe11jdev/11/db_dev/obe_%20databasedevmt.htm
    this, as name suggests, discusses db development with jdev 11g TP4.
    However I seem to have an issue with the section named 'Creating and Debugging PL/SQL Objects in the Database'.
    In section 9 of 'creating a pl/sql package' the tutorial talks about a compile for debug button on the code editor. This essentially compiles the package against the DB, however in my Jdev, this button is does not exist. Is this just because this is only a tech preview version or is there some further config I need to do?
    Versions are..
    OS: Vista SP1
    JDEV: 11.1.1.0.0
    DB: 10.2.0.1.0
    Thanks in advance
    Will

    hi Will
    Maybe this is a beter forum for your question:
    "JDeveloper and OC4J 11g Technology Preview"
    JDeveloper and OC4J 11g Technology Preview
    success
    Jan Vervecken

  • Plsql_optimize_level = 3 and native compilation in SQL Developer?

    SQL Developer: Version 3.1.06 (Build MAIN-06.82)
    Oracle: 11gR2
    OS: Ubuntu 10.10
    Whenever I compile a PL/SQL unit in SQL Developer (using 'Compile' button) it is compiled with the following settings:
    PLSQL_OPTIMIZE_LEVEL = 2
    PLSQL_CODE_TYPE = 'INTERPRETED'
    However, if I issue the following commands in an SQL Worksheet:
    ALTER SESSION SET plsql_optimize_level = 3;
    ALTER PACKAGE PACKAGE_NAME COMPILE PLSQL_CODE_TYPE = NATIVE;
    the query SELECT PLSQL_OPTIMIZE_LEVEL, PLSQL_CODE_TYPE FROM ALL_PLSQL_OBJECT_SETTINGS WHERE NAME = 'PACKAGE_NAME'; resullts in
    PLSQL_OPTIMIZE_LEVEL     PLSQL_CODE_TYPE
    3     NATIVE
    3     NATIVE
    Is it possible to make SQL Developer to use these settings by default?
    P.S. It seems that Tools > Preferences > Database > PL/SQL Compiler menu section is missing the options I need (Optimization level drop-down menu have numbers 0-2, but not 3). Are there any plans to support these features in the future releases?
    Edited by: Ravshan Abbasov on Feb 6, 2012 6:28 AM

    Hi Ravshan,
    I thought a workaround would be to create a sql script like the following:
    alter session set plsql_code_type=native;
    alter session set plsql_optimize_level=3;  then point to it in the setting for Tools|Preferences|Database|Filename for connection startup script. That doesn't work however, as the other preference setting for plsql_optimize_level overrides the session value of 3 during compilation from the UI.
    According to Oracle documentation, level 3 was added for Oracle 11g. Prior to that, the same effect could be achieved by level 2 in conjunction with the INLINE pragma in the PL/SQL code.
    You might want to make a feature request for this on the SQL Developer Exchange so the community can vote and comment.
    Regards,
    Gary
    SQL Developer Team
    Edited by: Gary Graham on Feb 6, 2012 2:32 PM
    And, of course, Compile for Debug does not work with the 'native' setting.

  • Warning: Type created with compilation errors. sql : oracle 11gr2

    I'm trying to create a supertype customer service and subtype agent and supervisor, so they can inherent values however when I try to run this in oracle sql: a message comes up
    Warning: Type created with compilation errors.
    What is wrong with the code below?
    Create or replace type customer_s_type as object ( csID number, csName varchar(15), csType number ) NOT FINAL;  Create or replace type supervisor_type UNDER customer_s_type ( title varchar (10) );  Create or replace type agent_type UNDER customer_s_type (title varchar (10));  Create table supervisor of supervisor_type ( CONSTRAINT supervisor_PK PRIMARY KEY (csID));  Create table agent of agent_type (CONSTRAINT agent_PK PRIMARY KEY (csID));  create table customer_service( csID number(10), csType number(10), constraint supervisor_pk primary key(csID) );

    Wile creating TYPE you need to terminate with a back slash (/) semi colon does not work.
    Try like this
    create or replace type customer_s_type as object ( csid number, csname varchar(15), cstype number ) not final
    create or replace type supervisor_type under customer_s_type ( title varchar (10) )
    create or replace type agent_type under customer_s_type (title varchar (10))

  • Exiting from sqlplus when there is any errors while compiling pl/sql progra

    I am connecting to sqlplus from unix and I am executing a pl/sql script . Now if I get some error while compiling a procedure, package, function or any sql statement I want to exit sqlplus.
    whenever sqlerror works only for sql statements but not for plsql
    I dont want to query user_errors table and then throw some exception depending on the same .
    Is there any command available or any easier way to solve this problem ?

    Those errors we get only when there is conflict in same etc.
    Now consider the example here
    sample.sql
    whenever sqlerror exit failure ;
    declare
            s1 long;
    begin
            s1 := 'create or replace procedure proc1 as '||
              'declare '||
              'begin '||
                  'end; '||
              'end;';
            execute immediate s1;
    end;
    select 1 from dual;When I run the script
    SQL> @sample.sql
    ERROR:
    ORA-24344: success with compilation error
    ORA-06512: at line 9
    Warning: PL/SQL compilation errors.
             1
             1Actually I want to get out before it executes select means once it throws error in pl/sql.

  • Problems compiling PL/SQL code

    I am having problmes compiling the following piece of pl/sql
    code:
    declare
    v_servicekey services.servicekey%type;
    v_tmodelkey tmodels.tmodelkey%type;
    l_bindingid bindingtemplates.bindingid%type;
    i_rowlimit number(28);
    begin
    select bindingid
    into l_bindingid
    from
    (select b.bindingid as bindingid,
    b.bindingkey,
    nvl(b.accesspointurltype,''),
    nvl(b.accesspointurl,''),
    nvl(b.hostingredirector,''),
    b.updated
    from bindingtemplates b, services s
    where s.serviceid=b.serviceid
    and s.servicekey=v_servicekey
    and (b.bindingid in (select i.bindingid
    from instances
    i,tmodels t
    where
    t.tmodelid=i.tmodelid
    and
    t.tmodelkey=v_tmodelkey)
    or (b.hostingredirector is not
    null
    and b.hostingredirector in
    (select bindingkey
    from bindingtemplates
    where bindingid in (select i.bindingid
    from instances i,tmodels t
    where t.tmodelid = i.tmodelid
    and t.tmodelkey = v_tmodelkey))))
    order by b.updated)
    where rownum <= i_rowlimit;
    end;
    I get the compilation error
    ERROR at line 30:
    ORA-06550: line 30, column 27:
    PLS-00103: Encountered the symbol "ORDER" when expecting one of
    the following:
    ) * & = - + < / > in mod not rem with an exponent (**)
    <> or != or ~= >= <= <> and or like between group having
    intersect minus start union where connect is null is not ||
    is dangling year DAY_
    The symbol ")" was substituted for "ORDER" to continue.
    ORA-06550: line 30, column 45:
    PLS-00103: Encountered the symbol ")" when expecting one of the
    following:
    . ( , * @ % & - + ; / for mod rem an exponent (**) asc desc
    ||
    Obviously there is only one SQL and it is complaining about the
    ORDER BY clause. Please ignore the values for the host variables.
    The same SQL when run from the SQL prompt with values
    substituted for the host variables runs perfectly well. Am I
    missing something or is there a catch with Oracle PL/SQL.
    Please enlighten.
    Thanks

    "Order by" can not be used in the subqueries.
    Order by should always be specified in the outer query only.
    rajkiran

  • Script Task Builds Successfully But Still Has Compile Error (SQL 2012)

    This is repost in a way but the problem has not gone away and I really need to find a solution.
    I have some script from SSIS 2008 that uses the ReportExecution2005
    web service to execute SSRS reports and save the results to Excel. There were some initial problems with confusion between Web Service Reference (legacy?) and Service Reference (WCF) but I think that I have that sorted out
    now.
    The remaining problem is that, while the VB script (which I have pasted in from a working SSIS 2008 Script Task) builds/complies without error, I get a compile error when I close the Script Task and it has the dreaded "Red X" in the Control
    Flow. If I attempt to run the package I get a message box saying that there is a compile error.
    How can I identify the problem and fix the error? The script itself has no errors in SSIS 2008.
    R Campbell

    This is the code by the way (see below) as pasted into the Main sub.
    I have added
    http://localhost/reportserver/reportexecution2005.asmx as a Web Service
    Reference (under the  "Advanced" button) not just a Service Reference (WCF).
    I can build the code without error but I get an error, saying that there is compile error, when I close the Script Task.
    ReportExecutionService definitely shows up in Object Explorer, not the
    WCF "equivalent" of ReportExecutionServiceSoapClient.
    I have always had the impression, that when you close a Script Task, a compiler kicks in to auto-generate some internal script. Could it be (as seems likely) that this compiler is picking up errors that "Build" doesn't (when the script is open)?
    I think that there was once an explicit Compile rather than just Build option in the Script editing environment but I can't find it in SQL 2012 Database Tools (nee BIDS).
    Dim objRSExec As New localhost.ReportExecutionService
    Dim objParam0 As New localhost.ParameterValue
    Dim objParam1 As New localhost.ParameterValue
    Dim objParam2 As New localhost.ParameterValu
    Dim objParam3 As New localhost.ParameterValue
    Dim objParam4 As New localhost.ParameterValue
    Dim objParam5 As New localhost.ParameterValue
    Dim objParam6 As New localhost.ParameterValue
    Dim objParams() As localhost.ParameterValue
    Dim objResult() As Byte
    Dim objStream As FileStream
    Dim FileType As String
    Dim FileExtension As String
    Dim FilePath As String
    Dim NumberOfParameters As Integer
    Dim ReportName As String
    Dim TaskSuccess As Boolean = True
    FileType = Dts.Variables("FileType").Value.ToString()
    FileExtension = Dts.Variables("FileExtension").Value.ToString()
    FilePath = Dts.Variables("FilePathNameExt").Value.ToString()
    ReportName = Dts.Variables("ReportPathName").Value.ToString()
    NumberOfParameters = CInt(Dts.Variables("NumberOfParameters").Value) - 1
    ReDim objParams(NumberOfParameters)
    If NumberOfParameters >= 0 Then
    objParam0.Name = Dts.Variables("P0Name").Value.ToString()
    objParam0.Value = Dts.Variables("P0Value").Value.ToString()
    objParams(0) = objParam0
    End If
    If NumberOfParameters >= 1 Then
    objParam1.Name = Dts.Variables("P1Name").Value.ToString()
    objParam1.Value = Dts.Variables("P1Value").Value.ToString()
    objParams(1) = objParam1
    End If
    If NumberOfParameters >= 2 Then
    objParam2.Name = Dts.Variables("P2Name").Value.ToString()
    objParam2.Value = Dts.Variables("P2Value").Value.ToString()
    objParams(2) = objParam2
    End If
    If NumberOfParameters >= 3 Then
    objParam3.Name = Dts.Variables("P3Name").Value.ToString()
    objParam3.Value = Dts.Variables("P3Value").Value.ToString()
    objParams(3) = objParam3
    End If
    If NumberOfParameters >= 4 Then
    objParam4.Name = Dts.Variables("P4Name").Value.ToString()
    objParam4.Value = Dts.Variables("P4Value").Value.ToString()
    objParams(4) = objParam4
    End If
    If NumberOfParameters >= 5 Then
    objParam5.Name = Dts.Variables("P5Name").Value.ToString()
    objParam5.Value = Dts.Variables("P5Value").Value.ToString()
    objParams(5) = objParam5
    End If
    If NumberOfParameters >= 6 Then
    objParam6.Name = Dts.Variables("P6Name").Value.ToString()
    objParam6.Value = Dts.Variables("P6Value").Value.ToString()
    objParams(6) = objParam6
    End If
    Try
    With objRSExec
    .Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
    .Url = "http://localhost/reportserver/reportexecution2005.asmx"
    .LoadReport(ReportName, Nothing)
    .SetExecutionParameters(objParams, "en-us")
    objResult = .Render(FileType, Nothing, FileExtension, Nothing, Nothing, Nothing, Nothing)
    End With
    objStream = File.Create(FilePath, objResult.Length)
    With objStream
    .Write(objResult, 0, objResult.Length)
    .Close()
    End With
    Catch e As Exception
    Dts.Log("ERROR - RSExec - " & e.Message.ToString(), 100, Nothing)
    TaskSuccess = False
    End Try
    If TaskSuccess Then
    Dts.TaskResult = ScriptResults.Success
    Else
    Dts.TaskResult = ScriptResults.Failure
    End If
    R Campbell

  • Error when compiling pl/sql in JDEV 11g

    db version: 9.2.0.6.0
    JDEV version : 11.1.1.0.2
    Whenever I click compile on a pl/sql package body from Jdev I get the following error:
    An error was encountered performing the requested operation:
    ORA-904: "ATTRIBUTE": invalid identifier
    00904.00000 - "%s: invalid identifier"
    *cause
    *action
    vendor code 904
    even though the package itself compiles successfully.. any clues why this keeps happening, are the 2 versions not compatible?
    Will

    does any one else get this when doing pl/sql dev on JDEV 11g?

  • Weired behaviour while we compile PL/SQL package

    Hi All,
    We have one package where we have declared few constants those we are using all over our application code. By mistake, one of the developer declared one constant twice, we didn't notice it until today while chasing down a bug...
    I was under impression that we can not declare same variable or constants twice in the same package/procedure/block. But surprisingly, if we are not using the same variable in that block, (We defined it global packaged constant) we are not getting compilation error or warning. Does anyone know anything about this.
    Oracle Configuration:
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.1.0 - ProductionThanks in advance.
    Thanks,
    Dharmesh Patel

    I would again point out that I do not see the results as you describe. see the output from 9.2.0.3 below. Both times it gives me the same result.
    As shown above by James, it throws out the correct error under 10G. But as far as I see, it seems to be consistent under Oracle9i release 9.2.0.3 and 9.2.0.5.
    I think it might be the time for your database to be upgraded to at least 9.2.0.3 release.
    SQL> CREATE OR REPLACE PACKAGE P00_Constants AS
      2      SubType201 CONSTANT VARCHAR2(3) := '201';
      3      SubType202 CONSTANT VARCHAR2(3) := '202';
      4      SubType202A CONSTANT VARCHAR2(4) := '202A';
      5      SubType202P CONSTANT VARCHAR2(4) := '202P';
      6      SubType202I CONSTANT VARCHAR2(4) := '202I';
      7      SubType203 CONSTANT VARCHAR2(3) := '203';
      8      SubType201 CONSTANT VARCHAR2(3) := '204';
      9
    10      Yesflag CONSTANT VARCHAR2(3) := 'YES';
    11      ------------------------------------------------------
    12
    13      --- <summary>This function returns value of YES</summary>
    14      --- <param name="none"></param>
    15      --- <exception cref="none"> </exception>
    16      FUNCTION GetyesFlag RETURN VARCHAR2;
    17      PRAGMA RESTRICT_REFERENCES(GetYesFlag,
    18                                 WNDS,
    19                                 WNPS);
    20  END P00_Constants;
    21  /
    Package created.
    SQL> SHOW ERRORS
    No errors.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE BODY P00_Constants AS
      2      ---function getYesFlag
      3      FUNCTION GetYesFlag RETURN VARCHAR2 IS
      4      BEGIN
      5          RETURN YesFlag;
      6      END;
      7  END P00_Constants;
      8  /
    Package body created.
    SQL> SHOW ERRORS
    No errors.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE Test_Constant IS
      2      -- Author  : DPATEL
      3      -- Created : 10/12/2004 8:20:12 AM
      4      -- Purpose : To test the duplicate constants defined in P00_Constants package
      5      -- Public type declarations
      6      FUNCTION getSubType RETURN VARCHAR2;
      7  END Test_Constant;
      8  /
    Package created.
    SQL> SHOW ERRORS
    No errors.
    SQL>
    SQL> CREATE OR REPLACE PACKAGE BODY Test_Constant IS
      2      FUNCTION getSubType RETURN VARCHAR2 IS
      3          mySubType VARCHAR2(10);
      4      BEGIN
      5          mySubType := P00_Constants.SubType201;
      6          RETURN(mySubType);
      7      END;
      8  END Test_Constant;
      9  /
    Package body created.
    SQL> SHOW ERRORS
    No errors.
    SQL>
    SQL> -- Test Script
    SQL> SET SERVEROUTPUT ON
    SQL> BEGIN
      2      Dbms_OutPut.Put_Line('Result is: ' || test_constant.getsubtype);
      3  END;
      4  /
    Result is: 204
    PL/SQL procedure successfully completed.
    SQL> ALTER PACKAGE P00_Constants COMPILE
      2  /
    Package altered.
    SQL> SET SERVEROUTPUT ON
    SQL> BEGIN
      2      Dbms_OutPut.Put_Line('Result is: ' || test_constant.getsubtype);
      3  END;
      4  /
    Result is: 204
    PL/SQL procedure successfully completed.
    SQL>
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    SQL>

Maybe you are looking for