Help with a large compound statement - sort of

Hi all. Hopefully you can help me. I'm trying to develop a little application in htmldb/ application express and having troubles with one little box.
I have a page item that will have a value between 2003 and 2036. I will be referencing the value of this item from the session state, no worries. The next item in the page will be based on this value and the session state will trigger one of 33 possible queries for this 2nd item. I know that sounds complex but it has to be that way unfortunately, the queries that will be triggered by this :ITEM_1 value are very different so there is no pretty way of doing that bit.
So say the value of Item1 = :ITEM1(session state value)
I need to do something like
IF
:ITEM1 = '2004'
THEN
select column.name from table.name where condition
ELSEIF
:ITEM = '2005'
THEN
select column.name from table.name where condition
ELSEIF
:ITEM = '2006'
THEN
''you get the idea
I need to repeat this the 33 times for 33 different SELECT statements. I've tried to figure out the best way to approach it, whether that is an IF statement, a WHERE statement or similar but am really struggling. I have no training in any of this and am not an IT person or programmer, just a cartograpaher who got an extra job to do :)
Which is the best approach for me here? And what is the syntax I need to use? I tried the IF statements but must be making some really fundamental mistakes in syntax. Forums are the only support available to me. Please help.....
Cheers and thanks for your time. Michael

:ITEM1 = '2004' ... :ITEM = '2005'
select column.name from table.name where conditionAssuming ITEM1 and ITEM is just a typo and if the select statement is the same, you can use
if :ITEM BETWEEN TO_NUMBER('2004') and TO_NUMBER('2005') THEN
select column.name from table.name where condition
end if;
HTH
Ghulam

