F4IF_INT_TABLE_VALUE_REQUEST - return more than 1 field in return_values?
In a dialog program I"m using the 'on value request' to call a routine that builds a dropdown on a field. It looks like this:
PROCESS ON VALUE-REQUEST.
FIELD ekpo_ci-zzlicnum module build_search.
Within build_search, I build itab_values with the dropdown values and the function module is called:
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING RETFIELD = 'ZZLICNUM'
DYNPPROG = w_progname
DYNPNR = w_scr_num
DYNPROFIELD = 'ZZLICNUM'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB_VALUES
RETURN_TAB = RETURN_VALUES
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
The routine calls F4IF_INT_TABLE_VALUE_REQUEST and in the dropdown, 5 fields are shown in each row (built in an internal table itab_values). When I select one of the rows, it returns the field value for zzlicnum in return_values. Is there a way to also return the other values I have in itab_values (other than just zzlicnum) - I need to use the other fields that are associated with zzlicnum in my program for some additional logic.
I appreciate any help!
hi,
refer to these codes:
you can change something according to your requirement.
PARAMETERS:
a TYPE char10,
b TYPE char10,
c TYPE char10.
DATA:
BEGIN OF tab OCCURS 0,
field1 TYPE char10,
field2 TYPE char10,
field3 TYPE char10,
END OF tab,
wa LIKE LINE OF tab,
DYNPFLD_MAPPING TYPE STANDARD TABLE OF DSELC,
dyn_wa TYPE DSELC,
lt_return TYPE TABLE OF DDSHRETVAL,
lwa_return TYPE ddshretval.
INITIALIZATION.
wa-field1 = 'aaaaa'.
wa-field2 = 'bbbbb'.
wa-field3 = 'ccccc'.
APPEND wa to tab.
wa-field1 = 'aaaaa'.
wa-field2 = 'bbccc'.
wa-field3 = 'ddddd'.
APPEND wa to tab.
wa-field1 = 'aaaab'.
wa-field2 = 'bbccc'.
wa-field3 = 'eeeee'.
APPEND wa to tab.
dyn_wa-FLDNAME = 'FIELD1'.
dyn_wa-DYFLDNAME = 'A'.
APPEND dyn_wa to DYNPFLD_MAPPING.
dyn_wa-FLDNAME = 'FIELD2'.
dyn_wa-DYFLDNAME = 'B'.
APPEND dyn_wa to DYNPFLD_MAPPING.
dyn_wa-FLDNAME = 'FIELD3'.
dyn_wa-DYFLDNAME = 'C'.
APPEND dyn_wa to DYNPFLD_MAPPING.
AT SELECTION-SCREEN on VALUE-REQUEST FOR a.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
retfield = 'FIELD1'
* PVALKEY = ' '
DYNPPROG = sy-cprog
DYNPNR = '1000'
DYNPROFIELD = 'A'
* STEPL = 0
* WINDOW_TITLE = WINDOW_TITLE
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
CALLBACK_PROGRAM = sy-cprog
CALLBACK_FORM = 'CALLBACK_F4'
* MARK_TAB = MARK_TAB
* IMPORTING
* USER_RESET = USER_RESET
TABLES
value_tab = tab
* FIELD_TAB = FIELD_TAB
RETURN_TAB = lt_return
* DYNPFLD_MAPPING = DYNPFLD_MAPPING
* EXCEPTIONS
* PARAMETER_ERROR = 1
* NO_VALUES_FOUND = 2
* OTHERS = 3
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
form callback_f4 TABLES record_tab STRUCTURE seahlpres
CHANGING shlp TYPE shlp_descr
callcontrol LIKE ddshf4ctrl.
DATA:
ls_intf LIKE LINE OF shlp-interface,
ls_prop LIKE LINE OF shlp-fieldprop.
*Hide unwanted fields
CLEAR: ls_prop-shlpselpos,
ls_prop-shlplispos.
* MODIFY shlp-fieldprop FROM ls_prop
* TRANSPORTING shlpselpos shlplispos
* WHERE ( fieldname NE 'F0001' AND
* fieldname NE 'F0002' AND
* fieldname NE 'F0003' ).
* " Overwrite selectable fields on search help
REFRESH: shlp-interface.
ls_intf-shlpfield = 'F0001'.
ls_intf-valfield = 'A'.
ls_intf-f4field = 'X'.
APPEND ls_intf TO shlp-interface.
ls_intf-shlpfield = 'F0002'.
ls_intf-valfield = 'B'.
ls_intf-f4field = 'X'.
APPEND ls_intf TO shlp-interface.
ls_intf-shlpfield = 'F0003'.
ls_intf-valfield = 'C'.
ls_intf-f4field = 'X'.
APPEND ls_intf TO shlp-interface.
ENDFORM.
Similar Messages
-
Repo error:ORA-01422:exact fetch returns more than requested number of rows
Hello,
on my page I have some input fields and a report based on a query (PL/SQL function body returning SQL-Statement). The Where-Clause from this sql-statement depends on the values of the input fields.
I listed the sql-Statement via htp.p (q ) and copied this displayed statement in sql-editor. There this statement works fine.
Is there a line-limit for reports?
Acutally there more than 500 rows in this table.
When I limit the return data with an value for the where-clause which returns less than 500 rows the results are shown correctly.
The layout and pagination row count is already set to 2000.
Which possiblities do I have to solve this problem?
Thanks in advance
Regards
Ulrike
Message was edited by:
[email protected]
Hi,
I found the problem.
Unfortunately I'm unable to delete this thread.
Regards Ulrikeselect ... into <variable>
means only 1 row can be returned.
Your select returns more than one row.
Either change v_txt into a collection, define a cursor and fetch from it, or change the statement so it returns one row.
Sybrand Bakker
Senior Oracle DBA -
Can a function return more than one item or object?
Hi I am trying to move text movies and textfields around a stage. This is a learning curve for me. I am confused by an example I have found on the internet.
http://forums.adobe.com/community/flash/flash_actionscript
What type of object is
var letter:Object = getLetterObject(_text.charAt(i)); // in the draw function
as it has properties
letter.stepDegrees = _totalAngle / numOfLetters;
getLetterObject()
seems to return lotts of stuff which would not be done in other languages like C
return
movie:movie,
field:field,
widthInDegrees:0,
fieldWidth:field.width,
fieldHeight:field.height
I would like to get my head around this as this is a good example of what I need. Well parts of it actualy.
I understand that the text field is added as a child to the Movieclip. I would have expected just a MovieClip object returned.
full code including the function getLetterObject()
=======
package
import flash.display.DisplayObject;
import flash.display.MovieClip;
import flash.geom.Rectangle;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;
public class CurvedText extends MovieClip
public static const DIRECTION_UP:String = "up";
public static const DIRECTION_DOWN:String = "down";
public var showLetterBorder:Boolean = false;
public var showCurve:Boolean = false;
private var _letterHolder:MovieClip;
private var _text:String;
private var _radius:Number;
private var _letters:Array;
private var _widthOfText:Number = 0;
private var _startAngle:Number = 0;
private var _endAngle:Number = 360;
private var _totalAngle:Number = 0;
private var _textFormat:TextFormat;
private var _direction:String;
public function CurvedText(text:String = "", radius:Number = 200, startAngle:Number = 0, endAngle:Number = 360, direction:String = "up", textFormat:TextFormat = null)
_text = text;
_radius = radius;
_startAngle = startAngle;
_endAngle = endAngle;
_direction = direction;
_textFormat = textFormat;
_letters = [];
_totalAngle = Math.abs(_startAngle) + Math.abs(_endAngle);
public function draw():void
// checking if there is any text set
if(_text == "")
return;
// clearing the letters' holder
if(_letterHolder && contains(_letterHolder))
removeChild(_letterHolder);
_letterHolder = new MovieClip();
addChild(_letterHolder);
// adding letters
var numOfLetters:int = _text.length;
for(var i:int=0; i<numOfLetters; i++)
var letter:Object = getLetterObject(_text.charAt(i));
letter.stepDegrees = _totalAngle / numOfLetters;
_letters.push(letter);
_widthOfText += letter.fieldWidth;
_letterHolder.addChild(letter.movie);
// positioning
position();
// draw the curve
if(showCurve) {
_letterHolder.graphics.lineStyle(1, 0xFF0000, 1);
_letterHolder.graphics.drawCircle(0, 0, _radius);
private function getLetterObject(letter:String):Object
// setting default text format
if(!_textFormat)
_textFormat = new TextFormat();
_textFormat.align = TextFormatAlign.CENTER;
_textFormat.font = "Verdana";
_textFormat.size = 12;
_textFormat.color = 0x000000;
// creating the field
var movie:MovieClip = new MovieClip();
var field:TextField = new TextField();
field.width = 10;
field.defaultTextFormat = _textFormat;
field.embedFonts = true;
field.multiline = false;
field.autoSize = TextFieldAutoSize.CENTER;
field.text = letter;
field.x = -field.width / 2;
field.y = -field.height / 2;
if(showLetterBorder)
field.border = true;
movie.addChild(field);
return // RETURNS more than one value?
movie:movie,
field:field,
widthInDegrees:0,
fieldWidth:field.width,
fieldHeight:field.height
private function position():void
// position the letters
var numOfLetters:int = _letters.length;
var degrees:Number = _startAngle;
for(var i:int=0; i<numOfLetters; i++)
var angle:Number = _letters[i].stepDegrees + degrees;
if(_direction == DIRECTION_DOWN)
angle -= 180;
_letters[i].movie.scaleY = -1;
} else {
xValue = _radius * Math.cos((angle-90)/180*Math.PI);
yValue = _radius * Math.sin((angle-90)/180*Math.PI);
var xValue:int = _radius * Math.cos((angle-90)/180*Math.PI);
var yValue:int = _radius * Math.sin((angle-90)/180*Math.PI);
_letters[i].movie.x = xValue;
_letters[i].movie.y = yValue;
_letters[i].movie.rotation = angle;
degrees += _letters[i].stepDegrees;
// position the holder
var bounds:Rectangle = _letterHolder.getBounds(this);
_letterHolder.x = -bounds.x;
_letterHolder.y = -bounds.y;
if(_direction == DIRECTION_DOWN)
_letterHolder.scaleX = -1;Hi
I still think I need an Object parent child linkage diagram on this to get my head around it.
It seems that things are reversed so that it is Object:value. Kind of confusing to see movie:movie.
var letter:Object = getLetterObject(_text.charAt(i));
letter holds the following objects
MovieClip:Movie
TextField:field
widthInDegrees:0 // What is this. What type is a widthInDegrees
fieldWidth:field.width // Same as above
fieldHeight:field.height // Same as above
And to cap it all, back in the calling function draw()
letter.stepDegrees = _totalAngle / numOfLetters; // What is stepDegrees a property of? MovieClip,TextField,widthInDegrees,fieldWidth or fieldHeight
I can understand the first two but not the last three
For example widthInDegrees is not mentioned anywhere in the code. and
letter.stepDegrees // implies that stepDegrees is a property of Object:letter.
Do you throw a property and value blindly at the letter object and let flash work out which object it is a property of?
MovieClip & TextField do not have this property. Searched the web for this information. We need an equivelent of MSDN.
Desmond. -
hi i am receiving "exact fetch returns more than requested number of rows oracle error". but i am not able to locate the error in the below code. Any help would be appreciated!!!
CREATE OR REPLACE PROCEDURE load_scene_collection_item (
--pdname VARCHAR2,
-- LOCATION TO ADD/CHANGE below!!!
pITEM_TYPE_ID INTEGER,
pSCENE_COLLECTION_ID INTEGER,
pCOLLECTION_ITEM_NAME VARCHAR2,
pCOLLECTION_ITEM_DESC VARCHAR2,
pDEFAULT_COORD_X NUMBER,
pDEFAULT_COORD_Y NUMBER,
pDEFAULT_COORD_Z NUMBER,
pDEFAULT_WIDTH NUMBER,
pDEFAULT_HEIGHT NUMBER,
pDEFAULT_ROTATION INTEGER,
pDEFAULT_ALPHA INTEGER,
pfname VARCHAR2) IS
src_file BFILE;
dst_file BLOB;
lgh_file BINARY_INTEGER;
BEGIN
src_file := bfilename('BUSINESSBLOBSIMAGES', pfname);
-- insert a NULL record to lock
Insert into SCENE_COLLECTION_ITEM
( ITEM_TYPE_ID,
SCENE_COLLECTION_ID,
COLLECTION_ITEM_NAME,
COLLECTION_ITEM_DESC,
COLLECTION_ITEM_IMAGE,
DEFAULT_COORD_X,
DEFAULT_COORD_Y,
DEFAULT_COORD_Z,
DEFAULT_WIDTH,
DEFAULT_HEIGHT,
DEFAULT_ROTATION,
DEFAULT_ALPHA,
CREATE_USER,
CREATE_DATE)
Values ( pITEM_TYPE_ID, pSCENE_COLLECTION_ID, pCOLLECTION_ITEM_NAME, pCOLLECTION_ITEM_DESC, EMPTY_BLOB(),
pDEFAULT_COORD_X,
pDEFAULT_COORD_Y,
pDEFAULT_COORD_Z,
pDEFAULT_WIDTH,
pDEFAULT_HEIGHT,
pDEFAULT_ROTATION,
pDEFAULT_ALPHA,
sys_context('USERENV', 'OS_USER'),
sys_extract_utc(systimestamp))
RETURNING COLLECTION_ITEM_IMAGE INTO dst_file;
-- LOCATIONs(2) TO ADD/CHANGE above!!!
-- lock record
SELECT COLLECTION_ITEM_IMAGE
INTO dst_file
FROM SCENE_COLLECTION_ITEM
WHERE ITEM_TYPE_ID = pITEM_TYPE_ID
AND SCENE_COLLECTION_ID = pSCENE_COLLECTION_ID
AND COLLECTION_ITEM_NAME= pCOLLECTION_ITEM_NAME
AND COLLECTION_ITEM_DESC= pCOLLECTION_ITEM_DESC
AND pDEFAULT_COORD_X = DEFAULT_COORD_X
AND pDEFAULT_COORD_Y = DEFAULT_COORD_Y
AND pDEFAULT_COORD_Z = DEFAULT_COORD_Z
AND pDEFAULT_WIDTH = DEFAULT_WIDTH
AND pDEFAULT_HEIGHT = DEFAULT_HEIGHT
AND pDEFAULT_ROTATION = DEFAULT_ROTATION
AND pDEFAULT_ALPHA = DEFAULT_ALPHA
FOR UPDATE;
-- LOCATION TO ADD/CHANGE above!!!
-- open the file
dbms_lob.fileopen(src_file, dbms_lob.file_readonly);
-- determine length
lgh_file := dbms_lob.getlength(src_file);
-- read the file
dbms_lob.loadfromfile(dst_file, src_file, lgh_file);
-- update the blob field
UPDATE SCENE_COLLECTION_ITEM
SET COLLECTION_ITEM_IMAGE = dst_file
WHERE ITEM_TYPE_ID = pITEM_TYPE_ID
AND SCENE_COLLECTION_ID = pSCENE_COLLECTION_ID
AND COLLECTION_ITEM_NAME= pCOLLECTION_ITEM_NAME
AND COLLECTION_ITEM_DESC= pCOLLECTION_ITEM_DESC
AND pDEFAULT_COORD_X = DEFAULT_COORD_X
AND pDEFAULT_COORD_Y = DEFAULT_COORD_Y
AND pDEFAULT_COORD_Z = DEFAULT_COORD_Z
AND pDEFAULT_WIDTH = DEFAULT_WIDTH
AND pDEFAULT_HEIGHT = DEFAULT_HEIGHT
AND pDEFAULT_ROTATION = DEFAULT_ROTATION
AND pDEFAULT_ALPHA = DEFAULT_ALPHA
-- LOCATION TO ADD/CHANGE above!!!
-- close file
dbms_lob.fileclose(src_file);
END load_scene_collection_item;
Thanks in advance!!!!Hi PaulHorth,
Thanks for the quick reply.
Actually, i am getting error while updating the records.
below is the error message:
Error starting at line 1 in command:
exec load_scene_collection_item(3,15,'2 Lane 4way Stop','4 Way Stop Intersection with 2 lanes in each direction',0,0,0,400,517,0,1,'2 Lane 4way Stop.PNG');
Error report:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "DP_OWNER.LOAD_SCENE_COLLECTION_ITEM", line 55
ORA-06512: at line 1
01422. 00000 - "exact fetch returns more than requested number of rows"
*Cause: The number specified in exact fetch is less than the rows returned.
*Action: Rewrite the query or change number of rows requested -
ORA-01427:single-row sub query returns more than one row (group by)
Hello every one, I am very new to this field , and Right now I am working with this sql, where BEG_BAL_WKST,WKST_RECEIVED_NUM,WKST_PROCESSED_NUM,WKST_CANCELED_NUM are needs to be grouped by,but I am getting the "single-row sub query returns more than one row".
This is the query I am using in my source qualifier:
select
SUM(tmp.WIP_TO_BILL_LOC_AMT) AS WIP_TO_BILL_LOC_AMT,
sum(tmp.REALIZATION_LOC_AMT) AS REALIZATION_LOC_AMT,
SUM(tmp.NEG_REAL_LOC_AMT) AS NEG_REAL_LOC_AMT,
sum(tmp.POS_REAL_LOC_AMT) AS POS_REAL_LOC_AMT,
sum(tmp.BILL_IN_ADVANCE_LOC_AMT) AS BILL_IN_ADVANCE_LOC_AMT,
sum(tmp.CARRY_FORWARD_LOC_AMT) AS CARRY_FORWARD_LOC_AMT,
sum(tmp.BILL_TO_CLIENT_LOC_AMT) AS BILL_TO_CLIENT_LOC_AMT,
sum(tmp.REMAIN_WIP_TO_BILL_LOC_AMT) REMAIN_WIP_TO_BILL_LOC_AMT,
sum(tmp.AR_INV_AMT) AS AR_INV_AMT,
sum(tmp.AR_TAX_AMT) AS AR_TAX_AMT,
tmp.BEG_BAL_WKST_NUM AS BEG_BAL_WKST_NUM,
tmp.WKST_RECEIVED_NUM AS WKST_RECEIVED_NUM,
tmp.WKST_PROCESSED_NUM AS WKST_PROCESSED_NUM,
tmp.WKST_CANCELED_NUM AS WKST_CANCELED_NUM,
tmp.DURATION AS DURATION,
tmp.NUM_DAYS AS NUM_DAYS,
tmp.NUM_HOURS AS NUM_HOURS,
tmp.NUM_MINUTES AS NUM_MINUTES,
tmp.NUM_SECONDS AS NUM_SECONDS,
tmp.LEAD_PROJECT_OFFICE_CODE AS LEAD_PROJECT_OFFICE_CODE,
tmp.LEAD_PROJECT_TEAM_CODE AS LEAD_PROJECT_TEAM_CODE,
tmp.ORG_ID AS ORG_ID,
tmp.RPT_DATE AS RPT_DATE,
tmp.RPT_DATE_WID AS RPT_DATE_WID,
tmp.LOCAL_CURR_CODE AS LOCAL_CURR_CODE,
tmp.USD_EXCH_RATE AS USD_EXCH_RATE,
tmp.EUR_EXCH_RATE AS EUR_EXCH_RATE,
tmp.GBP_EXCH_RATE AS GBP_EXCH_RATE
from(
SELECT
WIP_TO_BILL_LOC_AMT as WIP_TO_BILL_LOC_AMT ,
REALIZATION_LOC_AMT AS REALIZATION_LOC_AMT,
NEG_REAL_LOC_AMT AS NEG_REAL_LOC_AMT ,
POS_REAL_LOC_AMT AS POS_REAL_LOC_AMT,
BILL_IN_ADVANCE_LOC_AMT AS BILL_IN_ADVANCE_LOC_AMT ,
CARRY_FORWARD_loc_AMT AS CARRY_FORWARD_LOC_AMT,
bill_to_client_LOC_AMT AS BILL_TO_CLIENT_LOC_AMT ,
REMAIN_WIP_TO_BILL_LOC_AMT AS REMAIN_WIP_TO_BILL_LOC_AMT,
AR_inv_AMT AS AR_INV_AMT,
ar_tax_amt AS AR_TAX_AMT,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE ((inv_status_type='FIN'AND inv_status_code NOT IN ('COMPLETE','PROCESSED'))
OR (inv_status_type='WS' AND inv_status_code NOT IN ('PRC'))) --COMPLETED
AND to_char((sysdate-5),'YYYYMMDD') between to_char(status_start_dt,'YYYYMMDD') and to_char(status_end_dt,'YYYYMMDD')group by rpad(integration_id,32)) AS BEG_BAL_WKST_NUM ,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE (inv_status_code='NEW')
AND to_char((sysdate-4),'YYYYMMDD') between to_char(status_start_dt,'YYYYMMDD') and to_char(status_end_dt,'YYYYMMDD')group by rpad(integration_id,32))AS WKST_RECEIVED_NUM ,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE ((inv_status_type='FIN' and inv_status_code IN ('COMPLETE','PROCESSED'))
OR (inv_status_type='WS' AND inv_status_code IN ('PRC'))) --COMPLETED
AND to_char((sysdate-4),'YYYYMMDD') between to_char((status_start_dt),'YYYYMMDD') and to_char((status_end_dt),'YYYYMMDD')group by rpad(integration_id,32))AS WKST_PROCESSED_NUM ,
(SELECT count(distinct(RPAD(INTEGRATION_ID,32)))
FROM wc_twfs_olb_invoice_history_f
WHERE (inv_status_type='FIN' AND inv_status_code='CANCELLED')
AND to_char((sysdate-4),'YYYYMMDD') between to_char((status_start_dt),'YYYYMMDD') and to_char((status_end_dt),'YYYYMMDD')group by rpad(integration_id,32)) AS WKST_CANCELED_NUM,
DURATION AS DURATION,
NUM_DAYS AS NUM_DAYS,
NUM_HOURS AS NUM_HOURS,
NUM_MINUTES AS NUM_MINUTES,
NUM_SECONDS AS NUM_SECONDS,
lead_project_office_code AS LEAD_PROJECT_OFFICE_CODE,
lead_project_team_code AS LEAD_PROJECT_TEAM_CODE,
org_id AS ORG_ID,
trunc(sysdate-1) AS RPT_DATE,
to_char((sysdate-1),'YYYYMMDD') AS RPT_DATE_WID,
--last_day(a.report_date) mth_end_dt,
LOC_CURR_CODE AS LOCAL_CURR_CODE,
usd_exch_rate AS USD_EXCH_RATE,
eur_exch_rate AS EUR_EXCH_RATE,
gbp_exch_rate AS GBP_EXCH_RATE
FROM Wc_twfs_olb_invoice_history_f
Where
RPT_DT_MCAL_PERIOD_WID =(select max(RPT_DT_MCAL_PERIOD_WID)from Wc_twfs_olb_invoice_history_f))tmp
group by BEG_BAL_WKST_NUM,WKST_RECEIVED_NUM,WKST_PROCESSED_NUM,WKST_CANCELED_NUM,DURATION,NUM_DAYS,NUM_HOURS,NUM_MINUTES,NUM_SECONDS,
LEAD_PROJECT_OFFICE_CODE,LEAD_PROJECT_TEAM_CODE,ORG_ID,RPT_DATE,RPT_DATE_WID,
LOCAL_CURR_CODE,USD_EXCH_RATE,EUR_EXCH_RATE,GBP_EXCH_RATE;
Can you please suggest me what to do next, and what would be the solution to this.
Thanks a lot in advance. please show me some direction.you may want to change it something like
SELECT SUM(Wip_To_Bill_Loc_Amt) AS Wip_To_Bill_Loc_Amt,
SUM(Realization_Loc_Amt) AS Realization_Loc_Amt,
SUM(Neg_Real_Loc_Amt) AS Neg_Real_Loc_Amt,
SUM(Pos_Real_Loc_Amt) AS Pos_Real_Loc_Amt,
SUM(Bill_In_Advance_Loc_Amt) AS Bill_In_Advance_Loc_Amt,
SUM(Carry_Forward_Loc_Amt) AS Carry_Forward_Loc_Amt,
SUM(Bill_To_Client_Loc_Amt) AS Bill_To_Client_Loc_Amt,
SUM(Remain_Wip_To_Bill_Loc_Amt) AS Remain_Wip_To_Bill_Loc_Amt,
SUM(Ar_Inv_Amt) AS Ar_Inv_Amt,
SUM(Ar_Tax_Amt) AS Ar_Tax_Amt,
COUNT(DISTINCT CASE
WHEN ((Inv_Status_Type = 'FIN' AND
Inv_Status_Code NOT IN ('COMPLETE', 'PROCESSED')) OR
(Inv_Status_Type = 'WS' AND Inv_Status_Code NOT IN ('PRC'))) --COMPLETED
AND To_Char((SYSDATE - 5), 'YYYYMMDD') BETWEEN
To_Char(Status_Start_Dt, 'YYYYMMDD') AND
To_Char(Status_End_Dt, 'YYYYMMDD') THEN
Rpad(Integration_Id, 32)
END) AS Beg_Bal_Wkst_Num,
/*(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE ((Inv_Status_Type = 'FIN' AND
Inv_Status_Code NOT IN ('COMPLETE', 'PROCESSED')) OR
(Inv_Status_Type = 'WS' AND Inv_Status_Code NOT IN ('PRC'))) --COMPLETED
AND To_Char((SYSDATE - 5), 'YYYYMMDD') BETWEEN
To_Char(Status_Start_Dt, 'YYYYMMDD') AND
To_Char(Status_End_Dt, 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Beg_Bal_Wkst_Num,
(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE (Inv_Status_Code = 'NEW')
AND To_Char((SYSDATE - 4), 'YYYYMMDD') BETWEEN
To_Char(Status_Start_Dt, 'YYYYMMDD') AND
To_Char(Status_End_Dt, 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Wkst_Received_Num,
(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE ((Inv_Status_Type = 'FIN' AND
Inv_Status_Code IN ('COMPLETE', 'PROCESSED')) OR
(Inv_Status_Type = 'WS' AND Inv_Status_Code IN ('PRC'))) --COMPLETED
AND To_Char((SYSDATE - 4), 'YYYYMMDD') BETWEEN
To_Char((Status_Start_Dt), 'YYYYMMDD') AND
To_Char((Status_End_Dt), 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Wkst_Processed_Num,
(SELECT COUNT(DISTINCT(Rpad(Integration_Id, 32)))
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE (Inv_Status_Type = 'FIN' AND Inv_Status_Code = 'CANCELLED')
AND To_Char((SYSDATE - 4), 'YYYYMMDD') BETWEEN
To_Char((Status_Start_Dt), 'YYYYMMDD') AND
To_Char((Status_End_Dt), 'YYYYMMDD')
GROUP BY Rpad(Integration_Id, 32)) AS Wkst_Canceled_Num,*/
Duration AS Duration,
Num_Days AS Num_Days,
Num_Hours AS Num_Hours,
Num_Minutes AS Num_Minutes,
Num_Seconds AS Num_Seconds,
Lead_Project_Office_Code AS Lead_Project_Office_Code,
Lead_Project_Team_Code AS Lead_Project_Team_Code,
Org_Id AS Org_Id,
Trunc(SYSDATE - 1) AS Rpt_Date,
To_Char((SYSDATE - 1), 'YYYYMMDD') AS Rpt_Date_Wid,
--last_day(a.report_date) mth_end_dt,
Loc_Curr_Code AS Local_Curr_Code,
Usd_Exch_Rate AS Usd_Exch_Rate,
Eur_Exch_Rate AS Eur_Exch_Rate,
Gbp_Exch_Rate AS Gbp_Exch_Rate
FROM Wc_Twfs_Olb_Invoice_History_f
WHERE Rpt_Dt_Mcal_Period_Wid =
(SELECT MAX(Rpt_Dt_Mcal_Period_Wid)
FROM Wc_Twfs_Olb_Invoice_History_f)
GROUP BY Beg_Bal_Wkst_Num,
Wkst_Received_Num,
Wkst_Processed_Num,
Wkst_Canceled_Num,
Duration,
Num_Days,
Num_Hours,
Num_Minutes,
Num_Seconds,
Lead_Project_Office_Code,
Lead_Project_Team_Code,
Org_Id,
Rpt_Date,
Rpt_Date_Wid,
Local_Curr_Code,
Usd_Exch_Rate,
Eur_Exch_Rate,
Gbp_Exch_Rate;Edited by: 986006 on Mar 4, 2013 1:08 PM -
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-01427: single-row subquery returns more than one row -- no solution
Hello to all:
I have to tables:
Table a anwender (Email,Dept). --> all fields are filled
Table b dingo (Name,email,dept) --> all fields are filled
I now want to update the table a with the data from table b:
update anwender a set a.abteilung = ( select distinct b.abteilung from dingo b where b.email = a.email);
Then I got the error: ORA-01427: single-row subquery returns more than one row
Every dept is about 100x in the database, so it is clear that i got more than one row back. But how can I update the table now?Okay, I got several duplicates, and I deletet a lot of data in my database.
Now I want to remove all entries with more than one departments per mail adresses.
a
select email,count(abteilung) from dingo group by email having count(abteilung)>1 order by count(abteilung)
shows me all the fake mailadresses.
But a
delete from dingo where email in (select email,count(abteilung) from dingo group by email having count(abteilung)>1 order by count(abteilung) );
gives me a
SQL Error: ORA-00907: missing right parenthesis
I´m very confused now ...
Oops, now I got the solution:
delete from dingo where email in (select email from (select email,count(abteilung) from dingo group by email having count(abteilung)>1 )) ;
Edited by: user8309218 on Dec 18, 2009 6:24 AM -
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, -
Subquery returned more than one value
Hi,
I have this statement which has been working fine - not I get a 'Subquery returned more than one value" error:
SELECT
'WAS3' AS 'Rec ID',
E.EecEEID AS 'Emp ID',
eepNameFirst AS 'First Name',
eepNameLast AS 'Last Name',
EecDateOfOriginalHire AS 'Service Date',
(SELECT DATEDIFF(YEAR, EecDateOfOriginalHire, getdate()) from empcomp EC WHERE EC.EecEEID = E.EECEEID) as 'Yrs of Serv'
FROM
EmpPers
JOIN EmpComp E
ON E.eecEEID = eepEEID
JOIN Company
ON eecCoID = cmpCoID
WHERE
EecDateOfTermination IS NOT NULL
AND EXISTS
(SELECT 1
FROM EmpComp e2
WHERE e2.EecEEID = E.EecEEID
--AND e2.eecEmplStatus <> 'A')-- changed to <> ...this WAS/is to filter out anyone that was termed then re-hired
--AND E.EecTermReason NOT IN ('I01','I02','I03','I14','I22','V05','V07','V09','V12','V22','V13', 'TRO')
AND E.eecDateOfTermination
IN (SELECT (EC.eecDateOfTermination)
FROM EMPCOMP EC
WHERE EC.EecEEID = E.EECEEID
AND EC.eecDateOfTermination IS NOT NULL
AND eC.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0)
AND EC.eecDateOfTermination <=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6)
AND e.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0)
AND E.eecDateOfTermination <= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6)))
--AND eC.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,('12/30/2007')),0)
-- AND EC.eecDateOfTermination <=DATEADD(wk,DATEDIFF(wk,0,('12/30/2007')),6)
-- AND e.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,('12/30/2007')),0)
-- AND E.eecDateOfTermination <= DATEADD(wk,DATEDIFF(wk,0,('12/30/2007')),6)
-- AND E.eecDateOfTermination IS NOT NULL ))
--added below per Paul Cottle to exclude employeess less than four years
AND E.eecdateoforiginalhire >=dateadd(year,-4, CURRENT_TIMESTAMP)
qeqwCheck this, if it works:
SELECT
'WAS3' AS 'Rec ID',
E.EecEEID AS 'Emp ID',
eepNameFirst AS 'First Name',
eepNameLast AS 'Last Name',
EecDateOfOriginalHire AS 'Service Date',
DATEDIFF(YEAR, EecDateOfOriginalHire, getdate()) as 'Yrs of Serv'
FROM EmpPers
JOIN EmpComp E ON E.eecEEID = eepEEID
JOIN Company ON eecCoID = cmpCoID
WHERE EecDateOfTermination IS NOT NULL
AND EXISTS
(SELECT 1
FROM EmpComp e2
WHERE e2.EecEEID = E.EecEEID
AND E.eecDateOfTermination
IN (SELECT (EC.eecDateOfTermination)
FROM EMPCOMP EC
WHERE EC.EecEEID = E.EECEEID
AND EC.eecDateOfTermination IS NOT NULL
AND eC.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0)
AND EC.eecDateOfTermination <=DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6)
AND e.eecDateOfTermination >= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),0)
AND E.eecDateOfTermination <= DATEADD(wk,DATEDIFF(wk,0,GETDATE()),6)))
AND E.eecdateoforiginalhire >=dateadd(year,-4, CURRENT_TIMESTAMP)
If this post answers your query, please click "Mark As Answer" or "Vote as Helpful". -
GetSelectedRowKeys() returns more than one on Single Selection Tree Table
Hi,
I found that this issue occurring after PS3 (I think.)
I have a tree table component, which allows single row selection. There is a listener on a column of the tree table as follows:
public void listenPackageUnit(ValueChangeEvent valueChangeEvent)
Object oldKey = getTreeComponent().getRowKey();
try
* Retrieve index of selected package unit
* NOTE: Subtract 1 to remove no selection value. This only
* needs to be done if attached LOV has No Selection option set.
if (valueChangeEvent.getNewValue() != null)
Row row = null;
String selectedPackageUnit = null;
int packageUnitIndex = (Integer) valueChangeEvent.getNewValue();
packageUnitIndex--;
* Due to the no selection item, we need to prevent search of regular
* iterator if index is < 0. In this case we know the user selected
* the no selection (blank) value.
if (packageUnitIndex >= 0)
* Using index, determine the value of the selected package unit
DCIteratorBinding packageUnitsIterator =
(DCIteratorBinding) PasUiADFUtil.resolveExpression("#{bindings.PackageUnitsIterator}");
Row newRow =
packageUnitsIterator.getRowAtRangeIndex(packageUnitIndex);
selectedPackageUnit = (String) newRow.getAttribute("LookupCode");
RowKeySet selection = this.getTreeComponent().getSelectedRowKeys();
if (selection != null && selection.getSize() > 0)
for (Object facesTreeRowKey: selection)
this.getTreeComponent().setRowKey(facesTreeRowKey);
JUCtrlHierNodeBinding rowData =
(JUCtrlHierNodeBinding) this.getTreeComponent().getRowData();
row = rowData.getRow();
setSelectedLabel((String) row.getAttribute("Label"));
setSelectedLabelType((String) row.getAttribute("LabelType"));
row.setAttribute("PackageUnit", selectedPackageUnit);
getTreeComponent().setRowKey(oldKey);
finally
getTreeComponent().setRowKey(oldKey);
The issue is that getSelectedRowKeys() returns more than one when the user selects a child row in the tree table.
It seems to be returning the total number counting from the top parent through the child.
(For example, if the child is the second generation, it returns 2, and if the third generation, it returns 3.)
This is causing the issue that the method tries to update the attribute of the parent row with a value for the child row. (And it fails, because the attribute is updateable only while new.)
I remember getSelectedRowKeys() always returned one, the selected child itself, when I coded this around October, 2010.
Is this a design change after PS3? Why does it return more than one though the tree table is for single selection?
How can I get around this issue?
It would be truly appreciated if we can get any quick help, since we are at final testing phase of our product.
Thank you,
TomoHi Vinod,
I found the solution. Thank you very much for your suggestions. :)
Now my listenSelection (custom listener of the tree table) looks like below:
public void listenSelection(SelectionEvent selectionEvent)
Row currentRow;
PasUiADFUtil.invokeEL("#{bindings.TransactionLabelTopLevelVO1.collectionModel.makeCurrent}",
new Class[] { SelectionEvent.class },
new Object[] { selectionEvent });
Object oldKey = getTreeComponent().getRowKey();
try
if (this.getTreeComponent() != null)
RowKeySet rks = this.getTreeComponent().getSelectedRowKeys();
Iterator keys = rks.iterator();
while (keys.hasNext())
List key = (List) keys.next();
this.getTreeComponent().setRowKey(key);
JUCtrlHierNodeBinding node =
(JUCtrlHierNodeBinding) this.getTreeComponent().getRowData();
if (node != null)
currentRow = node.getRow();
if (currentRow != null)
this.setSelectedRow(currentRow);
setSelectedLabel((String) currentRow.getAttribute("Label"));
setSelectedLabelType((String) currentRow.getAttribute("LabelType"));
String shippedItemFlag =
(String) currentRow.getAttribute("ShippedItemFlagValue");
if (shippedItemFlag != null && shippedItemFlag.equals("1"))
setDisableAdd(true);
else
setDisableAdd(false);
finally
getTreeComponent().setRowKey(oldKey);
/* Refresh Action menu and buttons */
RequestContext.getCurrentInstance().addPartialTarget(this.getActionMenu());
RequestContext.getCurrentInstance().addPartialTarget(this.getToolbar());
And my tree table is like below:
<af:treeTable value="#{bindings.TransactionLabelTopLevelVO1.treeModel}"
var="node" rowSelection="single" id="tt1"
contentDelivery="immediate" fetchSize="25"
emptyText="#{bindings.TransactionLabelTopLevelVO1.viewable ? commonFoundationMsgBundle.NO_DATA_TO_DISPLAY : commonFoundationMsgBundle.ACCESS_DENIED}"
selectionListener="#{pageFlowScope.MaintainTransactionSerialAssociationBean.listenSelection}"
binding="#{pageFlowScope.MaintainTransactionSerialAssociationBean.treeComponent}"
summary="#{maintainAssociationUiBundle.CONTAINER_SERIAL_HIERARCHY}">
<!-- Row Header -->
The listener is now always getting the currently selected row only.
Tomo -
ORA-01422- exact fetch returns more than requested number of rows in D2K Report
Hi All,
Greetings.
I am using a report which is being called from the from in one of my application. The report is working fine from quiet a long time. I have an error with a particular record alone and it is working fine for all other records.
When I try to run the report, I am getting the error as Rep-1401- 'cf_vatformula' : Fatal pl/sql error occured.
ORA-01422- Exact fetch returns more than requested number of rows.
I opened the formula column and run the sql codes that are used in the formula column cf_vat and all of them are working fine. None of them are fetching more a single row. But, when I run the report, I am getting the same error as mentioned above.
Please help me resolve the issue ASAP. Thanks in Advance.
Regards,
Bhaskar.Hi InoL,
Thanks for your time.
I am sure that there is no other procedure used in cf_vatformula. It has select queries in and all of them are fetching the data not more than a single row.
I have tested each and every select query with every possible output.
Regards,
Bhaskar. -
How to find out which sub query returns more than one row
Hi all,
Can any one give me clue ,how to find out which sub query returns more than one row in the following query .
/* Formatted on 2011/05/17 19:22 (Formatter Plus v4.8.8) */
SELECT a.*, ROWNUM AS rnm
FROM (SELECT DISTINCT '1' AS "Page View", ou.org_unit_name AS "Org",
prxm.mbr_idntfr AS "Beneficiary ID",
md.last_name
|| ', '
|| md.first_name AS "Beneficiary Name",
pci.idntfr AS "Tracking No.",
TO_CHAR (TRUNC (req.pa_rqst_date),
'MM/dd/yyyy'
) AS "Request Date",
sts.status_name AS "Status",
req.pa_rqst_sid AS "Request #",
prxm.mbr_sid AS "Mbr_sid",
TO_CHAR
(TRUNC (req.pa_revision_date),
'MM/dd/yyyy'
) AS "Last Updated",
TO_CHAR (psd.TO_DATE, 'MM/dd/yyyy') AS "TO_DATE",
prxpl.prvdr_lctn_iid AS "PRVDR_LCTN_IID",
pd.prvdr_sid AS "PRVDR_SID", 'Y' AS "State View",
DECODE
((SELECT DISTINCT pd.national_prvdr_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid =
req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
0, (SELECT prxplo.prvdr_lctn_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
NULL, (SELECT prxplo.prvdr_lctn_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
(SELECT DISTINCT pd.national_prvdr_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid =
req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR')
) AS "NPI/ID",
DECODE
((SELECT pd.org_bsns_name
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
NULL, (SELECT pd.last_name
|| ', '
|| pd.first_name
|| ' '
|| pd.middle_name
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
(SELECT pd.org_bsns_name
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR')
) AS "Prvdr Name",
TO_CHAR (psd.from_date,
'MM/dd/yyyy'
) AS "Srvc From Date",
TO_CHAR (req.validity_start_date,
'MM/DD/YYYY'
) AS "Due Date",
(fn_get_busniess_days (TRUNC (req.validity_start_date))
) AS "Days<br>Left",
req.pa_mode_type_lkpcd AS "Source",
TO_CHAR (TRUNC (wmdtl.rtng_date),
'MM/dd/yyyy'
) AS "Assigned On",
NVL (wmdtl.assigned_to_user_name,
'Not Assigned'
) AS "Assigned To",
req.org_unit_sid AS "OrgUnitSid",
TO_CHAR
(wmdtl.modified_date,
'MM/dd/yyyy hh24:mi:ss'
) AS "WTRD_MODIFIED_DATE",
TO_CHAR (wmdtl.rtng_date,
'MM/dd/yyyy'
) AS "WTRD_RTNG_DATE",
req.status_cid AS "PA_STATUS_CID",
TO_CHAR (req.modified_date,
'MM/dd/yyyy'
) AS "PA_REQ_MODIFIED_DATE",
prs.state_pa_srvc_type_code
AS "STATE_PA_SRVC_TYPE_CODE",
wmdtl.wm_pa_task_rtng_dtl_sid
AS "WM_TASK_RTNG_DTL_SID",
wmdtl.assigned_to_user_acct_sid
AS "WTRD_Assigned_to_user_acct_sid",
(fn_get_busniess_days (TRUNC (req.validity_start_date))
) AS "Days<br>LeftSort",
wmdtl.assigned_to_org_unit_sid
AS "WTRD_Assigned_to_OrgUntSid",
DECODE
((SELECT COUNT (*)
FROM pa_request_status prs
WHERE prs.pa_rqst_sid = req.pa_rqst_sid
AND prs.status_cid = 5
AND prs.oprtnl_flag = 'I'),
0, 'N',
'Y'
) AS "SHOW_UTILIZATION"
FROM pa_request req,
pa_certification_identifier pci,
status sts,
pa_request_x_member prxm,
wm_pa_task_routing_detail wmdtl,
pa_service_date psd,
org_unit ou,
pa_request_service prs,
pa_request_x_provider_location prxpl,
provider_location pl,
provider_detail pd,
provider p,
mbr_dmgrphc md
WHERE req.oprtnl_flag = 'A'
AND req.status_cid NOT IN
(20, 30, 70, 25, 80, 96, 85, 5, 97, 98, 101)
AND req.org_unit_sid IN
(3057, 3142, 3058, 3143, 3059, 3144, 3060, 3145,
3061, 3146, 3062, 3147, 3063, 3148, 3064, 3149,
3065, 3150, 3066, 3151, 3067, 3152, 3068, 3153,
3069, 3154, 3070, 3155, 3071, 3156, 3072, 3157,
3073, 3158, 3074, 3159, 3075, 3160, 3076, 3161,
3077, 3162, 3078, 3163, 3079, 3164, 3080, 3165,
3081, 3166, 3082, 3167, 3083, 3168, 3084, 3169,
3085, 3170, 3086, 3171, 3087, 3172, 3088, 3173,
3089, 3174, 3090, 3175, 3091, 3176, 3092, 3177,
3093, 3178, 3094, 3179, 3095, 3180, 3096, 3181,
3097, 3182, 3098, 3183, 3099, 3184, 3100, 3185,
3101, 3186, 3102, 3187, 3103, 3003, 75000104,
75000108, 2006, 75000103, 75000102, 75000113,
75000111, 75000109, 2001, 2009, 75000105,
75000107, 2004, 2010, 2013, 2014, 2005, 2011,
75000112, 2002, 1001, 2012, 75000106, 2007,
75000101, 2003, 75000110, 2008, 3001, 3002, 3019,
3104, 3020, 3105, 3021, 3106, 3022, 3107, 3023,
3108, 3024, 3109, 3025, 3110, 3026, 3111, 3027,
3112, 3028, 3113, 3029, 3114, 3030, 3115, 3031,
3116, 3032, 3117, 3033, 3118, 3034, 3119, 3035,
3120, 3036, 3121, 3037, 3122, 3038, 3123, 3039,
3124, 3040, 3125, 3041, 3126, 3042, 3127, 3043,
3128, 3044, 3129, 3045, 3130, 3046, 3131, 3047,
3132, 3048, 3133, 3049, 3134, 3050, 3135, 3051,
3136, 3052, 3137, 3053, 3138, 3054, 3139, 3055,
3140, 3056, 3141)
AND req.pa_rqst_sid = prs.pa_rqst_sid
AND prs.oprtnl_flag = 'A'
AND prs.pa_rqst_srvc_sid = psd.pa_rqst_srvc_sid
AND psd.oprtnl_flag = 'A'
AND req.pa_rqst_sid = pci.pa_rqst_sid
AND pci.oprtnl_flag = 'A'
AND req.pa_rqst_sid = prxm.pa_rqst_sid
AND prxm.oprtnl_flag = 'A'
AND md.oprtnl_flag = 'A'
AND md.status_cid = 2
AND TRUNC (SYSDATE) BETWEEN md.from_date AND md.TO_DATE
AND prxm.mbr_sid = md.mbr_sid
AND ou.org_unit_sid = req.org_unit_sid
AND ou.oprtnl_flag = 'A'
AND req.pa_rqst_sid = prxpl.pa_rqst_sid
AND prxm.pa_rqst_sid = prxpl.pa_rqst_sid
AND pci.pa_rqst_sid = prxm.pa_rqst_sid
AND pci.pa_rqst_sid = wmdtl.subsystem_task_sid
AND pci.pa_rqst_sid = prxpl.pa_rqst_sid
AND prxpl.pa_prvdr_type_lkpcd = 'RR'
AND prxpl.oprtnl_flag = 'A'
AND req.status_cid = sts.status_cid
AND sts.status_type_cid = 3
AND sts.oprtnl_flag = 'A'
AND prxpl.prvdr_lctn_iid = pl.prvdr_lctn_iid
AND p.prvdr_sid = pd.prvdr_sid
AND p.prvdr_sid = pl.prvdr_sid
AND pd.oprtnl_flag = 'A'
AND pd.status_cid = 2
AND TRUNC (SYSDATE) BETWEEN pd.from_date AND pd.TO_DATE
AND wmdtl.subsystem_task_sid = req.pa_rqst_sid
AND wmdtl.subsystem_lkpcd = 'PA'
AND wmdtl.oprtnl_flag = 'A'
AND req.pa_rqst_date > (SYSDATE - 365)
ORDER BY TO_DATE ("Request Date", 'MM/dd/yyyy hh24:mi:ss') DESC,
"Beneficiary Name" ASC) a
WHERE ROWNUM < 102;regards,
P Prakash
Edited by: BluShadow on 17-May-2011 15:01
added {noformat}{noformat} tags around the code833560 wrote:
Can any one give me clue ,how to find out which sub query returns more than one row in the following query .This is why smaller, simpler queries are easier to work with than huge ones - when something like this goes wrong smaller queries are much eaiser to debug. Unfortunately using smaller, easier-to-work with queries is not always an option
Ganesh is right - you will have to dissect the big query bit by bit until you find the offending subquery. If there is another way I would like to find out about it too.
The easiest way to do this is probably to use block comments to isolate parts of the query bit by bit until you find the offending part. If you carefully examine the subqueries you might be able to figure out which one is returning multiple rows without commenting everything
Good luck! -
How to return more than one value from a function
hello everybody,
Can anyone tell me how to return more than a single value from a function, the problem is i have 4 points,
2 points form one line ,another 2 points form 2nd line ,each point is 3 dimensional(x,y,z coorinates) so i will pass these values to func(x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4), i will find the point of intersecton of two lines and i will get it as x,y,z , now how to return these 3 coordinates,usually the function returns only one value, please help me to solve it out.
Thanks.I think the easiest way or trick here is (easiest isn't always the best as we know, but atleast this one will work) to create simple data array. and pass that. Create an array with:
<code>
class justArray {
int x=0
int y=0;
int z= 0;
...somewhere
justArray[] points= new justArray[4];
points[0].x= ..
points[0].y= ..
points[0].z= ..
points[1].x= ..
return points[]
</code> -
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 -
PROCEDURE PROBLEM - Exact Fetch Returns More Than Requested Number of Rows
Here is my procedure:
CREATE OR REPLACE PROCEDURE question4
( cust_first IN customer.custfirstname%TYPE,
cust_last IN customer.custlastname%TYPE,
customer_no OUT customer.customerSsn%TYPE,
cust_address OUT customer.address%TYPE,
loanID OUT loan.loanNo%TYPE,
application_date OUT loan.appdate%TYPE,
remaining_payments OUT loan.remainingpaymentsdue%TYPE,
loan_amount OUT loan.loanamount%TYPE,
loan_term OUT loan.loanterm%TYPE,
interest_rate OUT loan.interestrate%TYPE,
monthly_payment OUT loan.monthlypayment%TYPE)
AS
BEGIN
SELECT customerssn, address INTO customer_no, cust_address FROM CUSTOMER WHERE custfirstname= cust_first AND custlastname = cust_last;
SELECT loanno, remainingpaymentsdue, loanamount, loanterm, interestrate, monthlypayment, appdate INTO loanID, remaining_payments, loan_amount, loan_term, interest_rate, monthly_payment, application_date FROM LOAN WHERE customerSsn = customer_no;
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;Here is the anonymous block showing the use of my procedure.
SET SERVEROUTPUT ON
DECLARE
customer_number customer.customerSsn%TYPE := NULL;
customer_address customer.address%TYPE := NULL;
loan_number loan.loanNo%TYPE := NULL;
app_date loan.appdate%TYPE := NULL;
rem_payment loan.remainingpaymentsdue%TYPE := NULL;
l_amount loan.loanamount%TYPE := NULL;
l_term loan.loanterm%TYPE := NULL;
i_rate loan.interestrate%TYPE := NULL;
m_payment loan.monthlypayment%TYPE := NULL;
view_customerSSN NUMBER;
view_address VARCHAR2(50);
view_loanID NUMBER;
view_date DATE;
view_remaining_payment NUMBER;
view_loan_amount NUMBER(8,2);
view_loan_term VARCHAR2(10);
view_interest_rate FLOAT(20);
view_monthly_payment NUMBER(8,2);
BEGIN
question4 ('Tim', 'Thompson', customer_number, customer_address, loan_number, app_date, rem_payment, l_amount, l_term, i_rate, m_payment);
IF (customer_number IS NULL OR customer_address IS NULL OR loan_number IS NULL OR app_date IS NULL
OR rem_payment IS NULL OR l_amount IS NULL OR l_term IS NULL OR i_rate IS NULL OR m_payment IS NULL) THEN
DBMS_OUTPUT.PUT_LINE ('NULL VALUE');
ELSE
view_customerSSN := customer_number;
view_address := customer_address;
view_loanID := loan_number;
view_date := app_date;
view_remaining_payment := rem_payment;
view_loan_amount := l_amount;
view_loan_term := l_term;
view_interest_rate := i_rate;
view_monthly_payment := m_payment;
DBMS_OUTPUT.PUT_LINE ('CUSTOMER NO : ' || view_customerSSN);
DBMS_OUTPUT.PUT_LINE ('CUSTOMER ADDRESS : ' || view_address);
DBMS_OUTPUT.PUT_LINE ('LOAN NO : ' || view_loanID);
DBMS_OUTPUT.PUT_LINE ('LOAN APPLICATION DATE : ' || view_date);
DBMS_OUTPUT.PUT_LINE ('REMAINING PAYMENTS : ' || view_remaining_payment);
DBMS_OUTPUT.PUT_LINE ('LOAN AMOUNT : ' || view_loan_amount);
DBMS_OUTPUT.PUT_LINE ('LOAN TERM : ' || view_loan_term);
DBMS_OUTPUT.PUT_LINE ('INTEREST RATE : ' || view_interest_rate);
DBMS_OUTPUT.PUT_LINE ('MONTHLY PAYMENT : ' || view_monthly_payment);
END IF;
END;
/Error Message:
Error report:
ORA-06550: line 21, column 3:
PLS-00306: wrong number or types of arguments in call to 'QUESTION4'
ORA-06550: line 21, column 3:
PL/SQL: Statement ignored
*06550. 00000 - "line %s, column %s:\n%s"*
**Cause: Usually a PL/SQL compilation error.*
**Action:*
What is the problem here? Could you anyone help me?
Thanks for your help from now on.
Have a beautiful day...
Edited by: RobertPires on May 1, 2011 5:13 PM
Edited by: RobertPires on May 1, 2011 8:19 PMThanks for your help, Sir. As you see it as above, I fixed the order of parameters, but since I would like to display multiple records, my procedure did not work properly and I got this error message:
Error report:
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: at "S4048958.QUESTION4", line 20
ORA-06512: at line 21
*01422. 00000 - "exact fetch returns more than requested number of rows"*
**Cause: The number specified in exact fetch is less than the rows returned.*
**Action: Rewrite the query or change number of rows requested*
I guess I need to create a cursor in my procedure, but I dunno how. Could you give me some suggestion for this please?
Thanks again...
Maybe you are looking for
-
[VIA] KT6 Delta hangs when I install SATA disk
I've had a lot of problems with my PC - maybe related to the mobo, maybe not. I have a KT6 Delta LSR - and was running XP SP2 with a SATA disk on it. Not RAID - just standalone. It ran OK for about 4 months, then it crashed hard. For the last two wee
-
FRM-92101 error while opening forms on fresh r12 vision db on hp ux (11.31)
Hi all, I have installed vision database r12(12.0.4) on hp ux (11.31). I am able to open the login page but when trying to access any form it gives below mention error. FRM-92101: There was a failure in the Forms Server during startup. This could hap
-
How to change a Windows Phone start page programmatically?
FYI, I know the title is similar to many posts in this forum, but they don't address this specific problem. I have the following line in the App.xaml.cs file: if (!rootFrame.Navigate(typeof(Page1), e.Arguments)) When I change MainPage to Page1, it ch
-
I had my iphone s4 on seasonal standby. I am now using it again, but when i try to play music on itunes, there is no sound. Also no sound for youtube.
-
How to validate the Male or Female for infotype 002 in LSMW at FieldMapping
Dear freinds, Small problem in LSMW for infotype 0002. Whiel recording for infotype 002 ihae done for an employee based on FeMale(GESC2) , no when i uploading data i am having for male (GESC1) ...how can i toggle in my Field mapping pleas