Min aggregate function returns empty string

I have a data set with a column named "month" which contains string values like 1,2,3... etc. including empty string. When I apply an aggregate Min function like below, it returns empty string instead of 1. or the lowest month number.
Min(Fields!month.Value, "Financial")
Please if any one can assist me on this.
Regards

Hi ABDUL-HAFEEZ,
As you know the Min() function returns the minimum value of all non-null numeric values specified by the expression, because you have null string in the field and also the field type is string but not numeric, so this function will not works fine.
I have tested on my local environment that we can get the first convert the string to numeric type value and then get the min value of the month field by using the query not the expression.
Details information below for your reference:
Create an new dataset(DataSet2) to get the minimum value from the Month and the query like below:
SELECT     Min(CAST(Month AS INT)) as NewMonth
FROM         TableName
Using below expression in the main dataset will display the minimum value of the month:
=Sum(Fields!NewMonth.Value, "DataSet2")
If you still have any problem, please feel free to ask.
Regards
Vicky Liu
If you have any feedback on our support, please click
here.
Vicky Liu
TechNet Community Support

Similar Messages

  • WINE err:"wine cmd.exe /c echo '%ProgramFiles%' returned empty string"

    So as the tittle states WINE is throiwng this error:
    wine cmd.exe /c echo '%ProgramFiles%' returned empty string
    As for what might have caused it? probably the last system update which was performed a few days ago, my old prefix works fine but I have a habit of creating new prefixes for troublesome applications, or applications I am unsure of whether they will cause trouble or not.
    Hence I created a new prefix using:
    export WINEARCH=win32
    export WINEPREFIX=~/.problematic
    winecfg
    As for how wine is run, it's run as a normal, unprivileged, user.
    Oh and I also tried generating yet another prefix like this:
    $ WINEARCH=win32 WINEPREFIX=~/.problematic-new winetricks steam
    Executing w_do_call steam
    wine cmd.exe /c echo '%ProgramFiles%' returned empty string
    Didn't work either.
    I'm at loss, any suggestion on how to fix it?
    Last edited by CubeGod (2014-06-29 15:48:05)

    $ WINEARCH=win32 WINEPREFIX=~/testprefix notepad.exe
    bash: notepad.exe: command not found
    So obviously I need to correct the command
    $ WINEARCH=win32 WINEPREFIX=~/testprefix wine notepad.exe
    wine: created the configuration directory '/home/shiina/testprefix'
    err:module:load_builtin_dll failed to load .so lib for builtin L"winemp3.acm": libmpg123.so.0: cannot open shared object file: No such file or directory
    fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    err:mscoree:LoadLibraryShim error reading registry key for installroot
    fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
    fixme:iphlpapi:NotifyAddrChange (Handle 0xece880, overlapped 0xece88c): stub
    wine: configuration in '/home/shiina/testprefix' has been updated.
    Wine cannot find the ncurses library (libncursesw.so.5).
    why is ncurses a dependency anyway? besides, wicd-curses works so this shouldn't be the case.
    Anyway, trying winetricks in the same prefix
    $ WINEARCH=win32 WINEPREFIX=~/testprefix winetricks steam
    Executing w_do_call steam
    wine cmd.exe /c echo '%ProgramFiles%' returned empty string
    Anyway, I expected notepad to work since it resides in %WINDOWS% not %ProgramFiles%
    Is there any registry key I can set for this? all my google searching says this can cause with a mismatch of wine versions but why would that happen?
    Either way checking wine --version outputs wine-1.7.20 which is the same as it was pre-update (when it still worked).

  • LicenseServer property in Company object alway return empty string

    Hi everyone,
    When I use Company object and LicenseServer property to get LicenseServer, both in SBO 2004 & SBO 2005 all return empty string, who can help me get the correct LicenseServer name.
    Thanks in advance.
    Kathy

    Jose Xabier,
    Thanks for your reply, actually I need the License server name, but in SLIC table it saves Local hotost and port number some times like below:
    [localhost:30000]
    who knows how to get the name instead of Localhost,
    why licenseserver return empty sting? doI need set other property to get license server name for company object?
    Thanks,
    Kathy

  • Cfexchangemail fromID returns empty string

    I'm trying to create a "Reply with Template" bit of code and since Outlook 2007 doesn't have this capability, I thought I'd try the cfexchange tags to view the mail, pick a reponse and cfmail to send.
    We're using SBS 2008 & CF8 with all hotfixes
    I have the following basic code
    <cfexchangemail action="get"  name="weeksmail" connection="myconn" />
    <cfdump var="#weeksmail#">
    This returns email correctly (can read the messages) but in something like 1/2 of the messages the Fromid reads [empty string]The other half is populated correctly.
    If I can't get the fromID I can't populate the TO: in cfmail so I can't do what I'm trying to do.
    I can't see anything in the email themselves that would account for this. Any Ideas?

    Can you please post your query / stored procedure you are using? Very possible reason includes one among your substring (within the concat) is null and making the final output to be null. Size, esp 800 shouldn't matter.

  • Php form field inserts return empty string

    hello -
    i've created a form that has multiple inserts. it inserts the data fine if i manually parse the data to it but when i use the form to test the inserts it errors out.
    i've used echo $_post variable and the variable is their. but its not being inserted into the database.
    it says that the string cannot be null?
    where do i go from here for debugging?
    thanks, in advance for your help!
    theo werntz ii

    I've tried entering data but it doesn't insert i've change the column type to longblob from varchar and it still doesnt insert.
    here is my code: ignore the numbers and line ending with $
      1 <?php require_once('Connections/upics.php'); ?>$
      2 <?php$
      3 if (!function_exists("GetSQLValueString")) {$
      4 function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") $
      5 {$
      6   if (PHP_VERSION < 6) {$
      7     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;$
      8   }$
      9 $
    10   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);$
    11 $
    12   switch ($theType) {$
    13     case "text":$
    14       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";$
    15       break;    $
    16     case "long":$
    17     case "int":$
    18       $theValue = ($theValue != "") ? intval($theValue) : "NULL";$
    19       break;$
    20     case "double":$
    21       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";$
    22       break;$
    23     case "date":$
    24       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";$
    25       break;$
    26     case "defined":$
    27       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;$
    28       break;$
    29   }$
    30   return $theValue;$
    31 }$
    32 }$
    33 $
    34 $
    35 $uname="guest";$
    36 $uname_id = '1' ;$
    37 $pt="pictures";$
    38 $picPath="pt/img_0.gif"; $
    39 $picSize="1024";$
    40 $
    41 $editFormAction = $_SERVER['PHP_SELF'];$
    42 if (isset($_SERVER['QUERY_STRING'])) {$
    43   $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);$
    44 }$
    45 $
    46 if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {$
    47 $
    48 $insertSQL_0 = sprintf("INSERT INTO album (album_id, album_nm, album_dt, album_pt) VALUES ( %s, %s, curdate(), '$pt')",$
    49                        GetSQLValueString($_POST['album_id'], "int"),$
    50                        GetSQLValueString($_POST['album_nm'], "text"),$
    51                        GetSQLValueString($_POST['album_dt'], "date"),$
    52                        GetSQLValueString($_POST['album_pt'], "text"));$
    53 $
    54 $insertSQL_1 = sprintf("insert into album_has_user (album_album_id, user_user_id, user_admin_id) values (last_insert_id(), '$uname_id', '$uname_id')",$
    55 GetSQLValueString($_POST['album_has_user'], "int"),$
    56 GetSQLValueString($_POST['user_user_id'], "int"),$
    57 GetSQLValueString($_POST['user_admin_id'], "int"),$
    58 $
    59 $insertSQL_2 = sprintf("insert into title (title_id, title_title, title_dt, album_album_id, title_memo) values (last_insert_id(), %s, curdate(), last_ins    ert_id(), %s)",$
    60 GetSQLValueString($_POST['title_id'], "int"),$
    61 GetSQLValueString($_POST['title_title'], "text"),$
    62 GetSQLValueString($_POST['title_dt'], "date"),$
    63 GetSQLValueString($_POST['album_album_id'], "int"),$
    64 GetSQLValueString($_POST['title_memo'], "text"));$
    65 $
    66 $
    67 $insertSQL_3 = sprintf("insert into picture (picture_id, picture_dp, picture_sz, picture_df, title_title_id) values  (last_insert_id(), '$picPath', '$pic    Size', 'N', last_insert_id())", $
    68 GetSQLValueString($_POST['picture_id'], "int"),$
    69 GetSQLValueString($_POST['picture_dp'], "text"),$
    70 GetSQLValueString($_POST['picture_sz'], "text"),$
    71 GetSQLValueString($_POST['picture_df'], "text"),$
    72 GetSQLValueString($_POST['title_title_id'], "int"));$
    73 $
    74 echo $_POST['title_title'];
    75 $
    76 //insert users album if null$
    77   mysql_select_db($database_upics, $upics);$
    78   $Result1 = mysql_query($insertSQL_0, $upics) or die(mysql_error());$
    79 $
    80 //insert users many data$
    81   mysql_select_db($database_upics, $upics);$
    82   $Result2 = mysql_query($insertSQL_1, $upics) or die(mysql_error());$
    83   $
    84 //insert users title and comments  $
    85   mysql_select_db($database_upics, $upics);$
    86   $Result3 = mysql_query($insertSQL_2, $upics) or die(mysql_error());$
    87   $
    88 //insert users picuter path$
    89   mysql_select_db($database_upics, $upics);$
    90   $Result4 = mysql_query($insertSQL_3, $upics) or die(mysql_error());  $
    91 $
    92   $insertGoTo = "picture_edit.php";$
    93   if (isset($_SERVER['QUERY_STRING'])) {$
    94     $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";$
    95     $insertGoTo .= $_SERVER['QUERY_STRING'];$
    96   }$
    97   header(sprintf("Location: %s", $insertGoTo));$
    98 }$
    99 ?>$
    100 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">$
    101 <html xmlns="http://www.w3.org/1999/xhtml">$
    102 <head>$
    103 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />$
    104 <title>Untitled Document</title>$
    105 </head>$
    106 $
    107 <body>$
    108 <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">$
    109   <table align="center">$
    110     <tr valign="baseline">$
    111       <td nowrap="nowrap" align="right">Album Name:</td>$
    112       <td><input type="text" name="album_nm"  id="album_nm" value="default" size="32" /></td>$
    113     </tr>$
    114     <tr valign="baseline">$
    115     <td nowrap="nowrap" align="center">Title:</td>$
    116     <td><input name="title_title" id="title_title" type="text" value="" size="32" /></td>$
    117     </tr>$
    118     <tr valign="baseline">$
    119     <td nowrap="nowrap" align="center">Date:</td>$
    120     <td><input name="title_dt" id="title_dt" type="text" value="" size="32" /></td>$
    121     </tr>$
    122     <tr valign="baseline">$
    123     <td nowrap="nowrap" align="center">Comments:</td>$
    124     <td><textarea name="title_memo" cols="32" id="title_memo"></textarea></td>$
    125     </tr>$
    126     <tr valign="baseline">$
    127       <td nowrap="nowrap" align="right"> </td>$
    128       <td><input type="submit" value="Insert record" /></td>$
    129     </tr>$
    130   </table>$
    131   <input type="hidden" name="album_id" value="" />$
    132   <input type="hidden" name="album_dt" value="" />$
    133   <input type="hidden" name="album_pt" value="" />$
    134   <input type="hidden" name="MM_insert" value="form1" />$
    135 </form>$
    136 <p> </p>$
    137 </body>$
    138 </html>$
    this is echo:    this is the error:
    default           Column 'title' cannot be null
    thanks in advance for you help

  • PL/SQL function returning a SQL Query

    Is this only availabe in HTML db or in 10g in general? Where do I find more about this feature?
    Thanks in advance,
    Denes

    Not sure what you mean. HTML DB allows to use a PL/SQL function returning a valid SQL query in report regions.
    Its just a PL/SQL function returning a string, outside of HTML DB, I guess you can use it wherever it makes sense.

  • Analytic function and aggregate function

    What are analytic function and aggregate function. What is difference between them?

    hi,
    Analytic Functions :----------
    Analytic functions compute an aggregate value based on a group of rows. They differ from aggregate functions in that they return multiple rows for each group. The group of rows is called a window and is defined by the analytic_clause. For each row, a sliding window of rows is defined. The window determines the range of rows used to perform the calculations for the current row. Window sizes can be based on either a physical number of rows or a logical interval such as time.
    Analytic functions are the last set of operations performed in a query except for the final ORDER BY clause. All joins and all WHERE, GROUP BY, and HAVING clauses are completed before the analytic functions are processed. Therefore, analytic functions can appear only in the select list or ORDER BY clause.
    Analytic functions are commonly used to compute cumulative, moving, centered, and reporting aggregates.
    Aggregate Functions :----------
    Aggregate functions return a single result row based on groups of rows, rather than on single rows. Aggregate functions can appear in select lists and in ORDER BY and HAVING clauses. They are commonly used with the GROUP BY clause in a SELECT statement, where Oracle Database divides the rows of a queried table or view into groups. In a query containing a GROUP BY clause, the elements of the select list can be aggregate functions, GROUP BY expressions, constants, or expressions involving one of these. Oracle applies the aggregate functions to each group of rows and returns a single result row for each group.
    If you omit the GROUP BY clause, then Oracle applies aggregate functions in the select list to all the rows in the queried table or view. You use aggregate functions in the HAVING clause to eliminate groups from the output based on the results of the aggregate functions, rather than on the values of the individual rows of the queried table or view.
    let me know if you are feeling any problem in understanding.
    thanks.
    Edited by: varun4dba on Jan 27, 2011 3:32 PM

  • SQLTables return empty

    Hi, all,
    I used to ues Microsoft ODBC driver for Oracle, my application works fine. Now, I switch to Oracle Driver for Oracle. My application does not work.
    It is becuase the "SQLTables" function returns empty recordset when I tried to look up tables. I am sure the table is there. Can anyone give me any clue? When I connect to the database, do I need special privilege?
    Thanks.
    Jing GUO

    Hi, there,
    When I connect to the database through ODBC, I use user "afm", and I am looking for a table named "bl" which belongs to schema "afm".
    the parameters are:
    cataloge name: ""
    schema name: ""
    table name "bl"
    tableType: ""
    And I also tried schema name: "AFM".
    Any clue? thanks
    Jing

  • Select text from all_views returns an empty string

    My application allows the user to select between the Data Provider for ODBC and the Data Provider for Oracle. (ODP)
    When using the ODBC provider the statement:
    Select text from all_views where view_name='MYVIEW'
    returns the expected string.
    If I connect via ODP however it returns an empty string.
    (If I use 'Select *' it tells me the text_length is 154 in this specific case - so there is definately text available.)
    I'm thinking it has something to do with the fact that the data type is LONG.
    In both cases I retreive the data using rdr.GetChars(), which should work.
    If I use the dbms_metadata.get_ddl function instead, it does return the string (Probably because the return type is not LONG)
    Unfortunately that function only works for Views in the current schema, while the original Select works for any view.
    (And I dont know what version of Oracle this function was added in - I have to support older versions too.)
    Similarly, if I use one of the XML functions to retreive the text as XML it works fine.
    (Again it is probably returned as a VARCHAR2 instead of a LONG.)
    The strange thing is that when I created my own table containing a LONG column I was able to load and retreive data without any problems.
    The problem appears to be specific to this column in all_views.
    Anyone know a solution to this?
    Thanks
    Mike

    Thanks that was it.
    I had not seen those properties since I am working with the 'generic' objects (DbCommand rather than OracleCommand, etc.)
    What is strange is that I was able to retreive data from my own LONG column WITHOUT setting this value to -1.
    (It defaulted to 0 in both cases.)
    The only difference was that when I retreived data from my own column I specified CommandBehaviour.SequentialAccess.
    When I retreived the all_views.text column I did not specify a behaviour at all.
    However the Oracle docs said that SequentialAccess is not supported ... so I guess that is not correct.
    (Maybe it doesn't 'work', but it certainly seems to cause things to work differently)
    Thanks
    Mike

  • Plsql - store function - passing a NULL or empty string argument

    Please see the question I posed below. Does anyone have experience with passing a NULL or empty string to a store function? THANKS.
    Hi All,
    I have a function that takes in two string arrays, status_array, and gender_array. You can see the partial code below. Somehow if the value for the string array is null, the code doesn't execute properly. It should return all employees, but instead it returns nothing. Any thoughts? THANKS.
    for iii in 1 .. status_array.count loop
    v_a_list := v_a_list || '''' || status_array(iii) || ''',';
    end loop;
    v_a_list := substr(v_a_list, 1, length(trim(v_a_list)) - 1);
    for iii in 1 .. gender_array.count loop
    v_b_list := v_b_list || '''' || gender_array(iii) || ''',';
    end loop;
    v_b_list := substr(v_b_list, 1, length(trim(v_b_list)) - 1);
    IF v_a_list IS NOT NULL and v_b_list IS NOT NULL THEN
    v_sql_stmt := 'select distinct full_name from t_employee where status in (' || v_a_list || ') and gender in (' || v_b_list || ')';
    ELSIF v_a_list IS NOT NULL and v_b_list IS NULL THEN
    v_sql_stmt := 'select distinct full_name from t_employee where status in (' || v_a_list || ') ';
    ELSIF v_a_list IS NULL and v_b_list is not null THEN
    v_sql_stmt := 'select distinct full_name from t_employee where gender in (' || v_b_list || ')';
    ELSE
    v_sql_stmt := 'select distinct full_name from t_employee';
    END IF;
    OPEN v_fullname_list FOR v_sql_stmt;
    RETURN v_fullname_list;

    Not sure what version of Oracle you are using, so here's an approach that will work with many releases.
    Create a custom SQL type, so we can use an array in SQL statements (we'll do that at the end).
    create or replace type string_list is table of varchar2(100);
    /declare your A and B lists as the type we've just created
    v_a_list    string_list default string_list();
    v_b_list    string_list default string_list();populate the nested tables with non-null values
    for iii in 1 .. status_array.count
    loop
       if status_array(iii) is not null
       then
          v_a_list.extend;
          v_a_list(v_a_list.count) := status_array(iii);
       end if;
    end loop;Here you'd want to do the same for B list.
    Then finally, return the result. Using ONE single SQL statement will help a lot if this routine is called frequently, the way you had it before would require excessive parsing, which is quite expensive in an OLTP environment. Not to mention the possibility of SQL injection. Please, please, please do some reading about BIND variables and SQL injection, they are very key concepts to understand and make use of, here's an article on the topic.
    [http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1922946900346978163]
    So here we ask for the distinct list of full names where either the status and the gender qualify based on the input data, OR the array passed in had no data to restrict the query on (the array.count = 0 does this).
    OPEN v_fullname_list FOR
       select
          distinct
             full_name
       from t_employee
       where
          status in (select /*+ CARDINALITY ( A 5 ) */ column_value from table(v_a_list) A )
          or v_a_list.count = 0
       and
          gender in (select /*+ CARDINALITY ( B 5 ) */ column_value from table(v_b_list) B )
          or v_b_list.count = 0
       );Hope that helps.
    Forgot to mention the CARDINALITY hint i added in. Oracle will have no idea how many rows these arrays (which we will treat as tables) will have, so this hint tells Oracle that you expect X (5 in this case) rows. Adjust it as you need, or remove it. If you are passing in thousands of possible values, where i've assumed you will pass in only a few, you may want to reconsider using the array approach and go for a global temporary table.
    Edited by: Tubby on Dec 11, 2009 11:45 AM
    Edited by: Tubby on Dec 11, 2009 11:48 AM
    Added link about using Bind Variables.

  • Xmltype.getnumberval() Returns "0" when attribute is an empty string.

    Hi,
    At my workplace we have noticed that when retrieving the value of a numeric attribute of an XML element we are getting "0" when the attribute's value is an empty string (see below for an example script).
    We can't find a reference to this in the documentation but I assume this is expected behavior. Has anyone else experienced this and has anyone else used an alternative work around to the following solution that we are using (with the understanding that it is a third party that is sending us the XML so we cannot just do the sensible thing and make sure the XML doesn't contain attributes with no value)?
    Solution we are using:
    variable := to_number(xml.extract('node()/@numeric_attribute').getstringval());
    Example Script:
    SET serverout ON
    DECLARE
      i xmltype;
    BEGIN
      -- Test statements here
      i := xmltype('<element a="" b="1" c="" d="abc" />');
      -- Get Number Values
      dbms_output.put_line('a=[' || i.extract('node()/@a').getnumberval() || ']*');
      dbms_output.put_line('b=[' || i.extract('node()/@b').getnumberval() || ']');
      -- Get String Values
      dbms_output.put_line('c=[' || i.extract('node()/@c').getstringval() || ']');
      dbms_output.put_line('d=[' || i.extract('node()/@d').getstringval() || ']');
      -- Get String then perform to_number()
       dbms_output.put_line('a (using to_number() on getstringval()=[' || to_number(i.extract('node()/@a').getstringval()) || ']');
      dbms_output.put_line('');
      dbms_output.put_line('*Even though value of attribute in element is an empty string, the getnumberval() function converts this to a 0');
    END;
    Thanks.

    We can't find a reference to this in the documentation but I assume this is expected behavior. Has anyone else experienced this and has anyone else used an alternative work around to the following solution that we are using (with the understanding that it is a third party that is sending us the XML so we cannot just do the sensible thing and make sure the XML doesn't contain attributes with no value)?
    Yes, I remember seeing a thread or two about that in the past.
    Your workaround is probably the best you can come up with if you want to stick to this approach.
    Extractvalue() function works too but it is SQL only.
    However, bear in mind that those functions are deprecated in your version.
    Use XMLQuery to extract scalar values or XMLTable to extract multiple values as relational columns.

  • What happens when a OUT parameter of a web-service returns an empty string

    Hi,
    Any idea on how to deal with the situation when a web-service returns an empty string
    I get the following System Exception:-
    Caused by: java.lang.AssertionError: Attempt to set empty javaType to ticketResponse(out,0) :: fuego.type.FuegoClass$LazyRef@6770f2. It must be null or a valid java type.
    It therefore either expects a null value or a valid java type...
    Since it goes into a system exception, the activity is not completed and nothing is inserted into the web-service..
    How do we resolve this error inside of BPM?

    Thanks Ben for your replies.
    Before I attempt changing a VI that was written by a client and make a total mess of it, there's something I'd like to point out.
    I tried the re-entrant VI approach and that didn't go any further than the VIT approach, and probably for the same reason(s).
    The interesting part is that (with the VIT approach) the same VIT is called by another process and it works fine.  It is just for the process that has it appear within 2 sub-panels.  So the issue is related to having either having two instances spawn at once of the same VIT or it is related to the sub-panels.  I think it is the two instances (or copies of the VIT) that causes LV to caugh...
    So you are trying to tell me that the above description is accurate and it is because of the private methods...??...
    How would I "wrap" those private methods into public ones?  The seems to be a piece of this puzzle that I am not yet grasping..
    Thanks for your patience and help.
    RayR

  • Function - Return More than One Value in a Concatenated String

    Hi,
    Is it possible for a function to return a concatenated string(combining more than one number). I am trying to return the PO number by inputting and invoice_id and code number but an invoice_id can have more than one PO with the same code number. I would like to concatenate the PO numbers with commas e.g.
    10124, 10090, 10987
    At the moment the function returns null for these cases that have more than one PO number.
    Thanks

    Also is is possible to create another function that can be called in the same script using the PO number as an IN parameter in SQL. See SQL below:
    select cck.concatenated_segments as "Segment" ,
    cc.code_combination_id,
    NVL ( src . user_je_source_name , '**********' ) AS "Source" ,
    NVL ( cat . user_je_category_name , '**********' ) AS "Category" ,
    jel . period_name as "Period Name" ,
    i.invoice_id as "Invoice ID",
    s.vendor_name as "Vendor Name",
    s.segment1 as "Supplier No",
    jeb . name as "Batch Name" ,
    func_get_po(i.invoice_id, cc.code_combination_id) "PO No",
    jeh . name AS "Header Name" ,
    jel . description AS "Description" ,
    jel.accounted_dr AS "Debit" ,
    jel.accounted_cr AS "Credit" ,
    NVL(jel.accounted_dr, 0) - NVL(jel.accounted_cr, 0) AS "Net Amount"
    FROM apps.gl_code_combinations cc ,
    apps.gl_code_combinations_kfv cck,
    apps.gl_je_lines jel ,
    apps.gl_je_headers jeh ,
    apps.gl_je_batches jeb ,
    apps.gl_je_categories cat ,
    apps.gl_je_sources src,
    apps.gl_import_references r,
    apps.xla_ae_lines al,
    apps.xla_ae_headers ah,
    apps.xla_events e,
    xla.xla_transaction_entities te,
    apps.ap_invoices_all i,
    apps.ap_suppliers s
    WHERE ( cck.concatenated_segments BETWEEN '23.83545.141.000.00.23.000.000' AND '23.83545.141.000.00.23.000.000'
    AND cc.CHART_OF_ACCOUNTS_ID = 50328
    AND jeh.LEDGER_ID IN
    (select acc.ledger_id
    FROM apps.gl_access_set_ledgers acc
    WHERE acc.access_set_id = 1000
    AND jel.code_combination_id = cc.code_combination_id
    AND cck.code_combination_id = cc.code_combination_id
    AND jel.status
    || '' = 'P'
    AND ( jel.accounted_dr != 0
    OR jel.accounted_cr != 0 )
    AND jeh.je_header_id = jel.je_header_id
    AND jeh.actual_flag = 'A'
    AND 1 = 1
    AND jeh.currency_code != 'STAT'
    AND jeb.je_batch_id = jeh.je_batch_id
    AND jeb.average_journal_flag = 'N'
    and src.je_source_name = jeh.je_source
    and cat.je_category_name = jeh.je_category
    and r.je_header_id(+) = jel.je_header_id
    and r.je_line_num(+) = jel.je_line_num)
    AND ( :period_name = jel.period_name
    and al.gl_sl_link_id(+) = r.gl_sl_link_id
    and al.ae_header_id = ah.ae_header_id(+)
    and al.application_id = ah.application_id(+)
    and ah.application_id = e.application_id(+)
    and ah.event_id = e.event_id(+)
    and e.application_id = te.application_id(+)
    and e.entity_id = te.entity_id(+)
    and nvl(te.source_id_int_1,-99) = i.invoice_id(+)
    and i.vendor_id = s.vendor_id(+) )
    AND ( jel.ledger_id = 2041)
    ORDER BY src.user_je_source_name ,
    cat.user_je_category_name ,
    jeb.name ,
    jeh.name ,
    cck.concatenated_segments ,
    jel.je_line_num
    I am using func_get_po(i.invoice_id, cc.code_combination_id), I would like to call another function in this script that uses the PO number as an IN parameter.
    For example func_get_po_requester(i.invoice_id, cc.code_combination_id, func_get_po(i.invoice_id, cc.code_combination_id))
    Would this work?
    Thanks

  • Calling c function that return a string

    Hallo,
    I found an example for calling void c function(http://zone.ni.com/devzone/cda/epd/p/id/1513). I could adapt the example and make the function return an integer. the code of the adapted function would look like this:
     int __declspec(dllexport) multiply(int number) {return number*3; }
    But I have problems when I want to return a string. Does someone knows how I should do. I tried:
     char* __declspec(dllexport) say(int number) {return "hallo"; }  
    but won't compile.

    yes the question was  more a c question then a labview question. I found the solution anyway, the correct code in order to get string is:
    _declspec(dllexport) char* testchar2();_declspec(dllexport) char* testchar2() {      return "hallo"; }

  • Maximum length of query string for functions return a SELECT

    Hi all,
    I have a report that gets it's SELECT statement from a function, instead of being coded into the region. All was well but I suspect now I'm blowing some kind of limit as I'm getting an error :
         ORA-06502: PL/SQL: numeric or value error
         Error      ERR-1101 Unable to process function body returning query.
    However if I run the procedure out of ApEx and grab the SELECT statement then it works fine. The length of the query is 8636 bytes (yup, it's a beauty!).
    Does anyone know if there is a hard limit to the size of the string that can be returned?
    I'm using ApEx 3.1.
    Thanks,
    Steve H

    I do have a similar painfull scenario - Although my query length is very less i.e 618 bytes only.
    I have defined a stored function, which returns an SQL query string, this return SQL string executes fantastic but when I tried to to call this function from a APEX report it gives error. the details are as follows. Please help.......
    The function code:
    CREATE OR REPLACE function PROD."TEST_C_QRY"
    return VARCHAR2
    is
    msql VARCHAR2(32767);
    Begin
    msql:='Select null,statusname,AgeInd, ';
    For m_stat in (select statusname from a02_status)
    loop
    msql:= msql || q'[decode(statusname,']';
    msql:= msql || m_stat.statusname;
    msql:= msql || q'[',count(id),0) ]';
    msql:= msql || m_stat.statusname|| ',';
    end loop;
    msql:=rtrim(msql,',');
    msql:= msql||' from ';
    msql:= msql||'( ';
    msql:= msql||'select a.id, round(sysdate-a.registeredon) TimeSpan,';
    msql:= msql||'case ';
    msql:= msql||q'[when round(sysdate-a.registeredon)<=7 then 'Week' ]';
    msql:= msql||q'[when round(sysdate-a.registeredon)>7 and round(sysdate-a.registeredon)<14 then 'Fortnight' ]';
    msql:= msql||q'[when round(sysdate-a.registeredon)>14 and round(sysdate-a.registeredon)<30 then 'Month' ]';
    msql:= msql||q'[else 'More...'  end ageind,]';
    msql:= msql||'a.status_id,b.statusname ';
    msql:= msql||'from a02_task a,a02_status b ';
    msql:= msql||'where b.id=a.status_id) ';
    msql:= msql||'group by statusname,AgeInd;';
    return msql;
    end TEST_C_QRY;
    The Output SQL comes from this is
    SQL> Select null,statusname,AgeInd, decode(statusname,'Scheduled',count(id),0) Scheduled,decode(statusname,'Executing',count(id),0) Executing,decode(statusname,
    'Completed',count(id),0) Completed from ( select a.id, round(sysdate-a.registeredon) TimeSpan, case when round(sysdate-a.registeredon)<=7 then 'Week' when round
    (sysdate-a.registeredon)>7 and round(sysdate-a.registeredon)<14 then 'Fortnight' when round(sysdate-a.registeredon)>14 and round(sysdate-a.registeredon)<30 then
    'Month' else 'More...' end ageind, a.status_id,b.statusname from a02_task a,a02_status b where b.id=a.status_id) group by statusname,AgeInd;
    The result that comes when I execute the above resultant SQL is as follows.
    N STATUSNAME AGEIND SCHEDULED EXECUTING COMPLETED
    Completed More... 0 0 4
    Completed Week 0 0 1
    Scheduled Week 1 0 0
    Completed Month 0 0 3
    Executing More... 0 1 0
    Executing Month 0 6 0
    Scheduled More... 1 0 0
    7 rows selected.
    But the surprising error that comes from Oracle XE when I use the following code for stacked bar chart
    Code:
    begin
    return TEST_D_QRY;
    end;
    Error thrown by XE report builder is as follows:
    1 error has occurred
    Failed to parse SQL query!
    Select null,statusname,AgeInd, decode(statusname,'Scheduled',count(id),0) Scheduled,decode(statusname,'Executing',count(id),0) Executing,decode(statusname,'Completed',count(id),0) Completed from ( select a.id, round(sysdate-a.registeredon) TimeSpan, case when round(sysdate-a.registeredon)<=7 then 'Week' when round(sysdate-a.registeredon)>7 and round(sysdate-a.registeredon)<14 then 'Fortnight' when round(sysdate-a.registeredon)>14 and round(sysdate-a.registeredon)<30 then 'Month' else 'More...' end ageind, a.status_id,b.statusname from a02_task a,a02_status b where b.id=a.status_id) group by statusname,AgeInd;
    Certain queries can only be executed when running your application, if your query appears syntactically correct, you can save your query without validation (see options below query source).
    Regards,
    Soumen