Similar Messages

  • Help with Autodiscover.Proxy Unhealthy state.

    Hello, I am trying to diagnose unhealthy systems in Exchange 2013.  Here is my command and output.  Lets start with the first one, Autodiscover.Proxy.
    [PS] C:\Windows\system32>Get-HealthReport -Server email| where {$_.alertvalue -ne "Healthy" }
    Server State HealthSet AlertValue LastTransitionTime MonitorCount
    email Offline Autodiscover.Proxy Unhealthy 11/19/2014 10:52... 1
    email Online HubTransport Unhealthy 11/24/2014 6:38:... 96
    email Online FrontendTransport Unhealthy 9/25/2014 9:28:3... 12
    email NotApplicable MSExchangeCertif... Disabled 1/1/0001 12:00:0... 2
    I go to follow this article here: http://technet.microsoft.com/en-us/library/ms.exch.scom.autodiscover.proxy%28v=exchg.150%29.aspx
    But the issue is that Invoke-MonitoringProbe does not return anything of value to me.  Can you help me analyze this output?
    [PS] C:\Windows\system32>Invoke-MonitoringProbe Autodiscover.Proxy\AutoDiscoverProxyTestProbe -Server email | Format-Lis
    t
    RunspaceId : bfa8f7cf-cc0b-4395-b3c8-75ab16fc227c
    Server : email
    MonitorIdentity : Autodiscover.Proxy\AutoDiscoverProxyTestProbe
    RequestId : d677ac2a-43fa-4147-b806-b2f433c5a6e3
    ExecutionStartTime : 11/25/2014 3:23:33 PM
    ExecutionEndTime : 11/25/2014 3:23:33 PM
    Error : Unknown app pool name:
    Exception : System.InvalidOperationException: Unknown app pool name:
    at Microsoft.Exchange.Monitoring.ActiveMonitoring.ClientAccess.CafeLocalProbe.DoWork(Cancellati
    onToken cancellationToken)
    at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.Execute(CancellationToken
    joinedToken)
    at
    Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.<>c__DisplayClass2.<StartExecuting>b__0()
    at System.Threading.Tasks.Task.Execute()
    PoisonedCount : 0
    ExecutionId : 60170839
    SampleValue : 0
    ExecutionContext : Probe Absolute Timeout=60000ms, Timeout Value=60000ms, Calculated HttpRequest Timeout=59000ms
    FailureContext :
    ExtensionXml :
    ResultType : Failed
    RetryCount : 0
    ResultName : d677ac2a43fa4147b806b2f433c5a6e3-AutoDiscoverProxyTestProbe
    IsNotified : False
    ResultId : 27004887
    ServiceName : InvokeNow
    StateAttribute1 :
    StateAttribute2 :
    StateAttribute3 :
    StateAttribute4 :
    StateAttribute5 :
    StateAttribute6 : 0
    StateAttribute7 : 0
    StateAttribute8 : 0
    StateAttribute9 : 0
    StateAttribute10 : 0
    StateAttribute11 :
    StateAttribute12 :
    StateAttribute13 :
    StateAttribute14 :
    StateAttribute15 :
    StateAttribute16 : 0
    StateAttribute17 : 0
    StateAttribute18 : 0
    StateAttribute19 : 0
    StateAttribute20 : 0
    StateAttribute21 :
    StateAttribute22 :
    StateAttribute23 :
    StateAttribute24 :
    StateAttribute25 :
    Identity : 956989c13cc44e6faf102491a8d7a11b
    IsValid : True
    ObjectState : New
    I'm not seeing any issue right now with Autodiscover but I don't want a larger issue to show up in the near future.

    Ok, I guess we can do that.  A new health set came up today Unhealthy.  Its Compliance and in a NotApplicable state.  I will try to determine the impact of this and start a different thread on that if I can't figure that one out.
    Otherwise I don't see any problem with mail.
    More info, not sure if I posted this, but if this helps, the Event Viewer states this:
    Log Name: Microsoft-Exchange-ManagedAvailability/Monitoring Source: Microsoft-Exchange-ManagedAvailability Date: 12/23/2014 7:03:08 AM Event ID: 4 Task Category: Monitoring Level: Error Keywords: User: SYSTEM Computer: email.domain.com Description: The Autodiscover.Proxy
    health set has detected a problem on EMAIL beginning at 12/22/2014 3:01:12 PM (UTC). The health manager is reporting that recycling the MSExchangeAutodiscoverAppPool app pool has failed to restore health and it has requested the protocol be marked offline.
    Attempts to auto-recover from this condition have failed and administrator attention is required.
    Details below: MachineName: EMAIL
    ServiceName: Autodiscover.Proxy
    ResultName: AutodiscoverProxyTestProbe/MSExchangeAutodiscoverAppPool
    Error: The remote server returned an error: (500) Internal Server Error.
    Exception: System.ApplicationException: The remote server returned an error: (500) Internal Server Error. at Microsoft.Exchange.Monitoring.ActiveMonitoring.ClientAccess.CafeLocalProbe.DoWork(CancellationToken cancellationToken) at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.Execute(CancellationToken
    joinedToken) at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.<>c__DisplayClass2.<startexecuting>b__0() at System.Threading.Tasks.Task.Execute() </startexecuting>
    <startexecuting>ExecutionContext: Probe Absolute Timeout=60000ms, Timeout Value=60000ms, Calculated HttpRequest Timeout=59000ms FailedResponse after 0 milliseconds. The remote server returned an error: (500) Internal Server Error.
    [000.000] Probe Absolute Timeout=60000ms, Timeout Value=60000ms, Calculated HttpRequest Timeout=59000ms [000.000] Starting HTTP request task [000.000] Waiting 59000 ms [000.000] Issuing GET against https://autodiscover.domain.com/AutoDiscover/ [000.000] Awaiting
    GET response [000.000] Performing SSL validation [000.000] Failed with exception: The remote server returned an error: (500) Internal Server Error. </startexecuting>
    <startexecuting>FailureContext:</startexecuting>
    <startexecuting></startexecuting>ResultType: Failed
    IsNotified: False
    DeploymentId: 0
    RetryCount: 0
    ExtensionXml:
    StateAttribute1: No response headers available.
    StateAttribute2: [email protected] cfj>M!T@O-;XNkj+=u8[SL#f8Oby*S:(&Bg@GTal_=R@3YXtGi=%Vj832L_AE|l>Jhy18K/an^cNHv7i*3-8d*9?#FQa8u!IUoAai-mr(&PG|ZALs2&?6hI2N]9NKK][
    StateAttribute3:
    StateAttribute4:
    StateAttribute5:
    StateAttribute6: 0
    StateAttribute7: 0
    StateAttribute8: 0
    StateAttribute9: 0
    StateAttribute10: 0
    StateAttribute11:
    StateAttribute12:
    StateAttribute13:
    StateAttribute14:
    StateAttribute14:
    StateAttribute16: 0
    StateAttribute17: 0
    StateAttribute18: 0
    StateAttribute19: 0
    StateAttribute20: 0
    StateAttribute21:
    StateAttribute22:
    StateAttribute23:
    StateAttribute24:
    StateAttribute25:
    PoisonedCount: 0
    Client Access Array: Client Access Array name could not be retrieved.
    ExecutionId: 30334093
    ExecutionStartTime: 12/23/2014 12:03:08 PM
    ExecutionEndTime: 12/23/2014 12:03:08 PM
    ResultId: 32263287
    SampleValue: 0 Event Xml:
    <event style="font-size:0.75em;line-height:1.5;" xmlns="http://schemas.microsoft.com/win/2004/08/events/event"><system><provider guid="{C424A887-A89F-455F-8319-960917152221}" name="Microsoft-Exchange-ManagedAvailability"><eventid>4</eventid>
    <version>0</version> <level>2</level> <task>2</task> <opcode>0</opcode> <keywords>0x8000000000000000</keywords> <timecreated systemtime="2014-12-23T12:03:08.889029200Z"><eventrecordid>7753</eventrecordid>
    <correlation activityid="{ED377619-21A3-44A7-9444-751CDE95B0A1}"><execution processid="4204" threadid="14216"><channel>Microsoft-Exchange-ManagedAvailability/Monitoring</channel> <computer>email.domain.com</computer>
    <security userid="S-1-5-18"></security></execution></correlation></timecreated></provider></system> <userdata><eventxml xmlns="myNs" xmlns:auto-ns2="http://schemas.microsoft.com/win/2004/08/events"><healthset>Autodiscover.Proxy</healthset>
    <subject>Exchange Server Alert: The Autodiscover.Proxy health set is unhealthy.</subject> <message>The Autodiscover.Proxy health set has detected a problem on EMAIL beginning at 12/22/2014 3:01:12 PM (UTC). The health manager is reporting
    that recycling the MSExchangeAutodiscoverAppPool app pool has failed to restore health and it has requested the protocol be marked offline. Attempts to auto-recover from this condition have failed and administrator attention is required. Details below: <b>MachineName:</b>
    EMAIL <b>ServiceName:</b> Autodiscover.Proxy <b>ResultName:</b> AutodiscoverProxyTestProbe/MSExchangeAutodiscoverAppPool <b>Error:</b> The remote server returned an error: (500) Internal Server Error. <b>Exception:</b>
    System.ApplicationException: The remote server returned an error: (500) Internal Server Error. at Microsoft.Exchange.Monitoring.ActiveMonitoring.ClientAccess.CafeLocalProbe.DoWork(CancellationToken cancellationToken) at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.Execute(CancellationToken
    joinedToken) at Microsoft.Office.Datacenter.WorkerTaskFramework.WorkItem.<>c__DisplayClass2.<StartExecuting>b__0() at System.Threading.Tasks.Task.Execute() <b>ExecutionContext:</b> Probe Absolute Timeout=60000ms, Timeout Value=60000ms,
    Calculated HttpRequest Timeout=59000ms FailedResponse after 0 milliseconds. The remote server returned an error: (500) Internal Server Error. [000.000] Probe Absolute Timeout=60000ms, Timeout Value=60000ms, Calculated HttpRequest Timeout=59000ms [000.000]
    Starting HTTP request task [000.000] Waiting 59000 ms [000.000] Issuing GET against https://autodiscover.domain.com/AutoDiscover/ [000.000] Awaiting GET response [000.000] Performing SSL validation [000.000] Failed with exception: The remote server returned
    an error: (500) Internal Server Error. <b>FailureContext:</b> <b>ResultType:</b> Failed <b>IsNotified:</b> False <b>DeploymentId:</b> 0 <b>RetryCount:</b> 0 <b>ExtensionXml:</b> <b>StateAttribute1:</b>
    No response headers available. <b>StateAttribute2:</b> [email protected] cfj>M!T@O-;XNkj+=u8[SL#f8Oby*S:(&Bg@GTal_=R@3YXtGi=%Vj832L_AE|l>Jhy18K/an^cNHv7i*3-8d*9?#FQa8u!IUoAai-mr(&PG|ZALs2&?6hI2N]9NKK][
    <b>StateAttribute3:</b> <b>StateAttribute4:</b> <b>StateAttribute5:</b> <b>StateAttribute6:</b> 0 <b>StateAttribute7:</b> 0 <b>StateAttribute8:</b> 0 <b>StateAttribute9:</b>
    0 <b>StateAttribute10:</b> 0 <b>StateAttribute11:</b> <b>StateAttribute12:</b> <b>StateAttribute13:</b> <b>StateAttribute14:</b> <b>StateAttribute14:</b> <b>StateAttribute16:</b>
    0 <b>StateAttribute17:</b> 0 <b>StateAttribute18:</b> 0 <b>StateAttribute19:</b> 0 <b>StateAttribute20:</b> 0 <b>StateAttribute21:</b> <b>StateAttribute22:</b> <b>StateAttribute23:</b>
    <b>StateAttribute24:</b> <b>StateAttribute25:</b> <b>PoisonedCount:</b> 0 <b>Client Access Array:</b> Client Access Array name could not be retrieved. <b>ExecutionId:</b> 30334093 <b>ExecutionStartTime:</b>
    12/23/2014 12:03:08 PM <b>ExecutionEndTime:</b> 12/23/2014 12:03:08 PM <b>ResultId:</b> 32263287 <b>SampleValue:</b> 0</message> <monitor>AutodiscoverProxyTestMonitor/MSExchangeAutodiscoverAppPool</monitor></eventxml></userdata></event>

  • Help with TYPE and LIKE statements

    HI guys,
    I know this is really novice stuff, but I am a little confused.
    Can anyone please explain the exact difference between TYPE and like with the help of a program, to understand it.
    What situation would demand the use of each of the LIKE statement, since I can do all these things using the TYPE ?

    Hi Akhil,
    I summarized the info in SDN posts and SAP Help, to make it easier for you to understand. I also included some code snippets. Hope these prove to be helpful to you.
    The following is from SAP Help:
    The Additions TYPE and LIKE
    The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.
    ·        Definition of local types in a program
    ·        Declaration of data objects
    ·        Dynamic creation of data objects
    ·        Specification of the type of formal parameters in subroutines
    ·        Specification of the type of formal parameters in methods
    ·        Specification of the type of field symbols
    A known data type can be any of the following:
    ·        A predefined ABAP type to which you refer using the TYPE addition
    ·        An existing local data type in the program to which you refer using the TYPE addition
    ·        The data type of a local data object in the program to which you refer using the LIKE addition
    ·        A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure compatibility with earlier releases, it is still possible to use the LIKE addition to refer to database tables and flat structures in the ABAP Dictionary. However, you should use the TYPE addition in new programs.
    The LIKE addition takes its technical attributes from a visible data object. As a rule, you can use LIKE to refer to any object that has been declared using DATA or a similar statement, and is visible in the current context.  The data object only has to have been declared. It is irrelevant whether the data object already exists in memory when you make the LIKE reference.
    ·        In principle, the local data objects in the same program are visible. As with local data types, there is a difference between local data objects in procedures and global data objects. Data objects defined in a procedure obscure other objects with the same name that are declared in the global declarations of the program.
    ·        You can also refer to the data objects of other visible ABAP programs. These might be, for example, the visible attributes of global classes in class pools. If a global class cl_lobal has a public instance attribute or static attribute attr, you can refer to it as follows in any ABAP program:
    DATA dref TYPE REF TO cl_global.
    DATA:  f1 LIKE cl_global=>attr,
           f2 LIKE dref->attr.
    You can access the technical properties of an instance attribute using the class name and a reference variable without first having to create an object. The properties of the attributes of a class are not instance-specific and belong to the static properties of the class.
    Example
    TYPES: BEGIN OF struct,
             number_1 TYPE i,
             number_2 TYPE p DECIMALS 2,
           END OF struct.
    DATA:  wa_struct TYPE struct,
           number    LIKE wa_struct-number_2,
           date      LIKE sy-datum,
           time      TYPE t,
           text      TYPE string,
           company   TYPE s_carr_id.
    This example declares variables with reference to the internal type STRUCT in the program, a component of an existing data object wa_struct, the predefined data object SY-DATUM, the predefined ABAP type t and STRING, and the data element S_CARR_ID from the ABAP Dictionary.
    The following info is from various posts:
    --> Type: It is used when userdefined object link with SAP system data type.
    Local types mask global types that have the same names. When typing the interface parameters or field symbols, a reference is also possible to generic types ANY, ANY TABLE,INDEX TABLE, TABLE or STANDARD TABLE, SORTED TABLE and HASHED TABLE.
    --> Like: It is when data object link with the other data object.
    --> TYPE, you assign datatype directly to the data object while declaring.
    --> LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.
    you can refer to all visible data objects at the ABAP program's positon in question. Only the declaration of the data object must be known. In this case it is totally irrelevant whether the data object already exists physically in
    memory during the LIKE reference. Local data objects mask global data objects that have the same name.
    --> Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object.
    Types: var1(20) type c.
    data: var2 type var1. ( type is used bcoz var1 is defined with TYPES and it
    does not occupy any memory spce.
    data: var3 like var2. ( like is used here bcoz var2 is defined with DATA
    so it does occupy space in memory ).
    data: material like mara-matnr. ( like is used here bcoz mara-matnr is stored in memory)
    --> Type refers the existing data type
    --> Like refers the existing data object
    Please Reward Points if any of the above points are helpful to you.
    Regards,
    Kalyan Chakravarthy

  • Help with filling a if statement

    hello everyone i hope someone can help me
    if you look at my code below the arraylist contains the number 8. but i want to know how i can use that number 8 inside the if statement (if (i%10 == 1)) where the number 1 is, so that number 1 will change to the number 8.
    could someone please help me.
    thanks for your time
    loftty
    hash.put(new Integer(8), st1);
    if(hash.containsValue(st1)) {
                             Enumeration e = hash.keys();
                                  while (e.hasMoreElements()) {
    Object it = e.nextElemenet();
    Object it1 = hash.get(it);
    if (it1.equals(st1){
    arraylist.add(it);
    Enumeration e = v.elements();
                        Object o;
                        for(int i = 1;e.hasMoreElements();i++) {
                        o = e.nextElement();
                             if (i%10 == 1){
                        System.out.println(o);

    By ArrayList do you mean the hashtable in your code?
    Because a hastable is not the same as an arraylist....
    For one thing your hashtable is wrong...
    The first parameter you pass in a put method is a key, the second is an object...
    When you want to get the object from the hashtable you pass it the key.... like so:
    hash.put("Str1", new Double(8));
    Double l_Double = (Double)hash.get("Str1");With an ArrayList you don't use keys by the way...
    Vermelh0

  • Help with a "AT NEW" statement

    I am debugging at some code and I am trying to understand the following statement
    <i>LOOP AT it_data_item_final INTO st_data_item_final.
    MOVE st_data_item_final-waers TO w_waers.
    <b>AT NEW xblnr."xblnr." budat xblnr waers.</b>
          MOVE-CORRESPONDING st_data_item_final TO s_bbkpf.
          s_bbkpf-waers = w_waers.
          t_upload_file = s_bbkpf.
          APPEND t_upload_file.
    ENDAT.</i>
    I know this code is to only execute when there is a change in the fields but I am not sure how to read the statement. I am assuming there if there is a change in the budat xblnr waers fields of the st_data_item_final table, this code will execute. I am not sure what the xblnr."xblnr." code is trying to do.
    thanks for the help in advance

    hi,
    LOOP AT it_data_item_final INTO st_data_item_final.
    v_tabix = sy-tabix.
    MOVE st_data_item_final-waers TO w_waers.
    AT NEW xblnr.
      read table it_data_item_final into st_data_item_final index v_tabix.
      MOVE-CORRESPONDING st_data_item_final TO s_bbkpf.
      s_bbkpf-waers = w_waers.
      t_upload_file = s_bbkpf.
      APPEND t_upload_file.
    ENDAT.
    endloop.
    After the at new XBLNR, the structure gets empty and only contains the fields that are left to the field (in the internal table) at which we are performing at end/at new.
    XBLNR F1 F2
    1     2   4 <-
    1     3   6
    2     2   4 <-
    3     3   3 <-
    then it gets triggered at these three positions. To fill the structure again with the values we need to read the table again with sy-tabix.
    Hope this helps.
    Regards,
    Richa

  • Help with linked files/ compound paths please

    Hi - I am working with an illustrator file from another designer which has a compound path with linked files - when you link a new file the image is automatically resized and clipped to the path.  I am able to edit it but i want to make my own from scratch and can't figure it out. I'm working with Illustrator CS6. Any help greatly appreciated. Thanks

    Hi Steve - thanks for the reply - my question was a bit vague as I wasn't entirely sure what I was working with but I think your point about the new linked image scaling to the same size as the existing file has helped me understand it a bit more.  What I want to know how to do is to make an entirely new file with a clipping mask that I then link an image to.  I made a file with a clipping mask on the page and then chose file>place but the image I import is not being clipped (I ticked the link option when importing it) I see it working with the existing file I'm working with but I need to know how to make a new one myself.
    If this makes it clearer here's what I want to do ...
    I am making a banner, I have 3 flat jpegs of t-shirts that I want to place on the banner without their white background.  I made a clipping mask the same shape as the outline of the t-shirt and now I want to import the jpeg so it is a linked file and is clipped by the clipping mask and so I can use it in future to import different t-shirt image in without scaling and clipping them each time.
    REally appreciate your help, thanks.

  • Help with parsing an UPDATE statement

    I am stuck and need help! The teacher has not gone over parsing with us
    and it is not on his scheduled topics list. But, I am a person that likes to
    scope out and learn new things. For our final project, we have to allow
    updates, delete and inserts into the 5 main tables of the Premiere Products
    database. I have done everything except for the updates. I can achieve
    the updates of the entities by pretty much hardcoding them and that is
    okay by the teacher, but I want to learn about parsing because Barbara
    from this site mentioned this to me.
    This is what I was able to write and I am getting errors:
    CREATE OR REPLACE PROCEDURE updatecust_proc (
    v_cust_num IN customera.cust_num%TYPE,
    v_attributetoupdate VARCHAR2 ,
    v_updatedvalue VARCHAR2 )
    AS
    e_invalidcustnum_error EXCEPTION;
    BEGIN
    v_isvalidcustnum := iscust(v_cust_num);
    IF (v_isvalidcustnum = FALSE) THEN
    RAISE e_invalidcustnum_error;
    END IF;
    PARSE(
    'UPDATE customer
    SET' | | v_attributetoupdate | | '=' | | v_updatedvalue | |
    'WHERE cust_num =' | | v_cust_num
    END;
    EXCEPTION
    WHEN e_invalidcustnum_error THEN
    DBMS_OUTPUT.PUT_LINE('Cannot be updated. Invalid customer number');
    END;
    Any help would be useful. I went to the Oracle help site but their examples are a little too complicated for me to understand, plus, I am not using any C code.
    Thanks in advance!
    Bob

    Now we are getting somewhere. Identifier 'PARSE' must be declared.
    I again used the 'Search' link just above the forum posts and entered 'dbms_sql.parse' and got a short list of hits (as I suggested in my previous reply).
    There is one with Barbara's name on it. It shows exactly how to do what you are trying to do. In particular note her code:
    DBMS_SQL.PARSE
    (cursor_name,
    'UPDATE client SET '
    | | v_column
    | | ' = ' | | '''' | | v_new_data | | ''''
    | | ' WHERE account_id = '
    | | v_account_id,
    DBMS_SQL.NATIVE);
    Compare her PARSE statement to yours and you will see some major differences. The PARSE procedure is defined in the DBMS_SQL package and must be reference by DBMS_SQL.PARSE as Barbara shows.
    In addition to dynamic SQL using the DBMS_SQL package Oracle 8i also supports the EXEC IMMEDIATE statement.
    All of Oracle's documentation is available online via the 'Documentation' link on the left side of the OTN home page.
    The 'Supplied PL/SQL Packages Reference' has a chapter for each package (including DBMS_SQL) and describes the procedures/functions in the package and how to use them.
    The 'Application Developers Guide - Fundamentals' has chapters on 'processing SQL statements' and 'dynamic SQL' that go into some detail on performing dynamic sql.
    Yes, Barbara's code uses a CURSOR. The DBMS_SQl package requires it and so does your code. Almost all SQL uses a CURSOR either implicitly or explicitly.
    My comments are not, and were not, directed at you personally so I hope you don't take them that way.
    Your latest reply has a lot of useful information in it.
    1. 19/1 PLS-00201: identifier 'PARSE' must be declared. This is the explicit error message we need to help someone. We don't have to guess which error they are talking about. We can look it up in the MESSAGES manual if necessary. When someone says 'I get an error', or 'I get a PARSE error' we can only guess which error they are talking about.
    In your reply you state that you looked at Barbara's code, she uses a cursor and you don't need a cursor. That is very useful information to someone trying to help you because it tells us two things: you are trying to find the answer for yourself (a lot of people just want someone to write the code for them) and it shows that you haven't made the connection between Barbara's example (which shows EXACTLY what you need to do) and your own code.
    This is a public forum and I have found it useful to keep repeating certain suggestions.
    For whatever reason many people still do not seem to realize that:
    1. ALL of Oracle's documentation is available on-line via the 'Documentation' link on the left side of the OTN main page.
    2. You can purchase (for about $50) a CD-ROM that has all of the Oracle documentation on it in both PDF and HTML format.
    3. The 'search' link just above each discussion forum allows one to search any or all forums for topics, users, etc.
    The above resources should be used by everyone.
    Good luck!
    null

  • Help with a update,select statement

    Hi all please can you help me with a update statement i am struggling with.
    I have 2 tables
    Holiday and data
    In the Holiday table i have columns for
    Machine_ID NUMBER,
    date_from DATE,
    date_to DATE,
    ID NUMBER
    Machine column represents a type of machine, the two dates represent the start and end date of a holiday and ID represents the ID of the machines that the holiday effects (as you can have many machines that are the same, so the ID unique field to seperate them.
    i.e.
    996     25-DEC-08 00:00:00     27-DEC-08 00:00:00     91     
    996     25-DEC-08 00:00:00     27-DEC-08 00:00:00     92     
    100     28-DEC-08 00:00:00     29-DEC-08 00:00:00     1
    100     28-DEC-08 00:00:00     29-DEC-08 00:00:00     2
    In the data table i have the following columns:
    DATE DATE
    Machine NUMBER
    SHIFT1S DATE
    SHIFT1F DATE
    SHIFT2S DATE
    SHIFT2F DATE
    CALS DATE
    CALF DATE
    CAP NUMBER
    CALCAP NUMBER
    total_hrs_up NUMBER
    In here i have data for every date in the calendar. The machines are cross references with the machine in holidays table.
    I run two shifts so have shift 1 start, finish. shift 2 start, finish. These are dates with times, so shift1s could be 01-01-08 09:00:00 shift1f could be 01-01-08 17:00:00.
    shift2S could be 01-01-08 21:00:00 shift2f could be 01-01-08 23:59:00.
    so that machine would be up between them hours of the day.
    Other columns include
    CALS, ,CALF = calendar start, finish, - This needs to be populated from the holiday table. currently null. So if the date is the 26 DEC and the machine is the same as what is in the holiday table then these two columns should be populated with them data
    CAP is the total number of these machines i have available.
    CALCAP is the no of machines the holiday affects -currently null
    total_hrs_up is the number of hours this machine is up and running -currently null.
    So what i need to do is populate the cals, calf calcap, total_hrs_up columns.
    total_hrs_up is the important one, this needs to work out based on the two shift patterns the number of hours that the machine is available and then take off the holiday hours to give a final value.
    so current data example in data is
    date machine shifts shiftf shift2s shift2f cals, calf, cap, calcap, total_hrs
    16-JUL-08     100 09:00:00     17:00:00     12:00:00     00:00:00               '','','',1     ,''     
    16-JUL-08     105 09:00:00     17:00:00     12:00:00     00:00:00               '','','',1     ,''
    16-JUL-08     107 09:00:00     17:00:00     12:00:00     00:00:00               '','','',1     ,''
    id like to see based on the holiday table if there is a holiday then this data is updated as such and a total_hrs machine is available populated on that date.
    Any help is very much appreciated!
    Thanks

    Hi,
    The following query does what you requested.
    It makes the following assumptions:
    (a) in data, shift1start <= shift1finish
    (b) in holiday, hol_start <= hol_finish
    (b) in data, the combination (machine, shift1start) is unique
    (c) in holiday, hol_start <= hol_finish
    (d) in holiday, rows for the same machine and id never have overlapping dates (including times). For example:
    INSERT INTO holiday (machine, id, date_from, date_to)
    VALUES (200, 1, '26-DEC-08 07:00:00', '26-DEC-08 09:59:59');
    INSERT INTO holiday (machine, id, date_from, date_to)
    VALUES (200, 1, '26-DEC-08 09:00:00', '26-DEC-08 09:59:59');will cause a probem. Multiple rows for the same machine and day are okay, however, if the times do not overlap, like the following:
    INSERT INTO holiday (machine, id, date_from, date_to)
    VALUES (200, 1, '26-DEC-08 07:00:00', '26-DEC-08 08:59:59');
    INSERT INTO holiday (machine, id, date_from, date_to)
    VALUES (200, 1, '26-DEC-08 09:00:00', '26-DEC-08 09:59:59');Here's the UPDATE statement:
    UPDATE     data     m
    SET     (     hol_start
         ,     hol_finish
         ,     no_of_available_minutes
         ) =
    (     SELECT     MIN (date_from)
         ,     MAX (date_to)
         ,     (     MAX (shift1finish - shift1start)     -- Total from data
              -     ( NVL     ( SUM     ( LEAST (date_to, shift1finish)
                             - GREATEST (date_from, shift1start)
                        , 0
                        )                    -- Total from holiday
                   / MAX (total_no_of_machines)          -- Average
              ) * 24 * 60                         -- Convert days to minutes
         FROM          data     d
         LEFT OUTER JOIN     holiday     h     ON     h.machine     = d.machine
                             AND NOT     (     date_from     > shift1finish
                                  OR      date_to          < shift1start
         WHERE          d.machine     = m.machine
         AND          d.shift1start     = m.shift1start
    );The subquery has to use its own copy of data (that is, in needs d, not m), since the subquery has to return a non-NULL number of minutes when no rows in h match m.

  • Help with excel grouped data and sorting to keep data intact

    I have a master spreadsheet with lots of data. I am trying to grouped the data based on physical address/city, add the values and once done sort it by valuation based on descending order by valuation but my data keep messing up.
    So in Row 1/col A: Address 1; Col B City: XXX; Col C: Valuation $$$
    Row 2/col A: Address 1; Col B City: XXX; Col C: Vauation $$$
    Row 3/col A: Address 2; COl B City: YYY; Col C:  Valuation $$$
    SO I sort by city and in ROw 1/2 same city with same address, I grouped it.  THen I created a new row below Row 3 and add up the grouped data (i.e. ROw 1 and 2).  I go through the entire list to finalize the grouped locations.  
    But when I am done and I sort by Valuation, all my data messed up coz I created a new row with addition of grouped location valuation and the formula gets messed up.
    Any one with ideas please help.  My deadline for this project is just a week away and I am freaking out.
    THanks in advance.

    it seems upload a sample is more clearly about the required.
    KR

  • Help with uploading large video to ipad2

    Hi guys, I'm using the ipad 2 with camera connection kit to import videos from a Mobius camera which is working fine for videos less than a minute long but when I try to import anything larger (2 minute) it won't work? There is approx 6gig space on the ipad so I'm confused why it won't allow it!
    Cheerrs

    What actually happens - can we have more detail please

  • Help with decode or case statement

    I have the following insert statement
    insert into t_outcome (
    TRANSACTION_ID,
    charge_DATE,
    Charge_TIME,
    STATUS_CODE)
    values(cur_tem.transaction_id,
    cur_tem.charge_date,
    cur_tem.charge_time,
    cur_tem.STATUS_code)
    I require to incorporate the following rules into the population of charge_TIME
    if cur_tem.STATUS_code is 7 and cur_temp.charge_time is not null then populate charge_TIME with cur_temp.charge_time
    else if cur_tem.STATUS_code is 7 and cur_temp.charge_time is null then populate charge_TIME with -9
    else if cur_tem.STATUS_code is not 7 then populate charge_TIME with -7
    How do I add these rules into the insert statement ?
    Thanks
    Brendon

    decode(cur_tem.STATUS_code, 7, nvl(cur_tem.charge_time, -9), -7)
    I think that will work.
    Lee
    Message was edited by:
    Lee Forkenbrock

  • Help with burning large project on dual layer DVD

    Hi need help please.
    I am busy with a SD 16x9 project 215 minutes long so I am trying to use dual layer DVD's. The project has a serious menu setup (well I think so), it starts with a intro and go's into the main menu with sub menu's and so on. my problems is the following:
    if I burn a image all works well if I burn a disc from the image or using encore the menu once using a DVD player is very slow (the last half of the links on the time line) and some links get mixed up (if I press play dvd on the 3rd sub menu it somtimes starts in the correct place and somtimes it starts one link later).
    is this caused by the break in the layer and what can I do to correct it or to get it better.
    thanks
    Darren

    Are you using any motion menus? Have you exceeded the 1 gig limit for menus etc?
    I assumed 16:9 and forgot to look before I started posting: it does not look like it, but be sure you don't have more than 18 buttons per menu (if it is 16:9).
    With lots of short clips, break position should not be an issue. You can export to a folder and use imgburn which gives more control over layer breaks.
    Even though complex, it all looks straight forward, and, even though I can't see the image detail, it looks okay. The most likely issue in such a project is that Encore got lost as you made changes/corrections. Sometimes they can be fixed. Other times, the solution is a do over. Newer versions for Encore appear more robust (fewer problems and more likely to fix problems), but no versions appear to be free of such issues.

  • Help with Very Large Pages

    I am designing a layout for a Renga Haiku series.  I have 100 haiku that will be printed two/page on pages 4 5/8" wide.  These "pages" will then be printed side by side on a roll of mulberry paper, resulting in a scroll that is 231.25" (50 X 4.625").  Then they will be according folded and bound (see diagram below).
    I'm hoping someone can help me lay this out so that it can be printed on the roll.  I could treat this as one giant "page" that is 231.25" wide.  But InDesign says the max page width is 216".  Alternatively, I could create pages that are 4 5/8" wide.  But then I can't figure out how to print them one right after the other on the roll.  Is there a way to tell InDesign to simply print all fifty pages, one right after the other, with no space in between?

    There are really two approaches that you can take.
    (1)     Scale everything down by a certain percentage and then scale it up at print time (preferably export PDF and then scale when printing the PDF). If you example you use a 75% scale, use that scale factor for everything including column widths, text point sizes, etc.
    (2)     My preference would be to create this as one hundred logical pages, each 4.625" in width. Output as PDF and leave the “imposition” to whoever is doing the final print job. You could also use one of a number of Acrobat plug-ins from third parties to do that impositon to make the two physical wide pages from the 100 logical pages.
              – Dov

  • Help with a union all statement

    Hello
    I am pulling a query much like this:
    (select ID, Created_timestamp from snapshot1
    where created_timestamp >= to_date ('8/15/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM')
    and created_timestamp < to_date('8/18/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'))
    UNION ALL
    (select ID, created_timestamp from snapshot2
    where created_timestamp >= to_date ('8/15/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM')
    and created_timestamp < to_date('8/18/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'))
    UNION ALL
    (select ID, created_timestamp from data_history
    where created_timestamp >= to_date ('8/15/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM')
    and created_timestamp < to_date('8/18/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM'))
    Is there an easier way to handle created_timestamp?
    I would like to put it at the beginning so I only have to change it in one place.

    I don't understand.
    I try your with statement and get: "end_date" invalid identifier as an error
    I start my query out:
    WITH start_date as
    (select to_date ('08/15/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM') from dual),
    end_date as (select to_date ('08/18/2007 12:00:00 AM','MM/DD/YYYY HH:MI:SS AM) from dual)
    select sales.id, start_date as callstart, end_date as callend
    where sales.created_timestamp >= start_date
    and sales.created_timestamp < end_date
    UNION ALL
    <<<<<<<here is where you take the last select statement and replace sales with manufacturing>>>>>>>>>>>>>
    UNION ALL
    <<<<<<<here is where you take the last select statement and replace sales with engineering>>>>>>>>>>>>>
    and it still fails.

  • Help with a simple select statement

    $x = oci_parse($c, "select quantity from balance where item_num=101");
    oci_execute($x);
    echo "the quant is: ".$x;
    I try to run this select statement without success
    then I tried...
    $x = oci_parse($c, "select quantity from balance where item_num=101");
    $y= oci_execute($x);
    echo "the quant is: ".$y;
    and it didn't work either...
    What should I change?
    thanks!

    The Oracle library operates a bit differently from some other PHP libraries, notably MySQL/MySQLi. With Oracle (OCI8), you have to execute the statement, and then afterward use an oci_fetch...() function to pull things from your $statement variable. Here's a small example that hopefully will illustrate the basic usage:
    <?php
         $conn = oci_connect('hr','hr','xe');
         if(!$conn) {
              echo 'Could not connect!';
              exit;
         $sql = 'select * from jobs';
         $stmt = oci_parse($conn, $sql);
         if(!$stmt) {
              echo 'Could not parse query.';
              exit;
         $result = oci_execute($stmt, OCI_DEFAULT);
         if(!$result) {
              echo 'Could not execute query.';
              exit;
         echo "Query ran successfully.\n";
         // Fetch rows as associative arrays, so
         // we can ask for values by column name.
         // Other options include oci_fetch_row(),
         // oci_fetch_array(), and oci_fetch_object().
         // Note that oci_fetch_assoc() will create
         // an associative array using upper-case
         // column names for the keys.
         while(($row = oci_fetch_assoc($stmt)) != null)
              echo $row['JOB_ID'] . ': ' . $row['JOB_TITLE'] . "\n";
         echo "All data returned.\n";
         oci_close($conn);
    ?>When I run this, I get the following:
    C:\workspace\php>php select.php
    Query ran successfully.
    AD_PRES: President
    AD_VP: Administration Vice President
    AD_ASST: Administration Assistant
    FI_MGR: Finance Manager
    FI_ACCOUNT: Accountant
    AC_MGR: Accounting Manager
    AC_ACCOUNT: Public Accountant
    SA_MAN: Sales Manager
    SA_REP: Sales Representative
    PU_MAN: Purchasing Manager
    PU_CLERK: Purchasing Clerk
    ST_MAN: Stock Manager
    ST_CLERK: Stock Clerk
    SH_CLERK: Shipping Clerk
    IT_PROG: Programmer
    MK_MAN: Marketing Manager
    MK_REP: Marketing Representative
    HR_REP: Human Resources Representative
    PR_REP: Public Relations Representative
    All data returned.
    C:\workspace\php>For more information, take a look at the OCI8 library documentation in the PHP manual online:
    OCI8
    http://us.php.net/manual/en/book.oci8.php
    Some other examples
    http://us.php.net/manual/en/oci8.examples.php
    Kind regards,
    Christopher L. Simons

Maybe you are looking for

  • Inbound Delivery For Scheduling Agreement Lines using LSMW

    Hi, We need to create inbound deliveries for scheduling agreements. Our scheduling Agreements are too big with 200 lines. But the vendor used to send only few discrete lines in his ASN. Is it possible to create inbound deliveries for the Scheduling a

  • How to use Action/Input maps

    It seems to me that the move to sharing actions menus, buttons, and other components is a logical one, given that it is desirable to have all references to the action reflect its enabled state. The question that arises is: which ActionMap object to u

  • Feature in Audition in STP?

    In Adobe Audition you can play a CD and record it in realtime as it is playing. Can you do this in Soundtrack Pro? I am not talking about a digital conversion. G5    

  • How to clear a master detail form in adf

    hi I am using j developer 11 g (ADF). I have a master detail page. i want to clear all data when the form loading first time I used an lov for searcching the data. here am called createInsert method for clearing the data from form on pageload, but am

  • PDF forms setup

    Hi I want to do some development related to PDF forms. I have downloaded Adobe Live Cycle Designer from Adobe Site but not able to integrate it with SAP. So can anyone please tell me what are the steps to configure the same with SAP? Thanks Siddarth