EXEC SQL with IN Clause

Hello,
I'm trying to run an EXEC SQL statement with an IN clause.  Here's my SQL code:
EXEC SQL.
      OPEN C FOR
      SELECT name
             FROM sv_hoover_data
             where dunsNum in :DUNS_NUMBERS
    ENDEXEC.
My DUNS_NUMBERS variable is of type String and contains the following data:
('12334223','4353434','54674563')
When the statement is executed, I receive the following error message in SM21:
Line 1: Incorrect syntax near '@P1'.
Also, the underlying database is MS SQL Server.  When I run the query via MS Query Ananlyzer, it runs fine.
Does any know if EXEC SQL can handle IN clauses, and if so, how they're written?
Thanks,
Matt

I haven't used it myself (yet), but this is what I found in the help:
EXEC SQL - EXECUTE
Syntax
EXEC SQL.
  EXECUTE PROCEDURE proc ( IN    p_in1    IN    p_in2 ...,
                           OUT   p_out1   OUT   p_out2 ...,
                           INOUT p_inout1 INOUT p_inout2 ... )
ENDEXEC.
Effect
In database systems, you can define procedures as so-called "stored procedures". Since the syntax for calling such procedures and the pertinent parameter transfer for various database systems can vary widely, a uniform command exists in Native SQL.
The statement EXECUTE PROCEDURE calls a procedure proc stored in the database. For all formal parameters of the procedure, you must specify the actual parameters, separated by commas. You must specify IN, OUT or INOUT before every actual parameter, in order to indicate whether the parameter is an input, output, or input/output parameter. You can use literals or Host Variables labeled by a colon(:)for the actual parameters.
Example
This example defines a selfunc procedure using database specific SQL-Statements (Informix). It also calls the procedure using the SAP-specific Native-SQL-Statement EXECUTE PROCEDURE in a LOOP-loop by means of a Selection Table, and deletes the the procedure using an SQL-Statement. In the case shown here, the procedure is a function whose return value output in EXECUTE PROCEDURE is copied to the host variable name.
DATA scarr_carrid TYPE scarr-carrid.
SELECT-OPTIONS s_carrid FOR scarr_carrid NO INTERVALS.
DATA s_carrid_wa LIKE LINE OF s_carrid.
DATA name TYPE c LENGTH 20.
TRY.
    EXEC SQL.
      CREATE FUNCTION selfunc( input CHAR(3) )
        RETURNING char(20);
        DEFINE output char(20);
        SELECT carrname
               INTO output
               FROM scarr
               WHERE mandt  = '000' AND
                     carrid = input;
        RETURN output;
        END FUNCTION;
    ENDEXEC.
    LOOP AT s_carrid INTO s_carrid_wa
                     WHERE sign = 'I' AND option = 'EQ'.
      TRY.
         EXEC SQL.
            EXECUTE PROCEDURE selfunc( IN  :s_carrid_wa-low,
                                       OUT :name )
          ENDEXEC.
          WRITE: / s_carrid_wa-low, name.
        CATCH cx_sy_native_sql_error.
          MESSAGE `Error in procedure execution` TYPE 'I'.
      ENDTRY.
    ENDLOOP.
    EXEC SQL.
      DROP FUNCTION selfunc;
    ENDEXEC.
  CATCH cx_sy_native_sql_error.
    MESSAGE `Error in procedure handling` TYPE 'I'.
ENDTRY.

