PLS-00201 error occurs when batching a stored procedure in SQL*Plus

I have a batch file to run a stored procedure and spool the results to file. When I enter the commands manually in sql*plus the output works fine and my results are spooled to the output file. But when I run the same commands in the batched script I get an error.
Any ideas?
Stored Procedure:
create or replace procedure MMP( p_cursor in out SYS_REFCURSOR)
as
begin
open p_cursorfor select name, id from table;
end;
batch file 1:
sqlplus -S user/pw@REPORTDV @sp_output_spooled.sql
script file sp_output_spooled.sql
Pasting these commands directly to the SQL*Plus command prompt spools the result set to file as expected.
set colsep '|'
set echo off
set feedback off
set termout off
set heading off
set linesize 9000
set pagesize 0
set trimspool on
set headsep off
spool output.TXT
var rc refcursor
execute MMP(:rc)
print rc
spool off
exit
The errors printed to output.TXT file after the batch is run and error occurs:
BEGIN MMP(:rc); END;
ERROR at line 1:
ORA-06550: line 1, column 8:
PLS-00201: identifier 'MMP' must be declared
ORA-06550: line 1, column 8:
PL/SQL: Statement ignored
ERROR:
ORA-24338: statement handle not executed
SP2-0625: Error printing variable "rc"

Hi,
Your code worked fine for me.
Is MMP procedure owned by the same user that is running the batch file or does it have proper privileges and synonym?
vr,
Sudhakar

