Cant get FBEAN.GET_CHAR_PROPERTY to return more than one character

I have a javabean on my form. I am passing values to the bean using FBEAN_INVOKE. I need to get error messages back from Java. I set the logging mode to Log_All.
I use FBEAN.GET_CHAR_PROPERTY to return an error.
Here's my code:
retval varchar2(10);
retval := FBEAN.GET_CHAR_PROPERTY('bean',1,'errorMessage');
message (retval);
The message appears on the Java control panel. But the message returned in the Form is null, unless the value is one char length. It should be able to return a string.
I have a similar problem when using FBEAN_INVOKE_CHAR.
My Java class extends JPanel
Does anyone know what is wrong ?

I dont know how but this issue resolved itself

Similar Messages

  • 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)
    qeqw

    Check 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,
    Tomo

    Hi 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

  • Methods that return more than one object.

    Hello everyone,
    I don't know if this has ever been proposed or if there's an actual solution to this in any programming language. I just think it would be very interesting and would like to see it someday.
    This is the thing: why isn't it possible for a method to return more than one object. They can receive as many parameters as wanted (I don't know if there's a limit), but they can return only 1 object. So, if you need to return more than one, you have to use an auxiliary class...
    public class Person {
       private String name;
       private String lastName;
       public Person(String name, String lastName) {
          this.name = name;
          this.lastName= lastName;
       public String getName() {
           return name;
       public String getLastName() {
           return lastName;
    }So if you want to get the name of somebody you have to do this, assuming "person" is an instance of the object Person:
    String name = person.getName();And you need a whole new method (getLastName) for getting the person's last name:
    String lastName = person.getLastName();Anyway, what if we were able to have just one method that would return both. My idea is as follows:
    public class Person {
       private String name;
       private String lastName;
       public Person(String name, String lastName) {
          this.name = name;
          this.lastName= lastName;
       public String name, String lastName getName() {
           return this.name as name;
           return this.lastName as lastName;
    }And you would be able to do something like:
    String name = person.getName().name;and for the last name you would use the same method:
    String lastName = person.getName().lastName;It may not seem like a big deal in this example, but as things get more complicated simplicity becomes very useful.
    Imagine for example that you were trying to get information from a database with a very complex query. If you only need to return 1 column you have no problem, since your object can be an array of Strings (or whatever type is necessary). But if you need to retrieve all columns, you have three options:
    - Create 1 method per column --> Not so good idea since you're duplicating code (the query).
    - Create and auxiliary object to store the information --> Maybe you won't ever use that class again. So, too much code.
    - Concatenate the results and then parse them where you get them. --> Too much work.
    What do you think of my idea? Very simple, very straight-forward.
    I think it should be native to the language and Java seems like a great option to implement it in the future.
    Please leave your comments.
    Juan Carlos García Naranjo

    It's pretty simple. In OO, a method should do one thing. If that thing is to produce an object that contains multiple values as part of its state, and that object makes sense as an entity in its own right in the problem domain--as opposed to just being a way to wrap up multiple values that the programmer finds it convenient to return together--then great, define the class as such and return an instance. But if you're returning multiple values that have nothing to do with each other outside of the fact that it's convenient to return them together, then your method is probably doing too much and should be refactored.
    As for the "if it increases productivity, why not add it?" argument, there are lots of things that would "increase productivity" or have some benefit or other, but it's not worth having them in the language because the value they add is so small as to no be worth the increase in complexity, risk, etc. MI of implementation is one great example of something that a lot of people want because it's convenient, but that has real, valid utility only in very rare cases. This feature is another one--at least in the domain that Java is targetting, AFAICT.

  • Update column with subquery returning more than one row

    Hi Everybody,
    Please let me know how to handle this. I am writing update statement in procedure with subquery and it is returning multiple rows. Please help me, how i can handle this :
    UPDATE TABLEA A
    SET A.ERROR_MESSAGE = (Select B.XERROR_MESSAGE from TABLEB B, TABLEA A WHERE B.id = A.id)
    WHERE A.id = (Select B.id from TABLEB B, TABLEA A WHERE B.id = A.id);
    (Select B.XERROR_MESSAGE from TABLEB B, TABLEA A WHERE B.id = A.id) --- This subquery is returning more than one rows. How i can handle this in Pl/SQL?
    Please let me know. I will be very thankful to you all.
    I will really appreciate your replies and comments.
    Thank you

    Try getting rid of tablea in your subqueries. You already have it in the UPDATE statement.
    UPDATE TABLEA A
    SET    A.ERROR_MESSAGE = (Select B.XERROR_MESSAGE
                              from   TABLEB B
                              WHERE  B.id = A.id
    WHERE  A.id = (Select B.id
                   from   TABLEB B
                   WHERE  B.id = A.id);You can also try a simple MERGE:
    merge into tablea a
    using tableb b
    on    (a.id = b.id)
    when  matched then update
          set a.error_message = b.xerror_message;

  • Possible to return more than one value?

    If I have a somethign like this:
    public int test()
    return 5;
    }Is it possible to have test() return more than one value? And if it can, can you post an example showing how?

    Could you post an example of how to do this?If you do not know how to define a class, you need to start from the very beginning.
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoratative than this.

  • 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.

  • Can oracle  function return more than one value

    Hi All
    please answer can oracle function return more than one value
    need one schenario
    regards

    Can any function, irrespective of the language, return multiple values?
    OF COURSE NOT!!
    So why do you think Oracle will now suddenly do it differently than all other languages? Never mind that it is impossible for a function (a unit/module of code) returning a memory address, to return multiple memory addresses. The machine code that does that, has not been yet been designed/implemented.
    I am continually amazed that this question is asked. It is about something so fundamental in almost every single 3rd and 4th generation language... something that is taught right at the start... the definition of what a procedure and what a function is.
    Sorry, but I simply cannot pull punches on this subject and smooth it over. There is something fundamentally wrong with your training as a programmer if you have to ask such a question about a function.
    And whatever programming skills you build on such a foundation, will be seriously lacking.
    I kindly suggest that you get back to the very basics of programming - and review and revisit until you fully understand it. There are no shortcuts in becomming a good programmer.
    Message was edited by:
    Billy Verreynne

  • Query returns more than one row

    hi all,
    I am getting this error msg, single row query returns more than one row after i added this
    (select FUNC_GET_COUNTY_NAME(CCNTY1)
              FROM   proposal ) CName,  
    and the error is righ here  AND K.CONTID = Q.CONTID
    can someone help me what to do to take care of this error msg.
    SELECT DISTINCT Decode(trim(Min(J.ROUTE)),null,'Un known', Min(J.ROUTE)) rt, v.vendor vd, r.addrnum ad, v.vnamel vn,
    TRIM (r.aaddr1 || decode(trim(r.aaddr2),null,'',' - ') || r.aaddr2) ad1,
    p.billto, r.acity cy, r.astate st,r.azipcode zp,
    (select FUNC_GET_COUNTY_NAME(CCNTY1)
              FROM   proposal ) CName,   
    substr(decode(trim(r.vasst1),null, 'N/A','000/000-0000?','N/A','000/000-0000','N/A', r.vasst1),1,12) fx, 
    substr(decode(trim(r.aphone),null, 'N/A','000/000-0000?','N/A', r.aphone),1,12)ph,                     
    substr(l.letting,3,2)||'-'|| substr(l.letting,5,2)||'-'|| substr(l.letting,1,2)lt,
    l.CALL cl, l.lcontid cid, q.cprojnum sp, q.cfacssup ds,q.ccnty1 cty
    FROM VENDOR V, VENDADDR R, LETPROP L, PLANHOLD P,PROPOSAL Q, PROJECT J,PROPPROJ K
    WHERE V.VENDOR = R.VENDOR
    AND K.CONTID = Q.CONTID
    AND K.PCN = J.PCN
    AND L.LCONTID = K.CONTID         
    and l.lcontid =   '060143'
    AND P.VENDOR = V. VENDOR
    AND L.LETTING = P.LETTING
    AND L.CALL = P.CALL
    AND R.ADDRNUM = P.BILLTO
    group by V.VENDOR,R.ADDRNUM, V.VNAMEL, R.AADDR1, R.AADDR2,P.BILLTO,R.ACITY, R.ASTATE,
    R.AZIPCODE,R.VASST1,R.APHONE,L.LETTING, L.CALL,L.LCONTID,Q.CPROJNUM,Q.CFACSSUP,Q.CCNTY1 ,CCNTY1
    ORDER BY Q.CPROJNUM DESC

    (select FUNC_GET_COUNTY_NAME(CCNTY1)
    FROM proposal ) CName,You have no where clause.
    But you might not need a select statement at all. Instead of a scalar subquery, can you just call the function:
    ,FUNC_GET_COUNTY_NAME(CCNTY1)

  • 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 row

    Hi,
    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.

  • Update gives "single-row subquery returns more than one row"

    Hi,
    I have to update a table by getting values from two other tables. While doing that the inner query returns more than one value. I am not sure how to implement the logic without returning more than one row in sub quesry. Need help on that.
    My query:
    update buf_office_str o
    set o.manager_ident =
    (select sp.ident
    from se2_r_src_sourceperson sp ,
    (select distinct director_name, team_name from buf_sales_dump )t
    where SP.SRCNAME = upper(substr(t.director_name,instr(t.director_name,' ')+1,length(t.director_name))||', '||substr(t.director_name,1,instr(t.director_name,' ')-1 ) )
    and o.office_descr = t.team_name
    Basically the query gets teh manager id from sp table where sp.srcname = t.team-name.
    The office descr should be equal to the team_name.
    This is the logic I am working towards:
    For each office, i get the office_descr and get corresponding team_name. Match the team's director_name (from table t) with the sp.name and return the employee's id (sp.ident) for that office_descr.
    I need to update all 50 offices with corresponding managerid for that office in buf_office_str table.
    Is it possible to get done in one update? Pls let me know.

    Hi,
    "Single-row subquery returns more than one row" is one of those error messages that actually means what it says: the correlated sub-query in your SET clause is sometimes returning 2 or more rows .
    The solution could be as simple as making the sub-query SELECT DISTINCT , as its in-line view, t, already is.
    It's possible you have bad data, or a mistake in your statement.
    To find the problem cases, you can run something like this:
    WITH  sub_q     AS
                       SELECT  -- DISTINCT ?
                                sp.ident
                       ,         t.team_name
                       ,         COUNT (*) OVER (PARTITION BY t.team_name)     AS cnt
                       FROM    se2_r_src_sourceperson     sp
                       ,         (  SELECT DISTINCT director_name
                                   ,                  team_name
                               FROM            buf_sales_dump
                             )                    t
                       WHERE   sp.srcname     = UPPER ( SUBSTR ( t.director_name
                                                         , INSTR ( t.director_name
                                                  ) + 1
                                                , LENGTH (t.director_name)
                                          || ', '
                                          || SUBSTR ( t.director_name
                                                          , 1
                                                   , INSTR ( t.director_name
                                                        ) - 1
    SELECT     o.*     -- or whatever helps you
    ,     sq.*
    FROM     buf_office_str     o
    JOIN     sub_q          sq     ON     o.office_descr = sq.team_name
    WHERE     sq.cnt          > 1
    ;If you'd like more help, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables as they exist before the UPDATE, and the results you want from that data (that is, the contents of buf_office_str after the UPDATE). Make sure the problem occurs with the sample data you post.

  • Still problem with single-row subquery returns more than one row

    //i did join each table but query runs forever and fail. looks Cartesian join so comes up the following SQL
    the following query has a problem. would you please help me, please
    Select pe.expense_id
    ,PE.CODE
    ,PE.PROJECT_ID
    ,PE.LDATE
    ,PE.INAMOUNT pe_amount
    ,(SELECT TRX.INV_AMOUNT FROM TRXEXPENSES TRX
    WHERE PE.EXPENSE_ID=TRX.EXPENSE_ID) AS invamount
    ,(SELECT RE.AMOUNT FROM REEXPENSES RE WHERE
    PE.EXPENSE_ID=RE.EXPENSE_ID) AS recogamount
    ,(SELECT MLE.M_AMOUNT FROM MATEXPENSES MLE
    WHERE PE.EXPENSE_ID=MLE.EXPENSE_ID) AS matamount
    from EXPENSES PE
    where pe.expense_id=5600
    group by expense_id,CODE,PROJECT_ID,LDATE,inamount
    //get error message
    ora-01427:single-row subquery returns more than one row
    //check database
    select expense_id,count(*) from TRXEXPENSES
    where expense_id in(select expense_id from
    expenses)
    group by expense_id
    having count(*)>1
    //here is duplicate record a lot
    EXPENSE_ID     COUNT(*)
    4176     2
    5600     3
    9572     2
    9573     2
    9574     2

    Yes, Expense_id has so many returning rows for trx.inv_amount from trxexpenses in subquery.
    I want to show Expense_id with retruning rows using the above query.
    ex)The result of the query is like that;
    Expense_ Id project_id Ldate InvAmount RecogAmount MatAmount
    5600 123 3/2/02 $100(InvAmount)
    5600 432 3/12/02 $200(recogAmount)
    5600 432 4/12/02 $250(MatAmount)
    Thank you so much
    Message was edited by:
    user524064
    Message was edited by:
    user524064

  • Why cant I connect address book to more than one email account.

    Why cant I connect address book to more than one email account I have 3 but can only do this for my icloud account ??  I am using the correct pass word but still no joy ????

    I bought an iPhone 3G this morning (wahoo!), and can confirm that I have setup both an IMAP (for my home server) and an exchange server (for work).
    Exchange is set to push email (so will get email as it arrives) and IMAP is currently set to manual, and is working like a charm.. With multiple accounts you get to set one as the preferred which it will default to when composing (but you can change the accounts on the compose screen)
    Only minor annoyance is signature is shared between both accounts, other than that am loving it!

  • 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 PM

    Hi,
    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,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for