Plsql block as required

hi ,
a plsql block and the result will be like
--> Title01 has taken by zero students.
--> Title02 has taken by ten students.
--> Title03 has taken by five students.
i got a question in this manner i am a beginner kinda help me out .
regards,
beginner..

8934589 wrote:
yes, but the question was put like this and i literally unable to understand....Surely you have a table structure you are working with?
Surely you could ask your instructor for more details?
Surely you could ask your fellow students to help, given that they know the context which you have withheld from us?
Go back and re-read your original post and ask yourself how a total stranger would make anything of it at all.
We don't know what a "Title01" (or 2 or 3) is.
Wed don't know what a student is.
We don't know that it means for a "Title01" to be taken (or not) by a "student"
But whatever it is, I'd be willing to bet that, given no further requirements, that a simple SQL query would do it, and no PL/SQL would be needed.
Edited by: EdStevens on May 29, 2013 10:08 AM

Similar Messages

  • Need to write a plsql block for calling another procedure.

    Hi Guys,
    I have a requirement to write a plsql block and to call another procedure which is having 5 parameters (each parameter having multiple values). Calling procedure generates one SQL query and it needs to be generated all combinations and print in another table.
    I need to pass multiple values for first three parameters from my PLSQL block and run.
    call sample proc:
    procedure(
    param1 varchar2,
    param2 p_varchar2,
    param3 p_varchar2,
    param4 in varchar2,
    param5 in number
    is
    begin
    ls_sql_query := 'with client_query as (select * from table)';
    end;
    Thanks in advance!
    Rgds,
    LRK

    This article is on exactly your subject. It is worth a careful read.
    Ask Tom: On Popularity and Natural Selection
    I paraphrase: "Always code a reference to every possible bind variable but do so in such a way that the optimizer removes the bind variable for us if we aren't going to actually use it in that particular execution of the SQL statement."
    P.S. This is the same answer I gave when you asked the same question earlier.

  • Using Execute Immediate in PLSQL block Vs Stand alone procedure

    I am facing very unusual ( atleast unusual to me ) with usage of "Execute Immediate" statement.
    I have a table dynamic_sql with one column plsql_block as VARCHAR2(4000);
    I have stored some PLSQL blocks ('DECLARE ..... BEGIN.... END.... ) in this column .
    Now I want to execute these PLSQL blocks one after other depending on certain conditions .
    In order to archive this I wrote a PLSQL block as below
    DECLARE
    Cursor c1 is
    select plsql_block from dynamic_sql
    begin
    for irec in c1
    loop
    <<< Condition >>>
    begin
    execute_immediate(irec.plsql_block);
    exception
    when others then
    raise_application_error(-20001,'error ' ||irec.plsql_block||' '||sqlerrm);
    end loop ;
    end ;
    With above PLSQL block , "execute immediate" is executing PLSQL block successfully without any error
    But When I converted above PLSQL block into standalone procedure as shown below , I am getting error .
    CREATE OR REPLACE procedure test AS
    Cursor c1 is
    select plsql_block from dynamic_sql
    begin
    for irec in c1
    loop
    <<< Condition >>>
    begin
    execute_immediate(irec.plsql_block);
    exception
    when others then
    raise_application_error(-20001,'error ' ||irec.plsql_block||' '||sqlerrm);
    end loop ;
    end ;
    BEGIN
    test;
    end ;
    It is showing the value of irec.plsql_block but not showing sqlerrm...
    I found this is very unusual as I am able to execute "execute immediate" statement with PLSQL block but not with similar procedure .
    can anybody explain me why this is happening?
    Thanks in Advance
    Amit

    Hello,
    It doesn't make any sense to add SQLERRM for user defined exception, unless you want to raise application error for already defined error (e.g NOT_DATA_FOUND, ..)
    Check following piece of code and its output,
    CREATE OR REPLACE PROCEDURE myinsert1
    AS
       v_count   NUMBER;
       v_sql     VARCHAR2 (300);
    BEGIN
       v_sql :=
          'INSERT INTO ENTITY_EMPLOYEE VALUES(0,''TIM'',''LASTNAME'',10000)';
       BEGIN
          EXECUTE IMMEDIATE v_sql;
          COMMIT;
       EXCEPTION
          WHEN OTHERS
          THEN
             DBMS_OUTPUT.PUT_LINE (SUBSTR (SQLERRM, 1, 300));
             RAISE_APPLICATION_ERROR (-20002, 'My Error ' || SQLERRM, TRUE);
             RAISE;
       END;
    END;
    Output._
    ORA-20002: My Error ORA-00001: unique constraint (ENTITY_EMPLOYEE_PK) violated
    ORA-06512: at "MYINSERT1", line 21
    ORA-00001: unique constraint (ENTITY_EMPLOYEE_PK) violated
    ORA-06512: at line 2
    Regrds

  • Have been advised by my email provider (recently blocked account requiring password reset) that they will only reset the password after a proven anti viru and malware scan has been done on ipad and iphone. Is this necessary and if so what do i use

    Have been advised by my email provider (recently blocked account requiring password reset) that they will only reset the password after a proven anti virus and malware scan has been done on ipad and iphone. Is this necessary and if so what do i use

    As KP has pointed out, there actually aren't any anti-virus programs in the App Store. There are a few that allow you to scan e-mail or stuff like that, and a few that provide you with information about malware and new threats for other systems. But none are available that can scan your iOS device for malware, because the security restrictions in iOS do not permit any apps to have that kind of access to anything. Which means that you also cannot be infected with a virus (unless you have jailbroken your device).
    If your account got compromised, that had nothing whatsoever to do with your iPad. Someone simply hacked it remotely. Happens all the time. It's really amazing that, in this day and age, e-mail providers are so ignorant of technology and how their own systems get compromised that they would try to require you to run software that does not exist!

  • Output parameter in plsql Block fails

    Hello. I am testing using an anonymous Plsql block with one in and out parameter. The in parameter work fine but when I add the out, the plsql block fails.
    This is my environment on a Windows 7 client attaching to a Solaris server. I am using Powershell 3.0, but it is very similar to #c. I have a .net framework of 4.5.
    PS L064217>    $GAC = $Env:Oracle_Home + "\" + "ODP.NET\bin\4\Oracle.DataAccess.dll"
    PS L064217>    [Void] [Reflection.Assembly]::LoadFile($Gac)
    PS L064217> [Reflection.Assembly]::LoadFile($Gac)
    GAC    Version        Location
    True   v4.0.30319     C:\windows\Microsoft.Net\assembly\GAC_64\Oracle.DataAccess\v4.0_4.112.3.0__89b4
    SQL*Plus: Release 11.2.0.3.0 Production on Wed Nov 28 19:09:57 2012
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsHere is a sample of my test code:
    # Define Plsql Anonymous Block
    $Table1 = 'AdvSearch_Statutes'
    $Table2 = ($Table1).Substring(0, $Table1.Length-1) + '_Docs'
    $Caml_Doc_Id = 'CHP201500010'
    $Sql =  " DECLARE "
    $Sql += "   vCamlId      VARCHAR2(30)  := ':Param1' "
    $Sql += "   vPath_Tx     VARCHAR2(200); "
    $Sql += "   vDelRows_Nr  PLS_INTEGER := 0; "
    $Sql += "   CURSOR Docs_Cur IS "
    $Sql += "       SELECT XPath "
    $Sql += "       FROM $Table2 "
    $Sql += "       WHERE Caml_Doc_Id = vCamlId; "
    $Sql += " BEGIN "
    $Sql += "   OPEN Docs_Cur; "
    $Sql += "   LOOP "
    $Sql += "     FETCH Docs_Cur INTO vPath_Tx; "
    $Sql += "     EXIT WHEN Docs_Cur%NOTFOUND; "
    $Sql += "     IF (DBMS_XDB.ExistsResource(vPath_Tx)) "
    $Sql += "     THEN "
    $Sql += "       DelRows_Nr := DelRows_Nr + 1; "
    $Sql += "       DBMS_XDB.DeleteResource(vPath_Tx, DBMS_XDB.DELETE_RECURSIVE_FORCE); "
    $Sql += "     END IF; "
    $Sql += "   END LOOP; "
    $Sql += "   DELETE FROM $Table2 WHERE Caml_Doc_Id = vCamlId; "
    $Sql += "   vDelRows_Nr := vDelRows_Nr + SQL%ROWCOUNT; "
    $Sql += "   DELETE FROM $Table1 WHERE Caml_Doc_Id = vCamlId; "
    $Sql += "   vDelRows_Nr := vDelRows_Nr + SQL%ROWCOUNT; "
    $Sql += "   SELECT vDelRows_Nr INTO :Param2 FROM Dual; "
    $Sql += " EXCEPTION "
    $Sql += "   WHEN OTHERS THEN ROLLBACK; "
    $Sql += " END; "
    # Set up the Connection and command objects using the prior defined information.  Ensure that
    # Bind by name is used.
    $Conn = New-Object Oracle.DataAccess.Client.OracleConnection($Connect_Str)
    $Cmd  = New-Object Oracle.DataAccess.Client.OracleCommand($Sql, $Conn)
    $Cmd.BindByName = $True
    #Set up the parameters for use with the Sql command.
    $Param1 = New-Object Oracle.DataAccess.Client.OracleParameter
    $Param2 = New-Object Oracle.DataAccess.Client.OracleParameter
    $Param1.DbType = 'AnsiString'
    $Param1.OracleDbType = 'Varchar2'
    $Param1.Direction = 'Input'
    $Param1.ParameterName = ':Param1'
    $Param1.Value = $Caml_Doc_Id
    $Param2.DbType = 'Int32'
    $Param2.OracleDbType = 'Int32'
    $Param2.Direction = 'Output'
    $Param2.ParameterName = ':Param2'
    [Void] $Cmd.Parameters.Add($Param1)
    [Void] $Cmd.Parameters.Add($Param2)
    # Open connection to database and execute the command
    Try
       $Conn.Open();
       $Result = $Cmd.ExecuteNonQuery();
       If ($Param2.Value -Eq $Null) {$Counts = 0}
       Else {$Count  = ($Param2.Value).ToString()}
       Write-Host "Return Code:  $Result"
       Write-Host "Rows Deleted:  $Counts"
    Catch [System.Exception]
      $Param2
      Write-Host $_.Exception.ToString() -ForeGroundColor "Red"
    Finally
      $Conn.Close();
      $Conn.Dispose();
      "`nSuccessful end of script"
    }I have some output. It all seems to be okay. I am following a book rather closely, but after several attempts changing one thing or another, I still cannot find a way to send an out value. I have commented out the " SELECT vDelRows_Nr INTO :Param2 FROM Dual; " and that is the problem statement. Thank you for your help. The first portion is the plsql being echoed back, then I list out what Param2 is defined at. The last bit is the error returned.
    PS L064217> .\Test_Odp_PLsqlBlock.ps1
    DECLARE    vCamlId      VARCHAR2(30)  := ':Param1'    vPath_Tx     VARCHAR2(200);    vDelRows_Nr  PLS_INTEGER := 0;
    CURSOR Docs_Cur IS        SELECT XPath        FROM AdvSearch_Statute_Docs        WHERE Caml_Doc_Id = vCamlId;  BEGIN
      OPEN Docs_Cur;    LOOP      FETCH Docs_Cur INTO vPath_Tx;      EXIT WHEN Docs_Cur%NOTFOUND;      IF (DBMS_XDB.ExistsR
    esource(vPath_Tx))      THEN        DelRows_Nr := DelRows_Nr + 1;        DBMS_XDB.DeleteResource(vPath_Tx, DBMS_XDB.DEL
    ETE_RECURSIVE_FORCE);      END IF;    END LOOP;    DELETE FROM AdvSearch_Statute_Docs WHERE Caml_Doc_Id = vCamlId;    v
    DelRows_Nr := vDelRows_Nr + SQL%ROWCOUNT;    DELETE FROM AdvSearch_Statutes WHERE Caml_Doc_Id = vCamlId;    vDelRows_Nr
    := vDelRows_Nr + SQL%ROWCOUNT;    SELECT vDelRows_Nr INTO :Param2 FROM Dual;  EXCEPTION    WHEN OTHERS THEN ROLLBACK;
    END;
    DbType                  : Int32
    SourceColumnNullMapping : False
    Direction               : Output
    IsNullable              : False
    Offset                  : 0
    OracleDbTypeEx          : Int32
    OracleDbType            : Int32
    ParameterName           : :Param2
    Precision               : 0
    Scale                   : 0
    Size                    : 0
    ArrayBindSize           :
    SourceColumn            :
    SourceVersion           : Current
    Status                  : Success
    ArrayBindStatus         :
    CollectionType          : None
    Value                   :
    UdtTypeName             :
    Oracle.DataAccess.Client.OracleException ORA-01036: illegal variable name/number    at Oracle.DataAccess.Client.OracleEx
    ception.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object sr
    c, String procedure, Boolean bCheck)
       at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
       at CallSite.Target(Closure , CallSite , Object )Edited by: CRoberts on Nov 28, 2012 7:30 PM

    As test
    use NUMBER instead of PLS_INTEGER in PL/SQL
    and
    use Decimal instead of Int32 for Oracle parameter datatype

  • Am facing this error sqlcode :-6502 while running sql code in plsql block

    Am facing this error sqlcode :-6502 while running sql code in plsql block.
    am using query :
    SELECT SUBSTR('123456DE789KL|987654321|B',1,INSTR('123456DE789KL|987654321|B','|')-1) FROM DUAL;
    CAN any body tell me why.

    BD_Fayez wrote:
    I've tried the following, but don't get any error.As I mentioned, most likely variable is too short:
    SQL> declare
      2  strSub varchar2(2);
      3  begin
      4  SELECT SUBSTR('123456DE789KL|987654321|B',1,INSTR('123456DE789KL|987654321|B','|')-1) into strSub FROM DUAL;
      5  dbms_output.put_line(strSub);
      6  end;
      7  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 4
    SQL> SY.

  • Can I use Count, Max function in PLSQL BLOCK.

    Can U help me to use count, max function in PLSQL BLOCK.
    Because it is giving me error "It is a SQL function"

    SELECT COUNT(*)
    INTO l_variable
    FROM dual;
    Will work inside PL/SQL

  • Calling plsql block in java

    Hi
    Needs some help, urgently.
    i have to call/execute a plsql block in java program.
    block is similar to this
    declare
    CURSOR l_csr IS
    select empname, empid, empdate from emp
    order by empid;
    l_empid NUMBER;
    l_empdate DATE;
    l_empname varchar2(30);
    o_dateProfileId NUMBER;
    o_dayofweekprofileid NUMBER;
    begin
    open l_csr;
    loop
    FETCH l_csr INTO l_empid , l_empname , l_empdate;
    EXIT WHEN l_csr%NOTFOUND;
    DETERMINEEMPPROFILE(l_empdate,o_dateProfileId,o_dayofweekprofileid,l_empid ,FALSE);
    IF(o_dateProfileId IS NOT NULL) THEN
    SELECT totaljobs INTO l_max1 FROM dateprofile WHERE dateprofileid = o_dateprofileid;               
    ELSE
    SELECT totaljobs INTO l_max1 FROM dayofweekprofile WHERE dayofweekprofileid = o_dayofweekprofileid;
    END IF;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('SQLCODE = ' || SQLCODE);
    END;
    i need to call this in java program and take the results of l_max1.
    can someone provide an example of hot to do this or sample code
    appreciate any help

    I'm assuming this is for Oracle. Take a look at this article [url=http://www.enterprisedt.com/publications/oracle/result_set.html
    ]here for an example of how to use java to parse a result set from an Oracle procedure.

  • PLSQL BLOCK TO RUN A TYPE PROCEDURE

    I have created a type called bank_account which has many member functions and procedures to open ,close,deposit and withdraw.I have created a type body where these member functions are defined.i have created a table based on this type.
    Now my problem is that the plsql block that i have written to call the member function open gives the following error:
    method dispatch on NULL SELF argument is disallowed
    the plsql block is as given below:
    SQL> run
    1 declare
    2 amount real;
    3 a bank_account(this is the type);
    4 begin
    5 amount:=&amount;
    6 a.open(amount);
    7 dbms_output.put_line('account opened');
    8* end;
    Enter value for amount: 5
    old 5: amount:=&amount;
    new 5: amount:=5;
    declare
    ERROR at line 1:
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    ORA-06512: at line 6
    please help me to solve my problem
    null

    I have created a type called bank_account which has many member functions and procedures to open ,close,deposit and withdraw.I have created a type body where these member functions are defined.i have created a table based on this type.
    Now my problem is that the plsql block that i have written to call the member function open gives the following error:
    method dispatch on NULL SELF argument is disallowed
    the plsql block is as given below:
    SQL> run
    1 declare
    2 amount real;
    3 a bank_account(this is the type);
    4 begin
    5 amount:=&amount;
    6 a.open(amount);
    7 dbms_output.put_line('account opened');
    8* end;
    Enter value for amount: 5
    old 5: amount:=&amount;
    new 5: amount:=5;
    declare
    ERROR at line 1:
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    ORA-06512: at line 6
    please help me to solve my problem
    null

  • Sales order is on overall block still requirements are passed to md04/md07.

    Hello Experts.
    Sales order is on overall block still requirements are passed to md04/md07.
    Please suggest...

    Hi Experts,
    Issue:  Sales orders are on overall block at header level. still sales orders are passing demand in MD04 and MD07 -
    here in this case the actual scenario is
    This Sales order was created on 09/28/2007. with overall block at header level.
    then sevral times header block for this order was removed & it was last set on 8 feb. 2009.
    after this, there was no change in delivery block at header till the date.
    in mean time at every month there was program from legacy system which used to change the below info from SO
    (In schedule lines --> shipping tab).
    except Delivery date.
    Delivery date         D   08/31/2007
    Goods issue date          07/30/2009
    Loading date              07/30/2009
    Material avail.date       07/30/2009
    Transportation Plan. Date 07/30/2009.
    *if we replicate this scenario in dev. and check this, system will not allow to keep above dates as delivery date is in past.
    Now if we check SO is on oveall block at header, but we can see Ruquirement for the same SOs in MD04.
    (*Note : here we found that date in MD04 for requirement of this SO, is same as date on which legacy system changed the data in SO for schedule line.)
    we have replicated the sales cycles like this in development with different possibilities of Blocks on SO header as well as Item level. but they are working fine with dev. and quality system, as all config. settings are fine.(as suggested above by experts).
    but it seems like a bug kind of thing.
    kindly revert if someone has faced issue like this ,knows to get rid of it.
    Regards,
    Sujit

  • Unable to insert row in object table from plsql block

    I have table called test based on an object type. When I issue an insert statement from sqlplus, the row is inserted. The exact same sql statement in a plsql block gives the error below. Any ideas? (it is not a constraint problem).
    SQL> insert into test values( 3,2,1,1,'asp',1,'mach' );
    1 row created.
    SQL> begin
    2 insert into test values( 3,2,1,1,'asp',1,'mach' );
    3 end;
    4 /
    insert into test values( 3,2,1,1,'asp',1,'mach' );
    ERROR at line 2:
    ORA-06550: line 2, column 16:
    PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-302: component 'DOCUMENT' must be declared
    ORA-06550: line 2, column 4:
    PL/SQL: SQL Statement ignored
    (ddl)
    CREATE OR REPLACE type document as object
    DOC_ID NUMBER (38),
    BATCH_ID NUMBER (38),
    STATE NUMBER (2),
    TRANSIENT NUMBER (2),
    ASP VARCHAR2 (20),
    USER_ID NUMBER (6),
    MACHINE VARCHAR2 (30),
    MEMBER PROCEDURE setState,
    MEMBER function getState RETURN NUMBER
    ) not final;
    create table test of document;

    Hi Adam
    You need to instantiate your object type in your insert statement(while doing through PL/SQL block), so try like this
    Insert into test values(document(1,2,'CO',55,'xyz','kkk','PENTIUM'));
    The reason you were successful through SQLPLUS was that, SQLPLUS automatically instantiate the values into object type.
    Qurashi

  • How to invoke plsql block when press a button

    new to htmldb,
    let's say i have a form with some items , after i press a button, i want to invoke a plsql block, how can i do that?
    Cheers,

    I have only played a bit with this. I had a region with search criteria’s and a region based on a procedure. I created a page button on the first region that branched to the same page. When I press the button the page is refreshed and the procedure is re-executed with what ever search criteria’s the user has keyed in. That is as far as I have come :-)

  • Plsql block error

    I have small PLSQL block with a bind variable in it which throws an error on its execution.
    declare
    cursor c1 is select product_name from PRODUCTS where month=:m;
    begin
    for i in c1 loop
    dbms_output.put_line(i.product_name);
    end loop;
    end;
    It thows the error
    ORA-01008: not all variables bound
    Is it not possible to have a bind variable in a cursor?
    Please help
    Regards

    If you're using SQL*Plus you need to declare and set the bind variable...
    SQL> set serverout on;
    SQL> var d number;
    SQL> exec :d := 20;
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.07
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    cursor c1 is select ename from emp where deptno=:d;
      3  begin
      4    for i in c1 loop
      5      dbms_output.put_line(i.ename);
      6    end loop;
      7* end;
    SQL> /
    SMITH
    JONES
    SCOTT
    ADAMS
    FORD
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.06
    SQL>

  • Unix command from Plsql block

    Hi all ,
    I have tried unix command from PLSQL Block,
    Please see the code.
    DECLARE
    stat INTEGER;
    host_command varchar2(100);
    errormsg VARCHAR2(80);
    command varchar2(2000);
    BEGIN
    command:='touch /home/oracle/testting.txt';
    dbms_pipe.reset_buffer;
    host_command:= dbms_pipe.unique_session_name;
    dbms_output.put_line('host_command:'||host_command);
    dbms_pipe.pack_message(command);
    dbms_output.put_line('pack message:'||command);
    stat := dbms_pipe.send_message(host_command);
    dbms_output.put_line('stat:'||stat);
    IF stat <> 0 THEN
    raise_application_error(-20000, 'Error:'||TO_CHAR(stat)||' sending on pipe');
    END IF;
    stat := dbms_pipe.receive_message(host_command);
    dbms_output.put_line('stat2:'||stat);
    IF stat <> 0 THEN
    raise_application_error(-20000, 'Error:'||TO_CHAR(stat)||' receiving on pipe');
    END IF;
    dbms_pipe.unpack_message(errormsg);
    dbms_output.put_line('errormsg:'||errormsg);
    IF errormsg <> 'SUCCESS' THEN
    raise_application_error(-20000, 'Execution error: '||errormsg);
    END IF;
    END;
    Nothing happend from this code just getting only following result with error.
    -----------------result-----------------------------
    host_command:ORA$PIPE$002D19820001
    pack message:touch /home/oracle/testting.txt
    stat:0
    stat2:0
    errormsg:touch /home/oracle/testting.txt
    DECLARE
    ERROR at line 1:
    ORA-20000: Execution error: touch /home/oracle/testting.txt
    ORA-06512: at line 33
    Can any one tell me what i doing wrong in this code.
    I m working on Oracle 11g and AIX unix server.

    This is the forum for the SQL Developer product, not for general PL/SQL questions. There is a link to the SQL and PL/SQL forum in the announcement at the top of this forum.

  • Problem with plsql block

    Hello All,
    I have a sql query which i am trying to put it in plsql block.It throws me an error saying i cannot have group function as my two select strings gives me more than one row. How to tackle this??
    declare
    uuid varchar;
    stat_date date;
    begin
    select 'I'||Lower(docfamily_uuid) into uuid, max(status_date) into stat_date from document_status where status_code=303 or status_code=305 group by docfamily_uuid;
    end;
    Thanks

    In addition to being mal-formed it is likely your problem stems from the fact that your query is returning more than one row. Now perhaps you are expecting only one row and your GROUP BY might be getting in the way. Try changing your GROUP BY to include the LOWER function that is in your SELECT statement. But realize that this in itself will not guarentee one row returning from the SELECT statement.
    WITH document_status AS
    SELECT 'xxx' docfamily_uuid, sysdate status_date, 303 status_code from dual
    UNION ALL
    SELECT 'XXX' docfamily_uuid, sysdate status_date, 303 status_code from dual
    SELECT 'I'||Lower(docfamily_uuid), max(status_date)
    FROM   document_status
    WHERE  status_code=303 or status_code=305
    GROUP BY docfamily_uuid;
    Ixxx     05-FEB-09
    Ixxx     05-FEB-09
    WITH document_status AS
    SELECT 'xxx' docfamily_uuid, sysdate status_date, 303 status_code from dual
    UNION ALL
    SELECT 'XXX' docfamily_uuid, sysdate status_date, 303 status_code from dual
    SELECT 'I'||Lower(docfamily_uuid), max(status_date)
    FROM   document_status
    WHERE  status_code=303 or status_code=305
    GROUP BY LOWER(docfamily_uuid);
    Ixxx     05-FEB-09Greg