Similar Messages

  • Testing stored procedure using sql plus

    I'm attempt to create and test a stored procedure in sql plus.
    I enter:
    create procedure sp_getconfiguration(mygroup in char, myparameter in char, myvalue in out char) as begin select configvalue into myvalue from tblconfiguration where configgroup = mygroup and configparameter = myparameter; end;/
    I get a procedure created. response by when I type:
    variable myval char
    call sp_getconfiguration('Language','Enabled', myval);
    I get the following error:
    error at line 1:
    ora-06576: not a valid function or procedure name
    I can go into DBA studio and see the procedure listed and can compile it and it says "valid". I have tried granting execute permission to public and trying it again under sql plus and nothing seems to help.
    I'm also attempting to run this same procedure from VB and get an invalid column name error from there.
    Thanks for any help in advance.
    Lee

    Thanks for all your help. What I actually called product support and they helped me solve it. But what I found out is that if using oracle 8.1.# you have to invoke the stored procedure without the "call " in front of the procedure name. For instance.
    sp_getconfiguation()
    In version 9.# it appears that you use the call in front of the procedure. Dah! So if anyone else is having this problem. That is the solution. Thanks anyway.

  • How to execute the parametered stored procedure in sql *plus ?

    how to execute the parametered stored procedure in sql *plus ?
    my storedprocedure format
    CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE
    (empDOB out date, empEmpName out varchar2)
    thanks & regards
    mk_mur

    Oh, sorry... making many reading-too-fast mistakes today...
    You can't declare date variables in SQL*Plus (seel help var), but you can cast to varchar2:
    TEST> CREATE OR REPLACE PROCEDURE SMS_SELECTMPLOYEE (empDOB out date, empEmpName out varchar2) IS
      2  d date := sysdate;
      3  e varchar2(10) := 'bob';
      4  begin
      5  empdob := d;
      6  empempname := e;
      7  end;
      8  /
    Procedure created.
    TEST> var d varchar2(30)
    TEST> var n varchar2(30)
    TEST> call  SMS_SELECTMPLOYEE(:d,:n);
    Call completed.
    TEST> print d n
    D
    11/07/06
    N
    bobYoann.

  • How to view  a stored procedure from sql plus

    Can anyone please tell what is the command for viewing the content of the stored procedure from sql plus ?
    Thanks

    Hi,
    I use this simple script to retrieve.......
    EDTRAD@T_E_S_9-->l
    1 select text from all_source where name = 'GET_MAN' -- proc name here
    2* order by line asc
    EDTRAD@T_E_S_9-->/
    TEXT
    FUNCTION get_man (in_man SSBOSS.CLNTWORK.manager%type)
    RETURN varchar2 IS
    CURSOR get_man(in_man SSBOSS.CLNTWORK.manager%type) IS
    SELECT name
    FROM ssboss.clntwork
    WHERE agency = 'TM'
    AND manager = in_man
    AND manager is not null
    AND manager != '**OB**';
    v_man SSBOSS.CLNTWORK.name%type := null;
    BEGIN
    OPEN get_man(in_man);
    FETCH get_man INTO v_man;
    IF get_man%notfound THEN
    v_man := 'Manager Not Found !';
    RETURN (v_man);
    CLOSE get_man;
    END IF;
    RETURN (v_man);
    CLOSE get_man;
    END;
    21 rows selected.
    EDTRAD@T_E_S_9-->

  • Getting Error message when execute Netezza Stored Procedure calling in ODI

    Hi,
    I need help to resolve this issue,
    I'm trying to execute a Netezza stored procedure passing three parameters and It getting error message .
    code:import java.sql as sql
    import java.lang as lang
    import java.sql.Types as types
    MyCon = snpRef.getJDBCConnection("SRC")
    def CALL_NZ_SP():
         try: p_log_id = 22
    p_step_number = 2
              p_drive_id= 3455
    myStmt = MyCon.prepareStatement("CALL SP_NAME(?,?,?)");
              myStmt.setInt(1, p_log_id);
              myStmt.setInt(2, p_step_number);
              myStmt.setInt(3, p_drive_id);
              resultSet=myStmt.executeQuery();
              resultSet.next();
              sp_return=resultSet.getInt(1);
              if sp_return !=0:
              raise 'fail';
         finally:
              pass
    Please let me know is this the right code or need any code updatation.
    I appreciate ur help in this regard
    Thanks
    brk

    Hi Gowsiya,
    Maybe the WCF forum would be better for this issue, you know that this forum is to discuss the VS IDE.
    WCF forum link:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wcf
    Thanks for your understanding.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Issue with new line when manually executing a procedure in SQL*Plus

    The below procedure works fine in SQL*Plus when the entire EXEC <procedure_name> (parameter1, parameter2, ..); is put in a single line
    SQL > exec cust_admin_util.create_schema (P_SCHEMA_NAME => 'SCOTT_01', P_SCHEMA_PWD => 'scott123', P_TBS_NAME => 'TRAG_TBS', p_temptbs_name => 'TEMP' );
    PL/SQL procedure successfully completed.I wanted to execute the same procedure with more readability. So, I put each parameters on a separate line and try to execute. But it is erroring out.
    SQL > exec cust_admin_util.create_schema
    P_SCHEMA_NAME => 'TESTUSR_01',
    P_SCHEMA_PWD => 'scott123',
    P_TBS_NAME => 'TRAG_TBS',
    p_temptbs_name => 'TEMP'
    );BEGIN cust_admin_util.create_schema; END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'CREATE_SCHEMA'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    SQL >   2    3    4    5    6    7
    P_SCHEMA_NAME => 'TESTUSR_01',
    ERROR at line 2:
    ORA-00928: missing SELECT keywordAny workaround for this ?

    Hi Tom,
    At SQL Plus,
    You have to use the -(Hyphen) as the concatenation Operator.
    For Instance,
    SQL>  exec host_command( -
    p_command => 'dir');
    PL/SQL procedure successfully completed.
    Thanks,
    Shankar                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How execute this stored procedure from SQL PLUS???

    Hello folks....
    Help me please...
    I have this procedure....
    CREATE OR REPLACE PROCEDURE TEST(COD OUT VARCHAR2, NUM OUT
    VARCHAR2, ID OUT VARCHAR2)
    AS
    BEGIN
    END;
    SO, I4D LIKE TO EXECUTE IT FROM SQL PLUS::
    BUT, I DONT KNOW HOW TO DO..PLEASE SEND ME A SAMPLE..
    THANK U

    Thank u man!!!
    look, my error before was :
    SQL> set serveroutput on
    SQL> declare
    SQL> cod varchar2(100);
    SQL> num varchar2(100);
    SQL> id varchar2(100);
    SQL> begin
    SQL> TEST( cod, num, id );
    SQL> EXEC DBMS_OUTPUT.put_line( cod || ' ' || num || ' ' ||
    id );
    SQL> end;
    SQL> /
    i put the EXEC....
    thank u!!!

  • An error occurred when processing the spool request.  (Possibly due to memory problems)

    Hi SAP,
    My backgroud job is failing with log as shown below
    Job started
    Step 001 started (program ZMRS0065, variant SUS
    Step 002 started (program ZDRS0090, variant SUS
    Step 003 started (program ZFRS0305, variant SUS
    Step 004 started (program ZFRS0300, variant SUS
    Access error
    Job cancelled after system exception ERROR_MESSAGE
    An error occurred when processing the spool request.  (Possibly due to memory problems)
    Kindly help out in this issue
    Regards
    Mohammed

    Hello Mohammed,
    Have you seen any error in your SM21 system log and developer trace of spool work process
    during that time?
    The maximum size when create spool is 2GB.Pls also check if you are creating a spool
    larger than it.
    Best Regards
    Jie Bai

  • Error in executing ABAP program. Error occurred when creating dataset

    hi,
    when I use LKM SAP ERP to Oracle (SQLLDR) to extract data from SAP ERP server. I execute my interface, and it's stop at extract data step.
    This is message:
    java.lang.RuntimeException: Error occured in open tool execute method...Error in executing ABAP program...Error in executing ABAP program...Error occurred when creating dataset/abc/ZODI_13001_6001_GLOBAL.txt
    I tried others path name, tried slash or backslash. This is content in code tab
    OdiSAPAbapExecute "-UPLOAD=1" "-EXECUTE=1" "-EXECUTEBASE_RKM=0" "-ZRFC_RUN_INSTALL=1" "-ABAP_PROGRAM_NAME=ZODI_13001_6001" "-HOST=10.86.87.24" "-USER=sv_hoa" "-PASSWORD=<@=snpRef.getInfo("SRC_PASS") @>" "-SAP_CLIENT=800" "-SAP_LANGUAGE=EN" "-SAP_SYSTEM_NUMBER=02" "-SAP_FUNCTION_GROUP_NAME=ZODI_FGR_13001" "-CONNECTION_POOL_NAME=SAP_ODI_ERP_POOL_10.86.87.24" "-CONNECTION_POOL_SIZE=10" "-FILE_DELIMITER=<@=""+(char)8@>" "-FILE_NAME=ZODI_13001_6001_GLOBAL.txt" "-FTP_HOST=10.86.82.108" "-FTP_USER=anh" "-FTP_PASSWORD=<@=sFtpPassword@>" "-FTP_PASSIVE_MODE=1" "-FTP_TRANSFER_TIMEOUT=100000" "-ODI_VARIABLE_NAMES=" "-ODI_VARIABLE_VALUES=" "-USER_ABAP_PARAMETER_NAMES=IV_DELIMITER,CHAR3;IV_FILENAME,CHAR255;IV_USER,CHAR35;IV_PWD,CHAR35;IV_HOST,CHAR35;IV_HASHVALUE,CHAR35;IV_PATH,CHAR35;IV_MAX_ROW_CNT,SYTABIX;IV_FETCH_BATCH_SIZE,SYTABIX;" "-USER_ABAP_PARAMETER_VALUES=<Value>" "-USER_ABAP_PARAMETER_SEPARATOR=<Value>" "-ABAP_TABLE_PARAMETERS=RETURN,BAPIRETURN;ET_FILE_RETURN,BAPIRET2" "-ABAP_EXPORT_PARAMETERS=ERRORMESSAGE;SY-MSGV1" "-LOG_FILE_NAME=C:\Users\anh\AppData\Local\Temp\SapAbapExecuteOpenTool_13001.log" "-FTP_PATH=/abc/" "-DEV_CLASS=ZODI_DEVCLASS" "-MAX_ROW_COUNT=" "-FETCH_BATCH_SIZE=100000" "-HASH_VALUE_MARKER=HVM" "-ABAP_PROGRAM_BODY=
    *Final Type declarations
    TYPES : BEGIN OF ty_final,
    Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_final.
    *Final Temp Type Declarations
    TYPES : BEGIN OF ty_final_tmp,
    Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID ,
    Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH ,
    Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH ,
    Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH ,
    Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI ,
    Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU ,
    END OF ty_final_tmp.
    *Final Target Type Declarations
    TYPES : BEGIN OF ty_final_target,
    C0_Y03HOCSINH_HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_final_target.
    * Table type for Y03HOCSINH
    TYPES : BEGIN OF ty_Y03HOCSINH,
    HOCSINH_ID TYPE
    Y03HOCSINH-HOCSINH_ID,
    MA_HOC_SINH TYPE
    Y03HOCSINH-MA_HOC_SINH,
    TEN_HOC_SINH TYPE
    Y03HOCSINH-TEN_HOC_SINH,
    GIOI_TINH TYPE
    Y03HOCSINH-GIOI_TINH,
    DIA_CHI TYPE
    Y03HOCSINH-DIA_CHI,
    GHI_CHU TYPE
    Y03HOCSINH-GHI_CHU,
    END OF ty_Y03HOCSINH.
    TYPES: BEGIN OF gs_text,
    line(843) TYPE c,
    END OF gs_text.
    *Structure Declarations
    DATA: wa_final_string TYPE string,
    wa_final TYPE ty_final,
    wa_final_target TYPE ty_final_target,
    wa_Y03HOCSINH TYPE ty_Y03HOCSINH,
    *Table Declarations
    tt_final TYPE STANDARD TABLE OF ty_final,
    tt_Y03HOCSINH TYPE STANDARD TABLE OF ty_Y03HOCSINH,
    tt_final_target TYPE STANDARD TABLE
    OF ty_final_target,
    tt_final_tmp TYPE STANDARD TABLE OF ty_final_tmp,
    tt_final_tmp1 TYPE STANDARD TABLE OF ty_final,
    gt_result TYPE STANDARD TABLE OF gs_text,
    *Variable Declarations
    lv_path TYPE string,
    lv_flag TYPE char1,
    C0_Y03HOCSINH_HOCSINH_ID TYPE
    STRING,
    C1_Y03HOCSINH_MA_HOC_SINH TYPE
    STRING,
    C2_Y03HOCSINH_TEN_HOC_SINH TYPE
    STRING,
    C3_Y03HOCSINH_GIOI_TINH TYPE
    STRING,
    C4_Y03HOCSINH_DIA_CHI TYPE
    STRING,
    C5_Y03HOCSINH_GHI_CHU TYPE
    STRING,
    wa_final_tmp TYPE ty_final_tmp,
    lv_file TYPE string,
    lv_datum TYPE sy-datum,
    lv_date TYPE char10,
    wa_result TYPE string,
    lv_delimiter type string,
    lv_cnt TYPE sytabix,
    *-Cursor Declaration
    lv_Y03HOCSINH_dbcur TYPE cursor,
    lv_tabix_frm TYPE sy-tabix.
    lv_delimiter = iv_delimiter.
    IF iv_hashvalue = 'HVM'.
    *Open/delete output file
    CONCATENATE iv_path iv_filename INTO lv_path.
    *Check for file existence, if found, delete it
    OPEN DATASET lv_path FOR INPUT
    IN TEXT MODE
    ENCODING DEFAULT.
    IF sy-subrc EQ 0.
    DELETE DATASET lv_path.
    ENDIF.
    *Open/create output file
    OPEN DATASET lv_path FOR APPENDING
    IN TEXT MODE
    ENCODING DEFAULT.
    IF sy-subrc EQ 0.
    *Batch Processing
    OPEN CURSOR WITH HOLD lv_Y03HOCSINH_dbcur FOR
    SELECT HOCSINH_ID
    MA_HOC_SINH
    TEN_HOC_SINH
    GIOI_TINH
    DIA_CHI
    GHI_CHU
    FROM Y03HOCSINH.
    DO.
    *Check for the counter, only for first batch
    *process new line is required...
    lv_cnt = lv_cnt + 1.
    REFRESH tt_Y03HOCSINH.
    FETCH NEXT CURSOR lv_Y03HOCSINH_dbcur
    APPENDING TABLE tt_Y03HOCSINH
    PACKAGE SIZE IV_FETCH_BATCH_SIZE.
    IF NOT tt_Y03HOCSINH IS INITIAL.
    ELSE.
    EXIT.
    ENDIF.
    LOOP AT tt_Y03HOCSINH INTO wa_Y03HOCSINH.
    MOVE wa_Y03HOCSINH-HOCSINH_ID
    TO wa_final_tmp-Y03HOCSINH_HOCSINH_ID.
    MOVE wa_Y03HOCSINH-MA_HOC_SINH
    TO wa_final_tmp-Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_Y03HOCSINH-TEN_HOC_SINH
    TO wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_Y03HOCSINH-GIOI_TINH
    TO wa_final_tmp-Y03HOCSINH_GIOI_TINH.
    MOVE wa_Y03HOCSINH-DIA_CHI
    TO wa_final_tmp-Y03HOCSINH_DIA_CHI.
    MOVE wa_Y03HOCSINH-GHI_CHU
    TO wa_final_tmp-Y03HOCSINH_GHI_CHU.
    APPEND wa_final_tmp TO tt_final_tmp.
    ENDLOOP.
    free : tt_Y03HOCSINH.
    LOOP AT tt_final_tmp INTO wa_final_tmp.
    MOVE wa_final_tmp-Y03HOCSINH_HOCSINH_ID
    TO wa_final_target-C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_tmp-Y03HOCSINH_MA_HOC_SINH
    TO wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_tmp-Y03HOCSINH_TEN_HOC_SINH
    TO wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_tmp-Y03HOCSINH_GIOI_TINH
    TO wa_final_target-C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_tmp-Y03HOCSINH_DIA_CHI
    TO wa_final_target-C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_tmp-Y03HOCSINH_GHI_CHU
    TO wa_final_target-C5_Y03HOCSINH_GHI_CHU.
    Append wa_final_target to tt_final_target.
    ENDLOOP.
    free : tt_final_tmp.
    Clear wa_final_target.
    IF NOT iv_max_row_cnt IS INITIAL.
    Loop at tt_final_target into
    wa_final_target TO iv_max_row_cnt.
    MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
    TO C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
    TO C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
    TO C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
    TO C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
    TO C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
    TO C5_Y03HOCSINH_GHI_CHU.
    CONCATENATE
    C0_Y03HOCSINH_HOCSINH_ID
    C1_Y03HOCSINH_MA_HOC_SINH
    C2_Y03HOCSINH_TEN_HOC_SINH
    C3_Y03HOCSINH_GIOI_TINH
    C4_Y03HOCSINH_DIA_CHI
    C5_Y03HOCSINH_GHI_CHU
    INTO wa_final_string
    SEPARATED BY lv_delimiter.
    IF sy-tabix EQ 1 AND lv_cnt EQ 1.
    CONCATENATE wa_final_string
    lv_delimiter INTO wa_final_string.
    ELSE.
    CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
    lv_delimiter INTO wa_final_string.
    ENDIF.
    APPEND wa_final_string TO gt_result.
    CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU.
    ENDLOOP.
    ELSE.
    Loop at tt_final_target into wa_final_target.
    MOVE wa_final_target-C0_Y03HOCSINH_HOCSINH_ID
    TO C0_Y03HOCSINH_HOCSINH_ID.
    MOVE wa_final_target-C1_Y03HOCSINH_MA_HOC_SINH
    TO C1_Y03HOCSINH_MA_HOC_SINH.
    MOVE wa_final_target-C2_Y03HOCSINH_TEN_HOC_SINH
    TO C2_Y03HOCSINH_TEN_HOC_SINH.
    MOVE wa_final_target-C3_Y03HOCSINH_GIOI_TINH
    TO C3_Y03HOCSINH_GIOI_TINH.
    MOVE wa_final_target-C4_Y03HOCSINH_DIA_CHI
    TO C4_Y03HOCSINH_DIA_CHI.
    MOVE wa_final_target-C5_Y03HOCSINH_GHI_CHU
    TO C5_Y03HOCSINH_GHI_CHU.
    CONCATENATE
    C0_Y03HOCSINH_HOCSINH_ID
    C1_Y03HOCSINH_MA_HOC_SINH
    C2_Y03HOCSINH_TEN_HOC_SINH
    C3_Y03HOCSINH_GIOI_TINH
    C4_Y03HOCSINH_DIA_CHI
    C5_Y03HOCSINH_GHI_CHU
    INTO wa_final_string
    SEPARATED BY lv_delimiter.
    IF sy-tabix EQ 1 AND lv_cnt EQ 1.
    CONCATENATE wa_final_string
    lv_delimiter INTO wa_final_string.
    ELSE.
    CONCATENATE '<@=""+(char)8@>' lv_delimiter wa_final_string
    lv_delimiter INTO wa_final_string.
    ENDIF.
    APPEND wa_final_string TO gt_result.
    CLEAR : C0_Y03HOCSINH_HOCSINH_ID,
    C1_Y03HOCSINH_MA_HOC_SINH,
    C2_Y03HOCSINH_TEN_HOC_SINH,
    C3_Y03HOCSINH_GIOI_TINH,
    C4_Y03HOCSINH_DIA_CHI,
    C5_Y03HOCSINH_GHI_CHU.
    ENDLOOP.
    ENDIF.
    free : tt_final_target.
    IF NOT gt_result IS INITIAL.
    CLEAR wa_result.
    LOOP AT gt_result INTO wa_result.
    TRANSFER wa_result TO lv_path.
    ENDLOOP.
    ENDIF.
    REFRESH gt_result.
    *End of main loop for batching
    ENDDO.
    *Close dataset
    CLOSE DATASET lv_path.
    CLOSE CURSOR lv_Y03HOCSINH_dbcur.
    ELSE.
    DATA: lv_mesg TYPE string.
    CLEAR et_file_return.
    et_file_return-type = 'E'.
    CONCATENATE
    'Error occurred when creating dataset' lv_path
    INTO lv_mesg.
    et_file_return-message = lv_mesg.
    Append et_file_return.
    ENDIF.
    ELSE.
    CLEAR et_file_return.
    et_file_return-type = 'E'.
    et_file_return-message =
    'Installed ABAP program does not match interface definition'.
    APPEND et_file_return.
    ENDIF.
    Thanks for help

    r u able to figure it out..........i got the same error .......can someone help me fix this issue

  • SQL Server 2008 R2 { An Error occured when attaching database(s) }

    Hello Guys!
    I just installed SQL Server 2008 R2 a couple of days ago, on the first day use i can attach database(.mdf) with out any problem.
    on the day 2, i keep getting this error:
    http://img515.imageshack.us/img515/14/1212i.png
    TITLE: Microsoft SQL Server Management Studio
    An error occurred when attaching the database(s).  Click the hyperlink in the Message column for details.
    BUTTONS:
    OK
    after clicking the Hyperlink this window open:
    http://img34.imageshack.us/img34/8766/hyperg.png
    TITLE: Microsoft SQL Server Management Studio
    Attach database failed for Server 'STARGAZER-PC\SQLSTARMAX'.  (Microsoft.SqlServer.Smo)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1+((KJ_RTM).100402-1539+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
    ADDITIONAL INFORMATION:
    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
    Unable to open the physical file "E:\New folder\DataBase.MDF". Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476
    BUTTONS:
    OK
    in that day i reinstall SQL Server 2008 R2, because I'm so confused. after that i try to attach i still got the same error, what i did is i share the folder where the database is.
    i open SSMS and try to attach and i attached without any error...
    i think this is the 4rth day, untill now everytime i want to attach a database i got this error, and even i try to share the folder where the database is i still got that error.
    any advice guys?
    Thanks a lot
    jhules
    if you want to be happy, find something you love to do and do it for free, then find someone to to you for it.

    The Error clearly shows that MDF files and LDF files are not matching or LDF file is corrupted.
    You can follow either of the one option below
    1. Restore a recent backup rather attaching the MDF file
    2. Attach  single MDF file without LOG File( Warning: All the log transactions will be gone and new log file will be created)
    EXEC sp_attach_single_file_db @dbname = 'AdventureWorks2008R2',
        @physname = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\AdventureWorks2008R2_Data.mdf';
    Thanks, Aditya Badramraju, _______________________________________________________ Please mark answered if your question is completely answered; vote it as helpful to help others find a solution quicker. This posting is provided AS IS with no warranties
    and confers no rights. _______________________________________________________

  • Error : The label 'http' has already been declared. Label names must be unique within a query batch or stored procedure.

    Hi all,
        I have created one SP for sending mail with formatting the HTML code inside script whenever i am individually declaring it and printing its expected but the problem at time of executing SP its giving error like this
    Msg 132, Level 15, State 1, Line 47
    The label 'http' has already been declared. Label names must be unique within a query batch or stored procedure.
    what is the possibilities to overcome this problem follwing is my stored procedure code 
    ALTER PROCEDURE [dbo].[USP_DataLoadMailsend_essRules]
    AS
    BEGIN
    SET NOCOUNT ON;
    SET XACT_ABORT ON;
    BEGIN TRY
    ---BEGIN TRANSACTION T1
    DECLARE @packagelogid INT
    DECLARE @batchlogid INT
    DECLARE @packagestatus CHAR(2)
    select @batchlogid =19870
    --print(@batchlogid)
    DECLARE @script VARCHAR(MAX)
    DECLARE @tableHTML VARCHAR(MAX)
    DECLARE @mailheader VARCHAR(50)
    DECLARE @count INT
    DECLARE @recipients1 VARCHAR(50)
    DECLARE @subject1 VARCHAR(200)
    DECLARE @sql VARCHAR(MAX)
    Declare @UserId varchar(Max)
    Declare @Information varchar(max)
    Declare @TableHTML1 varchar(max)
    Declare @TableHTML2 varchar(max)
    SET @mailheader = ''
    SET @mailheader = (select case
    WHEN FileUpload = 'F'
    THEN 'BussinessRules is Aborted'
    WHEN (InRule = 'S')
    AND (
    SELECT sum(isnull(ErrorRecords, 0)) tot
    FROM abc.FileUploadSummary z
    WHERE z.BatchId = bts.BatchId
    GROUP BY BatchId
    ) > 0
    THEN 'BussinessRules is Processed with Errors'
    WHEN InRule = 'F'
    THEN 'BussinessRules is Failed'
    WHEN (InRule = 'S')
    AND (
    SELECT sum(isnull(ErrorRecords, 0)) tot
    FROM abc.FileUploadSummary z
    WHERE z.BatchId = bts.BatchId
    GROUP BY BatchId
    ) = 0
    THEN 'BussinessRules is Succeeded'
    end
    from abc..BatchStatus bts where BatchId=@batchlogid)
    /* Selecting Person Mail as Recipient */
    SELECT TOP 1 @recipients1 = EmailId FROM abc.PersonEmail
    WHERE PersonId = ( SELECT TOP 1 personid FROM abc.FileUploadSummary WHERE BatchId = @batchlogid )AND EmailTypeId = 1
    /* Selecting UserId*/
    select top 1 @UserId=loginid from abc.FUS where BatchId=@batchlogid
    /*Selecting Information about the Status */
    Set @Information=
    (select case
    WHEN FileUpload = 'F'
    THEN 'BussinessRules is Aborted'
    WHEN (InRule = 'S')
    AND (
    SELECT sum(isnull(ErrorRecords, 0)) tot
    FROM abc.FileUploadSummary z
    WHERE z.BatchId = bts.BatchId
    GROUP BY BatchId
    ) > 0
    THEN 'BussinessRules is Processed with Errors'
    WHEN InRule = 'F'
    THEN 'BussinessRules is Failed'
    WHEN (InRule = 'S')
    AND (
    SELECT sum(isnull(ErrorRecords, 0)) tot
    FROM abc.FileUploadSummary z
    WHERE z.BatchId = bts.BatchId
    GROUP BY BatchId
    ) = 0
    THEN 'BussinessRules is Succeeded'
    end + N' <br> <B>BatchId= '+ convert(varchar(250),(select @batchlogid)) +'</B>'
    from abc..BatchStatus bts where BatchId=@batchlogid )
    /*Selecting the Error Reason*/
    if exists (select 1 from BatchStatus where BatchId=@batchlogid and ( InRule='f'))
    begin
    set @TableHTML1 = '<table border=1><tr><th>Sr.No.</th><th><P>Error Reason :</th></tr>'+
    cast((select td= ROW_NUMBER()over (order by (select 1)),'',
    td=isnull(e.ErrorDescription, '')
    from abc.x.tbPackageErrorLog e --50594
    join abc.x.tbPackageLog p -- 10223
    on p.PackageLogID=e.PackageLogID
    where p.BatchLogID= @batchlogid FOR XML PATH('tr'), TYPE )
    as NVarchar(max)) +'</table>'
    -- print @tableHTML
    if not exists (select 1 from BatchStatus where BatchId=@batchlogid and ( InRule='f'))
    set @TableHTML2 = 'Error Reason :N/A'
    end
    -- insert into #tmp values ( @TableHTML1)
    --select * from #tmp
    Set @tableHTML= 'Hello '+@UserId+', <br>Information:'+isnull(@Information,'') +
    '<Table Border=1><Tr><th>Sr No</th><th>Uploaded files </th>:'+
    CAST ((select td= ROW_NUMBER()over(order by f.FileUploadId), '',
    td = f.TableName , ''
    from abc.FileUploadSummary F where BatchId=@batchlogid
    FOR XML PATH('tr'), TYPE ) AS NVARCHAR(max) )
    +'</table>'+
    'Error Reason :'+isnull(isnull(@TableHTML1,'')+ isnull(@TableHTML2,''),'N/A')+ --concat (isnull(@TableHTML1,''),isnull(@TableHTML2,'')
    '<br> Please login to Your Account for further Details..!'
    +'<br>@Note: This is system generated message, Do not reply to this mail. <br>Regards,<br>'+
    'Admin'
    print @tableHTML
    SET @sql = ' EXEC msdb.dbo.sp_send_dbmail @profile_name = ''DBA_mail_test''
    ,@recipients = ''' + isnull(@recipients1,'''') + ''',@subject = ''' + isnull(@mailheader,'''') + ''',
    @body = ''' +isnull(@tableHTML,'''')+ ''',
    @body_format = ''HTML'''
    Exec(@sql)
    END TRY
    BEGIN CATCH
    PRINT error_message()
    -- Test whether the transaction is uncommittable.
    -- IF (XACT_STATE()) = - 1
    -- ROLLBACK TRANSACTION --Comment it if SP contains only select statement
    DECLARE @ErrorFromProc VARCHAR(500)
    DECLARE @ErrorMessage VARCHAR(1000)
    DECLARE @SeverityLevel INT
    SELECT @ErrorFromProc = ERROR_PROCEDURE()
    ,@ErrorMessage = ERROR_MESSAGE()
    ,@SeverityLevel = ERROR_SEVERITY()
    --INSERT INTO dbo.ErrorLogForUSP (
    -- ErrorFromProc
    -- ,ErrorMessage
    -- ,SeverityLevel
    -- ,DateTimeStamp
    --VALUES (
    -- @ErrorFromProc
    -- ,@ErrorMessage
    -- ,@SeverityLevel
    -- ,GETDATE()
    END CATCH
    END
    please help me to solve this problem
    Niraj Sevalkar

    This is no string http in your procedure. Then again the error message points to a line 47 outside a stored procedure. I can't tell it is outside, since there is no procedure name.
    But I see that you have this piece of dynamic SQL:
    SET @sql = ' EXEC msdb.dbo.sp_send_dbmail @profile_name = ''DBA_mail_test''
    ,@recipients = ''' + isnull(@recipients1,'''') + ''',@subject = ''' + isnull(@mailheader,'''') + ''',
    @body = ''' +isnull(@tableHTML,'''')+ ''',
    @body_format = ''HTML'''
     Exec(@sql)
    Why is this dynamic SQL at all? Why not just make plain call to sp_send_dbmail?
     EXEC msdb.dbo.sp_send_dbmail @profile_name = 'DBA_mail_test'
    ,@recipients = @recipients1, @subject = @mailheader, @body = @tableHTML
    Erland Sommarskog, SQL Server MVP, [email protected]

  • To whom it may concern I would like to inform you about an error occurred when I upgraded my firmware to IOS 6 When I plug a headphone/earphone into my, then unplug it, the volume turned out to be unadjustable I have attached 2 screenshots of the error, p

    To whom it may concern
    I would like to inform you about an error occurred when I upgraded my firmware to IOS 6
    When I plug a headphone/earphone into my, then unplug it, the volume turned out to be unadjustable
    I have attached 2 screenshots of the error, pls help?
    Thanks.

    Try a rest: Simultaneously hold down the Home and On buttons until the iPad shuts down. Ignore the off slider if it appears. Once shut down is complete, turn the iPad back on using the On button. In some cases it also helps to double click the Home button and close all apps from the tray before doing the reset.

  • ORA-04052: Error occurs when execute the block

    I'm trying to run one block and his query definition uses an active public database link. When I ran the script to block I get the following message:
    ERROR in line 1:
    ORA-04052: error occurred when looking up remote object
    SQ_DSV.temp_tipo_contr@SQ_DSV tc
    ORA-00604: error occurred at recursive SQL level 1
    But when I execute his definition query all is ok, the query works fine.
    I mean, I'm using the following sentence to block:
    declare
    Cursor Tipo_Contr is
    Select tc.rec_id, tc.tipo_contr from SQ_DSV.temp_tipo_contr@SQ_DSV tc;
    begin
    For Reg_Tipo_Contr in Tipo_Contr Loop
    Begin
    Update recursos Set tpcontr_id = Reg_Tipo_Contr.tipo_contr
    where rec_id = Reg_Tipo_Contr.rec_id;
    exception when others then
    dbms_output.put_line(Reg_Tipo_Contr.rec_id || ' Not find');
    end;
    end loop;
    -- Commit;
    end;
    I checked for the GLOBAL_NAMES parameter and it is set to FALSE. Please help me, How can I fix this problem ?
    I'm using Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production running over Win XP for run block.
    Thanks you, Paulo.

    ORA-04052 error occurred when looking up remote object stringstringstringstringstring
    Cause: An error has occurred when trying to look up a remote object.
    Action: Fix the error. Make sure the remote database system has run KGLR.SQL to create necessary views used for querying/looking up objects stored in the database.
    Regards
    Marcio Paiva

  • Error occurred when determining the business system (NO_BUSINESS_SYSTEM)

    Hi ,
    I am working on a POC(ECC 6.0(proxy)>PI 7.1>(proxy)ECC 6.0).
    I have created
    1) IR objects.
    2)Proxy generation & report program to fill the proxy structure.
    3)ID objects. (reciever CC, RA, ID, RD)
    I am getting below short dump on Sender ECC side,
    An exception occurred which is explained in detail below.
    The exception, which is assigned to class 'CX_AI_SYSTEM_FAULT', was not caught
    and
    therefore caused a runtime error.
    The reason for the exception is:
    Error (id=GET_BUSINESS_SYSTEM_ERROR): An error occurred when determining the
    business system (NO_BUSINESS_SYSTEM)
    pls let me know, what might be wrong.
    santosh.

    Hello,
    You may need to create your business system and point it to the Integration Server on SLD.
    Generally it acuses an error on tcode SDLCHECK, for this please check note #1143810.
    Regards,
    Caio Cagnani

  • I'm getting a message "An error occurred when attempting to change modules"

    Hi, I have just loaded LR CC on to my new iMac & I'm getting a message "An error occurred when attempting to change modules" I have used a Catalog from my Macbook stored on an external hard drive & there are no images, no panels & i can't access LR preferences, please help as i have images to process for clients! PLEASE HELP...

    I have tried to look for download as it says but no down load, so i went to step 2 but i don't understand & can't find the files they are asking me to change. I am not super good with macs or any computer so I'm finding it hard to follow there instructions e.g. Preference file and other file locations | Lightroom 5.x I'm not sure if I'm looking for the rite areas of the iMac & i can't find what they are asking.

Maybe you are looking for