SQL help: Selecting tickets with no open tasks

Hi Gurus,
I'm new to SQL. I need your help in a script where I need to fetch the tickets with no open tasks.
Say, following is the Task table
Table: Task
| ticketid | taskid | taskstatus |
| 1 | 1 | O |
| 1 | 2 | O |
| 1 | 3 | O |
| 2 | 4 | C |
| 2 | 5 | C |
| 3 | 6 | C |
| 3 | 7 | O |
The query should return the ticketid(s) with all its taskstatus = 'C'.
Any help would be highly appreciated.
Thanks

Hi Surya,
Here's an Oracle style example (Sorry, I just can't do that ansi stuff)
SQL> with ticket as (select 1 ticketid, 'C' reason from dual union all
                select 2 ticketid, 'O' reason from dual union all
                select 3 ticketid, 'O' reason from dual union all
                select 4 ticketid, 'C' reason from dual)
,taskstatus as (select 1 taskstatusid, 'O' taskstatus from dual union all
                select 2 taskstatusid, 'C' taskstatus from dual union all
                select 3 taskstatusid, 'P' taskstatus from dual union all
                select 4 taskstatusid, 'F' taskstatus from dual union all
                select 5 taskstatusid, 'O' taskstatus from dual union all
                select 6 taskstatusid, 'C' taskstatus from dual union all
                select 7 taskstatusid, 'P' taskstatus from dual union all
                select 8 taskstatusid, 'F' taskstatus from dual)
      ,task as (select 1 ticketid,  1 taskid, 2 taskstatusid from dual union all
                select 1 ticketid,  2 taskid, 3 taskstatusid from dual union all
                select 1 ticketid,  3 taskid, 4 taskstatusid from dual union all
                select 1 ticketid,  4 taskid, 4 taskstatusid from dual union all
                select 2 ticketid,  5 taskid, 1 taskstatusid from dual union all
                select 2 ticketid,  6 taskid, 1 taskstatusid from dual union all
                select 2 ticketid,  7 taskid, 1 taskstatusid from dual union all
                select 3 ticketid,  8 taskid, 2 taskstatusid from dual union all
                select 3 ticketid,  9 taskid, 2 taskstatusid from dual union all
                select 3 ticketid, 10 taskid, 6 taskstatusid from dual union all
                select 4 ticketid, 11 taskid, 2 taskstatusid from dual union all
                select 4 ticketid, 12 taskid, 6 taskstatusid from dual union all
                select 4 ticketid, 13 taskid, 4 taskstatusid from dual union all
                select 4 ticketid, 14 taskid, 8 taskstatusid from dual)
select a.ticketid, c.taskstatus
  from  task a, ticket b, taskstatus c
where a.ticketid = b.ticketid
   and c.taskstatusid = a.taskstatusid
   and (c.taskstatus = 'C' or c.taskstatus = 'F')
   and b.reason = 'C'     
   and not exists (select null
                     from task a1, taskstatus c1
                    where a1.ticketid = a.ticketid
                      and c1.taskstatusid = a1.taskstatusid
                      and (c1.taskstatus = 'O' or c1.taskstatus = 'P'))
order by 1,2
  TICKETID T
         4 C
         4 C
         4 F
         4 F
4 rows selected.Please note, how I made test data, that way is much more helpful than your tables
Regards
Peter