Maybe you are looking for

  • Suppress NULL Address Lines.

    Hi, I want to suppress the space if Address3 and Address4 are NULL. Right now I am getting blank lines if Address3 and Address4 are NULL. I tried using the following code but it's not working <?if:B_ADDRESS3!=NULL?><?B_ADDRESS3?> <?end if?> <?if:B_AD

  • What is a SiM card and do I need one in order to send email from my iPad?

    What is a SIM card and do I need one in order to be able to send email from my iPad?

  • Regarding Crystal report  parameter from and to.

    hi. I am having one requirement ie. Normally we are giving..i.e We are using parameter in Sap b1 like Docentry Based on this one Docentry the data will fetch from the data base and it will shows into the sap crystal reprot suppose Ex Docentry = 3 the

  • Changing Printer Default Setting

    Hello Folks, I got a requirement to change the printer default settings, but its not reflecting in ALV Reports. Any inputs? want to change layout to X_65_255 Here is the coding i have done.Please let me know on Corrections.     DATA: l_t_params LIKE

  • [solved]unsure of result from pacman -Syu

    hi i just did a pacman -Syu and got the following warning! [root@arch danny]# pacman -Syu :: Synchronising package databases... core is up to date extra is up to date community is up to date :: Starting full system upgrade... warning: iproute: local