EXEC SQL / EXECUTE PROCEDURE
Hi,
I´ve been asked to develop a program that should be run in background as a job.
The aim of this program is to select certain data from SAP an then pass it to a DB (sql) outside SAP so that this DB always gets the most updated data.
I´ve already set up an entry in table
DBCON.
My problem is that when I change the DB name in table DBCON the program does not work because it always remembers the former entry, that is, it re-uses the stored procedure already used in the former execution of the program.
Here goes the code:
EXEC SQL.
SET CONNECTION DEFAULT
ENDEXEC.
EXEC SQL.
CONNECT TO 'TOMAS3' AS 'con'
ENDEXEC.
EXEC SQL.
SET CONNECTION 'con'
ENDEXEC.
LOOP AT ti_vbap INTO wa_vbap.
CLEAR: wa_itab, g_input.
wa_itab-sapOrdID = wa_vbap-vbeln.
etc
CONCATENATE
wa_itab-sapOrdID
wa_itab-CopPos
wa_itab-isbn
wa_itab-isbnOLD
wa_itab-sta
wa_itab-dat
wa_itab-pte
wa_itab-snu INTO g_input.
call to the stored procedure that updates the external DB
EXEC SQL.
EXECUTE PROCEDURE RefrescaCOPdeSAP_JOBSAP2 ( IN :g_input )
ENDEXEC.
ENDLOOP.
*Close connection to external DB
EXEC SQL.
DISCONNECT 'con'
ENDEXEC.
Is there an statement like BEGIN TRANS
/ COMMIT that is missing?
Have you got an example so that I may have an idea of how to deal with this situation?.
Best regards.
Hi,
i think i´ve found out where the problem is.
In table
DBCON i´ve got the following entry:
MSSQL_SERVER=1XX.X0.X.X2 MSSQL_DBNAME=ESPAÑA
it seems as if the character 'Ñ' causes the connection to fail.
i´ve tried to connect to another DB where MSSQL_DBNAME=ESPANA (coy of the former one) and there was no problem.
could it be that the character 'Ñ' is the cause of the problem?.Best regards.
Similar Messages
-
Hi,
My ProC code works fine when I have Exec sql in it but when I include plsql block in it using EXEC SQL EXECUTE, it throws the following error:
/tmp/cc88UGZa.o(.text+0x2c0): In function `main':
: undefined reference to `ECPGget_sqlca'
I have included all these below header files:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sqlca.h>
#include <sqlda.h>
#include <sqlcpr.h>
and the path have been mentioned in pcscfg.cfg as well.
what can be the reason and the solution to this please? Help is appreciated.
Thanks in advance!
AshYou have to use 'BEGIN procedure_name END' in the execute statement while calling PL/SQL Procedures
EXEC SQL EXECUTE
DECLARE
BEGIN
END;
END-EXEC; -
I am interested in executing a stored Oracle procedure using Forte. I need
to pass records instead of scalars. Is this possible and, if so, how is it
accomplished?
Thanks
Richard Hedrick
[email protected]
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Hi,
i think i´ve found out where the problem is.
In table
DBCON i´ve got the following entry:
MSSQL_SERVER=1XX.X0.X.X2 MSSQL_DBNAME=ESPAÑA
it seems as if the character 'Ñ' causes the connection to fail.
i´ve tried to connect to another DB where MSSQL_DBNAME=ESPANA (coy of the former one) and there was no problem.
could it be that the character 'Ñ' is the cause of the problem?.Best regards. -
Execute procedure error (Native SQL)
Hi experts,
I create a procedure
EXEC SQL.
create or replace procedure update_zsmadiprinc
is begin
( p_codigo in number(5),
p_ano in varchar2(4),
p_doc_vlr_princ in varchar2(10)
p_subrc out number ) is begin
update T_INTERF_RESSARC_FORNEC_R3
set ano_doc = p_ano,
NUM_DOC_VALOR_PRINC = p_doc_vlr_princ,
where cod_interf_ressarc_fornec_r3 = p_codigo;
if sql%found then
p_subrc := 0;
else
p_subrc := 4;
end if;
end;
ENDEXEC.
and execute it
EXEC SQL.
execute procedure update_zsmadiprinc
(in :wa-cod_interf,
in :wa-ano_doc,
in :wa-num_doc_valor_princ,
out :vg_subrc)
ENDEXEC.
But when i execute the procedure, shows dump error:
Database error text........: "ORA-06550: line 1, column 7:#PLS-00905: object
UPDATE_ZSMADIPRINC is invalid#ORA-06550: line 1, column 7:#PL/SQL:
Statement ignored#"
Triggering SQL statement...: "CLOSE "
Internal call code.........: "[DBDS/NEW DSQL]"
Please check the entries in the system log (Transaction SM21).
I comment all source, and the error is the same.
When i create the procedure, no erros are show.
I changed the name of the procedure, the type of parameters, and now i comment all and the error always is the same!!!! Can you help me!!! I need to finish this urgently!
Thanks in advance
Message was edited by:
RPIt is not possible to create a procedure, then, i just execute sql direct.
thanks -
(OS - SCO, Oracle 817, Pro*C/C++: Release 2.2.4.0.0)
In C program I have a PL/SQL block with WHILE LOOP. Inside the loop I have SELECT statement with a begin..end arroung it and with EXCEPTION WHEN NO_DATA_FOUND for internal block. In this exception I have no RAISE statement. So, I expect the loop will be not broken by NO_DATA_FOUND error.
After control comes to the EXCEPTION NO_DATA_FOUND the loop is not continue anymore (but error is not populated out of this begin..end.) If EXCEPTION NO_DATA_FOUND is commented by -- the loop runs completely.
Is it known bug? Does anybody get something like this?
To be more specific, my EXEC SQL EXECUTE .. END EXECUTE block looks like this:
DECLARE
BEGIN
WHILE .. LOOP
begin SELECT ...
exception when NO_DATA_FOUND then NULL;
when others then ... RAISE;
end;
END LOOP;
END;
Would appreciate any response on this matter.
Thanks!
Alex.Call the procedure from another "wrapper" procedure. In the wrapper, place the call within to your existing procedure in a
for i in 1..3 loop
call procedure;
if <successful condition> then
exit loop;
end if;
end loop;I think that'd be easier than trying to work on controlling everything from within a single procedure. You could even set up a PACKAGE where the wrapper was the only public procedure, where your current procedure is private, and thus, can't be called outside of the wrapper, by accident. --=cf -
Dynamic SQL Stored Procedure call in Pro*C Application
Hello All
Could you help with a sample Pro*C program (or snippet) which has a dynamic call to a stored procedure? The procedure to be called is determined at run time and so also the number of parameters to it.
Is this even possible using Pro*C?
Thanks in Advance
RDHi Colin & Faust
We found sample pro*c programs for dynamically calling PL/SQL blocks but not for dynamically calling stored procedures.
Heres the program we compiled successfully but it doesnt work, it gives a core dump on execution. Could you point out whats wrong.
#include<stdio.h>
#include<iostream>
#include<fstream>
#include<stdlib.h>
#include<sqlca.h>
#include<string>
#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<thread.h>
#include<sqlda.h>
#include<sqlcpr.h>
using namespace std;
#define TRUE 1
int main()
EXEC SQL BEGIN DECLARE SECTION;
char *UserID = getenv( "DATABASE" );
char query[100];
EXEC SQL END DECLARE SECTION;
SQLDA *bind_des;
EXEC SQL CONNECT :UserID;
EXEC SQL WHENEVER SQLERROR CONTINUE;
bind_des = SQLSQLDAAlloc( 0, 2, (size_t)10, (size_t)0 );
bind_des->N = 2;
strcpy( query, "CALL sel_dept( :empno,:name );");
//Calling stored procedure sel_dept( no NUMBER IN, name VARCHAR2 OUT)
EXEC SQL PREPARE sql_stmt from :query;
EXEC SQL DESCRIBE BIND VARIABLES FOR sql_stmt INTO bind_des;
bind_des->N = bind_des->F;
//cout << " bind_des->N after assigment = " << bind_des->N;
//--------------------- Enter the Input values -----------------------------
//parameter :1
bind_des->L[0] = 4;
/* Allocate storage for value and null terminator. */
bind_des->V[0] = (char *) malloc(bind_des->L[0] + 1);
/* Store value in bind descriptor. */
strcpy(bind_des->V[0], "50");
/* Set datatype to STRING. */
bind_des->T[0] = 2;
//parameter :2
bind_des->L[1] = 20;
/* Allocate storage for value and null terminator. */
bind_des->V[1] = (char *) malloc(bind_des->L[1] + 1);
/* Store value in bind descriptor. */
strcpy(bind_des->V[1], "");
/* Set datatype to STRING. */
bind_des->T[1] = 5;
EXEC SQL EXECUTE sql_stmt;
//cout<<"name"<<"\t"<bind_des->V[0]<<"\t"<<bind_des->V[1]<<endl;
cout << "name"<<"\t";
cout << "bind_des->V[0]=" << bind_des->V[0]<<"\t";
cout << "bind_des->V[1]=" << bind_des->V[1]<<"\t"<<endl;
for (int i = 0; i < bind_des->F; i++) /* for bind descriptor */
free(bind_des->V);
free(bind_des->I[i]);
SQLSQLDAFree(0, bind_des);
EXEC SQL COMMIT;
return 0; -
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,
MattI 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. -
Memory Allocated using EXEC SQL VAR in ProC
For a table that stores resumes, I have a ProC program which outputs LONG column values into a host variable. Here is the table definition:
create table resume (resume_id number(5),
resume_size number(15),
resume_text LONG)
The size of the resume_text can be vary from 0 bytes up to 90K bytes. We use the column "resume_size" to store the size of the resume_text in bytes. Since most of them are smaller than 8K, we don't want to allocate 90K memory for every resume SELECT call. Before we do the SELECT on the resume_text, a host variable pointer is used to allocate memory according to the size of the resume_text:
char *resume_buffer;
len = get_resume_size(id); /* A SELECT statement to fetch the resume_size for this resume from the table */
resume_buffer = malloc(len); /* Allocate memory for the resume according to the resume_size. For example, len could be 6000 */
EXEC SQL VAR resume_buffer IS LONG (100000); /* without using a constant number will lead to a compiler error */
EXEC SQL SELECT resume_text INTO :resume_buffer FROM resume WHERE resume_id = :id;
Is 100000" the size actually allocated in memory (either OS level or Oracle data buffer cache) every time it runs or is it just the maximum possible size needed to satisfy the precompiler?
Any help greatly appreciated.You have to use 'BEGIN procedure_name END' in the execute statement while calling PL/SQL Procedures
EXEC SQL EXECUTE
DECLARE
BEGIN
END;
END-EXEC; -
Hi,
I am having 2 SQL blocks which calls the function HPS_SELECT_PIN_NB and INC_PIN_ERROR_NUMBER in oracle . Now the problem is that in the function inc_pin_error_number () .I see the trace event
trace_event("Debut inc_pin_error_number()", PROCESSING);
but i am NOT able to execute the EXEC SQL EXECUTE statement ( I guess that the control is not going in this EXEC statement ) , but when i call this same function (HPS_INC_PIN_NB) from the function load_pin_error_number it works .
Please have a look at the two functions below and suggest as to why the functions is NOT being called from inc_pin_error_number .
BLOCK 1
int load_pin_error_number (V_card_number,
V_pin_verification_number)
char *V_card_number;
int *V_pin_verification_number;
EXEC SQL BEGIN DECLARE SECTION;
int response_code;
VARCHAR T_card_number[22];
int T_pin_verification_number;
VARCHAR ERREUR[256];
EXEC SQL END DECLARE SECTION;
char buffer[LG_MAX];
trace_event("Debut load_pin_error_number()", PROCESSING);
memset(T_card_number.arr, 0, sizeof(T_card_number.arr));
memcpy(T_card_number.arr, V_card_number, strlen(V_card_number));
T_card_number.len = strlen(V_card_number);
response_code =999;
EXEC SQL EXECUTE
BEGIN
:response_code:= HPS_SELECT_PIN_NB (:T_card_number,
:T_pin_verification_number);
EXCEPTION
WHEN OTHERS THEN BEGIN
:response_code :=-2;
:ERREUR := SQLERRM;
END;
END;
END-EXEC;
if (response_code == -2)
memset(buffer, 0, sizeof(buffer));
sprintf(buffer,"GET PIN ERROR ERROR : %s\n", ERREUR.arr);
trace_event(buffer, ERROR);
*V_pin_verification_number = T_pin_verification_number;
sprintf(buffer,"V_pin_verification_number %d\n", V_pin_verification_number);
trace_event(buffer,V_pin_verification_number);
trace_event("Fin load_pin_error_number()", PROCESSING);
sprintf(buffer,"Response_code %d\n", response_code);
trace_event(buffer,response_code);
return(response_code);
BLOCK 2
int inc_pin_error_number (V_card_number)
char *V_card_number;
EXEC SQL BEGIN DECLARE SECTION;
int response_code;
VARCHAR T_card_number[22];
VARCHAR ERREUR[256];
EXEC SQL END DECLARE SECTION;
char buffer[LG_MAX];
trace_event("Debut inc_pin_error_number()", PROCESSING);
memset(T_card_number.arr, 0, sizeof(T_card_number.arr));
memcpy(T_card_number.arr, V_card_number, strlen(V_card_number));
T_card_number.len = strlen(V_card_number);
response_code =-1;
EXEC SQL EXECUTE
BEGIN
:response_code:= HPS_INC_PIN_NB (:T_card_number);
EXCEPTION
WHEN OTHERS THEN BEGIN
:response_code :=-2;
:ERREUR := SQLERRM;
END;
END;
END-EXEC;
if (response_code == -2)
memset(buffer, 0, sizeof(buffer));
sprintf(buffer,"INC PIN ERROR ERROR : %s\n", ERREUR.arr);
trace_event(buffer, ERROR);
trace_event("Fin inc_pin_error_number()", PROCESSING);
return(response_code);
Regards
Dhananjay Javalkar
nullPerhaps you can trap (profile) the query in Oracle to see what it gets submitted,
thing is this query
select id from table where ProcessedStatusColumn is null and DateColumn = (sub select to get most recent date in table where ProcessedStatusColumn is null)
is not guaranteed to return a value, you need a default returned in case the search failed e.g.
select
NVL(id, 0)
from table where ProcessedStatusColumn is null and DateColumn =
(sub select to get most recent date in table where
ProcessedStatusColumn is null)
Arthur My Blog -
How to execute procedure in SQL Worksheet ?
Hi, anybody know, how I can execute procedure here?
I try EXEC sec_roles, EXEC security_admin.sec_roles, EXECUTE - there is a SQL statement error. When I use CALL - there is no such procedure (I have execute previleges).
Although in SQLPlus EXEC works, but there are problems with standard SQL commands (all of them returns "2" no matter what content is).
Any ideas?
Regards
Krzysztofexec procedure(parameters) is a sql plus (and a few others) shortcut for
BEGIN
procedure(parameters);
END;So try that then pressing/clicking whatever it is in sql worksheet that makes a statement run.
Note that if your procedure has parameters defined as OUT or IN OUT, you will need to supply a variable to accept the returned value(s).
John -
How to use 'Execute Procedure' to retrieve table data from an ext. MS SQL ?
Hi,
We have to call a stored procedure from an external MS SQL database . We are able to connect to the database and are able to successfully do a SQL (Select ) on the SQL tables. However to maintain data integrity and other security issues, we have to call a stored procedure on that database from SAP. The stored rocedure will return a table which will contain multiple records .
We have tried using the EXECUTE PROCEDURE command. However it returns SQL errors?
Our SAP instance is on MS SQL.
Please note we have gone through all SAP notes and SDN already. The query is not about connecting to the database. It is solely to find out the correct way for calling the stored procedure. The example in the SAP help documentation is for single IN and OUT parameters. We are able to do that successfully. Our requirement is to get a table back from the stored procedure.
Please help with the correct syntax and code example if you have one.
I would be glad to provide any other information that may be helpful.
Thanks in advance.Hi,
I too have a similar issue, I have a stored procedure written in MS SQL and it executes but I need the result in an internal table; How do I get it into an internal table?
Following code is being used. Now the output of the query that is being executed, I need it in my internal table
EXEC SQL.
EXECUTE PROCEDURE d01.Z_PRICINGREPORT ( IN :i_mandt,
IN :i_kschl,
IN :i_vkorg,
IN :i_vtweg,
IN :i_matkll,
IN :i_matklh,
IN :i_matnrl,
IN :i_matnrh,
IN :i_inco1,
IN :i_inco2,
IN :i_zsalel,
IN :i_zsaleh,
IN :i_kunnrl,
IN :i_kunnrh,
IN :i_chargl,
IN :i_chargh,
IN :i_vkburl,
IN :i_vkburh,
IN :i_vkgrpl,
IN :i_vkgrph,
IN :i_wrkstl,
IN :i_wrksth,
IN :i_mtf,
IN :i_mtt,
IN :i_datbi,
IN :i_werks,
IN :i_stock
ENDEXEC.
CATCH cx_sy_native_sql_error.
MESSAGE `Error in procedure handling` TYPE 'I'.
endtry.
Warm Regards,
Abdullah -
How to get name of PL/SQL stored procedure being executed?
When executing a PL/SQL stored procedure, is there a way to extract the name of the procedure programatically?
(Similar to the way an Oracle Form can retrieve it's own name via GET_APPLICATION_PROPERTY(CURRENT_FORM_NAME). )
ThanksHere is one sample ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.17
satyaki>
satyaki>
satyaki>CREATE OR REPLACE PROCEDURE error_test1 AS
2 BEGIN
3 dbms_output.put_line(dbms_utility.format_call_stack);
4 END error_test1;
5 /
Procedure created.
Elapsed: 00:00:06.45
satyaki>
satyaki>
satyaki>exec error_test1;
----- PL/SQL Call Stack -----
object line object
handle number name
1D609C14 3 procedure SCOTT.ERROR_TEST1
1D5A89B8 1 anonymous block
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.21
satyaki>
satyaki>Regards.
Satyaki De. -
Return code for EXECUTE PROCEDURE (native SQL)
Hi Experts,
I've seen in the Note 364707 that the field %_ERRCODE is no longer supported since WAS 6.10 for stored procedures like this:
EXEC SQL.
EXECUTE PROCEDURE proc [(parameter list)] %_ERRCODE INTO :rc
ENDEXEC.
So an Upgrade to WAS 7.00 gives this programms an error.
Has anybody an idea for an alternative?
Regards,
StefanHello Peluka,
i have seen you have worked with 'execute procedure'.
I want to execute a procedure with two Parameters and one structure. Example:
EXECUTE PROCEDURE test.p_getdata ( in :i_ls_nr , in :vdatum , out :vtest ).
vtest has the simple structure with field lieferscheinnr (char25).
When i execute the procedure, i get the error <b>wrong number or types of arguments in call</b>.
Do you know, whether execute procedure with structures is not possible?
Thank you in advance. -
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 -
PL/SQL: Executing a procedure from within another procedure
Hello, I'm a newbie and I need help on how to execute procedures from within another procedure. The procedure that I call from within the procedure have return values that I want to check.
I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
but I get the error message:
PLS-00103: Encountered the symbol "USER_GET_FORUM_INFO" when expecting one of the following::= . ( @ % ; immediate
The symbol ":=" was substituted for "USER_GET_FORUM_INFO" to continue.
And when I tried: EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
I get the error message:
PLS-00222: no function with name 'USER_GET_FORUM_INFO' exists in this scope
PL/SQL: Statement ignored
The procedure USER_GET_FORUM_INFO exists. (don't understand why it says "no FUNCTION with name", it's a procedure I'm executing)
I'm stuck so thanks for any help...
Below is all the code. I'm using Oracle 9i on RedHat Linux 7.3.
================================================================================
CREATE OR REPLACE PROCEDURE user_forum_requestsaccess (
p_forumid IN NUMBER,
p_requestmessage IN VARCHAR2
AS
var_forumid NUMBER;
var_forum_exists NUMBER;
var_forum_access NUMBER;
request_exists NUMBER;
var_forumname VARCHAR2(30);
FORUM_DOESNT_EXIST EXCEPTION;
FORUM_USER_HAS_ACCESS EXCEPTION;
FORUM_REQUEST_EXIST EXCEPTION;
BEGIN
SELECT SIGN(NVL((SELECT request_id FROM forum.vw_all_forum_requests WHERE forum_id = p_forumid AND db_user = user),0)) INTO request_exists FROM DUAL;
EXECUTE(user_get_forum_info(p_forumid, var_forum_exists, var_forum_access, var_forumname));
IF var_forum_exists = 0 THEN
RAISE FORUM_DOESNT_EXIST;
ELSIF var_forum_access = 1 THEN
RAISE FORUM_USER_HAS_ACCESS;
ELSIF request_exists = 1 THEN
RAISE FORUM_REQUEST_EXIST;
ELSE
INSERT INTO tbl_forum_requests VALUES (SEQ_TBL_FORUM_REQ_REQ_ID.NEXTVAL, SYSDATE, p_requestmessage, p_forumid, user);
INSERT INTO tbl_forum_eventlog VALUES (SEQ_TBL_FORUM_EVNTLOG_EVNT_ID.NEXTVAL,SYSDATE,1,'User ' || user || ' requested access to forum ' || var_forumname || '.', p_forumid,user);
COMMIT;
END IF;
EXCEPTION
WHEN
FORUM_DOESNT_EXIST
THEN RAISE_APPLICATION_ERROR(-20003,'Forum doesnt exist.');
WHEN
FORUM_USER_HAS_ACCESS
THEN RAISE_APPLICATION_ERROR(-20004,'User already have access to this forum.');
WHEN
FORUM_REQUEST_EXIST
THEN RAISE_APPLICATION_ERROR(-20005,'A request to this forum already exist.');
END;
GRANT EXECUTE ON user_forum_requestsaccess TO forum_user;
================================================================================
Regards Goranyou don't have to use execute when you want to execute a procedure (only on sql*plus, you would use it)
just give the name of the funtion
create or replace procedure test
as
begin
dbms_output.put_line('this is the procedure test');
end test;
create or replace procedure call_test
as
begin
dbms_output.put_line('this is the procedure call_test going to execute the procedure test');
test;
end call_test;
begin
dbms_output.put_line('this is an anonymous block calling the procedure call_test');
call_test;
end;
/
Maybe you are looking for
-
How to move files after installing new hard drive
I am considering the installation of a new 80 or 100 GB hard drive. I purchased the new iLife 06 program but I do not have enough space to install on my present 60 GB unit. I only have 3 GB available. I've read all the posts involving the possible br
-
Multi-Mapping-Programm (1:n)
Hi, I have to make a 1:n Mapping with the graphical mapping editor. The situation is as follows: I have 1 ORDER with n positions and I have to convert this order to n ORDERS with 1 position in each order. My problem is, that I have to use the header-
-
Hi, After import the SAP_ESS to Development, I noticed that in the Buildspaces JDI_ESSTrack_D, there are 103 "Broken by Itself DCs" . These DCs have Compile State in "Red". An example of this DC is ess/ar/addr/cfg. Can you help to explain: 1. What is
-
I've had this problem for some time using the old iMovie HD/iDVD/Toast. Now I'm using the latest iMovie and Yosemite I hoped the problem might have disappeared, but sadly, no. My proble is in bad judder Movie footage shot using a Camcorder, and 3 di
-
ADF BC creating table from view
This is plain stupid all this crap of IDE's and Frameworks and things alike. I just loose a few days of work trying to do the simplest thing, create a table from a BC view. I did what the tutorials say, just drag&drop a %$$/& data control from the da