Similar Messages

  • SQL Question (Select rows with multiple records)

    Hello Gurus,
    I am learning SQL and have a question. Thanks for your time and help.
    I have 2 tables TABLE_AA and TABLE_BB. Both tables have two columns ID, DATA.
    TABLE_AA is connected to TABLE_BB through ID field (TABLE_AA.AA_DATA = TABLE_BB.BB_DATA)
    TABLE_AA
    ~~~~~~~
    AA_ID______AA_DATA
    ~~~~~~~~~~~~~~~~
    1111_______XXXX
    2222_______QQQQ
    3333_______ZZZZZ
    4444_______PPPPP
    ~~~~~~~
    TABLE_BB
    ~~~~~~~
    BB_ID BB_DATA
    ~~~~~~~~~~~~~~~~
    1111_______AAAA
    2222_______BBBB
    3333_______CCCC
    3333_______DDDD
    4444_______EEEE
    I am looking to get those AA_ID values that have multiple in TABLE_BB for their parent reference in TABLE_BB.
    So, from the above example, the sql should return the following as AA_ID 3333 has more than 1 reference value in BB_ID
    AA_ID_____BB_ID
    ~~~~~~~~~~
    3333______CCCC
    3333______DDDD

    Hi,
    It's working fine. !!
    14:10:05 topgun>With a As
    14:10:06   2   (
    14:10:06   3   Select 1111 c1, 'AAAA' c2 From dual Union All
    14:10:06   4    Select 2222 ,   'BBBB'    From dual Union All
    14:10:06   5    Select 3333 ,   'CCCC'    From dual Union All
    14:10:06   6    Select 4444 ,   'DDDD'    From dual
    14:10:06   7   ), b As
    14:10:06   8    (
    14:10:06   9    Select 1111 c1,'AAAA' c2 From dual Union All
    14:10:06  10   Select 2222 ,  'BBBB'    From dual Union All
    14:10:06  11   Select 3333 ,  'CCCC'    From dual Union All
    14:10:06  12   Select 3333 ,  'DDDD'    From dual Union All
    14:10:06  13   Select 4444 ,  'EEEE'    From dual
    14:10:06  14    )
    14:10:06  15   Select c1,
    14:10:06  16           c2
    14:10:06  17     From
    14:10:06  18       (
    14:10:06  19       Select a.c1,
    14:10:06  20              b.c2,
    14:10:06  21             Count(*) over (Partition By a.c1 Order By a.c1) cnt
    14:10:06  22      From  a,
    14:10:06  23             b
    14:10:06  24       Where a.c1 = b.c1
    14:10:06  25        )
    14:10:06  26   Where cnt = 2;
            C1 C2
          3333 CCCC
          3333 DDDD- Pavan Kumar N

  • Help urgently needed with Java RMI task.

    Hello All. Please I need help urgently with this task. I cant seem to be able to do this. Here is the task:
    There are m squares with side lengths a1, a2, ..., am and a rectangle with the height and width equal to h and w respectively. Find a subset of the squares, which must be placed within the rectangle in such a way that they do not overlap, and cover the maximum area of a rectangle.*
    Please all help me solve this task using Java RMI. I would be very grateful for your help. Thanks in advance.

    Here is my client.java.
    import compute.;*
    import java.lang.Math.;*
    import java.lang.Long;
    *public class Hypothesis implements Task {*
    private long start;
    private long end;
    private int number;
    private int count;
    public Hypothesis(long start, long end, int number,int
    *count) {*
    this.start = start;
    this.end = end;
    this.number = number;
    this.count = count;
    *public Object execute() {*
    return findSolution();
    *public String findSolution() {*
    long i,j,k,l,m=1,i_max,j_max,k_max,l_max,l_start;
    System.out.println(start);
    System.out.println(end);
    System.out.println(number);
    System.out.println(count);
    for(m=start+number;m<end;m+=count)
    i_max=(long)java.lang.Math.pow((double)(min(p5(m)-3)),0.2d)+1;
    for(i=i_max;i>0;i--)
    j_max=(long)java.lang.Math.pow((double)(min(p5(m)-p5(i)-2)),0.2d)+1;
    if (j_max>i) j_max=i;
    for(j=j_max;j>0;j--)
    k_max=(long)java.lang.Math.pow((double)(min(p5(m)-p5(i)-p5(j)-1)),0.2d)+1;
    if (k_max>j) k_max=j;
    for(k=k_max;k>0;k--)
    l_max=(long)java.lang.Math.pow((double)(min(p5(m)-p5(i)-p5(j)-p5k))),0.2d)+1;
    if (l_max>k) l_max=k;
    if (l_max>2) l_start=l_max-2;
    else l_start=1;
    for(l=l_max;l>l_start-1;l--)
    if(p5(i)+p5(j)+p5(k)+p5(l)==p5(m))
    Long[] solution=new Long[5];
    solution[0]=i;
    solution[1]=j;
    solution[2]=k;
    solution[3]=l;
    solution[4]=m;
    *return "" solution[0]"^5+"*
    solution[1]"^5+"*
    solution[2]"^5+"*
    solution[3]"^5="*
    solution[4]"^5";*
    return null;
    *private long p5(long n){*
    return nn*n*n*n;*
    *private long min(long n){*
    return n>0?n:0;
    I just can't seem to get the whole thing work correctly on the server side. I need it to run from 1 client on atleast 3 servers. Please any explanations will be appreciated.

  • No open tasks, but Solution Overview shows open tasks

    Hello,
    we have a problem with the "Open Tasks" display. In Solution Overview for our QA systems are 14 open tasks displayed. When we click on the link and go to our Solution, none of our systems has open tasks, cause we re-initialized all QA systems.
    But why are there 14 open tasks when all system belonging to this solution have no tasks active and configured? Refreshing in Solution Overview does not help.
    Thanks for your help!
    (Solution Manager 7 with SP-Stack 17)

    Hello Andreas,
    thanks for your post. We're already using ST-SER 700_2008_1.
    But we found out how this happens. After customizing the tasks, we moved one system to an logical component (same settings, only a new name) inside the same system group. After this the old open tasks appears every time in the solution overview.
    Solution:
    Create a new solution and attach system from the old solution to the new solution. You can use the "Copy customizing function", the problem is related to the solution and not to single systems.
    Hope this could help someone also.
    Best regards
    Kilian

  • Select list with pagination  in  Interfactive report

    Hi all
    Iam using apex 3.2.1.
    iam using interactive report it contains 15 thousand records.By default only two options are there in interative report x to y and x to y of z pagination. it is very difficult to finding the particular range rows.
    In Sql report select list with pagination and search engine (set based pagination) are provided.
    i want to use those options in in my interactive report
    i f any one knows about the solution please provide me information.
    Thanks in advance
    balu

    hi jari,
    In the HTML header i added this code
    <script type="text/javascript" src="#APP_IMAGES#jquery-1.4.4.min.js"></script>
    <script type="text/javascript">
    function htmldbIrtPagination(pRet){
    var p=$.trim($('#apexir_DATA_PANEL').find('td.pagination').find('span.fielddata').text());
    var a=new Array();var n=new Array();a=p.split(' ');
    $.each(a,function(i,v){if(!isNaN(v)){n.push(v)}});
    n.push($v('apexir_NUM_ROWS')*1);
    switch(pRet){case 'first':return n[0];case 'last':return n[1];case 'max':return n[2];case 'show':return n[3];default:return n}
    function RetMinRow(){
    var lS=$v('apexir_NUM_ROWS')*1;
    var lM=htmldbIrtPagination('max')*1;
    var lN=lM*1/lS*1;
    lN=Math.floor(lN*1);
    if(lN*1>1){lN=lN*1*lS*1+1;if(lN*1>lM*1){lN=lN*1-lS*1}}else{lN=lM*1}
    return lN
    </script>and in region footer
    <div id="first_last"><table><tr><td style="cursor:pointer;cursor:hand">
    <img align="absmiddle" alt="&lt;&lt;" title="&lt;&lt;" src="#IMAGE_PREFIX#srmvall.gif" onclick="gReport.navigate.paginate('pgR_min_row=1max_rows='+$v('apexir_NUM_ROWS')+'rows_fetched='+$v('apexir_NUM_ROWS'))" />
    </td><td style="cursor:pointer;cursor:hand">
    <img align="absmiddle" alt="&gt;&gt;" title="&gt;&gt;" src="#IMAGE_PREFIX#smvall.gif" onclick="gReport.navigate.paginate('pgR_min_row='+RetMinRow()+'max_rows='+$v('apexir_NUM_ROWS')+'rows_fetched='+$v('apexir_NUM_ROWS'))" />
    </td></tr></table></div>Could give the suggestion why it is giving like that.
    Thanks
    Balu
    Edited by: Balu K on Nov 26, 2010 12:58 AM
    Edited by: Balu K on Nov 26, 2010 1:03 AM
    Edited by: Balu K on Nov 26, 2010 1:04 AM

  • Need help with SQL for selecting ID where the sequence does not match..

    I have the following dilemma:
    Database contains IDs as follows:
    Incident#, Case#, & Part Sequence#
    example
    Record 1
    Incident_Number = 123456
    Case_Number = 1
    Part_sequence = 1
    Record 2
    Incident_Number = 123456
    Case_Number = 1
    Part_sequence = 2
    Sometimes the user will delete (let's say) Record 2 after creating a new Record 3
    So now the sequencing goes as follows:
    Record 1
    Incident_Number = 123456
    Case_Number = 1
    Part_sequence = 1
    Record 2
    Incident_Number = 123456
    Case_Number = 1
    Part_sequence = 3
    Now there will no longer be a Part_Sequence 2
    Need a SQL to select all records where the maximum part sequence > than the count of Incident_number||'-'||Case_number
    I tried the following:
    select a.incident_number||'-'||a.case_number||'-'||a.part_sequence
    from chsuser.a_compl_summary a
    where a.entry_date >= '01-may-2011'
    and max(a.part_sequence) > count(distinct a.incident_number||'-'||a.case_number)I end up getting a ORA-00934: group function is not allowed here (highlighting on the Max(a.part_sequence) portion.
    Any suggestions/hints
    Thanks

    select  incident_number || '-' || case_number || '-' || part_sequence
      from  (
             select  incident_number,
                     case_number,
                     part_sequence,
                     max(part_sequence) over(partition by incident_number,case_number) max_seq,
                     count(*) over(partition by incident_number,case_number) cnt
               from  chsuser.a_compl_summary
               where entry_date >= DATE '2011-05-01'
      where cnt != max_seq
    /SY.

  • File: e:\pt849-905-R1-retail\peopletools\SRC\PSRED\psred.cppSQL error. Stmt #: 1849  Error Position: 24  Return: 3106 - ORA-03106: fatal two-task communication protocol error   Failed SQL stmt:SELECT PROJECTNAME FROM PSPROJECTDEFN ORDER

    File:
    e:\pt849-905-R1-retail\peopletools\SRC\PSRED\psred.cppSQL error. Stmt #:
    1849  Error Position: 24  Return: 3106 - ORA-03106: fatal two-task
    communication protocol error
    Failed SQL stmt:SELECT PROJECTNAME FROM PSPROJECTDEFN ORDER
    BY PROJECTNAME
    Got this error when opening the peopletools application designer 8.49. The same is working fine within the server, but not working from the client's machine.
    We can still able to connect to the database & URL
    Please help by throwing some lights.
    Thanks,
    Sarathy K

    Looks like a SQL error. ARe you able to connect to the database with SQL*Plus ? Probably the Oracle client is badly configured.
    Nicolas.

  • Firefox won't open. I followed instructions in help. I closed Firefox via Task Manager, processeRestarted my comp. It still won't work. (as a test I ran Explorer to see if that would work. It does.) What can I do to get Firefox working properly?

    These are the help suggestions from Firefox Help that I followed:
    Firefox will not start and no error message is shown
    Another program may be preventing Firefox from starting. Restart your computer to end all running programs then try starting Firefox again. If Firefox still does not start or if the problem returns, the other suggestions listed below can help you fix the problem.
    An extension prevented Firefox from closing properly
    Sometimes your previous Firefox session did not close properly and this prevents you from restarting Firefox. Norton IPS, Norton Toolbar, and Skype 4.0 are all known to prevent Firefox from closing properly. Firefox is still running, but no windows are open.
    note: TO MY KNOWLEDGE I DON'T HAVE NORTON
    1. Right-click on an empty spot in the Windows task bar and select Task Manager (or press Ctrl+Shift+Esc).
    Note: On newer versions of Windows (XP, Vista, 7) the combination Ctrl+Alt+Del opens Task Manager as well.
    notron360sucks-taksmanager.png
    2. When the Windows Task Manager opens, select the Processes tab.
    TaskManagerProcesses.png
    3. Select the entry for firefox.exe (press F on the keyboard to find it) and click End Process.
    4. Click Yes in the "Task Manager Warning" dialog that appears.
    TaskMgrWarning.PNG
    5. Repeat the above steps to end any additional firefox.exe processes, if more than one entry is found, then exit the Windows Task Manager.
    6. Start Firefox normally. NOTE: THIS IS WHAT DOESN'T WORK AFTER CLOSING THE PROCESS IN TASK MANAGER AND RESTARTING THE COMPUTER...THEREFORE I COULDN'T DO THE REST OF THE INSTRUCTIONS
    7. At the top of the Firefox window, click on the Tools menu, and select Add-ons.
    8. Select the Extensions panel.
    9. (If it is listed) Select Norton IPS and click Disable.
    10. (If it is listed) Select Norton Toolbar and click Disable.
    11. (If it is listed) Select Skype 4.0 and click Disable.
    12. Click on Restart Firefox.
    ADDITIONAL NOTE: BEFORE THIS PROBLEM STARTED TODAY I WAS ON THE WEB LOOKING UP A PHONE NUMBER = THERE WAS SOME WEIRD JAVA ERROR MESSAGE SO i DIDN'T DOWNLOAD THE PAGE AND EXITED. SOMETIME LATER IS WHEN FIREFOX NO LONGER WORKED.

    Hi mcclausky, you may need to manually remove a policy setting from the registry. You also should scan for malware that might have created this problem.
    This article lists scanning and cleaning tools other Firefox users have found helpful: [[Troubleshoot Firefox issues caused by malware]].
    To check your Windows registry for policy settings that might affect Firefox or other programs, I suggest consulting a Windows forum or Microsoft's forums. For example:
    * http://windowssecrets.com/forums/
    * [http://answers.microsoft.com/en-us/windows/forum/windows_8-system/this-operation-has-been-cancelled-due-to/9677848e-072d-4206-87f4-9da9284d6151 This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator. - Microsoft Community]
    * [http://answers.microsoft.com/en-us/windows/forum/windows_xp-security/restrictions-this-operation-has-been-cancelled-due/8af1d0cd-8fbd-4223-9396-86d7497bb275 Restrictions. This operation has been cancelled due to to restrictions in effect on this computer.Please contact your system administrator. - Microsoft Community]

  • TS4040 I assumed this would help my problem with not being able to open apps like Preview or TextEdit since I installed Mountain Lion. Instead, first I'm prompted to enter a password, then once I do that, I get an error box telling me the Library needs re

    I assumed this would help my problem with not being able to open apps like Preview or TextEdit since I installed Mountain Lion. Instead, first I'm prompted to enter a password, then once I do that, I get an error box telling me the Library needs repairing. So I click on Repair, and once again I'm prompted for a password, which I enter, then the same error box opens, and so it goes. Can anyone help me with this problem? I'd greatly appreciate it.
    Thor

    Back up all data. Don't continue unless you're sure you can restore from a backup, even if you're unable to log in.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. To do that, unlock the preference pane using the credentials of an administrator, check the box marked Allow user to administer this computer, then reboot. You can demote the problem account back to standard status when this step has been completed.
    Triple-click the following line to select it. Copy the selected text to the Clipboard (command-C):
    { sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -Rh $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
    Paste into the Terminal window (command-V). You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2 (optional)
    Step 1 should give you usable permissions in your home folder. This step will restore special attributes set by OS X on some user folders to protect them from unintended deletion or renaming. You can skip this step if you don't consider that protection to be necessary, and if everything is working as expected after step 1.
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select
    Utilities ▹ Terminal
    from the menu bar. A Terminal window will open.
    In the Terminal window, type this:
    res
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not  going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
     ▹ Restart
    from the menu bar.

  • Can't figure out why colors don't totally change when you select type with curser? It looks like it has by looking at it, but when you highlight the area after the old color is still there. It happens with objects to. Driving me NUTZ. Help!

    Can't figure out why colors don't totally change when you select type with curser? It looks like it has by looking at it, but when you highlight the area after the old color is still there. It happens with objects to. Driving me NUTZ. Help!

    Select the text, and open the Appearance palette (Come on guys, text highlight is irrelevant, it happens to objects too says the OP), and see what's listed there.  For a simple text object, there should only be a line item "Type", followed by "Characters", and when double-clicked the Characters line item expands to tell you the stroke and fill color.  For a basic object, there should be a fill and/or stroke.
    What happens sometimes, is that you end up adding extra strokes/fills to objects or text, and the appearance palette is where that will be noted.  Especially when you are dealing with groups, and/or picking up a color with the eyedropper, you may inadvertently be adding a fill or stroke on top of something.  You can drag those unwanted thingies from the Appearance palette into its own little trash can.

  • SQL to manually complete bulk open tasks

    Hi,
    I am using OIM 9.1.0. The below sql is giving all open tasks that were created on a perticular day.
    SELECT USR_LOGIN,
    OSI.MIL_KEY,
    sch.sch_key,
    SCH.SCH_STATUS,
    OSI.OSI_RETRY_ON,
    MIL.MIL_NAME,SCH.*,OSI.*
    FROM OSI,
    SCH,
    MIL,
    USR,
    ORC
    WHERE SCH_CREATE >=TO_DATE('04/23/2012','MM/DD/YYYY')
    AND SCH.SCH_STATUS='R'
    AND OSI.SCH_KEY = SCH.SCH_KEY
    AND OSI.MIL_KEY = MIL.MIL_KEY
    AND OSI.ORC_KEY = ORC.ORC_KEY
    AND ORC.USR_KEY = USR.USR_KEY;
    However when I run the below SQL to complete these open tasks manually, these tasks are not getting completed. Please let me know the sql to manully complete bulk open tasks.
    update sch set sch_status='MC' where sch_key=(select sch.sch_key
    FROM OSI,
    SCH,
    MIL,
    ORC
    WHERE SCH_CREATE >=TO_DATE('04/23/2012','MM/DD/YYYY')
    AND SCH.SCH_STATUS='R'
    AND OSI.SCH_KEY = SCH.SCH_KEY
    AND OSI.MIL_KEY = MIL.MIL_KEY
    AND OSI.ORC_KEY = ORC.ORC_KEY);

    It is not recommended to manipulate OIM data using SQLs. It is against Audit. If we don't have any other way then only we go for SQLs.
    http://otndnld.oracle.co.jp/document/products/id_mgmt/idm_904/doc_cd/javadocs/operations/Thor/API/Operations/tcProvisioningOperationsIntf.html#setTasksCompletedManually%28long[]%29

  • My first PL/SQL block not working with using Select query within begin

    I am new to PL/SQL , just started with basics of BLOCKS .
    I am having a query here in executing a block .
    When i am doing a insert oprtation in Blocks Begin method everything is working fine , but when ever i tried to do select operation , some error is being thrown .
    First of all This is my Table :
    select from try :*
    KEY      VALUE
    Key     Value
    Key1     Value1
    Key2     Value2
    Key3     Value3
    ======================
    This is the code which is not working : Please see the code and tell me what is the problem .
    DECLARE
    v_KEY    VARCHAR2(20);
    v_VALUE   VARCHAR2(20);
    BEGIN
    select key into v_KEY FROM try where v_value='Value' ;
    dbms_output.put_line(v_KEY);
    END;
    When i run this code , it is saying Data Not Found on this line " select key into v_KEY FROM try where v_value='Value' ;"
    wheer when i run tis individually it worked fine :
    select KEY FROM try where VALUE='Value' ;"
    please share your ideas .as why it isn't running ??
    Edited by: user10503747 on Sep 20, 2010 3:16 AM

    Hi,
    user10503747 wrote:
    I am new to PL/SQL , just started with basics of BLOCKS .
    I am having a query here in executing a block .
    When i am doing a insert oprtation in Blocks Begin method everything is working fine , but when ever i tried to do select operation , some error is being thrown .
    First of all This is my Table :
    select from try :*
    KEY      VALUE
    Key     Value
    Key1     Value1
    Key2     Value2
    Key3     Value3
    ======================
    This is the code which is not working : Please see the code and tell me what is the problem .
    DECLARE
    v_KEY    VARCHAR2(20);
    v_VALUE   VARCHAR2(20);
    BEGIN
    select key into v_KEY FROM try where v_value='Value' ;
    dbms_output.put_line(v_KEY);
    END;
    When i run this code , it is saying Data Not Found on this line " select key into v_KEY FROM try where v_value='Value' ;"
    wheer when i run tis individually it worked fine :
    select KEY FROM try where VALUE='Value' ;"
    please share your ideas .as why it isn't running ??
    Edited by: user10503747 on Sep 20, 2010 3:16 AMInstead of:
    {code}
    select key into v_KEY FROM try where v_value='Value' ;
    {code}
    perhaps you meant something like:
    {code}
    v_value := 'Value1';
    select key into v_KEY FROM try where v_value=Value ; -- No quotes
    {code}
    Until you assign a vlue to a variable, like v_value, it is NULL, so your original statement was equivalent to
    {code}
    select KEY FROM try where NULL='Value' ;
    {code}
    In PL/SQL, a SELECT ... INTO statement must return exactly one row, or else you will get an error (either NO_DATA_FOUND or TOO_MANY_ROWS). This is different from SQL, where a query cn return any number of rows, including 0, without raising an error.

  • HELP!! Can't open a file created on CS8.2 with CC

    Hi Everyone, Please HELP!
    I keep getting this msg:
    I am running:

    Running on Macbook Pro
    OSX Yosemite 10.10.3
    i get this msg over and over again:
    Re: HELP!! Can't open a file created on CS8.2 with CC 

  • Creating select option with the search help based on other select option

    Hi,
    I have displayed a selection screen with two select options S1 and S2.
    My requirement is that the values in the search help of S2 should get filled based on the values selected in S1.
    Note: User has option to select multiple values in S1.
    Does anybody know how to implement this?
    Thanks,
    Feroz

    >
    Sanjeeva wrote:
    > Hi,
    >
    > With standard f4 you cannot acheive this. You need to write customise with OVS or Simple value selector by reading S1 selected values.
    >
    > Thanks,
    > Sanjeev
    I'm getting fairly tired of seeing this completely incorrect information on this forum.  As stated before and already found out by this poster, you can map input and output values between multiple data dictionary search helps. You do NOT have to resort to using OVS for this option.

  • How to open Task with out UWL

    Dear Experts,
    I want to open task without UWL.
    Suppose we created one task for one user, that user what to open task means he needs to go to UWL and click on the task.
    Requirement is to open task my custom WebDynpro  application.
    How to Get the url of all work items in uwl for one user.
    How to develop my custom UWL application.
    Can any one please help me.... very urgent.......
    Regards,
    Satya

    Hi,
    Look at the [UWL API|https://help.sap.com/javadocs/NW04S/current/uw/index.html].
    Dick

Maybe you are looking for

  • PDF Preview Handler is not working

    I am using Windows 7 32-bit with MS Office 2010 Professional. In 'My Documents' I have files associated with .pdf but it is not showing me any previews. I can go to another PC and I don't have that issue. For example if I am in explorer and have my p

  • Can't get Education Podcasts page in iTunes store

    I'm running the latest version of iTunes (11.0.5) on the latest version of Mountain Lion on a 2009 iMac and neither the Education Podcasts page or the Higher Education Podcasts page will show up in the iTunes store when I try to launch them.  The scr

  • A job in Cisco Prime Infrastructure 2.1 has been running for 50 days

    I found a job (SAM_Poller_22_15_GETVPNPoller_1878262177) in cisco prime infrastructure 2.1 (Administration -> Job Dashboard -> System-defined), which has been running for about 50 days. Is this normal? How can I stop it? Thanks for any help.. SAM_Pol

  • Passing page_url using hyperlink

    Hi, I would like to pass the page_url of the show_edit_mode to other procedures that I am calling using hyperlink(anchor tag). This works fine if I am using hidden variables & submitting the page. But if I am passing it as an argument of the hyperlin

  • About canvas Property Of Item

    How to get canvas name of an item at runtime? Thank's in advance