Compilation pl/sql error
create or replace procedure proc_test(v_empno in number
,v_ref_cursor out sys_refcursor
) is
function get_dept_name(p_department_id number)
return varchar2
is
v_dept_name varchar2(100);
begin
select department_name into v_dept_name
from departments
where department_id = p_department_id;
return v_dept_name;
end;
begin
open v_ref_cursor for
select e.last_name,get_dept_name(e.department_id)
from employees e
where e.employee_id = v_empno;
end;
This function give following
LINE/COL ERROR
18/2 PL/SQL: SQL Statement ignored
18/21 PL/SQL: ORA-00904: : invalid identifier
18/21 PLS-00231: function 'GET_DEPT_NAME' may not be used in SQL
Can you please clarify.
The function must be visible to SQL:
SQL> create or replace function get_dept_name(p_department_id varchar2)
2 return varchar2
3 is
4 v_dept_name varchar2(100);
5 begin
6 select dummy into v_dept_name
7 from dual
8 where dummy = p_department_id;
9 --
10 return v_dept_name;
11 --
12 end;
13 /
Function created.
SQL>
SQL> create or replace procedure proc_test
2 ( v_empno in varchar2
3 , v_ref_cursor out sys_refcursor
4 )
5 is
6 begin
7 open v_ref_cursor for
8 select e.dummy
9 , get_dept_name(e.dummy)
10 from dual e
11 where e.dummy = v_empno;
12 end;
13 /
Procedure created.
SQL> set autoprint on
SQL> var rc refcursor;
SQL> exec proc_test('X', :rc)
PL/SQL procedure successfully completed.
D
GET_DEPT_NAME(E.DUMMY)
X
X
1 row selected.
Ofcourse you'd encapsulate all this in a package.
Similar Messages
-
Pl/sql error while compiling forms on AS 10g running on linux
Compiling WHEN-BUTTON-PRESSED trigger on FILECHOOSER item in BLOCK2 data block...
Compilation error on WHEN-BUTTON-PRESSED trigger on FILECHOOSER item in BLOCK2 data block:
PL/SQL ERROR 201 at line 14, column 9
identifier 'WEBUTIL_FILE.FILE_SELECTION_DIALOG' must be declared
PL/SQL ERROR 0 at line 14, column 1
Statement ignored
Compiling WHEN-BUTTON-PRESSED trigger on DUMMY item in WEBUTIL data block...
Compilation error on WHEN-BUTTON-PRESSED trigger on DUMMY item in WEBUTIL data block:
PL/SQL ERROR 201 at line 4, column 1
identifier 'WEBUTIL_CORE.SHOWBEANS' must be declared
PL/SQL ERROR 0 at line 4, column 1
Statement ignored
Compiling WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_CLIENTINFO_FUNCTIONS item in WEBUTIL data block...
Compilation error on WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_CLIENTINFO_FUNCTIONS item in WEBUTIL data block:
PL/SQL ERROR 201 at line 2, column 3
identifier 'WEBUTIL_CORE.CUSTOMEVENTHANDLER' must be declared
PL/SQL ERROR 0 at line 2, column 3
Statement ignored
Compiling WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_FILE_FUNCTIONS item in WEBUTIL data block...
Compilation error on WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_FILE_FUNCTIONS item in WEBUTIL data block:
PL/SQL ERROR 201 at line 2, column 3
identifier 'WEBUTIL_CORE.CUSTOMEVENTHANDLER' must be declared
PL/SQL ERROR 0 at line 2, column 3
Statement ignored
Compiling WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_HOST_FUNCTIONS item in WEBUTIL data block...
Compilation error on WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_HOST_FUNCTIONS item in WEBUTIL data block:
PL/SQL ERROR 201 at line 2, column 3
identifier 'WEBUTIL_CORE.CUSTOMEVENTHANDLER' must be declared
PL/SQL ERROR 0 at line 2, column 3
Statement ignored
Compiling WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_SESSION_FUNCTIONS item in WEBUTIL data block...
Compilation error on WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_SESSION_FUNCTIONS item in WEBUTIL data block:
PL/SQL ERROR 201 at line 2, column 3
identifier 'WEBUTIL_CORE.CUSTOMEVENTHANDLER' must be declared
PL/SQL ERROR 0 at line 2, column 3
Statement ignored
Compiling WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_FILETRANSFER_FUNCTIONS item in WEBUTIL data block...
Compilation error on WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_FILETRANSFER_FUNCTIONS item in WEBUTIL data block:
PL/SQL ERROR 201 at line 2, column 3
identifier 'WEBUTIL_CORE.CUSTOMEVENTHANDLER' must be declared
PL/SQL ERROR 0 at line 2, column 3
Statement ignored
Compiling WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_OLE_FUNCTIONS item in WEBUTIL data block...
Compilation error on WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_OLE_FUNCTIONS item in WEBUTIL data block:
PL/SQL ERROR 201 at line 2, column 3
identifier 'WEBUTIL_CORE.CUSTOMEVENTHANDLER' must be declared
PL/SQL ERROR 0 at line 2, column 3
Statement ignored
Compiling WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_C_API_FUNCTIONS item in WEBUTIL data block...
Compilation error on WHEN-CUSTOM-ITEM-EVENT trigger on WEBUTIL_C_API_FUNCTIONS item in WEBUTIL data block:
PL/SQL ERROR 201 at line 2, column 3
identifier 'WEBUTIL_CORE.CUSTOMEVENTHANDLER' must be declared
PL/SQL ERROR 0 at line 2, column 3
Statement ignoredi have already compile webutil.pll and its successfully compiled.
now,when i go for compiling my form, the pl/sql error have been ocured.
help required in placing the files (.pll,.olb.....) for utilizing the webutil functionality
kindly reply. its urgent
Message was edited by:
user494855 -
Exiting from sqlplus when there is any errors while compiling pl/sql progra
I am connecting to sqlplus from unix and I am executing a pl/sql script . Now if I get some error while compiling a procedure, package, function or any sql statement I want to exit sqlplus.
whenever sqlerror works only for sql statements but not for plsql
I dont want to query user_errors table and then throw some exception depending on the same .
Is there any command available or any easier way to solve this problem ?Those errors we get only when there is conflict in same etc.
Now consider the example here
sample.sql
whenever sqlerror exit failure ;
declare
s1 long;
begin
s1 := 'create or replace procedure proc1 as '||
'declare '||
'begin '||
'end; '||
'end;';
execute immediate s1;
end;
select 1 from dual;When I run the script
SQL> @sample.sql
ERROR:
ORA-24344: success with compilation error
ORA-06512: at line 9
Warning: PL/SQL compilation errors.
1
1Actually I want to get out before it executes select means once it throws error in pl/sql. -
Hi everyone.
Can anyone tell me what is wrong in this code below?
Code:
function NO_DAYSFormula return Number is
begin
IF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')
AND :P_TO_DT<:MATURITY_DATE
AND :ACCT_OPN_DT>:P_FR_DT
THEN RETURN (:P_TO_DT-:ACCT_OPN_DT+1);
ELSIF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')
AND :P_TO_DT<:MATURITY_DATE
AND :ACCT_OPN_DT<:P_FR_DT
THEN RETURN (:P_FR_DT-:P_TO_DT+1);
ELSIF TO_CHAR(TO_DATE(:P_FR_DT, 'DD-MM-RRRR'), 'RRRR') =TO_CHAR(TO_DATE(:ACCT_OPN_DT, 'DD-MM-RRRR'), 'RRRR')
AND :P_TO_DT>:MATURITY_DATE
AND :ACCT_OPN_DT<:P_FR_DT
THEN RETURN (:P_FR_DT-:MATURITY_DATE+1);
END IF;
END;
It gets compiled successfully but when i run the report, i get 2 errors.
Error 1:
REP-1401: 'no_daysformula':Fatal PL/SQL error occurred.
ora-06503: PL/SQL : Function returned without value.
Error 2:
REP-0619: You cannot run without a layout.
Should i use only 1 return statement?
Can i use as many return statements as i want?
What is the exact mistake? Please let me know.
Thank You.Let me clear you the first thing...
If you get any fatal errors while running the report (e.g., function returned without value,no value etc.,) the report will show
REP-0619: You cannot run without a layout.
So you just correct the function 'no_daysformula' .
First of all you run the report without that formula column.
If it works fine then , Check the return value of your formula column (Your formula column properties --> Return value --> value (It will be DATE as i think so).
As function will always return a single value, Check your formula 'no_daysformula' returns the same.
declare a return variable say for example..
DECLARE
V_DATE DATE;
BEGIN
--YOUR CODE---
RETURN V_DATE := (RETURN VALUE)
END;
Last but not least ... use Else condition to return (NULL or any value ) in your code and check..
If any Problem persists let me know
Regards,
Soofi. -
ORA-06502: PL/SQL: error TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
Hi,
I've a Compiled Body Package which code I described below:
create or replace
PACKAGE body emp_pkg
IS
TYPE boolean_tabtype2
IS
TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
valid_jobs boolean_tabtype2;
PROCEDURE add_employee(
first_name employees.first_name%TYPE,
last_name employees.last_name%TYPE,
deptid employees.department_id%TYPE,
jobid employees.job_id%type)
IS
BEGIN
IF valid_deptid(deptid) THEN
if valid_jobid(jobid) then
INSERT
INTO employees
employee_id,
first_name,
last_name,
email,
hire_date,
job_id,
department_id
VALUES
employees_seq.NEXTVAL,
first_name,
last_name,
SUBSTR(first_name,1,1)
||SUBSTR(last_name,1,7)
||'@buongio.com',
sysdate,
'SA_REP',
deptid
ELSE
RAISE_APPLICATION_ERROR (-20204, 'Invalid job ID. Try again.');
END IF;
END add_employee;
PROCEDURE init_jobs
is
begin
FOR rec IN
(SELECT job_id FROM jobs
LOOP
valid_jobs(rec.job_id):=true;
END LOOP;
END init_jobs;
function valid_jobid(
jobid employees.job_id%type)
return boolean
is
BEGIN
return valid_jobs.exists(jobid);
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('no valid');
RETURN FALSE;
END valid_jobid ;
BEGIN
init_jobs;
END emp_pkg;and the server gives me the next output
ORA-06502: PL/SQL: error : error de conversión de carácter a número numérico o de valorI suspect that the problem is the procedure init_jobs but I don't Know what could I do to resolve it.
Thanks in advance...sorry
I forget to remove it,
the code:
create or replace
PACKAGE body emp_pkg
IS
TYPE boolean_tabtype2
IS
TABLE OF BOOLEAN INDEX BY BINARY_INTEGER;
valid_jobs boolean_tabtype2;
PROCEDURE add_employee(
first_name employees.first_name%TYPE,
last_name employees.last_name%TYPE,
deptid employees.department_id%TYPE,
jobid employees.job_id%type)
IS
BEGIN
if valid_jobid(jobid) then
INSERT
INTO employees
employee_id,
first_name,
last_name,
email,
hire_date,
job_id,
department_id
VALUES
employees_seq.NEXTVAL,
first_name,
last_name,
SUBSTR(first_name,1,1)
||SUBSTR(last_name,1,7)
||'@buongio.com',
sysdate,
'SA_REP',
deptid
ELSE
RAISE_APPLICATION_ERROR (-20204, 'Invalid job ID. Try again.');
END IF;
END add_employee;
PROCEDURE init_jobs
is
begin
FOR rec IN
(SELECT job_id FROM jobs
LOOP
valid_jobs(rec.job_id):=true;
END LOOP;
END init_jobs;
function valid_jobid(
jobid employees.job_id%type)
return boolean
is
BEGIN
return valid_jobs.exists(jobid);
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('no valid');
RETURN FALSE;
END valid_jobid ;
BEGIN
init_jobs;
END emp_pkg; -
Rep: Fatal pl/sql error Occured
Hi All
I have created one formula display chassis number based on Process(line_code).
When compile time its no error , but if i have pass parameter running time its generate the report error
Rep-0069: Internal error
Rep-57054 : In-Process job terminate
Rep-1401 : " Fatal Pl/SQL error occurred.
Below i have posted my Formula column what i written
function CF_Chassis_numFormula return varChar2 is
l_chassis_num varchar2(300);
begin
if :line_code like 'CHASSIS%' then
select chassis_num into l_chassis_num from xxtc_chassis_dtls_v where CHS_SCH_NUM = :schedule_number;
elsif :line_code like 'SPOT%' then
BEgin
select chassis_num into l_chassis_num from xxtc_chassis_dtls_v where to_char(SPT_SCH_NUM) = to_char(:schedule_number);
Exception
when others then
Return null;
end;
elsif :line_code like 'METAL%' then
select chassis_num into l_chassis_num from xxtc_chassis_dtls_v where MTL_SCH_NUM = :schedule_number;
elsif :line_code like 'TRIM%' then
select chassis_num into l_chassis_num from xxtc_chassis_dtls_v where TRM_SCH_NUM = :schedule_number;
elsif :line_code like 'PAINT%' then
select chassis_num into l_chassis_num from xxtc_chassis_dtls_v where PNT_SCH_NUM = to_char(:schedule_number);
elsif :line_code like 'FREC%' then
select chassis_num into l_chassis_num from xxtc_chassis_dtls_v where FREC_SCH_NUM = :schedule_number;
elsif :line_code like 'N100%' then
select chassis_num into l_chassis_num from xxtc_chassis_dtls_v where N101_SCH_NUM = :schedule_number;
elsif :line_code like 'PDIC%' then
Begin
select chassis_num into l_chassis_num from xxtc_chassis_dtls_v where to_char(PDIC_SCH_NUM) = to_char(:schedule_number);
Exception
when others then
Return null;
end;
else
l_chassis_num :='';
end if;
return l_chassis_num;
end;
Can please help to fix that bug
Regards
Sanjay
Edited by: 993525 on May 30, 2013 9:32 AMPlease post the details of the application release, database version and OS.
Please enable trace/debug and see if you get more details about the error.
Thanks,
Hussein -
We have an external procedure running fine on 8.1.7 on VMS. After compiling and linking succesfully under 10.1.0, I get ORA-06521 PL/SQL: Error mapping function and ORA-06522: ERROR - vms_dlsym for file x, where x in the filename of the linked executable. Another external procedure that does not connect to the 10.1.0 database runs fine. What could be causing this error in Server 10.1.0 on VMS?
Thanks,
DaveHere is the code to create the function:
CREATE OR REPLACE FUNCTION f1
(h_file_name IN VARCHAR2)
RETURN BINARY_INTEGER
IS EXTERNAL
LIBRARY l1
NAME "f1"
LANGUAGE C
WITH CONTEXT
PARAMETERS
(CONTEST,
h_file_name string);
Here is the beginning of the Pro*C:
int f1(epctx, h_file_name)
OCIExtProcContext *epctx;
char h_file_name[70];
char h_line_txt [251];
int lineno;
FILE *fptr;
/* register the connection context ... */
EXEC SQL REGISTER CONNECT USING :epctx;
The function loads a flat file into the database. It is probably not related but are unable to SQLPLUS/ or SQLLDR/ into the database from an OS autheniticated account (get ORA-12547: TNS:lost contact.) Thanks for taking the time to look at this. There aren't many people trying this on VMS, I'd bet. -
Hi,
I am getting the following error :
SQL> select MinDistance(TT) from egg1;
select MinDistance(TT) from egg1
ERROR at line 1:
ORA-06521: PL/SQL: Error mapping function
ORA-06522: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/custagg.so:
undefined symbol: ODCIAggregateInitialize
I am compiling my C program with OCI using the following command :
g++ -Wall -c custagg.c -o custagg.o -I$ORACLE_HOME/rdbms/public -I/usr/lib
I am linking to get a shared library custagg.so file with following command :
ld -shared -o custagg.so custagg.o $ORACLE_HOME/lib/l*.so ../../usr/lib/libstdc++.s*
I am not getting any errors during these two phases.
And when i am calling the extproc custagg(Mindistance) which i implemented using ODCI(oracle data catridge interface) ...I am getting the error undefined symbol : ODCIAggregateInitialize
So can any one please let me know what shared libraries are required to access the ODCI services and also am I compiling and linking it the right way or am I missing any libraries.
I have the oci.h & odci.h and several other header files in my :
$ORACLE_HOME/rdbms/public
And while linking i am using : $ORACLE_HOME/lib/*.so files.
So I don't know whether my directory is missing some shared files related to ODCI : can any one please let me know which files or shared libraries I am missing :
Below are list of files in my : $ORACLE_HOME/lib :
custagg123.o libclntsh.so libdbcfg10.so libjox10.so libocci.so.10.1 liborasdkbase.so libskgxpd.so libunwind.so.5
custagg.so libclntsh.so.10.1 libemmas10.so libldapjclnt10.so libocijdbc10.so liborasdkbase.so.10.2 libskgxpu.so libxdb.so
facility.lis libclsra10.so libhasgen10.so libnjni10.so libocr10.so liborasdk.so libsqlplus.so shell.so
hsdb_odbc.so libcorejava.so libheteroxa10.so libnjssl10.so libocrb10.so liborasdk.so.10.2 libsqora.so.10.1 sysliblist
hsdb_ora.so libcoresh10.so libhsbase.so libnnz10.so libocrutl10.so libqsmashr.so libsrvm10.so
lclasses12.zip libcprts.so.5 libhsnav.so libnque10.so libodm10.so libskgxn2.so libsrvmhas10.so
libagtsh.so libcxa.so.3 libimf.so libntcpaio10.so libodmd10.so libskgxns.so libsrvmocr10.so
libagtsh.so.1.0 libcxa.so.5 libirc.a libocci.so libons.so libskgxp10.so libuini10.so
Please reply to my queries.
Please let me know if you want to have a look at the symbols of my object file
Thanks & Regards,
-NNYour issue may relate to XE and it may relate to OCI but it does not relate to SQL and PL/SQL. Consider posting your question in a forum where it will be on topic.
When you do include full version information (3 decimal places) and the code that is generating the exception. -
Hi,
I am getting the following error :
SQL> select MinDistance(TT) from egg1;
select MinDistance(TT) from egg1
ERROR at line 1:
ORA-06521: PL/SQL: Error mapping function
ORA-06522: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/custagg.so:
undefined symbol: ODCIAggregateInitialize
I am compiling my C program with OCI using the following command :
g++ -Wall -c custagg.c -o custagg.o -I$ORACLE_HOME/rdbms/public -I/usr/lib
I am linking to get a shared library custagg.so file with following command :
ld -shared -o custagg.so custagg.o $ORACLE_HOME/lib/l*.so ../../usr/lib/libstdc++.s*
I am not getting any errors during these two phases.
And when i am calling the extproc custagg(Mindistance) which i implemented using ODCI(oracle data catridge interface) ...I am getting the error undefined symbol : ODCIAggregateInitialize
So can any one please let me know what shared libraries are required to access the ODCI services and also am I compiling and linking it the right way or am I missing any libraries.
I have the oci.h & odci.h and several other header files in my :
$ORACLE_HOME/rdbms/public
And while linking i am using : $ORACLE_HOME/lib/*.so files.
So I don't know whether my directory is missing some shared files related to ODCI : can any one please let me know which files or shared libraries I am missing :
Below are list of files in my : $ORACLE_HOME/lib :
custagg123.o libclntsh.so libdbcfg10.so libjox10.so libocci.so.10.1 liborasdkbase.so libskgxpd.so libunwind.so.5
custagg.so libclntsh.so.10.1 libemmas10.so libldapjclnt10.so libocijdbc10.so liborasdkbase.so.10.2 libskgxpu.so libxdb.so
facility.lis libclsra10.so libhasgen10.so libnjni10.so libocr10.so liborasdk.so libsqlplus.so shell.so
hsdb_odbc.so libcorejava.so libheteroxa10.so libnjssl10.so libocrb10.so liborasdk.so.10.2 libsqora.so.10.1 sysliblist
hsdb_ora.so libcoresh10.so libhsbase.so libnnz10.so libocrutl10.so libqsmashr.so libsrvm10.so
lclasses12.zip libcprts.so.5 libhsnav.so libnque10.so libodm10.so libskgxn2.so libsrvmhas10.so
libagtsh.so libcxa.so.3 libimf.so libntcpaio10.so libodmd10.so libskgxns.so libsrvmocr10.so
libagtsh.so.1.0 libcxa.so.5 libirc.a libocci.so libons.so libskgxp10.so libuini10.so
Please reply to my queries.
Please let me know if you want to have a look at the symbols of my object file
Thanks & Regards,
-NNIt's only a quick guess but have you checked your tnsnames.ora file to ensure you've opened the environment to find the libraries? If you set the EXTPROC_DLLS=ANY, you open the database to security issues but it should tell you if this cause because you can't access the library that contains the symbol.
SID_LIST_CALLOUT_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = <oracle_home_directory>)
(PROGRAM = extproc)
(ENV = "EXTPROC_DLLS=ONLY:
<oracle_home_directory>/customlib/writestr1.so
,LD_LIBRARY_PATH=<oracle_home_directory>/lib")
) -
Err 62007: SQL Error: 99999 ORA-24338: Statement Handle not Executed
Hi,
I am facing a problem while adding a new parameter n my JSP Report JDBC query based on a ref-cursor from a stored procedure define in a package in database.
No problem at database level, I have added the new parameter in package specification and Package body for that procedure and compile my package, it complies without any error and warning.
but when I open the report and add parameter in the report JDBC query window, then it is generating a error message,
"Err 62007: SQL Error: 99999 ORA-24338: Statement Handle not Executed "
and I am unable to add the new parameter in report.
e.g.
Actual which was working is:
My-package.My-procedure(:P1,:P2,:P3 ,:P4,:P5,:P6,:P7)
I want to do this:
My-package.My-procedure(:P1,:P2,:P3 ,:P4,:P5,:P6,:P7,:P8)
but unable to do due to this error message:
("Err 62007: SQL Error: 99999 ORA-24338: Statement Handle not Executed ")
Reports Builder 10g:
Database 10g:
Operating system windows XP:
using JDBC Query base on ref-cursor coming from the stored procedure define in the Package.
Regards,
Khanand compile my package, it complies without any error and warning.That doesn't mean anything in this case. You are getting a runtime error, not a compilation error. The error is coming when you execute your procedure.
Did you test your modified procedure in sqlplus or SQL Developer? -
Code runs correctly when compiled by SQL developer but not SQL Plus
I have a rather large package body I need to deploy and compile ... It's big and complex (I inherited the project). Our it dept is huge and scripts are deployed by the dba team and they seem to only use sql plus. My code deploys and runs fine when compiled in sql developer. Once I compile it from SQL plus it stops working. It runs and using debug statements I can see the values are correct but it no longer inserts the data into the proper tables. I get ZERO errors or warnings when this is compiled in SQL Plus and no errors are generated from the code at run time. I've diffed the extracts of the code from the DB after each deployment and the only difference is the blank lines which SQL Plus strips out when you load the file. Has anyone run into anything remotely similar and if so how did you solve it? I've tried modifying the code to no avail, adding in comments to preserve the white space makes no difference. The thing that really kills me is that there is no error at all.
Ok this is the problem area.... vReplyMessage is a clob. I've replaced it in this section of processing with a varchar2(32000). And now it works. I still would like to know why though. Nothing is changed when I load it though sqlplus or sql developer but this line " update swn_recip_response_t set SWN_RECIP_RESPONSE = vTextReply where notification_id = v_notification_id; " would never execute with the clob. Logging showed that the clob had the correct value though. I am puzzled.
begin
call_SWNPost('http://www.sendwordnow.com/usps/getNotificationResults',vMessageText, vReplyMessage, v_status_code, v_status_phrase, '');
exception
when others then
raise eJavaException;
end;
vTextReply := dbms_lob.substr( vReplyMessage, 32000, 1 );
if (vDebug) then
update PEMS_PROD_2.SWN_POST_LOG set response = 'notif_id == '|| v_notification_id || 'status code == '|| v_status_code|| ' '||vTextReply where log_pk = vLogPK;
commit;
end if;
IF v_status_code = 200 then
v_has_error := 'N';
ELSE
v_has_error := 'Y';
END IF;
-- we handle all exceptions below in case something goes wrong here.
-- this area can die silently.
vTextReply := replace(vTextReply,'<getNotificationResultsResponse xmlns="http://www.sendwordnow.com/usps">', '<getNotificationResultsResponse xmlns:xyz="http://www.sendwordnow.com/usps">');
begin
insert into swn_recip_response_t(notification_id) values (v_notification_id);
exception
when others then
if (vDebug) then
err_num := SQLCODE;
err_msg := SUBSTR(SQLERRM, 1, 100);
insert into PEMS_PROD_2.SWN_POST_LOG (LOG_PK, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
commit;
else
null;
end if;
end;
commit;
begin
update swn_recip_response_t
set SWN_RECIP_RESPONSE = vTextReply
where notification_id = v_notification_id;
exception
when others then
if (vDebug) then
err_num := SQLCODE;
err_msg := SUBSTR(SQLERRM, 1, 100);
insert into PEMS_PROD_2.SWN_POST_LOG (log_pk, create_date, REQUEST, notification_id) values(pems_prod_2.swn_post_log_seq.nextval,sysdate,
'err_num - '||to_char(err_num)|| ' error_msg - '|| err_msg, v_notification_id);
commit;
else
null;
end if;
end;
commit;
-- parse through the XML document and update the notification and recipient records
-- parse the clob into an xml dom object
begin
vReplyMessage := vTextReply;
... -
SQL Error: ORA-01861: literal does not match format string
Hello,
I'm trying to do data mining on a web log which recorded one day web access information from a busy web server. I imported the data into Oracle Data miner, and created a table (WEBLOG). The idea is to create a new field, i.e. session, for the users so that each session could be thought as a representative of a user-intent (aka topic). Now based on this, data mining models would be used to cluster(group) the users based on their similarity. The first step is to prepare the data which involves using SQL queries. So first, all I did was to create a function for date and time. This is the following code I used,
create or replace function ssndate(p_date in varchar2 default '03-01-18',
p_time in varchar2)
return number
$if dbms_db_version.ver_le_10 $then
deterministic
$elsif dbms_db_version.ver_le_11 $then
result_cache
$end
as
begin
return trunc((to_date(p_date||' '||p_time, 'dd-mm-yy hh24:mi:ss')
- to_date('01-01-90','dd-mm-yy')) * (86400/2400));
end ssndate;
The function ssndate compiled successfully.
The next step I took was to create a view through the following query,
create or replace view WEBLOG_VIEWS
as
select (select ssndate(LOG_DATE, LOG_TIME) from dual) as "SESSION_DT",
C_IP,
CS_USER_AGENT,
(CS_URI_STEM||'?'||CS_URI_QUERY) as WEB_LINK
from WEBLOG;
This was successful as well. The problem is in the next step where I try to do data grouping.
create table FINAL_WEBLOG as
select SESSION_DT, C_IP, CS_USER_AGENT,
listagg(WEB_LINK, ' ')
within group(order by C_IP, CS_USER_AGENT) "WEB_LINKS"
from WEBLOG_VIEWS
group by C_IP, CS_USER_AGENT, SESSION_DT
order by SESSION_DT
For this, I got the error,
Error starting at line 1 in command:
create table FINAL_LOG as
select SESSION_DT, C_IP, CS_USER_AGENT,
listagg(WEB_LINK, ' ')
within group(order by C_IP, CS_USER_AGENT) "WEB_LINKS"
from WEBLOG_VIEWS
group by C_IP, CS_USER_AGENT, SESSION_DT
order by SESSION_DT
Error at Command Line:1 Column:7
Error report:
SQL Error: ORA-01861: literal does not match format string
ORA-06512: at "DMUSER.SSNDATE", line 11
ORA-06512: at line 1
01861. 00000 - "literal does not match format string"
*Cause: Literals in the input must be the same length as literals in
the format string (with the exception of leading whitespace).
If the "FX" modifier has been toggled on, the literal must
match exactly, with no extra whitespace.
*Action: Correct the format string to match the literal.
I don't know where I'm going wrong with this.. the to_date function should be fine. In the data that I possess, the date and time are in no format. Example: 30118 and 0:00:09 respectively. If anyone has any clue about this I would be sincerely grateful for any help that I can get!! It's quite urgent..
The Oracle version is 11.2.0.1.0
Edited by: 975265 on Dec 5, 2012 5:31 PM975265 wrote:
Ok.. Looks like I touched a nerve there. I apologize. I'm still a student, and this is the first time that I've tried something at this level. I'm still in the learning process, so I was hoping that someone could point me in the right direction in order to "fix" the data.Not so much touching a nerve as simply trying to implement a very very poor, but all too common, practice. Since you are a student (which we didn't know until this post) most people will cut you some slack. However, this little exchange should now be burned into your brain as you move forward. One of the very first rules of programming is to ALWAYS use the correct data types for your data. And along with that, never ever depend on implicit type conversions - always use the proper explicit conversion functions.
And as a slight follow-on, when considering the appropriate data type, don't assume that just because we refer to a given element as a 'something number' that it is indeed a number. Telephone "numbers" are NOT numbers. U.S. Social Security "numbers" are NOT numbers. U.S. Postal Zip codes are NOT numbers. All are just character strings which, by convention, we limit to the same characters we use to represent numbers.
And since this entire discussion came up around the representation of dates, you might want to take a look at http://edstevensdba.wordpress.com/2011/04/07/nls_date_format/
Now, go forth and be a smarter programmer than your peers.
Edited by: EdStevens on Dec 6, 2012 6:12 AM -
Hi Experts,
While we are trying to Connect 10g database from Forms6i, we are facing an
error like :
Compilation Error on WHEN-NEW-FORM-INSTANCE trigger on form:
PL/SQL ERROR 0 at line 0, column 0
ORA-00600: internal error code, arguments: [17069], [58884584],[],[],[],[],
Compilation errors have occured
but connect 9i database froms6i it's no problem.
Thanks in advance
Budi GunawanHi,
Contact Oracle Support. Metalink describes the solution as
"It is possible to get this error on a long running process if the dependent object has been dropped or recompiled.
If the error occurs on a procedure, attempt to recompile the procedure." -
Hi Experts,
I have an error when I copy Homogeneous in SOLMAN, I do the import of the database and this error occurs:
sapparam: sapargv(argc, argv) has not been called!
sapparam(1c): No Profile used.
sapparam: SAPSYSTEMNAME neither in Profile nor in Commandline
/usr/sap/SOP/SYS/exe/uc/linuxx86_64/R3load: START OF LOG: 20140407112019
/usr/sap/SOP/SYS/exe/uc/linuxx86_64/R3load: sccsid @(#) $Id: //bas/720_REL/src/R3ld/R3load/R3ldmain.c#21 $ SAP
/usr/sap/SOP/SYS/exe/uc/linuxx86_64/R3load: version R7.20/V1.4 [UNICODE]
Compiled Mar 18 2014 22:40:46
/usr/sap/SOP/SYS/exe/uc/linuxx86_64/R3load -testconnect
(DB) ERROR: db_connect rc = 256
DbSl Trace: CONNECT failed with sql error '-2'
(DB) ERROR: DbSlErrorMsg rc = 99
/usr/sap/SOP/SYS/exe/uc/linuxx86_64/R3load: job finished with 1 error(s)
/usr/sap/SOP/SYS/exe/uc/linuxx86_64/R3load: END OF LOG: 20140407112019
I need help to correct this error.Hi Michal,
Login with ora<SID> and check whether you are able to connect to sqlplus ( do steps as below )
1. sqlplus "/as sysdba"
2. select status from v$instance.
Let us know the ouput of both the command
Thanks
Anil -
DbSl Trace: CONNECT failed with sql error '12518' at IMPORT ABAP
Hi
We are trying to install ECC 6.0 on windows 2008 SP2 and oracle 10.2.0.4. We get an error at IMPORT ABAP phase.
content of import_monitor.java :
java version "1.4.2_26"
Java(TM) Platform, Standard Edition for Business (build 1.4.2_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.4.2_26-b03, mixed mode)
Import Monitor jobs: running 1, waiting 1, completed 26, failed 0, total 28.
Loading of 'SAPSLOAD' import package: ERROR
Import Monitor jobs: running 0, waiting 1, completed 26, failed 1, total 28.
content of SAPSLOAD.log:
E:\usr\sap\UED\SYS\exe\uc\NTAMD64\R3load.exe: START OF LOG: 20100705173108
E:\usr\sap\UED\SYS\exe\uc\NTAMD64\R3load.exe: sccsid @(#) $Id: //bas/701_REL/src/R3ld/R3load/R3ldmain.c#5 $ SAP
E:\usr\sap\UED\SYS\exe\uc\NTAMD64\R3load.exe: version R7.01/V1.4 [UNICODE]
Compiled Feb 24 2009 23:41:07
E:\usr\sap\UED\SYS\exe\uc\NTAMD64\R3load.exe -i SAPSLOAD.cmd -dbcodepage 4103 -l SAPSLOAD.log -stop_on_error
DbSl Trace: OCI-call 'OCIServerAttach' failed with rc=12518
DbSl Trace: CONNECT failed with sql error '12518'
DbSl Trace: OCI-call 'OCIServerAttach' failed with rc=12518
DbSl Trace: CONNECT failed with sql error '12518'
(DB) ERROR: db_connect rc = 256
DbSl Trace: OCI-call 'OCIServerAttach' failed with rc=12518
DbSl Trace: CONNECT failed with sql error '12518'
DbSl Trace: OCI-call 'OCIServerAttach' failed with rc=12518
DbSl Trace: CONNECT failed with sql error '12518'
(DB) ERROR: DbSlErrorMsg rc = 99
E:\usr\sap\UED\SYS\exe\uc\NTAMD64\R3load.exe: job finished with 1 error(s)
E:\usr\sap\UED\SYS\exe\uc\NTAMD64\R3load.exe: END OF LOG: 20100705173108
content of sqlnet.log file:
Fatal NI connect error 12560, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracleUED)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=UED)(CID=(PROGRAM=E:\oracle\UED\102\bin\sqlplus.exe)(HOST=U34SSAPUED)(USER=uedadm))))
VERSION INFORMATION:
TNS for 64-bit Windows: Version 10.2.0.4.0 - Production
Oracle Bequeath NT Protocol Adapter for 64-bit Windows: Version 10.2.0.4.0 - Production
Time: 05-JUL-2010 16:19:39
Tracing not turned on.
Tns error struct:
ns main err code: 12560
TNS-12560: TNS:protocol adapter error
ns secondary err code: 0
nt main err code: 530
TNS-00530: Protocol adapter error
nt secondary err code: 2
nt OS err code: 0
Fatal NI connect error 12518, connecting to:
(DESCRIPTION=(ADDRESS=(COMMUNITY=SAP.WORLD)(PROTOCOL=TCP)(HOST=u34ssapued)(PORT=1527))(CONNECT_DATA=(SID=UED)(GLOBAL_NAME=UED.WORLD)(CID=(PROGRAM=E:\usr\sap\UED\SYS\exe\uc\NTAMD64\R3load.exe)(HOST=U34SSAPUED)(USER=uedadm))))
VERSION INFORMATION:
TNS for 64-bit Windows: Version 10.2.0.2.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 64-bit Windows: Version 10.2.0.2.0 - Production
Time: 05-JUL-2010 17:28:38
Tracing not turned on.
Tns error struct:
ns main err code: 12564
TNS-12564: TNS:connection refused
ns secondary err code: 0
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
Best Regards...,Hi,
TNS-12560: TNS:protocol adapter error
Probably your listener or database is down...
If both are running, just stop the installation and reboot the server.
Then again start listener and database and continue SAP installation with "Continue old installation" option..
Also make sure that below environment variables are set properly...
ORACLE_HOME
ORACLE_SID
DBSID
Regards.
Rajesh Narkhede
Maybe you are looking for
-
Christmas Gift for younger sisters....Good Idea?
I bought 2 pre-paid verizon phones from walmart with a $10 airtime included. These are for my 2 younger step-sisters. Are they going to be able to afford these on there own? I saw something about the phone staying active. Is there a charge everyt
-
My scenario is as follows: down payment received of $ 1000 Invoice I issued of $200 Invoice II issued of $300 AND allocated to down payment open AR + down payments should show: Down payment (balance) -700$ (= down payment less invoice II allocated)
-
Very slow BB since modem upgrade
Hi I've recently went through with the modem upgrade provided by Kelly Comms. Seemed ok at first but now my connection is pretty much unusable upstairs. Download speed is 1.6MBs upstairs but much better close to the modem (understandably). Any option
-
IOS 8.0.2 available via OTA
The new firmware is available via OTA
-
Please help, unknown space taken up!!!!
My dad bought a 3000 n100 lenovo computer a while back, he ended up taking the show computer off of the shelf becuase they offered him a good deal. He never noticed that around 80-90 GB of 106 GB was taken up on the computer. The computer is mine now