Populating a collection with function results

I am calculating some statistics and need to use a collection to store the results of several function so they can be used in a procedure. Example:
PROCEDURE PRODUCTIVITY_INSERT(p_first_of_month IN DATE)
AS
BEGIN
vc_FirstofMonth := p_first_of_month;
FOR i IN 1..3 loop
EXECUTE IMMEDIATE 'INSERT INTO RFC_BUS'||days(i)||'PRODUCTIVITY(ROUTE,PPPH)
SELECT a.route, ((sr05 / sy05)/'||counts(i)||') AS "RATIO"
FROM (SELECT route,
SUM (DECODE (TO_CHAR (pick, "MM-YYYY"),
to_char(vc_FirstofMonth, "MM-YYYY"), platform_hours, null)) AS sy05
FROM bus_platformhours
WHERE day_type ='||days(i)||' and platform_hours > 0
GROUP BY route) a,
(SELECT route,
SUM (DECODE (TO_CHAR (service_date, "mm-yyyy"),
to_char(vc_FirstofMonth, "MM-YYYY"), rides, null)) AS sr05
FROM bush_daily_rides
WHERE day_type = '||days(i)||
'GROUP BY route) b
WHERE a.route = b.route
ORDER BY a.route
VALUES(
p_route,
p_ratio
) USING days(i), counts(i)';
end loop;
Can I use collections to hold the function results (say three function out variables) while they are being looped through in the procedure? If I can do that I am presuming I use the functions name in the collection such as:
TYPE dayoneList IS TABLE OF NUMBER;
dayone dayoneList := dayoneList(wkdaysminusone(), sadaysminusone(), sudaysminusone());
thanks for any help you can give me.

Do you mean to use the functions as the elements of collection constructor ?
It's possible:
SQL> create function get_one return number is begin return 1; end;
  2  /
Function created.
SQL> create function get_two return number is begin return 2; end;
  2  /
Function created.
SQL> declare
  2   type arr is table of number;
  3   arr1 arr := arr(get_one(), get_two());
  4  begin
  5   for i in 1..arr1.count loop
  6    dbms_output.put_line(arr1(i));
  7   end loop;
  8  end;
  9  /
1
2
PL/SQL procedure successfully completed.Rgds.

Similar Messages

  • Problem with function result in form

    Hi, I'm in a trouble
    I wrote function which counts for me time elapsed since given point in time...
    I use it in one of my forms. When I figured out that is was wrong I updated it removing mistake.
    Now, WHEN I USE IT IN FORM from Application Server I get numbers below 0 as a result (something like I had before I changed it) and at the same time I get right result using sql plus console or form from Forms Builder....
    maybe someone knows what's wrong???
    thank a lot
    best regards

    WHEN I USE IT IN FORM from Application Server I get numbers below 0 as a result
    (something like I had before I changed it) and at the same time I get right result using
    sql plus console or form from Forms Builder..Which does rather suggest that either
    (1) it has been deployed to your OAS instance
    (2) your OAS instance has cached it
    (3) your local browser has cached it.
    My forms is too rusty to give your specifics. Initially I suggest you talk it over with your App Server admin person. Otherwise, as suggested, try the Forms because this really is a deployment issue.
    Cheers, APC

  • External Java Function with a Result Type

    Dear all,
    I have created a workflow process which use a Function Activity of type "External Java" without a result type and it works fine, but i have created another with the result type of boolean (WFSTD_BOOLEAN) and it doesn't work properly. I will explain what is happening.
    I start a process and it stops in that function activity, then the oracle Function Activity Agent executes the class associated to that function and it works fine. Then i review the workflow process and check that the status of the activity is "Deferred". I execute the wf_engine.background process, and then the status of the activity is "Complete" but the result field is blank, thus the process is stopped and did not go through the "True" branch of the process. I have follow the Oracle Workflow and Java Technical White Paper to build the class associated to the function activity, and i return true in the execute method and don't put anything in the errorStack variable.
    The documentation says:
    resultOut If a result type is specified in the Activities properties page for the activity in the Oracle Workflow Builder, this parameter represents the expected result that is returned when the procedure completes.
    Note: Unlike the resultout for a PL/SQL procedure called by a function activity, the resultOut for a Java procedure does not include a status code. In the Java API, only the result type value is required. The status of the activity will be set automatically by the Workflow Engine depending on whether there is a value in the errorStack variable.
    am I doing something wrong? could anyone help me?
    Thanks in advance.

    Hi Allison,
    I've found the solution to the problem. If i set the variable resultOut to "T" or "F" before finnishing the execute method it works.
    I think that you have to set the variable resultOut with the internal value of the lookup type that you are using as the result type of the function activity.
    Bye!

  • The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart.

    The below function is giving me the hours difference what I wanted, but today it is giving us the below error: 
    Msg 535, Level 16, State 0, Line 1
    The datediff function resulted in an overflow. The number of dateparts separating two date/time instances is too large. Try to use datediff with a less precise datepart.
    Please Help..
    ALTER FUNCTION [dbo].[GetHoursExcludingWeekdays](@StartDate datetime2,@EndDate datetime2)
    returns decimal(12,3)
    as
    begin
        if datepart(weekday,@StartDate) = 1
            set @StartDate = dateadd(day,datediff(day,0,@StartDate),1)
        if datepart(weekday,@StartDate) = 7
            set @StartDate = dateadd(day,datediff(day,0,@StartDate),2)
        -- if @EndDate happens on the weekend, set to previous Saturday 12AM
        -- to count all of Friday's hours
        if datepart(weekday,@EndDate) = 1
            set @EndDate = dateadd(day,datediff(day,0,@EndDate),-2)
        if datepart(weekday,@EndDate) = 7
            set @EndDate = dateadd(day,datediff(day,0,@EndDate),-1)
        declare @return decimal(12,3)
        set @return = ((datediff(second,@StartDate,@EndDate)/60.0/60.0) - (datediff(week,@StartDate,@EndDate)*48))
        return @return
    end
    ReportingServices

    You'll get this error if the difference between the start and end date is greater that about 68 years due to the "second" DATEDIFF specification.  Perhaps the dates are greater than the expected range due to a data quality issue. 
    Taking the advice from the error message, you could use minutes instead of seconds like the example below the version below.  This could still result in the error of the difference is greater than a couple of hundred years, though.  You might consider
    validating the dates and returning NULL if outside expected limits.
    ALTER FUNCTION [dbo].[GetHoursExcludingWeekdays](@StartDate datetime2,@EndDate datetime2)
    returns decimal(12,3)
    as
    begin
    if datepart(weekday,@StartDate) = 1
    set @StartDate = dateadd(day,datediff(day,0,@StartDate),1)
    if datepart(weekday,@StartDate) = 7
    set @StartDate = dateadd(day,datediff(day,0,@StartDate),2)
    -- if @EndDate happens on the weekend, set to previous Saturday 12AM
    -- to count all of Friday's hours
    if datepart(weekday,@EndDate) = 1
    set @EndDate = dateadd(day,datediff(day,0,@EndDate),-2)
    if datepart(weekday,@EndDate) = 7
    set @EndDate = dateadd(day,datediff(day,0,@EndDate),-1)
    declare @return decimal(12,3)
    set @return = ((datediff(minute,@StartDate,@EndDate)/60.0) - (datediff(week,@StartDate,@EndDate)*48))
    return @return
    end
    GO
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Database, Dataset, Table Adaptors Error "Unable to load, Update requires a valid DeleteCommand when passed DataRow collection with deleted row"

    Microsoft Visual Basic 2010 Express.
    I am new to Visual Basic programing and i am trying to understand the relationships between Datasets, database, table Adaptors. I have to following code that is is giving me the following error" Unable to load, Update requires a valid DeleteCommand
    when passed DataRow collection with deleted rows". 
    I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    It seems that i can delete the data on the DataGridView Table and it only displays the correct data. but my database is not updating, even though the data grid displays differently.I can determine this because, when i save the offset database, i have all
    the previous uploads and all the rows that i wanted to delete are still there.
    My final goal is to be able to import offset data from a CSV file, save this data on the pc, send a copy of this data to a NuermicUpDown so the customer can modify certain numbers. From here they download all the date to a controller.  IF the customer
    needs to modify the imported data, they can go to a tab with a data grid view and modify the table. They will also have to option to save the modified data into a csv file.  
    Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    CODE:
    Private Function LoadOffSetData()
            Dim LoadOffsetDialog As New OpenFileDialog 'create a new open file dialog and setup its parameters
            LoadOffsetDialog.DefaultExt = "csv"
            LoadOffsetDialog.Filter = "csv|*.csv"
            LoadOffsetDialog.Title = "Load Offset Data"
            LoadOffsetDialog.FileName = "RollCoaterOffset.csv"
            If LoadOffsetDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then  'show the dialog and if the result is ok then
                Try
                    Dim myStream As New System.IO.StreamReader(LoadOffsetDialog.OpenFile) 'try to open the file with a stream reader
                    If (myStream IsNot Nothing) Then 'if the file is valid
                        For Each oldRow As MaterionOffsetDataSet.OffsetTableRow In MaterionOffsetDataSet.OffsetTable.Rows
                            oldRow.Delete()                       
    'delete all of the existing rows
                        Next
                        'OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        Dim rowvalue As String
                        Dim cellvalue(25) As String
                        'Reading CSV file content
                        While myStream.Peek() <> -1
                            Dim NRow As MaterionOffsetDataSet.OffsetTableRow
                            rowvalue = myStream.ReadLine()
                            cellvalue = rowvalue.Split(","c) 'check what is ur separator
                            NRow = MaterionOffsetDataSet.OffsetTable.Rows.Add(cellvalue)
                            Me.OffsetTableTableAdapter.Update(NRow)
                        End While
                        Me.OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
                        MainOffset.Value = OffsetTableTableAdapter.MainOffsetValue          'saves all the table offsets
    to the offset numericUpDown registers in the main window
                        StationOffset01.Value = OffsetTableTableAdapter.Station01Value
                        StationOffset02.Value = OffsetTableTableAdapter.Station02Value
                       myStream.Close() 'close the stream
                        Return True
                    Else 'if we were not able to open the file then
                        MsgBox("Unable to load, check file name and location") 'let the operator know that the file wasn't able to open
                        Return False
                    End If
                Catch ex As Exception
                    MsgBox("Unable to load, " + ex.Message)
                    Return False
                End Try
            Else
                Return False
            End If
        End Function

    Hello SaulMTZ,
    >>I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
    This error usually shows that you do not initialize the
    DeleteCommand object, you could check this
    article to see if you get a workaround.
    >> Im not sure if i am making this overcomplicated or if there is a easier way to program this.
    If you are working CSV file, you could use OleDB to read it which would treat the CSV file as a Table:
    http://www.codeproject.com/Articles/27802/Using-OleDb-to-Import-Text-Files-tab-CSV-custom
    which seems to be easier (in my opinion).
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Filling a tree with the result of calls to a document/wrapped soap1.1 webservice

    Hi,
    I'm having trouble with filling a tree with the result to
    calls to a document/wrapped soap 1.1 webservice.
    I first declared the webservice in the mxml file as it was in
    the examples and tried to call it with no luck. The fault was it
    wasn't finding the document type for the call's unique parameter. I
    figured out the solution to this, I added a method in the
    webservice declaration having a single element named the same as
    the required parameter, and inside it, the "actual" parameters,
    bound to variables defined elsewhere.
    The reason for wanting the tree to be filled programatically,
    is the potential whole contents of the tree can be about 1.000.000
    nodes. Huge.
    quote:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" applicationComplete="initM()">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.controls.treeClasses.TreeListData;
    [Bindable] public var aParentId:String = null;
    [Bindable] public var aLevel:Number = 0;
    ]]>
    </mx:Script>
    <mx:WebService id="lws" wsdl="
    http://myServer/myContext/myPortURI?WSDL"
    useProxy="false" makeObjectsBindable="true">
    <mx:operation name="getNodes" resultFormat="object">
    <mx:request>
    <getNodesElement>
    <parentId>{aParentId}</parentId>
    <level>{aLevel}</level>
    </getNodesElement>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    <mx:Tree x="0" y="0" width="326" height="100%"
    id="layoutTree" enabled="true" labelField="nodeName">
    <mx:dataProvider>{lws.getNodes.lastResult}</mx:dataProvider>
    </mx:Tree>
    <mx:Script>
    <![CDATA[
    public function initM():void {
    lws.getNodes.send();
    return;
    ]]>
    </mx:Script>
    </mx:Application>
    So, here's the problem:
    1.- In both Java2 and .NET, I've been able to produce sets of
    proxy classes from the webservice wsdl, these include a proxy class
    for the service port and a set of classes for both the call
    parameter types and the call result types. I have not found yet a
    way to do the same with flex2, so I wonder, can I produce the
    required classes for dealing with such a webservice in an automatic
    way with flex2?
    2.- The second problem, is I haven't found a way to make a
    webservice call in sychronous mode, and I can't seem to find a way
    to set the parameters for the subsequent calls to the webservice.
    Is there a way to make a call to such webservice programatically? I
    mean, I've been able to make the first call I need programatically,
    but what if I end up making 2 or more simultaneous calls? I can't
    rely on setting the `variables defined elsewhere` before each call,
    because of possible concurrency issues (calls will be long after
    the 2nd level of the tree), so I wonder if there's a way to make a
    call to such webservice (document/wrapped, soap1.1) passing it the
    parameters programatically. If so, can I just put the parameters or
    do I have to produce the complete enclosure? If I have to produce
    also the enclosure, any hint on how to do so? I will need to pass
    different parentId, level pairs probably triggered by tree events.
    3.- the other problem, finally, is Tree looks quite different
    to me than the Java2 one. In java2, I can easily produce a changing
    model for the tree wich will even handle the calls to the
    webservice as needed (triggered by the tree itself), making it a
    `live model`. If there is a way to produce the same behaviour in
    flex2, I haven't found it yet. Sure, I've only downloaded the trial
    version yesterday, so I may have overlooked some docs or blogs.
    Any hints would be appreciated, specially on programatically
    modifying the tree, and making calls to the webservice changing the
    parameters every time.

    I would re-post to the Flex Data Services forum.

  • [Help Wanted] soap1.1 webservice, filling a tree with the result of calls...

    Hi,
    I'm having trouble with filling a tree with the result to
    calls to a document/wrapped soap 1.1 webservice.
    I first declared the webservice in the mxml file as it was in
    the examples and tried to call it with no luck. The fault was it
    wasn't finding the document type for the call's unique parameter. I
    figured out the solution to this, I added a method in the
    webservice declaration having a single element named the same as
    the required parameter, and inside it, the "actual" parameters,
    bound to variables defined elsewhere.
    The reason for wanting the tree to be filled programatically,
    is the potential whole contents of the tree can be about 1.000.000
    nodes. Huge.
    quote:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" applicationComplete="initM()">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.controls.treeClasses.TreeListData;
    [Bindable] public var aParentId:String = null;
    [Bindable] public var aLevel:Number = 0;
    ]]>
    </mx:Script>
    <mx:WebService id="lws" wsdl="
    http://myServer/myContext/myPortURI?WSDL"
    useProxy="false" makeObjectsBindable="true">
    <mx:operation name="getNodes" resultFormat="object">
    <mx:request>
    <getNodesElement>
    <parentId>{aParentId}</parentId>
    <level>{aLevel}</level>
    </getNodesElement>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    <mx:Tree x="0" y="0" width="326" height="100%"
    id="layoutTree" enabled="true" labelField="nodeName">
    <mx:dataProvider>{lws.getNodes.lastResult}</mx:dataProvider>
    </mx:Tree>
    <mx:Script>
    <![CDATA[
    public function initM():void {
    lws.getNodes.send();
    return;
    ]]>
    </mx:Script>
    </mx:Application>
    So, here's the problem:
    1.- In both Java2 and .NET, I've been able to produce sets of
    proxy classes from the webservice wsdl, these include a proxy class
    for the service port and a set of classes for both the call
    parameter types and the call result types. I have not found yet a
    way to do the same with flex2, so I wonder, can I produce the
    required classes for dealing with such a webservice in an automatic
    way with flex2?
    2.- The second problem, is I haven't found a way to make a
    webservice call in sychronous mode, and I can't seem to find a way
    to set the parameters for the subsequent calls to the webservice.
    Is there a way to make a call to such webservice programatically? I
    mean, I've been able to make the first call I need programatically,
    but what if I end up making 2 or more simultaneous calls? I can't
    rely on setting the `variables defined elsewhere` before each call,
    because of possible concurrency issues (calls will be long after
    the 2nd level of the tree), so I wonder if there's a way to make a
    call to such webservice (document/wrapped, soap1.1) passing it the
    parameters programatically. If so, can I just put the parameters or
    do I have to produce the complete enclosure? If I have to produce
    also the enclosure, any hint on how to do so? I will need to pass
    different parentId, level pairs probably triggered by tree events.
    3.- the other problem, finally, is Tree looks quite different
    to me than the Java2 one. In java2, I can easily produce a changing
    model for the tree wich will even handle the calls to the
    webservice as needed (triggered by the tree itself), making it a
    `live model`. If there is a way to produce the same behaviour in
    flex2, I haven't found it yet. Sure, I've only downloaded the trial
    version yesterday, so I may have overlooked some docs or blogs.
    Any hints would be appreciated, specially on programatically
    modifying the tree, and making calls to the webservice changing the
    parameters every time.

    1. Not yet, but we're looking into supporting this in an
    upcomming release.
    2. All RPC requests must be made asynchronously... this is a
    restriction of the way the Flash Player makes network requests
    (otherwise movies, which are single threaded, would hang waiting
    for results). You should be able to use the ActionScript API to
    programmatically call web services with normal parameters.
    3. If you leave makeObjectsBindable="true" (which it is by
    default) the Objects and Arrays will be wrapped in ObjectProxies
    and ArrayCollections automatically and will report change events,
    however I don't believe that we have an example that links these
    change events up to subsequent web service calls, but it would be
    possible (but not automatic). A feature that does do this sort of
    thing automatically is the Data Service, although this does not use
    WSDL/SOAP to describe/communicate with remote services and you have
    to setup a Java assembler to work with our adapters on the
    server.

  • I have been working on a book and have 418 photos already in my book.  All of a sudden I cannot access the book format to see the multiple view, spread view, or single view.  I can no longer see my book although I still see the collection with 418 photos

    I have been working on a book and have 418 photos already in my book.  All of a sudden I cannot access the book module and clicking on the multiple view, spread view, or single view does not take me back to the book I have been working on.  I can no longer see my book although I still see the collection with 418 photos under collections.  What I do see is a blank template for a new book and I can't find the unfinished book I started with 418 photos.  It is like the new empty template is somehow covering it up.  How do I get back to the book I have been working on?

    Is it possible you mistakenly clicked on a [Clear Layout] button?
    But a great hint is- Always click on the [Create a Saved Book] button, early in your new book design.
    Then you have a permanent link to the book in the Collections panel. (In addition to the standard collection of your selected images)
    Note: a Book Collection shows an icon that looks like a book.
    Every time you come back to edit the book, open the Book Module by clicking on the white arrow that appears on the end of your Book Collection title. (The title as saved)
    Re-opening a book without using the "Saved Book" option can have unpredictable results.
    A "Book" Collection is like a "Smart Collection" because anything you do to the book design, change pages, change images, etc,  is automatically updated in the Saved Book collection.

  • When I publish a pdf collection with index to a CD, the index won't load

    I am using acrobat XI pro. I have a pdf collection with 30 chapters, a table of contents that is linked to each chapter, and an index. I have inserted a bookmark for the table of contents in each chatper. There are lots of cross chapter links. It all works beautifully on my computer, I can click links between chapters, go back to table of contents using bookmark on each document, and conduct a search that uses the right index and breaks results down per chapter. But when I burn the folder to a CD and install on another computer, the index won't load and the table of contents link is broken. the index is there on the CD, every file and the file structure looks identical to what is on my computer hard drive. I have tried different methods of burning the disc. They all say they are successfully burned. But when I insert into another computer (have tried a laptop and desktop), I either get an error message about the index or it just create it at all. I deleted the index and all of its associated files and recreated from scratch, associating each of the 30 chapter to the index again, but still does not work. Help, past deadline already!

    I fail to see the issue. You have added crop marks, have you not? For all intents and purposes those are marks that are supposed to be visible and printable for cutting in the real world. If you don't want them, don't use them. Acrobat can generate them on the fly for printing, anyway.
    Mylenium

  • Group by Lookup function result

    I have a report that uses two datasets.
    The first one looks like this. It's the time members have recorded under a particular job title:
    ParentId TaskName ObjectiveId MemberId JobTitle TimeSpent Status
    3174ED19 TEST 3 42AA79F6 23179C0F NULL 0.00 01
    3174ED19 TEST 3 42AA79F6 596CA495 JobTitle1 9.00 01
    3174ED19 TEST 1 AEE18C46 23179C0F NULL 0.00 01
    3174ED19 TEST 1 AEE18C46 596CA495 JobTitle2 3.00 01
    3174ED19 TEST 2 AEE18C46 23179C0F NULL 0.00 01
    3174ED19 TEST 2 AEE18C46 596CA495 6.00 01
    I need to show the records which have JobTitle == null with a particular Job Title, the current one they have in Active Directory. So I use another dataset from a WCF service:
    MemberId Name JobTitle
    23179C0F Member1 JobTitle1
    Then I use a lookup function to show the correct Job Title:
    =IIF(IsNothing(Fields!JobTitle.Value) OR Fields!JobTitle.Value = "",lookup(Fields!MemberId.Value,Fields!MemberId.Value,Fields!JobTitle.Value,"Members"),Fields!JobTitle.Value)
    This works ok. The problem is that I need the data to be grouped by several fields, including the Job Title. It seems grouping happens before the lookup function is executed, so instead of grouping the NULL values along with the fields that contains the actual
    values, I end up with two groups with the same Job Title, one containing the null values and another with the actual values.
    Is there any workaround for this?
    Thanks.

    Hi EXR88,
    Per my understanding that you have add some row group in the report to group the result which include the JobTitle from the table1 and also group by the field which result comes from the lookup funtion, now the issue is the group by the Lookup function result
    isn't correct, right?
    I have tested on my local envoronment and can't reproduce the issue, please find the details information below to make sure you have done the correct setting:
    I tried to create the two tables like below:
    Table1:
     Have the same recores as you provided above.
    Table2:
    MemberId    Name      JobTitle
    23179C0F   Member1    JobTitle1
    596CA495   Member1      NULL
    After adding the LookUP function, i got the report like below:
    I add two row group base on the JobTitle(JobTitle) and the Lookup functiuon result(Lookupfunctiongroup), the Lookupfunctiongroup row group is the child group of the JobTitle like below, please make sure you have add the expression with the lookupfunction
    in the group on:
    If i have some misunderstanding, please try to provide the expectted group by  result you want to get and also the currectly result you have got.
    Any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Apex report result doesn't agree with the result of sql developer

    Hello guys,
    at the moment I try to create a standard report which takes his content from several spreadsheets. Because of some problems with the searchbar I'm not able to use an interactive report. The sql query contains a function, which sets some space characters into the content of a column. But there is a big problem. When I call my sql query in apex from the spreadsheets the result doesn't agree with the result which affords the sql developer.
    I know that the sql developer affords the right result.
    best regards
    wderr
    Edited by: user9072567 on 07.02.2010 12:57

    thats the query:
    select "TWORKITEM"."WORKITEMKEY",
    "TWORKITEM"."PROJCATKEY",
    "TPROJECT"."LABEL",
    "TWORKITEM"."PACKAGESYNOPSYS",
    replace(replace("TWORKITEM"."PACKAGEDESCRIPTION", chr(10), '<br>'),'<td></td>','&lt;td&gt;&lt;/td&gt;') packagedesc,
    suche_ohne_ti_be("TWORKITEM"."WORKITEMKEY") "CHANGEDESCRIPTION"
    from "TWORKITEM" "TWORKITEM", "TPROJECT" "TPROJECT", "TPROJCAT" "TPROJCAT"
    where "TWORKITEM"."PROJCATKEY" = "TPROJCAT"."PKEY"
    and "TPROJCAT"."PROJKEY" = "TPROJECT"."PKEY"
    and (instr(upper("TWORKITEM"."WORKITEMKEY"), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."WORKITEMKEY"))) > 0
    or instr(upper("TPROJECT"."LABEL"), upper(nvl(:P10_SEARCHTEXT, "TPROJECT"."LABEL"))) > 0
    or instr(upper("TWORKITEM"."PACKAGESYNOPSYS"), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."PACKAGESYNOPSYS"))) > 0
    or instr(upper("TWORKITEM"."PACKAGEDESCRIPTION"), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."PACKAGEDESCRIPTION"))) > 0
    or instr(upper(suche_ohne_ti_be("TWORKITEM"."WORKITEMKEY")), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."WORKITEMKEY")))>0
    I mean with spreadsheets some tables/charts. And I take those informations from 3 of them.
    regards
    wderr

  • App-V PowerShell: Script to Query XenApp Servers for App-V Publishing Errors and Output an Excel Document with the Results

    Please Vote if you find this to be helpful!
    App-V PowerShell:  Script to Query XenApp Servers for App-V Publishing Errors and Output an Excel Document with the Results
    Just posted this to the wiki:
    http://social.technet.microsoft.com/wiki/contents/articles/25323.app-v-powershell-script-to-query-xenapp-servers-for-app-v-publishing-errors-and-output-an-excel-document-with-the-results.aspx

    Hi petro_jemes,
    Just a little claritification, you need to add the value to the variable "[string]$ou", and also change the language in the variable "$emailbody" in the function "Get-ADUserPasswordExpirationDate".
    I hope this helps.

  • Function result Cache in oracle 11G

    Hi,
    i am reading the following article and trying to reproduce same set of statements to learn about function result cache.
    http://www.oracle.com/technology/oramag/oracle/07-sep/o57asktom.html
    Details about my output:
    SQL> create or replace
    function not_cached
    ( p_owner in varchar2 )
    return number
    as
    l_cnt number;
    begin
    select count(*)
    into l_cnt
    from t
    where owner = p_owner;
    sys.dbms_lock.sleep(1);
    return l_cnt;
    end;
    Function created.
    Elapsed: 00:00:00.13
    SQL> create or replace
    function cached
    ( p_owner in varchar2 )
    return number
    result_cache
    relies_on(T)
    as
    l_cnt number;
    begin
    select count(*)
    into l_cnt
    from t
    where owner = p_owner;
    dbms_lock.sleep(1);
    return l_cnt;
    end;
    Function created.
    Elapsed: 00:00:00.08
    SQL> exec dbms_output.put_line( not_cached( 'SCOTT' ) );
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.06
    SQL> exec dbms_output.put_line( not_cached( 'SCOTT' ) );
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.01
    SQL> SQL> exec dbms_output.put_line( not_cached( 'SCOTT' ) );
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.02
    SQL> SQL> set serveroutput on
    SQL> exec dbms_output.put_line( not_cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.02
    SQL> SQL> exec dbms_output.put_line( cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.02
    SQL> SQL> exec dbms_output.put_line( cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.02
    SQL> SQL> exec dbms_output.put_line( cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    SQL> exec dbms_output.put_line( cached( 'SCOTT' ) );
    0
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.01
    I am supposed to get the results quickly for "cached" call. However, i still dont see any change in the response time. May i know what i am missing here?
    Thank you
    Giridhar

    Try to play with
    RESULT_CACHE_MAX_SIZE
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/initparams206.htm#REFRN10272
    RESULT_CACHE_MAX_RESULT
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/initparams205.htm#REFRN10298

  • Refering alias of a function result in an sql statement

    Dear Sir,
    How to refer an alias of a function result in sql statement?
    eg.(new_name is the alias)
    select myfunction(name) new_name
    from mytable
    where new_name = '#vincent#';
    I can't refer new_name in the above statement coz it gives an error "invalid column name".
    But I don't want to put the myfunction(name) again in the where clause which will double the job. So, how should I refer to it?
    Please advise.
    Thanks.
    null

    You can not refer to the alias like you are talking. You will have to use myfunction(name) as you have said. Or you can try creating a view with query:
    select myfunction(name) new_name
    from mytable
    and then refer to "new_name".
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by guest2000:
    Dear Sir,
    How to refer an alias of a function result in sql statement?
    eg.(new_name is the alias)
    select myfunction(name) new_name
    from mytable
    where new_name = '#vincent#';
    I can't refer new_name in the above statement coz it gives an error "invalid column name".
    But I don't want to put the myfunction(name) again in the where clause which will double the job. So, how should I refer to it?
    Please advise.
    Thanks.<HR></BLOCKQUOTE>
    null

  • Using ASSOCIATED on a function result

    I'm having trouble using the ASSOCIATED intrinsic with the result of a function. It appears to work in Studio 12 but in 12.2 I get a segfault. The problem happens when the result of a function is set to null. It appears that the function result pointer somehow becomes undefined (but I'm not sure). For example the following sample program gives a segfault in Studio 12.2:
    double precision, pointer :: input=>null()
    if (associated(getY(input)) then
    print*, "associated"
    else
    print*, "not associated"
    endif
    contains
    function getY (y) result (yResult)
    double precision, pointer :: y
    double precision, pointer :: yResult
    yResult => null()
    if (associated(y)) then
    yResult=>y
    endif
    end function getY
    If however if first associate a new local variable with the function result (x=>getY(input)) I don't get a segfault when calling associated(x). Any ideas on why this happens or if I'm doing something wrong?

    I apologize for taking so long to respond.
    After modifying your code slightly so that it would compile, I was able to reproduce the problem using the Oracle Solaris Studio 12.2 release. When I compile the program with the beta compiler for release 12.3, it works correctly. The output is
    not associated
    I hope the problem has been resolved.
    Robert Corbett

Maybe you are looking for

  • Safari will not open a browsing window

    I have a G4 tower running 10.3 and Safari 1.3.2 Each time I open Safari, it loads fine, but I get no browsing window. The menus work, I can quit, organize bookmarks and so on. But, I cannot get a window, File > New window, or Apple N, neither will gi

  • Is there a way to protect the download list and/or history so they can't be cleared/deleted?

    I use the same computer as the rest of my family. Although I am ostensibly the administrator I use the family logon for normal use. I ask the rest of my family to not clear the download list because I like to keep track of what's been downloaded in c

  • DOM xml file, reading

    I have an XML file I am parsing, or trying to parse. I can get the Document object but how do you traverse the elements?? It seems simple but the Node methods are somewhat vague in what they return, per the Javadoc. I've tried trial and error to much

  • I've updated my iphone 5 and have lost all contacts' where can i find them?

    i/ve lost contacts after updating to ios6' what can i do?

  • Some problem using in this function!!!

    Is it valid to write a function like this?? CREATE OR REPLACE FUNCTION dept_dtls(DEPT_ID IN VARCHAR2) RETURN record is DEPT EMPLOYEE.DEPT_ID%TYPE; STATUS RECORD; BEGIN Select COUNT(DESIGNATION), into STATUS from EMPLOYEE where DEPT=DEPT_ID GROUP BY D