Return zero

Can i have simple select query to get the expected out. if negative balance return zero otherwise return as it is. Please provide a select query to get expected output
Actual output
Balance
-20
40
50
-60
Expected output(if balance negative return 0)
Balance
0
40
50
0

Hi,
Try this:
SELECT     GREATEST (balance, 0)     AS balance
FROM     table_x
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using.

Similar Messages

  • Bug Report: ResultSet.isLast() returns false when queries return zero rows

    When calling the method isLast() on a resultset that contains zero (0) rows, false is returned. If a resultset contains no rows, isLast() should return true because returning false would indicate that there are more rows to be retrieved.
    Try the following Java source:
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import oracle.jdbc.driver.*;
    public class Test2 {
    public static void main (String [] args) throws Exception {
    Connection conn = null;
    String jdbcURL = "jdbc:oracle:thin:@" +
    "(DESCRIPTION=(ADDRESS=(HOST=<host computer>)"+
    "(PROTOCOL=tcp)(PORT=<DB port number>))"+
    "(CONNECT_DATA=(SID=<Oracle DB instance>)))";
    String userId = "userid";
    String password = "password";
    try{
    // Load the Oracle JDBC Driver and register it.
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // *** The following statement creates a database connection object
    // using the DriverManager.getConnection method. The first parameter is
    // the database URL which is constructed based on the connection parameters
    // specified in ConnectionParams.java.
    // The URL syntax is as follows:
    // "jdbc:oracle:<driver>:@<db connection string>"
    // <driver>, can be 'thin' or 'oci8'
    // <db connect string>, is a Net8 name-value, denoting the TNSNAMES entry
    conn = DriverManager.getConnection(jdbcURL, userId, password);
    } catch(SQLException ex){ //Trap SQL errors
    // catch error
    //conn = new OracleDriver().defaultConnection(); // Connect to Oracle 8i (8.1.7), use Oracle thin client.
    PreparedStatement ps = conn.prepareStatement("select 'a' from dual where ? = ?", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); // Use any query that will return zero rows.
    ps.setInt(1, 1); // Set the params so that the query returns 0 rows.
    ps.setInt(2, 2);
    ResultSet rs = ps.executeQuery();
    System.out.println("1. Last here? " + rs.isLast());
    while (rs.next()) {
    // do whatever
    System.out.println("2. Last here? " + rs.isLast());
    ps.close();
    rs.close();
    EXPECTED RESULT -
    1. Last here? true
    2. Last here? true
    ACTUAL RESULT -
    1. Last here? false
    2. Last here? false
    This happens to me on Oracle 9.2.0.1.0.

    387561,
    For your information, I discovered this problem from
    running a query that did access an actual DB table.
    Try it and let me know.I did say I was only guessing, and yes, I did try it (after I posted my reply, and before I read yours). And I did check the query plan for the queries I tried -- to verify that they were actually doing some database "gets".
    In any case, the usual way that I determine whether a "ResultSet" is empty is when the very first invocation of method "next()" returns 'false'. Is that not sufficient for you?
    Good Luck,
    Avi.

  • Global Temp Table, always return  zero records

    I call the procedure which uses glbal temp Table, after executing the Proc which populates the Global temp table, i then run select query retrieve the result, but it alway return zero record. I am using transaction in order to avoid deletion of records in global temp table.
    whereas if i do the same thing in SQL navigator, it works
    Cn.ConnectionString = Constr
    Cn.Open()
    If FGC Is Nothing Then
    Multiple = True
    'Search by desc
    'packaging.pkg_msds.processavfg(null, ActiveInActive, BrandCode, Desc, Itemtype)
    SQL = "BEGIN packaging.pkg_msds.processavfg(null,'" & _
    ActiveInActive & "','" & _
    BrandCode & "','" & _
    Desc & "','" & _
    Itemtype & "'); end;"
    'Here it will return multiple FGC
    'need to combine them
    Else
    'search by FGC
    SQL = "BEGIN packaging.pkg_msds.processavfg('" & FGC & "','" & _
    ActiveInActive & "','" & _
    BrandCode & "',null,null); end;"
    'will alway return one FGC
    End If
    ' SQL = " DECLARE BEGIN rguo.pkg_msds.processAvedaFG('" & FGC & "'); end;"
    Stepp = 1
    Cmd.Connection = Cn
    Cmd.CommandType = Data.CommandType.Text
    Cmd.CommandText = SQL
    Dim Trans As System.Data.OracleClient.OracleTransaction
    Trans = Cn.BeginTransaction()
    Cmd.Transaction = Trans
    Dim Cnt As Integer
    Cnt = Cmd.ExecuteNonQuery
    'SQL = "SELECT rguo.pkg_msds.getPDSFGMass FROM dual"
    SQL = "select * from packaging.aveda_mass_XML"
    Cmd.CommandType = Data.CommandType.Text
    Cmd.CommandText = SQL
    Adp.SelectCommand = Cmd
    Stepp = 2
    Adp.Fill(Ds)
    If Ds.Tables(0).Rows.Count = 0 Then
    blError = True
    BlComposeXml = True
    Throw New Exception("No Record found for FGC(Finished Good Code=)" & FGC)
    End If
    'First Row, First Column contains Data as XML
    Stepp = 0
    Trans.Commit()

    Hi,
    This forum is for Oracle's Data Provider and you're using Microsoft's, but I was curious so I went ahead and tried it. It works fine for me. Here's the complete code I used, could you point out what are you doing differently?
    Cheers,
    Greg
    create global temporary table abc_tab(col1 varchar2(10));
    create or replace procedure ins_abc_tab(v1 varchar2) as
    begin
    insert into abc_tab values(v1);
    end;
    using System;
    using System.Data;
    using System.Data.OracleClient;
    class Program
        static void Main(string[] args)
            OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger");
            con.Open();
            OracleTransaction txn = con.BeginTransaction();
            OracleCommand cmd = new OracleCommand("begin ins_abc_tab('foo');end;", con);
            cmd.Transaction = txn;
            cmd.ExecuteNonQuery();
            cmd.CommandText = "select * from abc_tab";
            OracleDataAdapter da = new OracleDataAdapter(cmd);
            DataSet ds = new DataSet();
            da.Fill(ds);
            Console.WriteLine("rows found: {0}", ds.Tables[0].Rows.Count);
            // commit, cleanup, etc ommitted for clarity
    }

  • Query returns zero records in coldfusion context, but works fine in Navicat

    I've got a query that's returning zero records when I load a page.  If I copy and paste that same query (from the debug output) into navicat, I get rows returned (as I expect).  Has anyone seen this?  It happens locally (CF9) AND remotely on our staging server (CF10).  Even weirder, it's a query that was previously working fine - I simply added an if statement to the where clause, and all of a sudden... 
    Here's the query:
            <CFQUERY name="LOCAL.getEncounterServices" datasource="#REQUEST.dsn#"> 
            SELECT
                a.EncounterProductID,
                a.DateTime AS ServiceDate,
                aa.CartItemID,
                aaa.CartID,
                aaaaa.CartStatus,
                b.ProductID,
                b.ProductName,
                b.CPTCode,
                b.Price,
                c.EncounterID,
                c.DateTimeClosed AS EncounterClosedDate,
                d.FirstName,
                d.LastName
            FROM
                EncounterProducts a
                    LEFT JOIN CartItemProduct aa ON (a.EncounterProductID = aa.EncounterProductID AND aa.Active = 1)
                    LEFT JOIN CartItem aaa ON (aa.CartItemID = aaa.CartItemID)
                    LEFT JOIN Cart aaaa ON (aaa.CartID = aaaa.CartID)
                    LEFT JOIN CartStatus aaaaa ON (aaaa.CartStatusID = aaaaa.CartStatusID),
                Product b,
                Encounters c,
                Contacts d,
                EncounterStatuses e
            WHERE
                1 = 1
                AND (aa.CartItemID IS NULL OR aaaaa.CartStatus = 'Deleted')
                AND a.Active = 1
                AND a.ProductID = b.ProductID
                AND a.EncounterID = c.EncounterID
                AND c.PatientID = d.ContactID
                AND c.EncounterStatusID = e.EncounterStatusID
                AND e.EncounterStatus = 'Closed'
              <CFIF IsDefined("ARGUMENTS.encounter") AND IsObject(ARGUMENTS.encounter)>
                     AND c.EncounterID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.encounter.getID()#">
             <CFELSE>
                    AND c.DateTimeClosed >= <CFQUERYPARAM cfsqltype="cf_sql_date" value="#ARGUMENTS.startDate#">
                    AND c.DateTimeClosed < <CFQUERYPARAM cfsqltype="cf_sql_date" value="#DateFormat(DateAdd('d', 1, ARGUMENTS.endDate), 'yyyy-mm-dd')# 00:00:00">
               </CFIF>
                AND c.LocationID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.locationID#">
                AND c.CustomerID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.customerID#">
            </CFQUERY>
    All of this worked just fine before I added the lines:
             <CFIF IsDefined("ARGUMENTS.encounter") AND IsObject(ARGUMENTS.encounter)>
                     AND c.EncounterID = <CFQUERYPARAM cfsqltype="cf_sql_integer" value="#ARGUMENTS.encounter.getID()#">
             <CFELSE>
                    AND c.DateTimeClosed >= <CFQUERYPARAM cfsqltype="cf_sql_date" value="#ARGUMENTS.startDate#">
                    AND c.DateTimeClosed < <CFQUERYPARAM cfsqltype="cf_sql_date" value="#DateFormat(DateAdd('d', 1, ARGUMENTS.endDate), 'yyyy-mm-dd')# 00:00:00">
              </CFIF>
    Previously, it had just been:
                    AND c.DateTimeClosed >= <CFQUERYPARAM cfsqltype="cf_sql_date" value="#ARGUMENTS.startDate#">
                    AND c.DateTimeClosed < <CFQUERYPARAM cfsqltype="cf_sql_date" value="#DateFormat(DateAdd('d', 1, ARGUMENTS.endDate), 'yyyy-mm-dd')# 00:00:00">
    With no IF/ELSE statement.
    Anyone seen anything like this before?  Any ideas? 
    Thanks.

    Right, I'll start disabusing myself of the DateFormat!
    I'm sorry, I should've posted the actual query too.  It's inserting the first part - "AND c.EncounterID = ....."
    Here's the full query:
    LOCAL.getEncounterServices (Datasource=xmddevdb, Time=9ms, Records=0) in /Applications/ColdFusion9/wwwroot/XMD_NEW/xmd_dev/cfc/ShoppingGateway.cfc @ 16:56:28.028
    SELECT
                a.EncounterProductID,
                a.DateTime AS ServiceDate,
                aa.CartItemID,
                aaa.CartID,
                aaaaa.CartStatus,
                b.ProductID,
                b.ProductName,
                b.CPTCode,
                b.Price,
                c.EncounterID,
                c.DateTimeClosed AS EncounterClosedDate,
                d.FirstName,
                d.LastName
            FROM
                EncounterProducts a
                    LEFT JOIN CartItemProduct aa ON (a.EncounterProductID = aa.EncounterProductID AND aa.Active = 1)
                    LEFT JOIN CartItem aaa ON (aa.CartItemID = aaa.CartItemID)
                    LEFT JOIN Cart aaaa ON (aaa.CartID = aaaa.CartID)
                    LEFT JOIN CartStatus aaaaa ON (aaaa.CartStatusID = aaaaa.CartStatusID),
                Product b,
                Encounters c,
                Contacts d,
                EncounterStatuses e
            WHERE
                1 = 1
                AND (aa.CartItemID IS NULL OR aaaaa.CartStatus = 'Deleted')
                AND a.Active = 1
                AND a.ProductID = b.ProductID
                AND a.EncounterID = c.EncounterID
                AND c.PatientID = d.ContactID
                AND c.EncounterStatusID = e.EncounterStatusID
                AND e.EncounterStatus = 'Closed'
                     AND c.EncounterID = ?
                AND c.LocationID = ?
                AND c.CustomerID = ?
    Query Parameter Value(s) -
    Parameter #1(cf_sql_integer) = 28
    Parameter #2(cf_sql_integer) = 16
    Parameter #3(cf_sql_integer) = 6
    Thansk again for the help!

  • 0fi_ar_4 INIT returning zero records

    Hi gurus,
    0fi_ar_4 INIT is returning zero records while loading into ODS.I have checked in RSA3 it is returning zero records with INIT selection but is it is fetching records with Full update.Can ne one tell me what to do.how to solve this problem.
    rgds,
    ***Points Assured**

    Hi Suravi,
    Check at the Info Package selection-- Init with out data transfer.
    Make it with data transfer..
    Hope it helps..

  • TotalVHDCapacity attribute is returning zero in "Get-SCVMTemplate | select Name, TotalVhdCapacity" powershell command though the Vhd capacity is 20 gb in size, vmm 2012 r2

    Hi All,
    TotalVHDCapacity attribute is returning zero in "Get-SCVMTemplate | select Name, TotalVhdCapacity" powershell command though the template has Vhd capacity is 20 gb in size, vmm 2012 r2. I can create VM using this template too.
    For other templates it is returning correct value though.
    Can anyone help us understanding the root cause and the solution too.
    Thanks in advance.
    Debabrata

    I booted this drive from another computer (Asrock M3A770DE mobo) and works fine, speed with dd was ~100MB/s
    I also update bios on my first computer with Intel D945GSEJT (there is selected AHCI mode) still the same transfers with dd (~10Mb/s)
    I have no idea what to do with it now
    EDIT:
    More tests with other hdd (Samsung HD502IJ), dd on mounted NTFS partition:
    Intel D945GSEJT booted from Archlinux iso:
    hdparm: ~75 MB/s
    dd: ~10 MB/s
    Intel D945GSEJT booted from Archlinux iso, HDD connected to PCI SATA controller (Promise 378):
    hdparm: ~60 MB/s
    dd: ~10 MB/s
    Asrock M3A770DE booted from Archlinux iso:
    hdparm: ~87 MB/s
    dd: ~76 MB/s
    Asrock M3A770DE booted from Archlinux iso, HDD connected to PCI SATA controller (Promise 378):
    hdparm: ~81MB/s
    dd: ~76 MB/s
    What is broken on D945GSEJT?
    Last edited by miskoala (2012-03-30 13:47:23)

  • Shadowing API Issues on 2012R2 (SM_REMOTECONTROL GetSystemMetrics and WTSStopRemoteControlSession) Always Returns Zero

    According to the MSDN article on the GetSystemsMetric API, SM_REMOTECONTROL returns zero if the user is not currently being shadowed but will return non-zero if the user is currently being shadowed.  It lists no restirction on OS support from what I
    can see.
    WTSStopRemoteControlSession also lists no restrictions on OS support in MSDN.
    I have a simple VB.NET application that calls these APIs.  It basically reads:
    <DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> Public Shared Function GetSystemMetrics(ByVal nIndex as Integer) As Integer
    End Function
    Private Const SM_REMOTECONTROL as Integer = &H2001
    <DllImport("wtsapi32.dll", SetLastError:=True)> Public Shared Function WTSStopRemoteControlSession(ByVal iLoginId as Int32) as Int32
    End Function
    Private Declare Function ProcessIdToSessionId Lib "Kernel32.dll" Alias "ProcessIdToSessionId" (ByVal processID as Int32, ByRef sessionID as Int32) as Boolean
    retVal = GetSystemMetrics(SM_REMOTECONTROL)
    On 2008R2, retVal = 1 when the user is being shadowed, retVal = 0 when the user is not being shadowed.
    On 2012R2, retval = 0 no matter if the user is being shadowed or not shadowed.
    Dim sessionIDCurrent as Int32
    ProcessIdToSessionId(Process.GetCurrentProcess, sessionIDCurrent)
    WTSStopRemoteControlSession(sessionIDCurrent)
    On 2008R2, the shadow session will be stopped and WTSStopRemoteControlSession returns non-zero (indicating success)
    On 2012R2, the sahdow session will NOT be stopped and WTSStopRemoteControlSession returns zero (indicating failure).  LastDLLError returns zero as well.
    Has anyone else run into this?  Is this a known issue?

    Known issue,similar to this question: http://stackoverflow.com/questions/14725781/getsystemmetrics-returns-different-results-for-net-4-5-net-4-0
    http://connect.microsoft.com/VisualStudio/feedback/details/763767/the-systemparameters-windowresizeborderthickness-seems-to-return-incorrect-value
    https://connect.microsoft.com/VisualStudio/feedback/details/753224/regression-getsystemmetrics-delivers-different-values
    Best Regards,
    Please remember to mark the replies as answers if they help

  • Popularity Trends report always returns zero

    Hello,
    I have a SharePoint installed on “Windows server 2008 -R2”.
    I have a SQL Data base installed on the same machine.
    I create a new web application with port “2020”. Then I create w new site collection “Publishing”.
    I activate the feature “Reporting” in the site collection level.
    I Open central admin “Monitoring >> Configure usage and health data collection”. I checked “Enable usage data collection” Check box. And I Checked All “Events to Log” check boxes.
    I have configures the following services applications :
           -Business Connectivity Service
           -Excel Services Application
          -Search Service Application
         -Security Token Service Application
         -Application Discovery and Load Balancer Service Application
         -WSS_UsageApplication.
    I run the crawl search. And it is completed successfully.
    The search service account is member of “WSS_WPG” group.
    I have checked the following values from SharePoint PowerShell:
             AppEventTypeId          : 00000000-0000-0000-0000-000000000000
             EventTypeId                 : 1
             EventName                   : Views
             LifeTimeManagedPropertyName : ViewsLifeTime
             RecentManagedPropertyName   : ViewsRecent
            ApplicationName             :
            RecommendationWeight        : 1
           RelevanceWeight             : 1
          RecentPopularityTimeframe   : 14
          AggregationType             : Count, UniqueUsers
         Rollups                     : SiteSubscriptionId, SiteId, ScopeId
        TailTrimming                : 2
       Options                     : AllowAnonymousWrite
        IsReadOnly                  : False
    I open the “default.aspx” page on the portal (I have opened it more than 10 times in different browser window).
    Next day I open “popularity Trends” report, I found that it returns zero.
    I open the “Analytics Report” data base. Then I open “AnalyticsItemData” table. There are already items in the table.
        So I need to know why the “popularity Trends” excel sheet report returns zeros all the time.
    ASk

    Hi,
    According to your description, the popularity Trends report always returns no records.
    Please check the status of the 3 timer jobs: Microsoft SharePoint Foundation Usage Data Import, Microsoft SharePoint Foundation Usage Data Processing and Web Analytics
    Trigger Workflows to see if they are configured to run at regular intervals.
    Also you can take a look at the two links about the similar issue for more information:
    http://www.myriadtech.com.au/blog/Ben/Lists/Posts/Post.aspx?ID=7
    http://sharepoint.stackexchange.com/questions/66476/whats-popular-webpart-is-empty
    Feel free to reply if there any progress.
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Resolving "IOException: Underlying input stream returned zero bytes" errors

    Hi guys,
    I'm currently working on a simple application that reads GPS receiver data from a serial port using the RXTX library. However, everytime I try to read the resulting InputStream (which I convert to a BufferedReader) using readLine(), after 2 or 3 lines of reading normally, I always get the following exception:
    GPSNotifier::run(): I/O error encountered while reading from COM4
    java.io.IOException: Underlying input stream returned zero bytes
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:268)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
    at java.io.InputStreamReader.read(InputStreamReader.java:167)
    at java.io.BufferedReader.fill(BufferedReader.java:136)
    at java.io.BufferedReader.readLine(BufferedReader.java:299)
    at java.io.BufferedReader.readLine(BufferedReader.java:362)
    at discomm.gps.GPSNotifier.run(GPSNotifier.java:260)
    at java.lang.Thread.run(Thread.java:619)
    I'm not sure how to fix this problem, since it occurs everytime I run the application. The code for opening the stream is as follows:
    // Open up the port: no problems here ...
    CommPortIdentifier comm = CommPortIdentifier.getPortIdentifier(port_name);
    CommPort port = comm.open(APP_NAME, OPEN_TIMEOUT);
    SerialPort serial_port = (SerialPort) port;
    serial_port.setSerialPortParams(PORT_BAUDRATE, PORT_DATABITS, PORT_STOPBITS, PORT_PARITY);
    BufferedReader in = BufferedReader(new InputStreamReader(serial_port.getInputStream()));
    String line = null;
    // Problem is here ...
    while ((line = in.readLine()) != null) {
    }The IOException always occurs when readLine() is called. Any ideas on how to fix this problem?
    Thanks in advance,
    Simon Liu

    I don't use readLine() but read()
    A bit of code:
              BufferedReader inStream = new BufferedReader(new InputStreamReader(inputStream));
              byte ch = 0;
              char myChar;
              int charVal;          
              try{               
                   while((ch = (byte)inStream.read()) != -1){
                        if((ch == 13) || (ch == 10)){ //In ASCII code: 13 = Carriage return, 10 = line feed. When the GPS receiver sends those characters, the while loop must be broken to avoid an IOException                         
                             break;
                        }else{
                             myChar = (char)ch;
                        charVal = myChar;
                        //System.out.print("byte=" + ch +" myChar=" + myChar + " charVal=" + charVal + "\n");
                        System.out.print(myChar);
                   }

  • XPath query string returns zero node error

    I have created car loan bpel application. One is Citi Loan and another is Star Loan.
    I have created just like similar to sample loan demo.
    I have entered the SSN, email, carModel, carYear, loanAmount and creditRating value and submitted. It will initiated the following tasks successfully.
    StarLoan Instance
    CitiLoan Instance
    TaskManager Instance
    CreditRating Instance
    Root appln. instance
    I have created one user approval page for Approve/Reject (jsp). Through this page, I have approved the CitiLoan offer. I have faced the following errors.
    <output>
    <part name="payload" >
    <loanOffer>7.4</loanOffer>
    </part>
    </output>
    <loanOffer>7.4</loanOffer>
    <selectionFailure>
    <part name="summary" >
    <summary>XPath query string returns zero node. According to BPEL4WS spec 1.1 section 14.3, The assign activity <to> part query should not return zero node. Please check the BPEL source at line number "90" and verify the <to> part xpath query. </summary>
    </part>
    </selectionFailure>
    Please help me.
    Thanks in advance.
    Regards,
    Sara

    Let us know if you have customized SOA composite for user creation approval?
    -Vamsi.

  • Stored proc returns zero result

    Hello, please help me. I am quite new to oracle stored
    procedures. I have a proc that returns data to cfm but it keeps
    giving zero results. But if i don't use stored proc, the same query
    gives me something. please help. my stored proc and cfm goes
    something like below:
    ************************************ stored procedures
    CREATE OR REPLACE PACKAGE PACK_REFCURSOR_NHM_TRANSACTION AS
    TYPE TRANS_TableRows IS REF CURSOR;
    PROCEDURE REFCUR_NHM_TRANSACTION (
    IN_sTMPACC IN varchar2,
    IN_sITEM_TYPES IN varchar2,
    OUT_TRANS OUT TRANS_TableRows);
    END PACK_REFCURSOR_NHM_TRANSACTION ;
    CREATE OR REPLACE PACKAGE BODY PACK_REFCURSOR_NHM_TRANSACTION
    AS
    PROCEDURE REFCUR_NHM_TRANSACTION (
    IN_sTMPACC IN varchar2,
    IN_sITEM_TYPES varchar2,
    OUT_TRANS OUT TRANS_TableRows)
    IS
    BEGIN
    OPEN OUT_TRANS FOR
    SELECT T.TRANSACTION_ID, T.TRANSACTION_TYPE,
    T.TRANSACTION_DATE, T.TRANSACTION_TIME,
    T.ITEM_CODE, 0 OE_DETAIL_ID,
    T.QUANTITY, T.LIST_PRICE, T.DISCOUNT, T.SALE_PRICE,
    T.GST_AMOUNT, 'I' INSURER_TYPE
    FROM NHM_TRANSACTION T
    WHERE DISPENSED_FLG = 'Y'
    AND T.ACCOUNT_ID = IN_sTMPACC
    AND T.TRANSACTION_TYPE IN ('01','02', '09')
    AND NVL(T.STATUS,'F') != 'C'
    AND T.BILLED_FLG = 'N'
    AND T.ITEM_TYPE IN (IN_sITEM_TYPES)
    AND T.BILL_ITEM_FLG = 'Y'
    UNION ALL
    SELECT T.OE_TRANSACTION_ID TRANSACTION_ID, TRANSACTION_TYPE,
    T.TRANSACTION_DATE,
    T.TRANSACTION_TIME, NVL(T.ITEM_CODE,T.PACKAGE_CODE)
    ITEM_CODE, T.OE_DETAIL_ID,
    T.QUANTITY, T.LIST_PRICE, T.DISCOUNT, T.SALE_PRICE,
    T.GST_AMOUNT, 'S' INSURER_TYPE
    FROM NHC_OE_TRANSACTION T, NHC_MASTER_ITEM M, NHM_PACKAGE P
    WHERE T.ACCOUNT_ID = IN_sTMPACC
    AND T.ITEM_CODE = M.ITEM_CODE(+)
    AND T.PACKAGE_CODE = P.PACKAGE_CODE(+)
    AND (DECODE(T.ITEM_CODE,NULL,P.BILL_OPTION,M.BILL_OPTION) in
    ('P','O','F'))
    AND NVL(T.STATUS,'F') != 'C'
    AND T.BILLED_FLG = 'N'
    AND ((T.TRANSACTION_TYPE = '09' AND STATUS IN ('P','R'))
    OR T.TRANSACTION_TYPE IN ('01','02','11','12', '10'))
    AND T.BILL_ITEM_FLG = 'Y'
    AND T.ITEM_TYPE IN (IN_sITEM_TYPES) ;
    END REFCUR_NHM_TRANSACTION ;
    END PACK_REFCURSOR_NHM_TRANSACTION ;
    *************** the cfm code (note: i am using coldfusion
    MX************
    <cfstoredproc datasource="#application.datasource#"
    procedure="NSCOCT.PACK_REFCURSOR_NHM_TRANSACTION.REFCUR_NHM_TRANSACTION">
    <cfprocparam type="IN" cfsqltype="CF_SQL_VARCHAR"
    value="#TMPACC#" dbvarname="IN_sTMPACC">
    <cfprocparam type="IN" cfsqltype="CF_SQL_VARCHAR"
    value="#QRYLOCITEM.ITEM_TYPE#" dbvarname="IN_sITEM_TYPES">
    <cfprocresult name="getPrescItems">
    </cfstoredproc>
    ***** i dumped getPrescItems and returns no data. it's
    suppose to return something . Any help is much appreciated. Thank
    you. *********

    just an update. i found out that it has something to do with
    the condition "IN". the values there is supposed to be a list (e.g.
    a,b,c,d,e,f,g). What I suspect is that when in stored proc, it
    interprets in the query as "IN('a,b,c,d,e,f,g')" instead of
    "IN('a','b','c','d','e','f','g')" which is what I actually want.
    I have also tried the quotedvaluelist in cfm but still no
    result, so i suspect again, using quotedvaluelist, that it
    interprets in the proc as "IN(''a','b','c','d','e','f','g'')".
    Can anybody help me whit this so i can have the proc
    interpret my IN condition as "IN('a','b','c','d','e','f','g')"?
    Thanks.

  • BUG Apex4.0 AnyChart: apex_util.flash  - returning zero rather than null

    [Line chart screen capture|http://www.anaruk.com/linechart.jpg]
    The chart image I linked to above is a year over year sales chart. The first series returns 2009 Sales. The second returns year to date 2010. The problem is that even though the query returns no data for August through December of 2010 - because they haven't happened yet - the XML returned by the apex_util.flash proc returns those months with a zero value causing the chart to plot that data.
    2009 query result set:
    LINK MONTH SALES
    - Jan 250
    - Feb 230
    - Mar 360
    - Apr 130
    - May 120
    - Jun 180
    - Jul 130
    - Aug 280
    - Sep 270
    - Oct 250
    - Nov 360
    - Dec 410
    2010 query result set:
    LINK MONTH SALES
    - Jan 130
    - Feb 970
    - Mar 170
    - Apr 140
    - May 110
    - Jun 230
    - Jul 440
    XML for 2010 comes back:
    <series name="YTD 2010" type="Line" color="0x1D8BD1">
    <point name="Jan" y="130">
    </point>
    <point name="Feb" y="970">
    </point>
    <point name="Mar" y="170">
    </point>
    <point name="Apr" y="140">
    </point>
    <point name="May" y="110">
    </point>
    <point name="Jun" y="230">
    </point>
    <point name="Jul" y="440">
    </point>
    <point name="Aug" y="0">
    </point>
    <point name="Sep" y="0">
    </point>
    <point name="Oct" y="0">
    </point>
    <point name="Nov" y="0">
    </point>
    <point name="Dec" y="0">
    </point>
    </series>
    IF I modify and load the following, AnyChart correctly does not plot the last four months:
    <series name="YTD 2010" type="Line" color="0x1D8BD1">
    <point name="Jan" y="130">
    </point>
    <point name="Feb" y="970">
    </point>
    <point name="Mar" y="170">
    </point>
    <point name="Apr" y="140">
    </point>
    <point name="May" y="110">
    </point>
    <point name="Jun" y="230">
    </point>
    <point name="Jul" y="440">
    </point>
    <point name="Aug" y="">
    </point>
    <point name="Sep" y="">
    </point>
    <point name="Oct" y="">
    </point>
    <point name="Nov" y="">
    </point>
    <point name="Dec" y="">
    </point>
    </series>
    Thanks for any feedback.
    Walter
    Edited by: WannaRock on Jul 23, 2010 2:17 PM
    - made Subject more descriptive
    - fixed three typos

    Hi Walter,
    Thanks for bringing this to our attention. The behaviour you have reported is the current default behaviour for handling null values on the Line chart, where they are represented as zero in the series data. I appreciate this handling is not what you would expect, particularly in your scenario, where you do not wish to represent certain points on the chart (AUG - DEC 2010), so I will revise this behaviour and include a fix for this in our upcoming patch release 4.0.1. I've logged bug 9945462 to track this issue.
    Regards,
    Hilary

  • Sales Return, Zero Price

    We were on the user testing stage. Something went wrong to the production server and the back-up copy was loaded to that production server. Configurations were transferred and upload of data is being done.
    One of the issues I encountered is about sales return (Reg Ret Charge VAT). My client says before when they enter the material, the amount (or price of the material) becomes zero but this time the amount reflects the real amount of the material (just like making a regular order). Client want to put back the original setting wherein the price becomes zero when material is entered for sales returns.
    Please guide me on what I can check.

    Your initial post gave me the impression that RE (return order) is created and prices in Tab condition are given manually. In a later post, you are saying RE (return order) is created by referring to a sales order. Which one is it?
    go to VA02, in  your return order. check what is the item category?
    Then go to VOV7, and for that item category, in field "pricing" give BLANK
    In VTAA, return order <-- sales order
    For that item category, give Pricing = B (redetermine pricing) and test.
    I have been thinking,
    1) if the business does not want any prices (i.e. price = 0), then WHY are you (going to) creating a RE credit memo? As in this case, there is NOTHING to pay back to the customer.
    process = RE return order --> LR return delivery, RE credit memo
    So, explain what are the process steps you have configured in the RE process?
    2) Are there any charges you are going to payback to the customer, in this RE process?
    Freight charges, Taxes etc. etc.
    If yes, then at item category level, VOV7, you can NOT give pricing = Blank.
    This shall be applicable for the entire line.
    3) If you don't want any prices / bills -
    have you thought about RE --> SDF (subsequent delivery Free) --> LF?
    or RE --> LR
    Give some background information as to why user / client wants prices = 0? (for all material?)
    Edited by: Typewriter on Sep 24, 2011 9:15 PM

  • PDEContentGetAttrs returns zero attributes

    Hi,
    I'm currently in the process of adjusting a plugin written with Acrobat SDK 8.0 to Acrobat SDK 10.0 (X).
    All goes well but I'm stuck on something very annoying...
    In order for the plugin to parse the contents of the current page there is the following code:
    PDEContent pdeContent= PDPageAcquirePDEContent(page, gExtensionID); //Gets the content of the page
    parsePageObjects(pdeContent); //Parse the content of the page - this caches some objects in-memory for later use (this function is recursive).
    PDPageReleasePDEContent(page, gExtensionID); //Releases the aquired contents of the page, no need for it anymore after parsing the contents
    First question:
    1) I did not find any reference to the API calls: PDPageAcquirePDEContent & PDPageReleasePDEContent. Although they are documented in the Acrobat 9.0 SDK manuals, I did not find anything mentioning these calls in the X SDK. They seem to be working (no errors, no crashes etc.). Are these function calls still relevant in SDK X? If not - maybe the next described issue is a side effect of these "old" (?) calls.
    In the parsePageObjects method the content stream of the page is being parsed. All goes well, but for some reason when the current PDEElement is a form (/Type /XObject /Subtype /Form), after extracting the form's content's stream, the call to PDEContentGetAttrs populates the attrs structure with ZEROs.
    For example:
    void parsePageObjects(const PDEContent& pdeContent) //Receives the page contents
         int numElems = PDEContentGetNumElems(pdeContent); //Get number of elements in the contents
         for (int j=0; j < numElems; j++)
          PDEElement pdeElement = PDEContentGetElem(pdeContent, j); // get the current element
          PDEType type=(PDEType)PDEObjectGetType((PDEObject) pdeElement); //Get the element type
          switch(type)
           case kPDEForm: //In case the element is a Form XObject
              PDEContent fc=PDEFormGetContent((PDEForm)pdeElement); //Get the Form's content
              PDEContentAttrs attrs; //Declare an Attrs struct to be filled by the next call to GetAttrs
              PDEContentGetAttrs(fc,&attrs,sizeof(PDEContentAttrs)); //Fills the attrs structure with the data
    After the last API call (PDEContentGetAttrs), the attrs structure is filled with ZEROs (like after memset(&attrs, 0, sizeof(attrs))). Even the forms matrix is all ZERO's.
    For example: this is the dictionary (without the content stream) of a Form XObject which it's attrs are returned as ZERO, although the matrix & bbox are non zero:
    20 0 obj
    <<
        /Type /XObject
        /BBox   [ 0.000000 110.880000 252.000000 252.000000]
        /Filter   [/FlateDecode]
        /FormType 1
        /Length 5682
        /Matrix[ 1 0 0 1 -0.000000 -110.880000]
        /Name /Frm2
        /Resources 19 0 R
        /Subtype   /Form
    >>
    stream
    endstream
    endobj
    Other questions:
    1) Why does the attrs return filled with zeros although the object is 100% valid?
    2) Why is this working perfectlly on Acrobat SDK 8.0 only (when compiling with Acrobat 9.0 SDK - the behaviour is not consistent. The attrs can retun as a valid value or zeros)?
    3) How can I make it wok with Acrobat X SDK?
    Thanks,
    Omri

    For this level of support, you REALLY need to open a formal support case
    with our Developer Support staff.

  • RFC Integer field Returns Zero

    Hi
    We're having a strange issue with a SAP RFC which is called from BizTalk. The SAP function returns a list of customer orders. All fields are fine except the volume field which is an integer and always returns a zero.
    I have tested the SAP BAPI which the RFC links to directly in SAP and it returns perfectly with proper values for the volumes.
    Any idea why when BizTalk calls the RFC it returns 0 as the value for the integer volume fields?
    Thanks in advance!
    Regards
    Riaz

    How is your sap schema? is it "xs:integer" or custom datatype? did you see if there any equivalent conversion type created for the volume field? You need to check in idoc schema.
    I have seen some conversion/validation done at the wcf channel against idoc schema. When I talked to SAP guys they suggest to use character with fix length or string type most of the time.
    Few things to check:
    -> check if there are any spaces leading or trailing in the value field
    -> Check the idoc schema if there is any custom type is created
    -> Try changing the type to string (not very good idea though but just to check if type conversion is the issue)
    -> Agree to exchange the field with other type as I suggested above
    If this answers your question please mark it as Answer and if this post is helpful, please vote as helpful. Thanks !