Similar Messages

  • Derive found flag in SQL with where clause using TABLE(CAST function

    Dear All,
    Stored procedure listEmployees
    ==========================
    CREATE OR REPLACE TYPE STRING_ARRAY AS VARRAY(8000) OF VARCHAR2(15);
    empIdList STRING_ARRAY
    countriesList STRING_ARRAY
    SELECT EMP_ID, EMP_COUNTRY, EMP_NAME, FOUND_FLAG_
    FROM EMPLOYEE WHERE
    EMP_ID IN
    (SELECT * FROM TABLE(CAST(empIdList AS STRING_ARRAY))
    AND EMP_COUNTRY IN
    (SELECT * FROM TABLE(CAST(countriesList AS STRING_ARRAY))
    =================
    I have a stored procedure which lists the employees using above simple query.
    Here I am using table CAST function to find the list of employees in one go
    instead of looping through each and every employee
    Everything fine until requirements forced me to get the FOUND_FLAG as well.
    Now I wanted derive the FOUND_FLAG by using rownum, rowid, decode functions
    but I was not successful
    Can you please suggest if there is any intelligent way to say weather the
    row is found for given parameters in the where clause?
    If not I may have to loop through each set of empIdList, countriesList
    and find the values individually just to set a flag. In this approach I can’t use
    the TABLE CAST function which is efficient I suppose.
    Note that query STRING_ARRAY is an VARRAY. It is very big in size and this procedure
    suppose to handle large sets of data.
    Thanks In advance
    Regards
    Charan
    Edited by: kmcharan on 03-Dec-2009 09:55
    Edited by: kmcharan on 03-Dec-2009 09:55

    If your query returns results, you have found them... so your "FOUND" flag might be a constant,...

  • PPR error with sql with where clause

    dear pakar,
    why my PPR report error using this query
    Select process_id,
    to_char(start_date, 'Dy DD-Mon-YYYY HH24:MI:SS') start_date,
    to_char(finish_date, 'Dy DD-Mon-YYYY HH24:MI:SS') finish_date,
    to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI:SS') timestamp
    From status_process_list
    where created_by = :P9_GLOBAL_EMPLOYEE_ID
    (:P9_GLOBAL_EMPLOYEE_ID is in form, and value i can see, type text)
    call by functions :
    function mon_Refresh()
    if(html_SelectValue('P9_UPDATE_TIME') != 0)
    setInterval("mon_User_Refresh()",html_SelectValue('P9_UPDATE_TIME') * 1000);
    mon_User_Refresh()
    function mon_User_Refresh()
    var lGrab = $x('UPDATE_REPORT_body');
    var lReport = getElementsByClass('standard',lGrab,'TABLE')[0];
    var lReport_ID = lReport.id;
    html_PPR_Report_Page (null,lReport_ID.substring(2),$x(lReport_ID).getAttribute('htmldb:href'))
    thanks

    I'm having the same problem.
    One potential solutions is to use a custom SQL server JDBC driver instead of going through the ODBC bridge. This will minimize dependencies and should also improved performance. Hope this helps.
    - Joe

  • Retrieve SQL with filters applied from an Interactive Report

    I want to use an Interactive report as interface for providing parameters to a base report query.
    I would like to capture the full SQL code from the filtered interactive report and then run the sql to create a collection.
    I have found this tread
    Re: Using Data from filtered Interactive Report
    which says that you can use APEX_APPLICATION_PAGE_IR to access the reports SQL. This holds the information about the interactive report when the user saves it. The sql code from the interactive report (after the user has added filters) is stored in the field sql_query.I can only retrieve the base query and not the filtered version even after saving.
    Any ideas how this can be done would be appreciated.
    regards
    PP

    OK Darren I think I've got it working. My solution is an adaption that follows the steps of a blog I found here: http://stewstools.wordpress.com/2009/02/19/get-ir-where-clause/
    My solution allows you to click on a button and the records that are currently displayed in the IR report are saved to an APEX collection. You can then use the collection to save records to a table or run a report on another page. (I haven't included code for this last step but it's easy to find on the forum)
    First a bit of background knowledge. The following APEX views hold all the information on IRs that you access via PLSQL code in the package you need to download. Run an IR report, save a version of the report, then in SQL Workshop have a look at:
    select * from APEX_APPLICATION_PAGE_IR
    select * from APEX_APPLICATION_PAGE_IR_COND
    select * from APEX_APPLICATION_PAGE_IR_COL
    select * from APEX_APPLICATION_PAGE_IR_RPT
    When you run an IR report it has an internal ID that you can access and also a Base Id for each Saved report that is currently in context.
    Here are the steps:
    1) Download the following package and install it in the workspace schema
    http://www.mediafire.com/?nj118x9vmc9
    click on the link "click here to download"
    2)In the HTML header Attribute of the page where your IR runs, put the following Javascript:
    <!--===================================================================-->
    <!--FUNCTION TO RETRIEVE IR REPORTS SQL WITH WHERE CLAUSE
    <!--===================================================================-->
    <script language="JavaScript" type="text/javascript">
    function SaveAndRunReport() {
    document.location='f?p=&APP_ID.:3:&SESSION.:CONSTRUCT_IR_QUERY:NO::'+
    'P3_BASE_REPORT_ID:'+$v('apexir_REPORT_ID');
    </script>
    <!--===================================================================-->
    Notes: You will need to obviously change the URL above to reflect your Page No. (3) and the name of a HIDDEN Item (P3_BASE_REPORT_ID) that you will populate with the base ID of the report.
    Setting :P3_BASE_REPORT_ID to +$v('apexir_REPORT_ID') is an internal thing and works out of the box. It returns the Id of the Base report.
    3) Create a button called SELECT_SPECIMENS (in region position - top of region) in the IR region that will initiate the execution of the IR background SQL to create a collection with the current selected records.
    TARGET= URL
    URL Target = javascript:SaveAndRunReport();
    You might also want to create a condition that only shows the button when there are records selected
    CONDITION TYPE=Exists(SQL returns at least one row)
    EXPRESSION 1 - put the SQL of the IR report here.
    4)Create a branch back to the same page (3) and with the REQUEST attribute set to the value in the Javascript URL above e.g. CONSTRUCT_IR_QUERY. Create a condition on the branch that uses this branch WHEN BUTTON PRESSED= SELECT_SPECIMENS
    5) Create an AFTER HEADER PROCESS with the following code:
    declare
    v_base_query clob;
    v_where clob;
    v_query clob;
    v_base_where varchar2(12):=' where 1=1 '; -- incase there is no where clause in the base query
    begin
    if apex_collection.collection_exists('IR_COLLECTION') THEN
    htmldb_collection.delete_collection( p_collection_name => 'IR_COLLECTION');
    end if;
    --GET THE BASE QUERY OF THE IR REPORT
    select sql_query
    into v_base_query
    from APEX_APPLICATION_PAGE_IR
    where application_id=:APP_ID
    and page_id=:APP_PAGE_ID; -- you can only have one IR report per page
    --UNCOMMENT TO VIEW THE PARAMETERS TO THE PACKAGED FUNCTION
    --raise_application_error(-20001, :APP_ID||'-'||:APP_PAGE_ID||'-'||:SESSION||'-'||:P3_BASE_REPORT_ID);
    --GET THE SQL FILTER CODE
    select apex_ir_query.ir_query_where(:APP_ID,:APP_PAGE_ID,:SESSION,:P3_BASE_REPORT_ID)
    into v_where
    from dual;
    --CHECK TO SEE THAT THERE IS A "WHERE" CLAUSE IN THE BASE QUERY
    if instr(upper(v_base_query),'WHERE ') > 0 then
    v_query:=v_base_query||' '||v_where;
    else
    v_query:=v_base_query||' '||v_base_where||' '||v_where;
    end if;
    --UNCOMMENT TO SEE THE FULL QUERY SYNTAX
    --raise_application_error(-20001,v_query);
    --CREATE COLLECTION FROM IR RECORDS
    apex_collection.create_collection_from_query(P_collection_name=>'IR_COLLECTION',p_query=>v_query);
    exception
    when others then
    raise_application_error(-20001, 'Interactive report not found. Contact Administrator. Could not create collection of records.');
    end;
    remember to update P3_BASE_REPORT_ID above to your HIDDEN ITEM name.
    Set the following attributes for the process above
    CONDITIONAL PROCESSING
    CONDITION TYPE = Request=Expression 1
    EXPRESSION 1 --> CONSTRUCT_IR_QUERY (Note: this was set on the branch in step 4 above)
    6) Run the IR report, click on the "SELECT SPECIMENS" button then click on the Session link on the Developer's Toolbar and select VIEW COLLECTIONS from the popup list then click GO. You should now see the IR records.
    By the way I've been testing in IE not Firefox.
    ...and that's it!
    enjoy
    Paul P

  • SELECT on TIMESTAMP field from ABAP with EXEC SQL

    Hello,
    I'm trying to get a field of one table which is defined as TIMESTAMP. MaxDB parameter DATE_TIME_FORMAT is set to INTERNAL. When I do the SELECT in SQL Studio I get ISO format 'YYYY-MM-DD HH:MM:SS.MMMMMM' back. So I tried a SELECT with ISO in WHERE clause, but I'm always getting a shortdump with this error:
    Database error text........: "POS(82) Invalid date input value"
    Database error code........: "-3065"
    Then I did a SELECT without a WHERE clause in ABAP and got value '06-FEB-09' back from this field. So I tried with this ABAP statement and got no shortdump, but I also need to add time and not only the date.
      EXEC SQL.
        SELECT recv_time INTO :l_time FROM ztest WHERE sent_recv_time = '06-FEB-09'
      ENDEXEC.
    I'm using Native SQL because the SELECT is on a table which is not located in SAP Schema User. "SELECT recv_time FROM ztest WHERE recv_time = '2009-02-24 10:02:55.888000'" works in SQL studio, but not from ABAP.
    Does anyone know which format I need to specify in the WHERE clause?
    Regards
    Markus Karsch
    Edited by: Markus Karsch on Feb 26, 2009 4:22 PM

    >
    Thomas Theodor Koetter  wrote:
    > Hello Markus
    >
    > I don't know whether this will work from ABAP, but at least MaxDB can internally handle the ODBC literals for time, date and timestamp.
    >
    > Therefore literals like
    >
    > "{d'0001-02-03'}"
    > "{t'01:02:03'}"
    > "{ts'0001-02-03 04:05:06'}"
    >
    > might work. See [http://msdn.microsoft.com/de-de/library/ms190234(SQL.90).aspx]
    >
    >
    > HTH & regards  Thomas
    Hi Thomas,
    Thanks for your help. Unfortunately doesn't seem to work, I get following shortdumps (tried with 3 different notations):
    Database error text........: " "
    Database error code........: "-4005"
    Triggering SQL statement...: "SELECT xxxxxx, status, sent_xxxx_time FROM
    xxx_xxxxxxxxx WHERE sent_recv_time = "{ts'2009-02-06 04:05:06'}""
    Database error text........: "POS(87) Invalid keyword or missing delimiter"
    Database error code........: "-3008"
    Triggering SQL statement...: "SELECT xxxxxx, status, sent_xxxx_time FROM
    xxx_xxxxxxxxx WHERE sent_recv_time = '{ts' 2009-02-06 04:05:06 '}'"
    Database error text........: "POS(81) Missing value specification"
    Database error code........: "-5010"
    Triggering SQL statement...: "SELECT xxxxxx, status, sent_xxxx_time FROM
    xxx_xxxxxxxxx WHERE sent_recv_time = { ts '2009-02-06 04:05:06.000' }"
    Regards
    Markus

  • Use Of "#EC CI_EXECSQL in ABAP with EXEC SQL. Statement giving Syntax Error

    Dear Gurus,
    I have encountered an issue while trying to remove warning for using Native SQL statement using pseudo comment "#EC CI_EXECSQL
    The thing is like this -- i have used follwing native sql command in abap.
    EXEC SQL.
        CONNECT TO 'SURROUND_DB'
      ENDEXEC.
    Now when i am checking this code in code inspector it is showing a warning with information below
    CA CL_CI_TEST_CRITICAL_STATEMENTS0006
    Code Inspector
    Critical Statements
    Use of Native SQL
    Authorization checks cannot be appropriately run using EXEC SQL and should be carried out at program level.
    The message can be hidden using the pseudo-comment "#EC CI_EXECSQL
    Use of exceptin handling section for that warning showing me to use :
    The message can be hidden using pseudo
    comment      "#EC CI_EXECSQL
    Now when I am using "#EC CI_EXECSQL in the abap like below :
    EXEC SQL. "#EC CI_EXECSQL
        CONNECT TO 'SURROUND_DB'
      ENDEXEC.
    It is giving syntax error
    The text literal ""#EC CI_EXECSQL        " is longer than 255
    characters.Check whether it ends correctly.
    Please provide the guideline to resolve this issue.
    Thanks & regards
    Saifur Rahaman.

    Hi Saifur,
    You can remove the warning using the following syntax:
    EXEC "#EC CI_EXECSQL
      SQL.
        CONNECT TO 'SURROUND_DB'
      ENDEXEC.
    At least, it worked fine for me when using OPEN CURSOR, SELECT, FETCH and so on statements.
    The way to use the pseudo comment is not very intuitive, but at least for my examples worked fine.
    I hope this may help you.
    Best regards,
    Edgardo G. König

  • SQL statement with union clause

    Hi,
    I have a scenario where i need to generate a sql statement with UNION .
    Eg:
    SELECT B.YY_ID,
    FROM XXXX.YY B
    WHERE (B.YY_TY= 'as')
    UNION
    SELECT B.YY_ID
    FROM XXXX.YY_ALT_NAME A, XXXX.YY B
    WHERE (A.YY_TY= 'zx'
    AND (B.YY_ID=A.YY_ID)"
    I tried ns1:table1() union ns3:table2() in XQuery.
    But it is pushdown as 2 seperate sqls.
    Is it possible to create XQuery that pushdown as SINGLE SQL statement with union clause ?
    Thanks

    No. See 3.1.1.5 in the document I referenced in your previous post.

  • Can a SQL WITH Clause be used in Materialized View

    Hello,
    Can we use SQL WITH clause in Materialized View.
    Thanks

    Hello,
    Here is an example
    CREATE MATERIALIZED VIEW MV_TEST
    BUILD IMMEDIATE
    REFRESH FORCE ON DEMAND
    AS
    WITH t AS (SELECT owner, object_type, COUNT ( * )
               FROM my_objects
               GROUP BY object_type, owner)
    SELECT *
    FROM t
    WHERE owner IN ('SYS', 'SYSTEM');Regards

  • TRY ... CATCH doesn't work with EXEC SQL?

    When I created a native SQL statement, I knew before, that it would take a few tries to get it working. I decided to use exception classes to avoid short dumps, but it didn't work.
    Following code causes a short dump because of the dot after :xp_stras in the native SQL SELECT statement:
       try.
           EXEC SQL                     PERFORMING  list.
             SELECT LIFNR, NAME1, STRAS
                                    INTO  :xsl
                                    FROM  LFA1
             WHERE  UPPER( NAME1 )  LIKE  :xp_name1
             AND    UPPER( STRAS )  LIKE  :xp_stras.
           ENDEXEC.
                                                                                    catch CX_SY_NATIVE_SQL_ERROR.
           write: /1 'CX_SY_NATIVE_SQL_ERROR'.
       catch CX_SY_SQL_ERROR.
           write: /1 'CX_SY_SQL_ERROR'.
       catch CX_DYNAMIC_CHECK.
           write: /1 'CX_DYNAMIC_CHECK'.
       catch CX_ROOT.
           write: /1 'CX_SY_ROOT'.
       endtry.
    In ST22 you can see
    Name of runtime error: DBIF_DSQL2_SQL_ERROR
    Exception:
    The name of the exception is empty, in other short dumps you can find there the name of the exception class. Maybe that's the reason for CATCH does'nt work, but I don't understand it.
    Online help for EXEC SQL says:
    Catchable Exceptions
    CXSY_NATIVE_SQL_ERROR_
    Cause: SQL-Error at the execution of a Native SQL-command.
    Runtime Error: DBIF_DSQL2_SQL_ERROR
    We have SAP ECC 6.0 with SAP_BASIS rel. 700 lvl. 0013.
    If You have an idea why CATCH doesn't work, please tell me!
    Regards,
    Klaus

    Hi Rob,
    I tried out Your original code as program ZTEST5 and got a short dump (sorry, some of the short dump symbols are formatting this post in a wrong way ...):
    Short text
        An SQL error occurred when executing Native SQL.
    What happened?
        The error 919 occurred in the current database connection "DEFAULT".
    What can you do?
        Note down which actions and inputs caused the error.
        To process the problem further, contact you SAP system
        administrator.
        Using Transaction ST22 for ABAP Dump Analysis, you can look
        at and manage termination messages, and you can also
        keep them for a long time.
    How to correct the error
        Database error text........: "ORA-00919: invalid function"
        Database error code........: 919
        Triggering SQL statement...: "FETCH NEXT "
        Internal call code.........: "[DBDS/NEW DSQL]"
        Please check the entries in the system log (Transaction SM21).
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "DBIF_DSQL2_SQL_ERROR" " "
        "ZTEST5" or "ZTEST5"
        "START-OF-SELECTION"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction
           Restrict the time interval to 10 minutes befor
        after the short dump. Then choose "System->List->
        (Unconverted)".
        3. If the problem occurs in a problem of your own
        program: The source code of the program
           In the editor, choose "Utilities->More
        Utilities->Upload/Download->Download".
        4. Details about the conditions under which the e
        actions and input led to the error.
    System environment
        SAP-Release 700
        Application server... "lux01617"
        Network address...... "195.217.80.104"
        Operating system..... "Linux"
        Release.............. "2.6.5-7.283-smp"
        Hardware type........ "x86_64"
        Character length.... 16 Bits
        Pointer length....... 64 Bits
        Work process number.. 5
        Shortdump setting.... "full"
        Database server... "lux09208"
        Database type..... "ORACLE"
        Database name..... "D10"
        Database user ID.. "SAPDAT"
        Char.set.... "C"
        SAP kernel....... 700
        created (date)... "Dec 2 2007 20:18:08"
        create on........ "Linux GNU SLES-9 x86_64 cc3.3.3"
        Database version. "OCI_102 (10.2.0.2.0) "
        Patch level. 138
        Patch text.. " "
        Database............. "ORACLE 9.2.0.., ORACLE 10.1.0.., ORACLE 1
        SAP database version. 700
        Operating system..... "Linux 2.6"
        Memory consumption
        Roll.... 16192
        EM...... 16759392
        Heap.... 0
        Page.... 98304
        MM Used. 694160
        MM Free. 3493088
    User and Transaction
        Client.............. 500
        User................ "Z0000D2P"
        Language key........ "E"
        Transaction......... "SE38 "
        Transactions ID..... "48FE92EB921F51C3E1000000C3D95068"
        Program............. "ZTEST5"
        Screen.............. "SAPMSSY0 1000"
        Screen line......... 6
    Information on where terminated
        Termination occurred in the ABAP program "ZTEST5" - in "START-OF-SELECTION".
        The main program was "ZTEST5 ".
        In the source code you have the termination point in line 16
        of the (Include) program "ZTEST5".
    Source Code Extract
    Line  SourceCde
        1 REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.
        2
        3 TABLES: lfa1.
        4
        5 DATA: BEGIN OF xsl,
        6         lifnr TYPE lfa1-lifnr,
        7         name1 TYPE lfa1-name1,
        8         stras TYPE lfa1-stras,
        9       END   OF xsl.
       10
       11 DATA: xp_name1 TYPE lfa1-name1,
       12       xp_stras TYPE lfa1-stras.
       13
       14 TRY.
       15     EXEC SQL PERFORMING list.
    >>>>>       SELECT LIFNR, NAME1, STRAS
       17       INTO :xsl
       18       FROM LFA1
       19       WHERE UPPER( NAME1 ) LIKE :xp_name1
       20       AND UPPER( STRAS ) LIKE :xp_stras.
       21     ENDEXEC.
       22
       23   CATCH cx_sy_native_sql_error.
       24     WRITE: /1 'CX_SY_NATIVE_SQL_ERROR'.
       25   CATCH cx_sy_sql_error.
       26     WRITE: /1 'CX_SY_SQL_ERROR'.
       27   CATCH cx_dynamic_check.
       28     WRITE: /1 'CX_DYNAMIC_CHECK'.
       29   CATCH cx_root.
       30     WRITE: /1 'CX_SY_ROOT'.
       31 ENDTRY.
       32
       33 &----
       34 *&      Form  LIST
       35 &----
    Edited by: Klaus Babl on Oct 22, 2008 6:42 AM

  • Pro*C with Visual C++ - leaks memory with EXEC SQL CONTEXT FREE

    Hello,
    I am making an aplication with threads, using Visual C++ with Pro*C... and I have a problem when the aplication execute EXEC SQL CONTEXT FREE the memory reserved is not free.
    this is my code:
    #include <sqlca.h>
    EXEC SQL BEGIN DECLARE SECTION;
    sql_context ctx;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL ENABLE THREADS;
    EXEC SQL CONTEXT ALLOCATE :ctx;
    EXEC SQL CONTEXT USE :ctx;
    EXEC SQL COMMIT WORK RELEASE;
    EXEC SQL CONTEXT FREE :ctx;
    thanks in advance

    Hi!
    I suppose to helping in solve your question is necessary see how your application is working with threads.
    Can you print them also?

  • Hosting company does not support SQL query with OUTFILE clause

    From my mysql database, I want to allow the user to run a query and produce a csv / text file of our membership database.   Unfortunately,  I just found out my hosting company does not support the SQL query with OUTFILE clause for MySQL database.
    Are there any other options available to produce a file besides me running the query in phpadmin and making the file available to users.
    Thanks.  George

    Maybe this external Export Mysql data to CSV - PHP tutorial will be of help
    Cheers,
    Günter

  • Create data base table with EXEC SQL

    Hello,
    I nead to create o data base table with EXEC SQL in an Abap program.
    My code is :
    TRY.
       EXEC SQL.
          CREATE table zt_hello ( mandt char(4) NOT NULL,
                                  kunnr char(10) NOT NULL,
                                  PRIMARY KEY (mandt, kunnr) )
        ENDEXEC.
      CATCH cx_sy_native_sql_error INTO exc_ref.
        error_text = exc_ref->get_text( ).
    ENDTRY.
    IF sy-subrc = 0.
      COMMIT WORK.
    ENDIF.
    But it still not working.
    Can you help me please.
    Thanks.
    Edited by: widad soubhi on Jul 14, 2010 5:26 PM

    Please refer this code
    REPORT z_struct_create .
    DATA: my_row(500) TYPE c,
    my_file_1 LIKE my_row OCCURS 0 WITH HEADER LINE.
    DATA: dd02v TYPE dd02v.
    DATA: my_file_tab1 LIKE dd03p OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME TITLE text
    NO INTERVALS.
    PARAMETERS:
    name TYPE ddobjname,
    testo TYPE text40,
    file_1 LIKE rlgrap-filename.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN END OF BLOCK blk.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR file_1.
    PERFORM file_selection USING file_1.
    INITIALIZATION.
    text = text-001.
    START-OF-SELECTION.
    IF file_1 IS INITIAL.
    MESSAGE ID 'Z0017_BDI' TYPE 'I' NUMBER 001.
    EXIT.
    ENDIF.
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
    filename = file_1
    filetype = 'ASC'
    TABLES
    data_tab = my_file_1.
    IF sy-subrc 0.
    MESSAGE ID 'Z0017_BDI' TYPE 'I' NUMBER 002.
    EXIT.
    ENDIF.
    LOOP AT my_file_1.
    IF sy-tabix > 1.
    CLEAR my_file_tab1.
    SPLIT my_file_1 AT ';' INTO
    my_file_tab1-fieldname
    my_file_tab1-datatype
    my_file_tab1-leng
    my_file_tab1-decimals
    my_file_tab1-ddtext
    my_file_tab1-inttype = 'C'.
    my_file_tab1-INTLEN = my_file_tab1-leng.
    my_file_tab1-tabname = name.
    my_file_tab1-position = sy-tabix - 1.
    my_file_tab1-ddlanguage = sy-langu.
    my_file_tab1-OUTPUTLEN = my_file_tab1-leng.
    APPEND my_file_tab1.
    ENDIF.
    ENDLOOP.
    dd02v-tabname = name.
    dd02v-ddlanguage = sy-langu.
    dd02v-tabclass = 'INTTAB'.
    dd02v-DDTEXT = testo.
    dd02v-MASTERLANG = sy-langu.
    IF NOT my_file_tab1[] IS INITIAL.
    CALL FUNCTION 'DDIF_TABL_PUT'
    EXPORTING
    name = name
    dd02v_wa = dd02v
    TABLES
    dd03p_tab = my_file_tab1
    EXCEPTIONS
    tabl_not_found = 1
    name_inconsistent = 2
    tabl_inconsistent = 3
    put_failure = 4
    put_refused = 5
    OTHERS = 6
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ELSE.
    MESSAGE ID 'Z0017_BDI' TYPE 'I' NUMBER 003.
    EXIT.
    ENDIF.
    *& Form file_selection
    -->P_FILE_1 text
    FORM file_selection USING p_file.
    CALL FUNCTION 'WS_FILENAME_GET'
    EXPORTING
    def_filename = ''
    def_path = 'c:\'
    mask = ',.,..'
    mode = '0'
    title = 'Selezione file'
    IMPORTING
    filename = p_file
    RC = RCODE
    EXCEPTIONS
    inv_winsys = 1
    no_batch = 2
    selection_cancel = 3
    selection_error = 4
    OTHERS = 5.
    ENDFORM. " file_selection
    File Template:
    Fieldname;Data Type;Lentgh;Dec.;Descr.
    FIELD1;CHAR;000020;000000;my field 1
    FIELD2;CHAR;000008;000000;my field 2
    FIELD3;CHAR;000007;000000;my field 3
    FIELD4;CHAR;000006;000000;my field 4

  • EXEC SQL , PROBLEM WITH SELECT

    Hi.
    I have a external database in which I do the next query...
    Data: cod_campana TYPE integer,
             departament TYPE STRING.
    EXEC SQL.
        connect to 'EX_PP' as 'ex_pp'
      ENDEXEC.
      EXEC SQL.
        set connection 'ex_pp'
      ENDEXEC.
    cod_campana = 272
    departament = 'BKK'  "-> This data it's variable
    EXEC SQL.
        OPEN c1 FOR
            SELECT a.cod_modelo, a.nom_modelo2, a.cod_color, b.nom_color
            FROM pro_modelos a ,con_color b
              WHERE a.cod_modelo = b.cod_modelo
              AND a.cod_campana = b.cod_campana
              AND a.cod_color = b.numero
              AND a.brand = :departament
              AND a.cod_campana = :cod_campana
    END EXEC
    I obtain a  dump and the reason it's in the phrase -->  AND a.brand = :departament
    When I execute the same query and don't put the variable --> AND a.brand = 'BKK' like this the program run correctly... and I don't obtain dump...
    EXEC SQL.
        OPEN c1 FOR
            SELECT a.cod_modelo, a.nom_modelo2, a.cod_color, b.nom_color
            FROM pro_modelos a ,con_color b
              WHERE a.cod_modelo = b.cod_modelo
              AND a.cod_campana = b.cod_campana
              AND a.cod_color = b.numero
              AND a.brand = 'BKK'
              AND a.cod_campana = :cod_campana
    END EXEC
    I don't know what it's the problem, and how I can solve it...,
    Can you help me??
    I try the next phrases and not obtain a good result:
    AND a.brand like :departament
    departament = '"BSK"'
    and a.brand = :departament
    Thks for your help

    You can put the code in TRY-ENDTRY block, and CATCH the exceptions.
    If you are sure of the asignation to "department" (try to debug), you can make this:
    OPEN c1 FOR
    SELECT a.cod_modelo, a.nom_modelo2, a.cod_color, b.nom_color
    FROM pro_modelos a ,con_color b
    WHERE a.cod_modelo = b.cod_modelo
    AND a.cod_campana = b.cod_campana
    AND a.cod_color = b.numero
    AND a.brand = :departament
    Remove (AND a.cod_campana = :cod_campana).
    Or
    OPEN c1 FOR
    SELECT a.cod_modelo, a.nom_modelo2, a.cod_color, b.nom_color
    FROM pro_modelos a ,con_color b
    WHERE a.cod_modelo = b.cod_modelo
    AND a.cod_campana = b.cod_campana
    AND a.cod_color = b.numero
    AND ( a.brand = :departament )
    AND a.cod_campana = :cod_campana
    Remember to put department or DEPARMENT in case.

  • Dynamic SQL with cursor variables in pro*c

    Please, what I need to do in order to be able
    to do something like this:
    EXEC SQL DECLARE :c CURSOR FOR :s;
    In other words: I want to use variables
    in cursor names.
    Is it possible ? How ?
    Thank you.

    OK. Here is an example of a Dynamic SQL #4 program I wrote several years ago (It's still running in production). It is currently running on a Sun E10K with Oracle 8.1.5. This code is JUST the pro*c part of a program which uses IBM MQ Series. MQ passes this program a Select SQL statement (as well as other parameters) as an argument. The Pro*c code allocates the structures, parses, and fetches, and executes the statement. I realize that this will not be easy to read. There are SOME comments in the code. However, I realize that to read anyone elses code is a chore. When you add Dynamic #4 to the list, it becomes much more complicated. Anyway, you'll probably need to copy and paste the code to a text file. It will be easier to read.
    ==========================================
    Code
    ==========================================
    | Program: mqsql.pc |
    | Creator: Jim Wartnick |
    | Purpose: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
    | XXXXXXXXXXX |
    | Date: 01/03/1997 |
    | Modifications: |
    #include"mqsql.h"
    #define DEBUG
    #ifdef DEBUG
    FILE *fp=stdout;
    #endif
    int
    disconnect_db() {
    char msg[256], oraclmsg[256];
    char buf[MAX_STRING_LENGTH+4];
    int buf_len = 0, msg_len = 0;
    EXEC SQL
    COMMIT WORK RELEASE;
    #ifdef DEBUG
    fprintf(fp, " --> Disconnecting from database. RC: %d.\n", sqlca.sqlcode);
    fflush(fp);
    #endif
    if (sqlca.sqlcode != 0) {
    buf_len = sizeof(oraclmsg)-1;
    sqlglm(oraclmsg, &buf_len, &msg_len);
    oraclmsg[msg_len] = '\0';
    error("disconnect_db()", "disconnect", sqlca.sqlcode, oraclmsg);
    return(FAILURE);
    return(SUCCESS);
    int
    connect_db() {
    char msg[256], oraclmsg[256];
    char buf[MAX_STRING_LENGTH+4];
    int buf_len = 0, msg_len = 0;
    char user[4];
    strcpy(user, "/");
    EXEC SQL
    CONNECT :user;
    #ifdef DEBUG
    fprintf(fp, " --> Connecting to database. RC is %d\n", sqlca.sqlcode);
    fflush(fp);
    #endif
    if (sqlca.sqlcode != 0) {
    buf_len = sizeof(oraclmsg)-1;
    sqlglm(oraclmsg, &buf_len, &msg_len);
    oraclmsg[msg_len] = '\0';
    sprintf(Results, "%9d", sqlca.sqlcode);
    error("connect_db()", "connect", sqlca.sqlcode, oraclmsg);
    return(FAILURE);
    return(SUCCESS);
    int
    allocate_sqlda() {
    | Initialize the SQLDA structure. |
    | We only need the select descriptor |
    | because we do not have any bind |
    | variables. |
    if ((Select_da = sqlald(
    MAX_COLUMN_COUNT,
    MAX_COLUMN_STRING_LENGTH,
    MAX_INDICATOR_VARS
    )) == (SQLDA *) 0) {
    #ifdef DEBUG
    fprintf(fp, " Memory allocation for Select Descriptor failed.\n");
    fflush(fp);
    #endif
    strcpy(Results, "000000001");
    error("allocate_sqlda()", "create SQLDA", 0, "Memory Error");
    return(FAILURE);
    #ifdef DEBUG
    fprintf(fp, " Memory allocation for Select Descriptor succeeded.\n");
    fflush(fp);
    #endif
    Select_da->N = MAX_COLUMN_COUNT;
    return(SUCCESS);
    int
    prepare_sql() {
    char msg[256], oraclmsg[256];
    int buf_len = 0, msg_len = 0;
    | Prepare the Sql statement. |
    EXEC SQL
    PREPARE sql_stmt
    FROM :Sql;
    #ifdef DEBUG
    fprintf(fp, " Prepared SQL: %s. RC: %d.\n", Sql, sqlca.sqlcode);
    fflush(fp);
    #endif
    if (sqlca.sqlcode != 0) {
    buf_len = sizeof(oraclmsg)-1;
    sqlglm(oraclmsg, &buf_len, &msg_len);
    oraclmsg[msg_len] = '\0';
    sprintf(Results, "%9d", sqlca.sqlcode);
    error("prepare_sql()", "Parse", sqlca.sqlcode, oraclmsg);
    return(FAILURE);
    return(SUCCESS);
    int
    declare_cursor() {
    char msg[256], oraclmsg[256];
    int buf_len = 0, msg_len = 0;
    | Set up the cursor to loop through |
    EXEC SQL
    DECLARE sql_cursor
    CURSOR FOR sql_stmt;
    #ifdef DEBUG
    fprintf(fp, " Declared cursor. RC: %d\n", sqlca.sqlcode);
    fflush(fp);
    #endif
    if (sqlca.sqlcode != 0) {
    buf_len = sizeof( oraclmsg)-1;
    sqlglm(oraclmsg, &buf_len, &msg_len);
    oraclmsg[msg_len] = '\0';
    sprintf(Results, "%9d", sqlca.sqlcode);
    error("declare_cursor()", "declare cursor", sqlca.sqlcode, oraclmsg);
    return(FAILURE);
    return(SUCCESS);
    int
    open_cursor() {
    char msg[256], oraclmsg[256];
    int buf_len = 0, msg_len = 0;
    | Open the cursor. |
    EXEC SQL
    OPEN sql_cursor;
    #ifdef DEBUG
    fprintf(fp, " Opened cursor. RC:%d\n", sqlca.sqlcode);
    fflush(fp);
    #endif
    if (sqlca.sqlcode != 0) {
    buf_len = sizeof(oraclmsg)-1;
    sqlglm(oraclmsg, &buf_len, &msg_len);
    oraclmsg[msg_len] = '\0';
    sprintf(Results, "%9d", sqlca.sqlcode);
    error("open_cursor()", "open cursor", sqlca.sqlcode, oraclmsg);
    return(FAILURE);
    return(SUCCESS);
    int
    describe_select_list() {
    char msg[256], oraclmsg[256];
    int buf_len = 0, msg_len = 0;
    | Get description of columns |
    EXEC SQL
    DESCRIBE SELECT LIST FOR sql_stmt
    INTO Select_da;
    #ifdef DEBUG
    fprintf(fp, " Described columns. RC %d\n", sqlca.sqlcode);
    fflush(fp);
    #endif
    if (sqlca.sqlcode != 0) {
    buf_len = sizeof(oraclmsg)-1;
    sqlglm(oraclmsg, &buf_len, &msg_len);
    oraclmsg[msg_len] = '\0';
    sprintf(Results, "%9d", sqlca.sqlcode);
    error("describe_select_list()", "describe select list", sqlca.sqlcode, oraclmsg);
    return(FAILURE);
    return(SUCCESS);
    int
    setup_sqlda() {
    char buf[MAX_STRING_LENGTH+4];
    int done = FALSE, nullok = 0, i = 0;
    #ifdef DEBUG
    fprintf(fp, " --> Setting up SQLDA.\n");
    fflush(fp);
    #endif
    if (allocate_sqlda() == FAILURE)
    return(FAILURE);
    if (prepare_sql() == FAILURE)
    return(FAILURE);
    if (declare_cursor() == FAILURE)
    return(FAILURE);
    if (open_cursor() == FAILURE)
    return(FAILURE);
    if (describe_select_list() == FAILURE)
    return(FAILURE);
    | Too many columns in select list. |
    if (Select_da->F < 0) {
    strcpy(Results, "000000001");
    error("setup_sqlda()", "check select list count", 0, "Too many values in select list");
    return(FAILURE);
    | Set the number of columns to the actual |
    | number of columns. |
    Select_da->N = Select_da->F;
    | We are going to convert all fields to a string. |
    for (i == 0; i < Select_da->F; i++) {
    sqlnul(&(Select_da->T), &(Select_da->T[i]), &nullok);
    Select_da->T[i] = EXT_STRING;
    Select_da->L[i] = MAX_STRING_LENGTH;
    | Allocate the result area to be as big as |
    | MAX_STRING_LENGTH. |
    if ((Select_da->V[i] = malloc(Select_da->L[i])) == NULL) {
    #ifdef DEBUG
    fprintf(fp, " Allocation of column values failed.\n");
    fflush(fp);
    #endif
    strcpy(Results, "000000001");
    error("setup_sqlda()", "allocate column values", 0, "Memory Error");
    return(FAILURE);
    if ((Select_da->I[i] = (short *) malloc(sizeof(short))) == NULL) {
    #ifdef DEBUG
    fprintf(fp, " Allocation of idicator values failed.\n");
    fflush(fp);
    #endif
    strcpy(Results, "000000001");
    error("setup_sqlda()", "allocate indicator values", 0, "Memory Error");
    return(FAILURE);
    #ifdef DEBUG
    fprintf(fp, " Allocation of memory for values succeeded.\n");
    fflush(fp);
    #endif
    return(SUCCESS);
    | add_eom adds the end of message |
    | delimiter (an aditional comma). |
    int
    add_eom() {
    char *result_ptr;
    if (strlen(Results) >= sizeof(Results) - 1) {
    strcpy(Results, "000000001");
    error("add_eom()", "Add eom failed. Size overflow", 0, "Memory Error");
    return(FAILURE);
    result_ptr = &Results[strlen(Results)-1];
    while (*result_ptr && (*result_ptr != ','))
    result_ptr--;
    if (*result_ptr) {
    result_ptr++;
    *(result_ptr++) = ',';
    *result_ptr = '\0';
    return(SUCCESS);
    int close_cursor() {
    char msg[256], oraclmsg[256];
    int buf_len = 0, msg_len = 0;
    | Close the cursor. |
    EXEC SQL
    CLOSE sql_cursor;
    #ifdef DEBUG
    fprintf(fp, " Closing cursor. RC: %d\n", sqlca.sqlcode);
    fflush(fp);
    #endif
    if (sqlca.sqlcode != 0) {
    buf_len = sizeof(oraclmsg)-1;
    sqlglm(oraclmsg, &buf_len, &msg_len);
    oraclmsg[msg_len] = '\0';
    error("generate_sql()", "close cursor", sqlca.sqlcode, oraclmsg);
    return(FAILURE);
    return(SUCCESS);
    int
    fetch() {
    char msg[256], oraclmsg[256];
    char buf[MAX_STRING_LENGTH+4];
    int buf_len = 0, msg_len = 0;
    EXEC SQL
    FETCH sql_cursor
    USING DESCRIPTOR Select_da;
    #ifdef DEBUG
    fprintf(fp, " --> Fetching rows. RC %d\n", sqlca.sqlcode);
    fflush(fp);
    #endif
    if (sqlca.sqlcode != 0) {
    if (sqlca.sqlcode != NODATAFOUND) {
    buf_len = sizeof(oraclmsg)-1;
    sqlglm(oraclmsg, &buf_len, &msg_len);
    oraclmsg[msg_len] = '\0';
    error("fetch()", "Error fetching row.", sqlca.sqlcode, oraclmsg);
    return(sqlca.sqlcode);
    return(NODATAFOUND);
    return(SUCCESS);
    | Free up any memory structures. |
    void
    free_memory() {
    int i = 0;
    for (i = 0; i < Select_da->F; i++) {
    free(Select_da->V[i]);
    free(Select_da->I[i]);
    | generate_sql() uses the message we received from the queue |
    | (a SQL statement) to query the database. We have to use |
    | dynamic Sql Version 4 for this type of Sql. The number of |
    | columns we are selecting is unknown. This means we can't |
    | use the INTO clause. |
    int
    generate_sql() {
    char buf[MAX_STRING_LENGTH+4];
    int rc = SUCCESS, done = FALSE, nullok = 0, i = 0;
    #ifdef DEBUG
    if ((fp = fopen(SQLLOG, "a")) == NULL)
    fp = stderr;
    #endif
    | Connect to the database |
    if (connect_db() == FAILURE)
    return(FAILURE);
    if (setup_sqlda() == FAILURE)
    return(FAILURE);
    | Place the answer in a comma delimited buffer. |
    memset(Results, NULL, sizeof(Results));
    done = FALSE;
    while (!done) {
    rc = fetch();
    if (rc != SUCCESS) {
    if (Results[0] == '\0')
    sprintf(Results, "%9d,", rc);
    done = TRUE;
    else {
    | Put return code of success in first. |
    if (Results[0] == '\0')
    strcpy(Results, "000000000,");
    for (i = 0; i < Select_da->F; i++) {
    Select_da->V[i][Select_da->L[i]] = '\0';
    | Check to see if the value is null. |
    if (*Select_da->I[i] < 0)
    strcpy(buf, " ,");
    else
    sprintf(buf, "%s,", Select_da->V[i]);
    if (strlen(Results) + strlen(buf) > sizeof(Results)) {
    strcpy(Results, "000000001");
    error("generate_sql()", "String concat failed. Size overflow", 0, "Memory Error");
    return(FAILURE);
    strcat(Results, buf);
    #ifdef DEBUG
    fprintf(fp, " --> Results %s\n", Results);
    fflush(fp);
    #endif
    | Close the cursor. |
    close_cursor();
    | Disconnect from the database |
    disconnect_db();
    | Remove trailing comma. |
    if (add_eom() == FAILURE)
    return(FAILURE);
    #ifdef DEBUG
    fflush(fp);
    #endif
    free_memory();
    #ifdef DEBUG
    fclose(fp);
    #endif
    null

  • SQL error 3113 occurred when executing EXEC SQL.

    Hi,
    We are facing one typical problem, One background is failing regularly with
    below dump. as we now got all notes giving information, if database  restarted
    taking backup, these type of failures occur, but our database is only down for backup once in a week, but it is failing with frequenly.
    in this two servers are located in different place, in this job tries to connect
    another server to get material statistics.
    It is giving some error message in sm21 with
    SQL error 3113 occurred when executing EXEC SQL.
    work procees in reconnect mode.
    all notes saying these types of dump occur when database restared, but this dump
    even though database is up.
    below is short dump, please can anyone help me from this problem.
    ABAP runtime errors    DBIF_DSQL2_SQL_ERROR
          Occurred on    08.01.2007 at 00:30:28
    >> Short dump has not been completely stored. It is too big.
    SQL error 3113 occurred when executing EXEC SQL.
    What happened?
    The error occurred in the current database connection "AZ1".
    What can you do?
    Note the actions and input that caused the error.
    Inform your SAP system administrator.
    You can print out this message by choosing "Print". Transaction ST22
    allows you to display and manage termination messages, including keeping
    them beyond their normal deletion date.
    Error analysis
    How to correct the error
    Database error text........: "ORA-03113: end-of-file on communication channel#"
    Triggering SQL statement...: "select mara.groes, mara.brgew, mara.ntgew,
    mara.gewei, mara.volum, mara.voleh, mara.mstae, mara.mstde, mara.prdha,
    marc.matnr, marc.werks, marc.mmsta, marc.mmstd from sapr3.mara, sapr3.m
    where sapr3.mara.mandt = sapr3.marc.mandt and sapr3.mara.matnr =
    Internal call code.........: "[DBDS/NEW DSQL]"
    Please check the entries in the system log (Transaction SM21).
    If the error occurred in a non-modified SAP program, you may be
    able to find a solution in the SAP note system.
    If you have access to the note system yourself, use the following
    search criteria:
    "DBIF_DSQL2_SQL_ERROR"
    "ZM2431216 " or "ZM2431216 "
    "EXTRACT_GENERAL_DATA"
    If you cannot solve the problem yourself, please send the
    following documents to SAP:
    1. A hard copy print describing the problem.
      To obtain this, select the "Print" function on the current screen.
    2. A suitable hardcopy prinout of the system log.
      To obtain this, call the system log with Transaction SM21
      and select the "Print" function to print out the relevant
      part.
    3. If the programs are your own programs or modified SAP programs,
      supply the source code.
      To do this, you can either use the "PRINT" command in th
      print the programs using the report RSINCL00.
    4. Details regarding the conditions under which the error o
      or which actions and input led to the error.
    System environment
    SAP Release.............. "46C"
    Application server....... "essceu3"
    Network address.......... "172.19.119.198"
    Operating system......... "AIX"
    Release.................. "5.3"
    Hardware type............ "00C7ADBD4C00"
    Database server.......... "ukblx176"
    Database type............ "ORACLE"
    Database name............ "EU3"
    Database owner........... "SAPR3"
    Character set............ "es_ES.ISO8859-1"
    SAP kernel............... "46D"
    Created on............... "Jul 9 2006 20:26:33"
    Created in............... "AIX 1 5 00447C4A4C00"
    Database version......... "OCI_920__OCI_7_API "
    Patch level.............. "2257"
    Patch text............... " "
    Supported environment....
    Database................. "ORACLE 8.0.5.., ORACLE 8.0.6.., ORACLE
    8.1.6.., ORACLE 8.1.7.., ORACLE 9.2.0.., ORACLE 10.2.0.."
    SAP database version..... "46D"
    Operating system......... "AIX 1 4, AIX 2 4, AIX 3 4, AIX 1 5, AIX 2 5, AIX 3
    5, , System build information:,                                      , LCHN :
    841480"
    User, transaction...
    Client.............. 600
    User................ "MPZMMES"
    Language key........ "S"
    Transaction......... " "
    Program............. "ZM2431216 "
    Screen.............. "SAPMSSY0 1000"
    Screen line......... 6
    Information on where termination occurred
    The termination occurred in the ABAP/4 program "ZM2431216 " in
    "EXTRACT_GENERAL_DATA".
    The main program was "ZM2431216 ".
    The termination occurred in line 980
    of the source code of program "ZM2431216 " (when callin
    The program "ZM2431216 " was started as a background jo
    Source code extract
    009500              mara.ntgew,
    009510              mara.gewei,
    009520              mara.volum,
    009530              mara.voleh,
    009540              mara.mstae,
    009550              mara.mstde,
    009560              mara.prdha,
    009570              marc.matnr,
    009580              marc.werks,
    009590              marc.mmsta,
    009600              marc.mmstd
    009610        into :w_ops-groes,
    009620              :w_ops-brgew,
    009630              :w_ops-ntgew,
    009640              :w_ops-gewei,
    009650              :w_ops-volum,
    009660              :w_ops-voleh,
    009670              :w_ops-mstae,
    009680              :w_ops-mstde,
    009690              :w_ops-prdha,
    009700              :w_ops-matnr,
    009710              :w_ops-werks,
    009720              :w_ops-mmsta,
    009730              :w_ops-mmstd
    009740        from sapr3.mara, sapr3.marc
    009750        where sapr3.mara.mandt = sapr3.marc.mandt
    009760          and sapr3.mara.matnr = sapr3.marc.matnr
    009770          and sapr3.mara.mandt = :p_mandt
    009780          and sapr3.mara.matnr = :w_ebs-matnr
    009790          and sapr3.marc.werks = :p_owerks
        >    ENDEXEC.
    009810  endform.                    " extract_general_data
    009820  *&
    009830  *&      Form  append_i_ops
    009840  *&
    009850  *      Appends W_OPS to I_OPS
    009860  *
    009870  form append_i_ops.
    009880    append w_ops to i_ops.
    009890  endform.                    " append_i_ops
    009900  *&
    009910  *&      Form  extract_material_description
    009920  *&
    009930  *      Extracts a Material Description from the remote database an
    009940  *      modifies the current record in I_OPS.
    009950  *
    009960  *        >P_SPRAS  Language Key
    009970  *
    009980  form extract_material_description using    p_spras.
    009990    EXEC sql performing set_langauge.
    Contents of system fields
    SY field contents..................... SY field contents............
    SY-SUBRC 0                            SY-INDEX 0
    SY-TABIX 1                            SY-DBCNT 1
    SY-FDPOS 18                            SY-LSIND 0
    SY-PAGNO 0                            SY-LINNO 1
    SY-COLNO 1
    Chosen variables
    Name.......................... Contents.1........2........3....+..
    W_EBS-PRAT4
                                  2
                                  0
    W_OPS-GROES
                                  22222222222222222222222222222222
                                  00000000000000000000000000000000
    W_OPS-BRGEW                    #######
                                  0000000
                                  000000C
    W_OPS-NTGEW                    #######
                                  0000000
                                  000000C
    regards,
    krishnaiah.

    Hi,
    This is usually a SERVER SIDE DATABASE PROBLEM or SQLNET LISTENER (server side) PROBLEM.  The client side should initially be ignored and instead the server should be investigated. In rare cases, this can be caused by client
    side memory or other resource problem, or a DLL version mismatch, but this is
    unlikely.
    Enlist the assistance of your DBA.  Then reproduce the ORA-3113 error on your
    client application.  Ask your DBA to look at the database side Alert.log and
    trace files and look for ANY activity.  Any activity that coincides with your
    ORA-3113 will be a clue.
    REgards
    Vinod

Maybe you are looking for

  • ITunes 7: unknown publisher?

    a message keeps coming up that iTunes is from an unknown publisher and i can only click 'ok' so i can't go any farther in the installation. It also sometimes says something about a cabinet? It first says: Error 1905.Module C:/Program Files/iTunes/iTu

  • Payment Run Problem

    Dear Gurus, We had 100 open items for venders. We decided to pay all of them and done all the settings in F110.The problem is that payment cleared for the 60 items and left 40 items.What whould be the reason? How to make payment rest of them? Once ag

  • Web Page Composer: making iViews available in Portal Repository tab

    Hello experts. I'm trying to make some content (banners, images, iviews) for WPC (in SAP EP 7.4) and I cannot find any information how to add an iView to the Portal Repository (see the image). It says 'The contents of this repository are defined by y

  • How is supposed schools should install XCode 4 in many macs rooms?

    With XCode 3, and before, intalling it was a matter of preparing a Mac and deploying it over the many macs each lab has, but I don't know how to do it with the new App Store policy of the new XCode 4. Please, are there something we have missed? Any h

  • Generate legal paper report

    How do I use XML Publisher to generate a report on legal paper from Oracle Concurrent Manager in Oracle Financials 11i? My template type will either by RTF or XSL-TEXT.