Maybe you are looking for

  • Issue in BMP

    Hi all, I am starting a new thread on the issue i previously had: Just transported a scenario into Q for testing, suddenly the BPM fails. I am guessing this is a performance related issue, let me briefly explain what is happening, there is a transfor

  • Convert Video Switch in Desktop Software

    What happens when I use  the convert video switch in the Desktop Software when I am syncing videos to and from playbook.  Having problems playing video clips tagged as AVI.  Get error message on Playbook when I go to play the clips.  Assuming not a t

  • What is the best way of testing a custom web service

    We have a custom developed service (a jar sitting in the xmlpserver/WEB-INF/lib folder) on the BI Publisher server. This service uses the BookBinder class to concatenate some documents. We call this service through Axis (PublicReportService_v11) from

  • Snippit visible in mobile me but not local site

    As the topic says this search box snippet <form method="get" action="http://www.google.com/search"> <table border="0" cellpadding="0"> <tr><td> <input type="text" name="q" size="25" maxlength="255" value="" /> <input type="submit" value="Search" /></

  • Can't get rid of HTTPS in Web services for Lion

    Some setting changed and I can't figure out what. But now my Lion webserver is forcing everything to https. Previously, as of a few hours ago, I could resolve my hostname.local and get to the same machine from the actual web URL. But then this https