ORA-17125: "Improper statement type returned by explicit cache"
I have been using SQLJ to some extent in the current java project but just now I'm getting this error on a particular piece of code which was converted using SQLJ pre-compiler:
// #sql [xtrConnectionContext] { CALL
// XTR_CFNG_DBAPI.pRemoveXTRLotsLogger(:billCycle,
// :billCycleEndDate, :runType) };
// declare temps
oracle.jdbc.OraclePreparedStatement __sJT_st = null;
sqlj.runtime.ref.DefaultContext __sJT_cc = xtrConnectionContext;
if (__sJT_cc == null)
sqlj.runtime.error.RuntimeRefErrors.raise_NULL_CONN_CTX();
sqlj.runtime.ExecutionContext.OracleContext __sJT_ec = ((__sJT_cc
.getExecutionContext() == null) ? sqlj.runtime.ExecutionContext
.raiseNullExecCtx()
: __sJT_cc.getExecutionContext().getOracleContext());
try {
__sJT_st = __sJT_ec
.prepareOracleStatement(__sJT_cc,
"0com.pt.vodafone.xtr_ppb.XTR",
"BEGIN XTR_CFNG_DBAPI.pRemoveXTRLotsLogger( :1 , :2 , :3 ) \n; END;");
// set IN parameters
__sJT_st.setString(1, billCycle);
__sJT_st.setString(2, billCycleEndDate);
__sJT_st.setString(3, runType);
// execute statement
__sJT_ec.oracleExecuteUpdate();
} finally {
__sJT_ec.oracleClose();
The procedure called has the following declaration:
PROCEDURE pRemoveXTRLotsLogger(pvBillCycle IN VARCHAR2,
pvBillCycleEndDate IN VARCHAR2,
pvExpeditionCode IN VARCHAR2);
The procedure just deletes a few records from a table and works perfectly during testing.
The variables billCycle, billCycleEndDate, runType are all String.
During execution, the ORA-17125 is always returned. It's description is "Improper statement type returned by explicit cache".
One interesting thing was that even replacing the procedure call by the delete itself, the execution also returned the same error.
I'm not using any kind of explicit cache and the connection to the database shouldn't be a problem, because previous statements in the same connection were executed without any problem.
Thanks a for your time.
Best regards,
VP
I solved the problem disabling the statement cache in my connection method:
public DefaultContext connectToDB(String server, String port, String sid, String user, String pass) throws ErrorException {
DefaultContext connectionContext;
// DISABLE CONNECTION STATEMENT CACHE!
DefaultContext.setDefaultStmtCacheSize(0);
try {
connectionContext = Oracle.getConnection(oracleJDBCDriver + server
+ ":" + port + ":" + sid, user, pass, false);
} catch (SQLException e) {
throw new ErrorException("Connect to " + sid + " failed.");
return (connectionContext);
Best regards,
VP
Similar Messages
-
ORA-06503: PL/SQL: Function returned without value
Hello
Having a bit of a problem with piplined functions.
Why does this work :
SET SERVEROUTPUT ON
DECLARE
TYPE SARRAY IS TABLE OF VARCHAR2(4000);
CURSOR CU IS SELECT * FROM DX_XML_ATTENDANCE WHERE STUD_ID = 107777 AND BASE_ID = 94;
T_STUD NUMBER(10);
T_BASE NUMBER(10);
T_DATE DATE;
T_MARKS VARCHAR2(1000);
LEN_MARKS NUMBER;
PDATE DATE;
SDATE DATE;
EDATE DATE;
SLEN NUMBER;
WEEKLEN NUMBER;
INIPOS NUMBER;
MARRAY VARCHAR2(1000);
SUBARRAY SARRAY := SARRAY();
SFILL VARCHAR2(14) := '--------------';
EPOS NUMBER;
MY_REC DX_XML_ATTENDANCE%ROWTYPE;
BEGIN
SUBARRAY.EXTEND(17);
DBMS_OUTPUT.ENABLE(100000000);
--FOR MY_REC IN CU
OPEN CU;
LOOP
FETCH CU INTO MY_REC;
EXIT WHEN (CU%NOTFOUND);
T_STUD := MY_REC.STUD_ID;
T_BASE := MY_REC.BASE_ID;
T_DATE := TO_DATE(MY_REC.START_DATE, 'DD/MM/YYYY');
T_MARKS := MY_REC.MARKS;
LEN_MARKS := LENGTH(T_MARKS);
EPOS := LEN_MARKS / 2;
SDATE := ROUND(TO_DATE(T_DATE), 'W') - 1;
INIPOS := TO_NUMBER(TO_CHAR(T_DATE, 'D'));
SLEN := INIPOS + 3;
PDATE := SDATE;
EDATE := SDATE + EPOS;
MARRAY := SUBSTR(T_MARKS, 1, SLEN);
WEEKLEN := LENGTH(MARRAY);
IF WEEKLEN < 14 THEN
MARRAY := SUBSTR(SFILL, 1, 14 - WEEKLEN) || MARRAY;
END IF;
SUBARRAY(1) := T_STUD;
SUBARRAY(2) := T_BASE;
SUBARRAY(3) := PDATE;
FOR i IN 4 .. 17 LOOP
SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
END LOOP;
DBMS_OUTPUT.PUT_LINE(SUBARRAY(1)||' '||SUBARRAY(2)||' '||SUBARRAY(3)||' '||SUBARRAY(4)||' '||
SUBARRAY(5)||' '||SUBARRAY(6)||' '||SUBARRAY(7)||' '||SUBARRAY(8)||' '||SUBARRAY(9)||' '||
SUBARRAY(10)||' '||SUBARRAY(11)||' '||SUBARRAY(12)||' '||SUBARRAY(13)||' '||SUBARRAY(14)||' '||
SUBARRAY(15)||' '||SUBARRAY(16)||' '||SUBARRAY(17));
WHILE PDATE < EDATE LOOP
PDATE := PDATE + 7;
MARRAY := SUBSTR(T_MARKS, SLEN + 1, 14);
WEEKLEN := LENGTH(MARRAY);
IF WEEKLEN < 14 THEN
MARRAY := MARRAY || SUBSTR(SFILL, 1, 14 - WEEKLEN);
END IF;
FOR i IN 4 .. 17 LOOP
SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
END LOOP;
SUBARRAY(3) := PDATE;
DBMS_OUTPUT.PUT_LINE(SUBARRAY(1)||' '||SUBARRAY(2)||' '||SUBARRAY(3)||' '||SUBARRAY(4)||' '||
SUBARRAY(5)||' '||SUBARRAY(6)||' '||SUBARRAY(7)||' '||SUBARRAY(8)||' '||SUBARRAY(9)||' '||
SUBARRAY(10)||' '||SUBARRAY(11)||' '||SUBARRAY(12)||' '||SUBARRAY(13)||' '||SUBARRAY(14)||' '||
SUBARRAY(15)||' '||SUBARRAY(16)||' '||SUBARRAY(17));
PDATE := PDATE + 7;
SLEN := SLEN + 14;
END LOOP;
END LOOP;
END;
and this does not :
CREATE OR REPLACE PACKAGE BODY PARSE_ATTENDANCE AS
FUNCTION ENUM_MARKS(SEL_SQL IN VARCHAR2)
RETURN TMP_ATT_DATA_TBL PIPELINED
IS
V_SQL VARCHAR(1000):= SEL_SQL;
V_CURSOR SYS_REFCURSOR;
V_ROW TMP_ATT_HOLDING:=TMP_ATT_HOLDING(NULL, NULL, NULL, NULL);
T_STUD NUMBER(10);
T_BASE NUMBER(10);
T_DATE DATE;
T_MARKS VARCHAR2(1000);
LEN_MARKS NUMBER;
PDATE DATE;
SDATE DATE;
EDATE DATE;
SLEN NUMBER;
WEEKLEN NUMBER;
INIPOS NUMBER;
MARRAY VARCHAR2(1000);
SUBARRAY SARRAY := SARRAY();
SFILL VARCHAR2(14) := '--------------';
EPOS NUMBER;
BEGIN
SUBARRAY.EXTEND(17);
OPEN V_CURSOR FOR V_SQL;
LOOP
FETCH V_CURSOR INTO V_ROW.STUD_ID, V_ROW.BASE_ID, V_ROW.START_DATE, V_ROW.MARKS;
EXIT WHEN V_CURSOR%NOTFOUND;
T_STUD := V_ROW.STUD_ID;
T_BASE := V_ROW.BASE_ID;
T_DATE := TO_DATE(V_ROW.START_DATE, 'DD/MM/YYYY');
T_MARKS := V_ROW.MARKS;
LEN_MARKS := LENGTH(T_MARKS);
EPOS := LEN_MARKS / 2;
SDATE := ROUND(TO_DATE(T_DATE), 'W') - 1;
INIPOS := TO_NUMBER(TO_CHAR(T_DATE, 'D'));
SLEN := INIPOS + 3;
PDATE := SDATE;
EDATE := SDATE + EPOS;
MARRAY := SUBSTR(T_MARKS, 1, SLEN);
WEEKLEN := LENGTH(MARRAY);
IF WEEKLEN < 14 THEN
MARRAY := SUBSTR(SFILL, 1, 14 - WEEKLEN) || MARRAY;
END IF;
SUBARRAY(1) := T_STUD;
SUBARRAY(2) := T_BASE;
SUBARRAY(3) := PDATE;
FOR i IN 4 .. 17 LOOP
SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
END LOOP;
PIPE ROW(TMP_ATT_DATA_OBJ(SUBARRAY(1),SUBARRAY(2),SUBARRAY(3),SUBARRAY(4),
SUBARRAY(5),SUBARRAY(6),SUBARRAY(7),SUBARRAY(8),SUBARRAY(9),
SUBARRAY(10),SUBARRAY(11),SUBARRAY(12),SUBARRAY(13),SUBARRAY(14),
SUBARRAY(15),SUBARRAY(16),SUBARRAY(17)));
WHILE PDATE < EDATE LOOP
PDATE := PDATE + 7;
MARRAY := SUBSTR(T_MARKS, SLEN + 1, 14);
WEEKLEN := LENGTH(MARRAY);
IF WEEKLEN < 14 THEN
MARRAY := MARRAY || SUBSTR(SFILL, 1, 14 - WEEKLEN);
END IF;
FOR i IN 4 .. 17 LOOP
SUBARRAY(i) := SUBSTR(MARRAY, i - 3, 1);
END LOOP;
SUBARRAY(3) := PDATE;
PIPE ROW(TMP_ATT_DATA_OBJ(SUBARRAY(1),SUBARRAY(2),SUBARRAY(3),SUBARRAY(4),
SUBARRAY(5),SUBARRAY(6),SUBARRAY(7),SUBARRAY(8),SUBARRAY(9),
SUBARRAY(10),SUBARRAY(11),SUBARRAY(12),SUBARRAY(13),SUBARRAY(14),
SUBARRAY(15),SUBARRAY(16),SUBARRAY(17)));
PDATE := PDATE + 7;
SLEN := SLEN + 14;
END LOOP;
END LOOP;
END ENUM_MARKS;
END PARSE_ATTENDANCE;
(This is then called like SELECT * FROM
TABLE(
PARSE_ATTENDANCE.ENUM_MARKS(
'SELECT STUD_ID, BASE_ID, START_DATE, MARKS
FROM DX_XML_ATTENDANCE WHERE STUD_ID = 107777
AND BASE_ID = 94'))
I get the same error, around this section near the bottom :
PDATE := PDATE + 7;
SLEN := SLEN + 14;
Can any one help?Here is an example. you are missing an return statement.
SQL> create or replace type varchar2_table is table of varchar2(10) ;
2 /
Type created.
SQL> show errors
No errors.
SQL> create or replace function get_data return varchar2_table pipelined is
2 begin
3 pipe row(('Test')) ;
4 end ;
5 /
Function created.
SQL> show errors
No errors.
SQL> select * from table(get_data) ;
ERROR:
ORA-06503: PL/SQL: Function returned without value
ORA-06512: at "KKISHORE.GET_DATA", line 3
no rows selected
SQL> create or replace function get_data return varchar2_table pipelined is
2 begin
3 pipe row(('Test')) ;
4 return ;
5 end ;
6 /
Function created.
SQL> show errors
No errors.
SQL> select * from table(get_data) ;
COLUMN_VAL
Test
SQL> -
ORA-30689: improper value for ORA_DEBUG_JDWP
I'm setting up PL/SQL debugging from an ASP.Net application. I've followed all of the steps from cshay's blog. I am able to debug and connect directly from the Oracle Explorer. My problem occurs when I run debug and try to step through from the .Net code.
Some things to Note:
We have a central library that uses .Net Reflection and the System.Data.OracleClient to instatiate connections and condense some SQL querying processes so that we don't have to parameterize and write full queries in the application over and over again. I cannot change this library.
The error listed above appears when I have the following setup:
* Oracle Application Debugging is checked
* VS 2005 asp.net web app
* Using the development (local) webserver
* Exception Details: System.Data.OracleClient.OracleException: ORA-30689: improper value for ORA_DEBUG_JDWP
* Process explorer properties say that the ORA_DEBUG_JDWP variable is set to host=machineName;port=49152
* web app comes up in http://localhost:xxxx
* When I ping machineName, I get my ip address
* When I ping localhost, I get the local ip 127.0.0.1
* Oracle db 9.2.0.6
* The error occurs when my application first trys to obtain a connection to the database (just a select statement and only when I have OADebuggin turned on)
Any help on this would be appreciated. Otherwise, I'll have to figure out why my SQL Developer instance won't debug correctly.
Thank you.
shellieThanks for the quick response Christian.
1) Are you using ODAC 11g beta?
Yes I downloaded it yesterday. In Visual studio in 'about' I have:
Oracle Developer Tools for Visual Studio .NET 11.1.0.5.10 Beta
Oracle Developer Tools for Visual Studio .NET Copyright (c) 2005, 2007
2) Are you setting ORA_DEBUG_JDWP anywhere? If so, what are you setting it to?
No I am not setting it anywhere. I used process explorer and when I debug it is set to my IP address (i.e. the host of my dev environment on W2K3 and not the Unix Server hosting Oracle) and port 49152.
I've also logged on the to Unix server and from there telneted into my W2K3 server on port 49512 and got a "JDWP-handshake" response so the network looks fine.
So ... #1 is Yes and #2 is No. So I followed your instructions ... and I got some expert oracle and unix assistance when i got the following ...
There is nothing in any trc file that has anything like "kqaccd: ORA_DEBUG_JDWP". A grep "DEBUG" *.trc shows nothing anywhere.
Another bit of info .... I get a ORA_DEBUG_JDWP type of error from time to time. Seems mainly to be on connections to databases that I've connected to before. If I close VS2005 and re-open VS2005 - everything is back to normal.
I can step into and run s.p. directly from VS2005 so that's something.
(Also another thing I noticed is that even though I'm logged own as the schema owner I can not change/re-order columns in an index as they are greyed out. Also - and this is not good as I would like developers to be able to optimise their queries - you can not scroll through the list of columns in an index if the list of columns is larger than the list box. I can live without the former but the later is highly desirable.)
Thanks for your help with this Christian. (I really like ODT and can see it becoming indespensible very quickly).
Cheers,
Chris. -
TWO ERRO ORA-01427: single-row subquery returns more than one row
Hi,
I have a procedure which contains a cursor. If i run the select statement in the cursor separetly, it returns only value and works fine. But the same select statement in the cursor of a procedure throws me the error as below:
TWO ERRO ORA-01427: single-row subquery returns more than one row
Not sure what going on...any help appreciated.
Below is the select statement:
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN
HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID =
HAPF2.POSITION_DEFINITION_ID
AND
HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID =
PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' ||
PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN
PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN
PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND
HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;
Thanks
PK
Edited by: user539616 on Jun 30, 2009 6:30 PMHi,
The cursor has a different parameter? Maybe the query is not exactly the same. Could you check this?
This is your query (formatted):
SELECT DISTINCT PSE.PARENT_POSITION_ID,
(SELECT DISTINCT PPD1.SEGMENT2
FROM PER_POSITION_DEFINITIONS PPD1,
HR_ALL_POSITIONS_F HAPF2,
PER_POS_STRUCTURE_ELEMENTS PSE2
WHERE TRUNC(SYSDATE) BETWEEN HAPF2.EFFECTIVE_START_DATE AND
HAPF2.EFFECTIVE_END_DATE
AND PPD1.POSITION_DEFINITION_ID = HAPF2.POSITION_DEFINITION_ID
AND HAPF2.POSITION_ID = PSE2.PARENT_POSITION_ID
AND PSE2.PARENT_POSITION_ID = PSE.PARENT_POSITION_ID
AND ROWNUM = 1) SEGMENT2,
(SELECT DISTINCT PAPF1.FIRST_NAME || ' ' || PAPF1.LAST_NAME CHIEF_NAME
FROM PER_ALL_PEOPLE_F PAPF1,
PER_ALL_ASSIGNMENTS_F PAAF1
WHERE TRUNC(SYSDATE) BETWEEN PAPF1.EFFECTIVE_START_DATE AND
PAPF1.EFFECTIVE_END_DATE
AND TRUNC(SYSDATE) BETWEEN PAAF1.EFFECTIVE_START_DATE AND
PAAF1.EFFECTIVE_END_DATE
AND PAAF1.POSITION_ID = PSE.PARENT_POSITION_ID
AND PAPF1.PERSON_ID = PAAF1.PERSON_ID
AND ROWNUM = 1) CHIEF_NAME
FROM PER_POS_STRUCTURE_ELEMENTS PSE,
HR_ALL_POSITIONS_F HAPF,
PER_POSITION_DEFINITIONS PPD
WHERE PSE.SUBORDINATE_POSITION_ID = 52744
AND TRUNC(SYSDATE) BETWEEN HAPF.EFFECTIVE_START_DATE AND HAPF.EFFECTIVE_END_DATE
AND HAPF.POSITION_ID = PSE.SUBORDINATE_POSITION_ID
AND HAPF.POSITION_DEFINITION_ID = PPD.POSITION_DEFINITION_ID;Tips: To put formatted code you must use {noformat}{noformat} tags, start tag and end tag are the same,you don't need to put '/' in the close tag.
Regards, -
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-00604: error occurred at recursive SQL level 1 ORA-01003: no statement
Hi ,
we pass Query to ref cursor using with clause and it works fine on oracle Sql but raise an error when called from
ADO.net
for example
create or replace package body abc_details
as
proedure initial (p_refcursor out sys_refcursor)
is
begin
v_sql='with a as (select ..
, b as (select * from table(emppkg.empdetails))
open p_refcursor for v_sql;
end;
with oracle 10g it works fine on Sql prompt and fetches the results but when called from ado.net it
intermitantly fetches and error "ORA-00604: error occurred at recursive SQL level 1 ORA-01003: no statement "
Please suggest
Thanks in advance.wild guess here,
but emppkg.empdetails type look's like a pl/sql type,
while it should be a sql type.
Amiel -
RE: Getting ORA-01003: no statement parsed error
Hi,
It looks familiar to some of the error which I encountered before. The
situation was a for ... select loop without explicit begin/end transaction.
The reason given by Forte consultant is that:
The dbsession used by the for ... select loop needed to be locked by a
begin/end transaction otherwise, there may be chances that the dbsession is
being acquired by some other sql that unknowingly corrupted the cursor
implicitly built for that for ... select loop.
Hopes this help.
Regards,
Peter Sham.
-----Original Message-----
From: Robinson, Richard [SMTP:[email protected]]
Sent: Friday, April 16, 1999 12:12 AM
To: '[email protected]'
Subject: Getting ORA-01003: no statement parsed error
Any clues? We're getting the following error on a server side
object that
interfaces to Oracle:
SYSTEM ERROR: Select failed for SQL statement in project xxxx, class
yyy,
method ...
error from database is: ORA-01003:no statement parsed
Class: qqdb_ResourceException
Detected at: qqdb_OracleVendorInfo::DoOexfet
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive
<URL:http://pinehurst.sageit.com/listarchive/>
To unsubscribe, email '[email protected]' with
'unsubscribe forte-users' as the body of the message.
Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>Somebody asked nearly the same question Re: EMERGENCY! pl/sql syntax error!!!
-
ORA-01427: single-row subquery returns more than one row HELP
I need to update baemployee.Stock_nbr field with select substr(C.CHECK_DIGIT, 3, 10)
from EMP_CHECK_DIG c where C.EMPLOYEE = e.EMPLOYEE
Please help.
update baemployee e
set Stock_nbr = (select substr(C.CHECK_DIGIT, 3, 10)
from EMP_CHECK_DIG c where C.EMPLOYEE = e.EMPLOYEE)
where exists
(select C.CHECK_DIGIT
from EMP_CHECK_DIG c where C.EMPLOYEE = e.EMPLOYEE)
and exists (select 1 from EMPLOYEE ee where ee.employee = e.employee and ee.emp_status like 'A%');
ORA-01427: single-row subquery returns more than one rowHi,
Welcome to the forum!
Whenever you have a question, please post some sample data, so that people can re-create the problem and test their solutions.
CREATE TABLE and INSERT statements, like the ones below, are great:
CREATE TABLE baemployee
( employee NUMBER (4)
, stock_nbr VARCHAR2 (10)
INSERT INTO baemployee (employee, stock_nbr) VALUES (1234, 'FUBAR');
CREATE TABLE employee
( employee NUMBER (4)
, emp_status VARCHAR2 (10)
INSERT INTO employee (employee, emp_status) VALUES (1234, 'ACTIVE');CREATE TABLE AS is good, too:
CREATE TABLE emp_check_dig
AS SELECT 1234 AS employee, 'AA1234567890ZZZ' AS check_digit FROM dual
UNION ALL SELECT 1234, 'AA2121212121ZZZ' FROM dual
;Also post the results you want from that data. In this case, the results would be the contents of the baemployee table after you run the UPDATE.
Would you want:
employee stock_nbr
1234 1234567890or would you want
employee stock_nbr
1234 2121212121If you run the UPDATE statement you posted with the data above, you'll get the "ORA-01427: single-row subquery returns more than one row" error, and you can see what causes it: there is more than one row from emp_check_dig that could be used to UPDATE the same row of baemployee. Say what you want to do in this situation (and why), and someone will help you find a way to do it. -
ORA-27369: job of type EXECUTABLE failed with exit code: Key has expired
Hi
I defined the following Job on Linux Redhat 5.4 & Oracle DB 10.2.0.4:
BEGIN
dbms_scheduler.create_job(job_name => 'expjob',
job_type => 'executable',
job_action => '/EXPORT/scott_cmd',
enabled => TRUE,
auto_drop => FALSE);
END;
drwxrwxrwx 2 oracle oinstall 4096 Jul 10 19:19 EXPORTwhere:
/home/oracle>cat /EXPORT/scott_cmd
#!/bin/sh
exp parfile=./scott.par
/home/oracle>cat /EXPORT/scott.par
FILE=scott.dmp
USERID=STRMADMIN/STRMADMIN
OWNER=SCOTT
LOG=scott.log
/home/oracle>ls -l /EXPORT/scott_cmd
-rwxr-xr-x 1 oracle oinstall 34 Jul 10 19:16 /EXPORT/scott_cmd
/home/oracle>ls -l /u01/app/oracle/OraHome_1/rdbms/admin/externaljob.ora
-rw-r--r-- 1 root oinstall 1575 Jul 10 18:42 /u01/app/oracle/OraHome_1/rdbms/admin/externaljob.ora
(run_user = nobody
run_group = nobody)
/home/oracle>ls -l /u01/app/oracle/OraHome_1/bin/extjob
-rwsr-x--- 1 root oinstall 64842 Jul 8 14:21 /u01/app/oracle/OraHome_1/bin/extjob
/home/oracle>ls -l /u01/app/oracle/OraHome_1/bin/extjobo
-rwxr-xr-x 1 oracle oinstall 64842 Jul 8 14:21 /u01/app/oracle/OraHome_1/bin/extjoboWhen I executed as user STRMADMIN ( has DBA & CREATE JOB Privileg) the Job, I got always the error:
/EXPORT>sqlplus STRMADMIN/STRMADMIN
SQL*Plus: Release 10.2.0.4.0 - Production on Sun Jul 10 19:40:24 2011
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exec dbms_scheduler.run_job('expjob');
BEGIN dbms_scheduler.run_job('expjob'); END;
ERROR at line 1:
ORA-27369: job of type EXECUTABLE failed with exit code: Key has expired
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1
SQL>Please, help
regards
hqt200475
Edited by: hqt200475 on Jul 10, 2011 10:04 AM
Edited by: hqt200475 on Jul 10, 2011 10:05 AMHi Ronald,
I need the external Job in the 10.2.0.4-Environment because of the Online-Upgrade of a 10.2.0.4-Database to 11.2.0.2 with STREAMS. I want to start the old export from a PL/SQL-Procedure.
Now returning to my problem:
First: Change the run user to oracle:oinstall $ORACLE_HOME/rdbms/admin/externaljob.ora
# This configuration file is used by dbms_scheduler when executing external
# (operating system) jobs. It contains the user and group to run external
# jobs as. It must only be writable by the owner and must be owned by root.
# If extjob is not setuid then the only allowable run_user
# is the user Oracle runs as and the only allowable run_group is the group
# Oracle runs as.
#run_user = nobody
#run_group = nobody
run_user = oracle
run_group = oinstallsecond:
/EXPORT>cat scott_cmd
#!/bin/sh
ORACLE_SID=STB;export ORACLE_SID
ORACLE_HOME=/u01/app/oracle/OraHome_1;export ORACLE_HOME
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib;export LD_LIBRARY_PATH
/u01/app/oracle/OraHome_1/bin/exp parfile=/EXPORT/scott.parand:
BEGIN
dbms_scheduler.create_job(job_name => 'expjob_r',
job_type => 'executable',
job_action => '/EXPORT/scott_cmd',
enabled => TRUE,
auto_drop => FALSE);
END;
/The manual execution of export as user oracle/oinstall was unproblematic, But I still got the error when running the following procedure :
SQL> exec dbms_scheduler.run_job('expjob_r');
BEGIN dbms_scheduler.run_job('expjob_r'); END;
ERROR at line 1:
ORA-27369: job of type EXECUTABLE failed with exit code: Operation not
permitted
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1regards
hqt200475 -
Case Statement Not returning resutlset Varbinary
Declare @val varbinary
set @val = cast('123456789' as varbinary)
select @val as value -- Varbinary Value Result
Declare @check bit
set @check= 1
--THis Case Statement Not returning Result set in Varbinary .
select case @check when 1 then @val else 1 end as valueSee the below part from MSDN documentation reg return type
Returns the highest precedence
type from the set of types in result_expressions and
the optional else_result_expression.
http://msdn.microsoft.com/en-IN/library/ms181765.aspx
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
I want a select statement to return two values, sum of one column and customer number
I have two columns one called invoice_number and the other invoice_amount. I want a select statement to return two columns.... invoice_number and then the sum of the invoice_amount(s) for each unique invoice number.
SELECT sum(invoice_amount) AS Totalinvoice_amount FROM InvoiceTB where invoice_number = 'INV102'
This is where I've started, which returns:
Totalinvoice_amount
500.00
Any help is appreciated.
Please mark my post as helpful or the answer or better yet.... both! :) Thanks!Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect.
This is minimal polite behavior on SQL forums.
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL -
ORA-01427 single-row subquery returns more than requested number of rows
Hi All,
SR#3-5155460391
When opening the Expense report form the given error occurs.
This is happening with only one employee.
The condition could not be evaluated because of error ORA-01427
single-row subquery returns more than requested number of rows.
query is:
select pea.segment5
from
per_all_assignments_f paf,
pay_personal_payment_methods_f ppm,
pay_external_accounts pea,
fnd_application fap,
fnd_id_flex_structures ffs
where
paf.person_id=:employee_id
and paf.primary_flag='Y'
and paf.assignment_type='E'
and trunc(sysdate) between paf.effective_start_date and paf.effective_end_date
and ppm.assignment_id=paf.assignment_id
and trunc(sysdate) between ppm.effective_start_date and ppm.effective_end_date
and ppm.attribute2='Y'
and pea.external_account_id=ppm.external_account_id
and pea.id_flex_num=ffs.id_flex_num
and fap.application_short_name='PAY'
and ffs.application_id=fap.application_id
and ffs.id_flex_code='BANK'
and ffs.id_flex_structure_code='GB_BANK_DETAILS';
Thanks,
Shikha
Edited by: user10456902 on Feb 3, 2012 1:57 AMHi,
First try to find pea.external_account_id from per_all_people_f,per_all_assignments_f,fnd_application.fnd_id_flex_structures etc
and then find
SELECt pea.segment5
FROM pay_external_accounts pea
WHERE pea.external_account_id = : external_account_id -- derived from SQL1
and check how many rows are returned -
Assign error with complex type return message
Dear all,
I have an axis web service with complex type return message. When I invoke the web service, and try to assign one element of the result to other variable, it fails with following error message(BPEL Fault:{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure{}
The invoking web service and assignment BPEL source is as follows:
<invoke name="registerConference" partnerLink="conferenceCenter" portType="tns:ConfArrangementPort" operation="Conference_Register" inputVariable="registerInput" outputVariable="registerOutput"/>
<copy>
<from variable="registerOutput" part="Conference_RegisterReturn" query="/Conference_RegisterReturn/confcity"></from>
<to variable="bookHotelInput" part="si" query="/si/city"/>
</copy>
I tunneled the response SOAP message:
==== Response ====
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Date: Sun, 31 Oct 2004 08:28:27 GMT
Server: Apache Coyote/1.0
Connection: close
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:Conference_RegisterResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://conference.sjtu.edu">
<ns1:Conference_RegisterReturn href="#id0"/>
</ns1:Conference_RegisterResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:ConfInfo" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://conference.sjtu.edu">
<confcity xsi:type="xsd:string">star</confcity>
<confend xsi:type="xsd:string">20041120</confend>
<confstart xsi:type="xsd:string">20041116</confstart>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
==============
However, when i check the invoke activity audit trail, it return the following info:
<messages>
<registerInput>
<part xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" name="gi">
<gi xmlns="http://conference.sjtu.edu">
<attendeename xmlns="">ss</attendeename>
<confname xmlns="">hh</confname>
</gi>
</part>
</registerInput>
<registerOutput>
<part xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" name="Conference_RegisterReturn">
<ns1:Conference_RegisterReturn xmlns:ns1="http://conference.sjtu.edu" href="#id0" />
</part>
</registerOutput>
</messages>
The detailed value of the return message lost, only leaving the href. Can I find the desired value again? should I try another XPATH expression? should I parse the result from the SOAP message directly? Or it's a problem of the system itself?
Hope you can do me a favor, thanks.From Axis's user guide: RPC services default to the soap section 5 encoding rules, objects will be encoded via "multi-ref" serialization. Document services do not use any encoding (so in particular, you won't see multiref object serialization or SOAP-style arrays on the wire)
May be I should try document service style instead of RPC. Thanks for your reply. -
Error:ORA-01003: no statement parsed
Hi,
While clicking on details button of customized form it's give below error:
1)Error:
ORA-01003: no statement parsed
Details..:
ORA-01003: no statement parsed
FRM-407535: ON-UPDATE trigger raised unhandled exception ORA-04098
FND_FORMS_ERROR_MSG(ERRNO=4098) (REASON=ORA-01003: no statement parsed)
2)Error:
APP-FND-01388: Cannot read value for profile option
FND_LOOK_AND_FEEL in routine & ROUTINE..
Details..
Message History
APP-FND-01388: Cannot read value for profile option FND_LOOK_AND_FEEL in routine &ROUTINE.
APP-FND-01388: Cannot read value for profile option FND_COLOR_SCHEME in routine &ROUTINE.
APP-FND-01388: Cannot read value for profile option FND_INDICATOR_COLORS in routine &ROUTINE.
ORA-01003: no statement parsed
Please help me how to sort out the problem.
Thanks
Regards
GSMWas this working before? If yes, any changes have been done recently?
Did you compile the form successfully at the client side before uploading it to the server?
Did you use the TEMPLATE.fmb file to create this custom form?
Not sure what is the code you are using in that form, so posting it may help -- OERR: ORA 1003 no statement parsed [ID 18594.1]
Thanks,
Hussein -
ORA-00932: inconsistent data types: expected NUMBER got BINARY
ORA-00932: inconsistent data types: expected NUMBER got BINARY
Hi,
Could anyone help in resolving my problem?
I m developing cmp beans in Jbuilder X,
My database is Oracle 10g, running on Linux and Application server is Oracle10gAs. Running on Windows.
I can deploy my Entity EJBs OK and look then up using finder methods as long as Ive created the data directly in the database using SQL*Plus for instance.
In the database I have my primary keys defined as type NUMBER
In my EJB the corresponding number fields get mapped as java.math.BigDecimal.
which according to the Oracle JDBC specification is how they are mapped.
Problem:
When I try to create a new database entity through my EJB entity bean I get:-
Error "ORA-00932: inconsistent datatypes: expected NUMBER got BINARY".
The value of the number being used as the primary key in this example is 10.
Eg:-
BigDecimal pk = new BigDecimal(10);
TestBean test = home.create(pk);
The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
The jdbc driver defined in my application.xml is
oracle.jdbc.driver.OracleDriverand url="jdbc:oracle:thin..." in the connection.
Ive even tried mapping a datatype as described in the Oracle FAQs but this didnt work.
21. I'm trying to deploy a CMP entity bean with a field type BigDecimal and the table creation fails with an error. How do I work around this?
You have to perform the following steps prior to deploy your application.
o Define the mapping for java.math.BigDecimal in the database-schemas/oracle.xml as follows:
<type-mapping type="java.math.BigDecimal" name="number(20,8)" />o Use this schema in your data-source as follows:-
<data-source
class="com.evermind.sql.DriverManagerDataSource"
name="OracleDS"
ejb-location="jdbc/OracleDS"
schema="database-schemas/oracle.xml"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="scott"
password="tiger"
url="jdbc:oracle:thin:@localhost:1521:DEBU"
clean-available-connections-threshold="30"
rac-enabled="false"
inactivity-timeout="30"
/>Further clarification of my problem.
Originally I said the error occurred when deploying EJB's
Correction: I can deploy them OK on the application server However the Error message occurs when I try to create a new EJB entity, the only value required is the Primary key which I pass as type BidDecimal.
If I create entries directly in the database my EJB findByPrimaryKey can find entities OK.
But I cant create new ones through EJB.
What realy baffels me is why I'm able to read data through the connection but not write.
The datatype in my EJB Deployment descriptor ejb-jar-xml <pri-key-class> is java.math.BigDecimal>
The jdbc driver defined in my application.xml is
oracle.jdbc.driver.OracleDriver
and url="jdbc:oracle:thin..." in the connection.
Maybe you are looking for
-
Getting Back Values from Shift Register from Other Loop (FPGA)
Referring to the picture above, both while loops are inside one while loop (not shown in picture). Problem is im trying to execute the numeric control once only and use the value from the second loop after that. I tried many ways and still have no id
-
Lightroom CC Import sees CF Card in reader but does not see any images, cannot import anything
I have installed Lightroom CC. It seems to work but if I connect a card reader with a CF card, while Lightroom sees the card, it sees no images. I have to copy the files to a hard disk and import from there. How do I fix this annoying problem?
-
HTML Button use an image instead of Text
I have an HTML button in its own region called A_BUTTON, its current Button display attributes are sytle: HTML Button Attributes: name="A" class="where_clause_button" what it does is i use a dynamic action based off the where_clause_button jquery sel
-
How to clear the hung calls in CUBE?
I'm installing a new CUBE as SIP-SIP gateway in Cisco 2921, IOS: 15.1(4)M3. When i tried few test calls, I saw couple of hung calls in it. I tried clearing them manually with the below command but it didn't help. clear call voice causecode identifier
-
Photoshop CS5 Issue - Very Annoying
Hello all, I'm having a very weird (and needless to say, very annoying) issue with my Photoshop CS5 Extended. Any knowledge or help would be highly appreciated. FYI - I'm photographer so my primary use is image editing. Basically, every time I make a