Maybe you are looking for

  • System is showing Bill Doc No in VF01 but in VF02 - No billing doc generate

    While creating invoice using Billing Plan, only for certain contacts,  we face an issue. In VF01-The system is saying Billing document XXXXXX123 is created but in VF02 , we are not able to see any document and the system says No billing document is g

  • Droid razr maxx

    I have an Apple Airport Extreme and am trying to utilize the wirelss function with my Droid Razr Maxx...the reception is poor at best on my Droid (3 units) and Motorolla says to contact Apple for resolution as the Droids have good reception with all

  • Disable .mac sync from top-menu

    I don't know the name of this menu, but I guess it's something related to sync with .mac, which I don't use. I have looked in system preferences but there is no option for disabling it. Any ideas?

  • Have 1 tune in a series of downloads that wants re-authorization

    Scenario: Downloaded a handful of tunes. Problem: 1 will not play - wants re-authorization: Message: "This computer is not authorized to play ..." Its the only one acting this way. It is recognized as already authorized, if I enter the username & pas

  • Software Apple MacBooK Air OS to install Tata Indicom Huawei Accees Manager

    I understand there are softwares available with Mac OS including that for MacBook Air which can help install Tata Indicom's Huawei Access Manager Data Card Only if that happens, one may use this data card to connect to the Internet Apprise me please