Field Number(19,8) always returns Zero!

Thanks for reading this
I am developing an application in VB6 on
NT 4 SP5 and have come accross a very strange
error. This project is a migration from
Sequel Server, I am redoing an ACCESS application.
In one of the tables, the Latitude and Longitude is stored as of Type Number(19,8)
(don't ask why - I didn't design the tables).
All of the data is being retrieved through disconnected ADO recordsets. The data is being written with ADO connection SQL statements.
Writing of the values through the Oracle ODBC driver seems to work properly (8.01.05 - 02/02/99). When I read the values through a ADO Recordset query, the latitude and longitude always returns 0 (when they are not null).
I tried switching to the Microsoft ODBC Driver for Oracle, and that driver works fine. The latitude and longitude are correct.
I can view the data fine through SQL Plus or
ACCESS via linked Tables, so the data is OK.
Thanks
John
null

And what does this have to do with JDBC?
There was a bug in one of the earlier 8.x Oracle ODBC drivers that woukld cause this behavior. Get the latest patch version of the driver frorm Oracle support and you will be fine.

Similar Messages

  • 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
    }

  • 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

  • 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

  • JNI_GetCreatedJavaVMs always return zero

    Why does pfnGetCreatedJavaVMs(&jvmBuf, 1, &no_vms) always return 0(success) even though there is no created JVM?
    typedef jint (JNICALL GetCreatedJVMs_t)(JavaVM *vmBuf, jsize bufLen,jsize *nVMs);
    GetCreatedJVMs_t pfnGetCreatedJavaVMs=(GetCreatedJVMs_t)GetProcAddress(handle,"JNI_GetCreatedJavaVMs");
              JavaVM* jvmBuf=NULL;
              jsize no_vms=0;
              if(pfnGetCreatedJavaVMs(&jvmBuf, 1, &no_vms)==JNI_OK)
                   OutputDebugString("VM Found!! Trying to attach to it..");
                   jvm = &jvmBuf[0];
                   if(jvm!=NULL && no_vms!=0)
                        (*jvm).AttachCurrentThread((void **)&env, NULL);
              else{
                   OutputDebugString("Cannot find created VMs");
    /*****************************************************

    Here is sample code:
    if (m_vm == NULL){
         env->GetJavaVM(&mvm);
    jobj = env->NewGlobalRef(_jobj);
    m_vm->AttachCurrentThread((void **)&_env, NULL);
    jclass jcls = env->GetObjectClass(_jobj);
    jmethodID id = env->GetMethodID(_jcls, "OnRecvData", "(Ljava/lang/String;)V");
    jint jint = env->CallIntMethod(_jobj, id, jstr);

  • Xdofx function least() always returns Yes

    Hi,
    I am trying to do the following calculation
    I have a aggregated field called AD_IMPS_TOTAL. And I also have a field called PRICE and TARGET_IMPS which are not aggregated fields. And I wish to perform the following calcuation.
    least (AD_IMPS_TOTAL, TARGET_IMPS) * PRICE / 1000
    So I did the following in the RTF template
    <?xdofx:least(sum(current-group()/AD_IMPS_TOTAL), TARGET_IMPS) * PRICE div 1000 ?>
    But the calcuation always returns zero. Even when I just give the least function, it returns Yes.
    Can anyone help me out.
    Thanks,
    Ram

    Hi,
    I am trying to do the following calculation
    I have a aggregated field called AD_IMPS_TOTAL. And I also have a field called PRICE and TARGET_IMPS which are not aggregated fields. And I wish to perform the following calcuation.
    least (AD_IMPS_TOTAL, TARGET_IMPS) * PRICE / 1000
    So I did the following in the RTF template
    <?xdofx:least(sum(current-group()/AD_IMPS_TOTAL), TARGET_IMPS) * PRICE div 1000 ?>
    But the calcuation always returns zero. Even when I just give the least function, it returns Yes.
    Can anyone help me out.
    Thanks,
    Ram

  • Passive Sentences always returns 0 in Readability Stats - Word 2013

    Is there are workaround for the Passive sentences issue in Readability stats? I have seen this issue mentioned going back over several years, but no working answer. The following code always returns zero, but grammar checker does not:
    Sub Stats()
        Dim Stats As String 
        For Each rs In ActiveDocument.Content.ReadabilityStatistics
            Stats = Stats + rs.Name & " - " & rs.Value & vbCr
        Next rs
        MsgBox Stats, vbOKOnly, "Readability Statistics"
        Stats = ""
    End Sub
    If there is no fix in Word, does anyone know of a good third party option? We would like to have statistics in a comment on a paragraph by paragraph level.
    Thanks,
    Marc Wiener
    Gartner, Inc.
    Marc Wiener

    Hi Marc,
    Base on my test in word 2013 and 2010, I can reproduce that issue too, others work fine except passive sentences.
    On the other hand, I don't find third party option.
    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.
    Regards
    Starain
    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.

  • 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 !

  • PCI-6133 always returns huge constant number of counts

    Hi,
    I am trying to use a PCI-6133 with a BNC-2110 adapter to counting leading edges of pulses.  Please excuse my high degree of ignorance of how to do this.  Anyway, I connected up my TTL input signal according to the BNC-2110 instructions (to PFI-8 via User-2). Whenever I run the DAQmx sample program Count Digital Events.vi, it recognizes the PCI-6133 OK, but always returns an absurdly high and constant number of counts, like 3.2e9.  The number doesn't change as I send test pulses into the input.  It also remains the same even if I disconnect the input line entirely and rerun the sample program.
    Rebooting yields the same behavior.
    Using DAQ assistant to generate my own code, instead of the sample program, produced exactly the same result.
    Thanks for any help you can give me.  I don't even know where to start to debug this problem.
    Thanks,
    Andy

    BVeezy wrote:
    How/what exactly are you measureing from;? Are you wiring the digital signal directly into PFI 8? Have your tried using the other counter (CTR1) on the 6133? It should be PFI 3 (as indicated in the manual). You may also try generating a pulse signal from the 6133 and reading it with this VI to determine if your source may be the issue (you could use PFI 2 as a Digital Output for this). Finally, does it read the same value every time you run it (the reported 3.2e9)?
    Regards,
    Brandon V.
    Applications Engineer
    National Instruments
    Thank you very much for your help.
    How/what exactly are you measureing from;?
    I am measuring (counting) TTL pulses coming from a TTL driver.  They are about 1 us long and nominal TTL high and low values.  The pulses look fine on a scope.  The rate is very low, typically a few Hz up to perhaps 200 Hz.  The behavior is the same regardless of whether I have the input signal connected to the BNC-2110, however.  The pulses are ultimately generated by a neutron detector, with a bunch of signal processing in between.
    Are you wiring the digital signal directly into PFI 8?
    The input signal is connected by BNC cable to the "User 2" port on the BNC-2110.  A jumper wire connects the "User2" PFI Terminal to the "PFI-8" PFI Terminal.  Again, the behavior is exactly the same regardless of whether these wires are installed or not.
    Have your tried using the other counter (CTR1) on the 6133?
    The behavior is exactly the same on ctr1, which has no wires connected to it.
    You may also try generating a pulse signal from the 6133 and reading it with this VI to determine if your source may be the issue (you could use PFI 2 as a Digital Output for this).
    I tried running a "test panel" in MAX to count the 20 MHz internally generated signal.  It gave the exact same results, on both ctr0 and ctr1.  It did not throw any error message.
    Finally, does it read the same value every time you run it (the reported 3.2e9)?
    It reads the same value every time I run the sample VI or test panel (3217997774) on both channels, except that the number changes to a different constant number (very close) when I reboot the computer.
    I have been wondering if the problem might be associated with the configuration of the ports on the PCI-6133.  The manual repeatedly says that you can configure the ports to input or output, for example, but it is not clear to me how to do that.  When I right-click the device in MAX, "Configure" is not one of the choices, despite what it says in the "Getting Started" manual.
    Again, thanks for your help. 
    Take care,
    Andyaina

  • Make a number in column A always return a different specific number in column B

    I'm trying to create a retirement calculator.
    How do I set it up so that no matter where a specific number appears in column A, column B, same row, always returns a different specific number.
    This second number cannot be derived from the first mathematically.
    example:
    Column A your current age is entered in the first cell.
    Column B is the Life Expectency Factor (LEF). Before age 70 it is 0.  At age 70 that number is 24.7, at 71 it is 26.4 etc.
    Column C returns the Minimum Required Distribution (How much one has to withdraw) (B * $IRA = $MinDist)
    Depending on the age in the first cell of column A, age 70 could be in any row.
    How can I have the LEF in column B move with the age so that no matter in which row age 70 may appear in column A, that row in column B always returns 24.7 and age 71 always returns 26.4... and on.
    No matter which row 70 is in, 24.7 is always next to it in the same row. This will go from 70 to 100 each with a specific LEF next to it.
    Thanks

    Hi Les,
    Setup a Lookup table listing the LEF in column B beside each age in column A. Assuming one header row, start with 0 and 0 in A2 and B2, 70 and 24.7 in A3 and B3, etc.
    On your Main table, enter the formula below in the first data cell of Main::column B (B2, again assuming a single header row for labels). Fill the formula down to the end of the table.
    Main::B2: =LOOKUP(A,Lookup::$A,Lookup::$B)
    Fill the formula to the end of column B
    Numbers on the lookup table on the right are from the (US) government Social Security Administration Actuarial Life Table, and may not (do not, for the two examples in your post) agree with those you are using.
    Regards,
    Barry

  • 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.

  • APEX_UTIL.GET_PRINT_DOCUMENT always returning empty BLOB

    Dear community,
    I have a huge problem when using the function APEX_UTIL.GET_PRINT_DOCUMENT in a job or database procedure.
    The following code runs perfectly when I integrate it in the APEX application directly e.g. using a button to execute it (of course I use an anonymous PL/SQL block in APEX itself). But when I run the same code as a procedure or job in the APEX database itself I always receive a mail with an empty PDF:
    CREATE OR REPLACE PROCEDURE APEX_DRUG_SAFETY.CALL_MAIL
    is
    l_id number;
    l_document BLOB;
    BEGIN
    wwv_flow_api.set_security_group_id;
    l_document := APEX_UTIL.GET_PRINT_DOCUMENT
    +(+
    p_application_id=>'105',
    p_report_query_name=>'TestReport',
    p_report_layout_type=>'pdf',
    p_document_format=>'pdf'
    +);+
    l_id := APEX_MAIL.SEND
    +(+
    p_to        => '[email protected]',
    p_from      => '[email protected]',
    p_subj      => 'sending PDF via print API',
    p_body      => 'Please review the attachment.',
    p_body_html => 'Please review the attachment.'
    +);+
    APEX_MAIL.ADD_ATTACHMENT
    +(+
    p_mail_id    => l_id,
    p_attachment => l_document,
    p_filename   => 'mydocument.pdf',
    p_mime_type  => 'application/pdf'
    +);+
    wwv_flow_mail.push_queue(
    P_SMTP_HOSTNAME => 'DESMTP.TEST.COM',
    P_SMTP_PORTNO => '25');
    end;
    The problem is that the function APEX_UTIL.GET_PRINT_DOCUMENT always returns an empty BLOB when executed outside of the APEX application. I found this issue in several other posts in this forum but I did not find a solution.
    The mail transmission itself works perfectly. Also with an attachment if e.g. I use another BLOB already stored in the database for testing purposes. So it is not the mail transmission that causes the problem but the empty variable l_document that is still empty.
    Thanks in advance for the help.

    user9007075 wrote:
    Dear community,
    wwv_flow_api.set_security_group_id;
    you should be using this
        l_workspace_id := apex_util.find_security_group_id (p_workspace => 'YOUR_WORKSPACE_NAME');
        apex_util.set_security_group_id (p_security_group_id => l_workspace_id);
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_util.htm#AEAPI512

  • XML Validation : isschemavalid always returns 0

    Hello XML folks,
    I have registered the schema and tried to validate. It always returns 0 (i.e invalid).
    Could you please let me know what is wrong with XSD or XML
    Thanks,
    Parappa
    SQL> DECLARE
    2 doc varchar2(3800) :=
    3 '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    4 <!--W3C Schema generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    5 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:context="http://ibtco.com/common/exception/context" targetNamespace="http://ibtco.com/common/exception/context" elementFormDefault="qualified" attributeFormDefault="unqualified">
    6 <xs:simpleType name="ContextValueType">
    7 <xs:annotation>
    8 <xs:documentation>data types for properties</xs:documentation>
    9 </xs:annotation>
    10 <xs:restriction base="xs:string">
    11 <xs:enumeration value="boolean"/>
    12 <xs:enumeration value="char"/>
    13 <xs:enumeration value="byte"/>
    14 <xs:enumeration value="int"/>
    15 <xs:enumeration value="long"/>
    16 <xs:enumeration value="float"/>
    17 <xs:enumeration value="double"/>
    18 <xs:enumeration value="decimal"/>
    19 <xs:enumeration value="date"/>
    20 <xs:enumeration value="time"/>
    21 <xs:enumeration value="dateTime"/>
    22 <xs:enumeration value="string"/>
    23 </xs:restriction>
    24 </xs:simpleType>
    25 <xs:complexType name="ContextPropertyType">
    26 <xs:annotation>
    27 <xs:documentation>
    28 for holding name/value pair for application data
    29 </xs:documentation>
    30 </xs:annotation>
    31 <xs:simpleContent>
    32 <xs:extension base="xs:string">
    33 <xs:attribute name="Name" type="xs:Name" use="required"/>
    34 <xs:attribute name="Type" type="context:ContextValueType" use="optional"/>
    35 </xs:extension>
    36 </xs:simpleContent>
    37 </xs:complexType>
    38 <xs:complexType name="ExceptionContextType">
    39 <xs:annotation>
    40 <xs:documentation>
    41 for holding the data from applications
    42 </xs:documentation>
    43 </xs:annotation>
    44 <xs:sequence>
    45 <xs:element name="Property" type="context:ContextPropertyType" minOccurs="0" maxOccurs="unbounded"/>
    46 </xs:sequence>
    47 </xs:complexType>
    48 <xs:element name="ExceptionContext" type="context:ExceptionContextType">
    49 <xs:annotation>
    50 <xs:documentation>
    51 top level element exception context
    52 </xs:documentation>
    53 </xs:annotation>
    54 </xs:element>
    55 </xs:schema>';
    56 BEGIN
    57 dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/context', doc);
    58 END;
    59 /
    PL/SQL procedure successfully completed.
    SQL> DECLARE
    2
    3 l_errormsgid VARCHAR2(30);
    4 l_errorinfo VARCHAR2(100);
    5 l_error_context CLOB; -- Error Stack
    6 l_error_context_data CLOB; -- XML Context
    7 l_var_xml_context VARCHAR2(4000);
    8 l_var_error_stack VARCHAR2(4000);
    9 l_sqlCode UTL_ERROR_LOGS.ERROR_CODE%TYPE;
    10 p_ErrorMsgId NUMBER := '0';
    11 p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
    12 l_xml_context SYS.XMLTYPE;
    13 l_count number :=0;
    14 l_ret NUMBER;
    15 BEGIN
    16
    17
    18 -- Store XML in a clob
    19 /*
    20 l_var_xml_context := '<ExceptionContext>
    21 <Property Name="Name1" Type="boolean">true</Property>
    22 <Property Name="Name2" Type="string">String</Property>
    23 </ExceptionContext>';
    24 */
    25
    26 l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
    27 <!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    28 <ExceptionContext
    29 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    30 xsi:schemaLocation="http://ibtco.com/common/exception/context"
    31 >
    32 <Property Name="Name1" Type="boolean">true</Property>
    33 <Property Name="Name2" Type="string">String</Property>
    34 </ExceptionContext>';
    35
    36 DBMS_LOB.CREATETEMPORARY
    37 (
    38 lob_loc => l_error_context_data,
    39 cache => TRUE
    40 );
    41
    42 DBMS_LOB.WRITE
    43 (
    44 lob_loc =>l_error_context_data,
    45 amount => length(l_var_xml_context),
    46 offset => 1,
    47 buffer => l_var_xml_context
    48 );
    49
    50 l_xml_context := XMLTYPE(l_error_context_data);
    51
    52
    53 -- validate against XML schema
    54 --l_xml_context.schemavalidate();
    55 l_ret := l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
    56 IF l_ret = 1 then
    57 dbms_output.put_line('Data is valid:' || l_ret );
    58 ELSE
    59 dbms_output.put_line('Data is invalid:' || l_ret);
    60 END IF;
    61 END;
    62 /
    Data is invalid:0
    PL/SQL procedure successfully completed.
    SQL>
    SQL>
    Here is the script :
    DECLARE
    doc varchar2(3800) :=
    '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!--W3C Schema generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:context="http://ibtco.com/common/exception/context" targetNamespace="http://ibtco.com/common/exception/context" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:simpleType name="ContextValueType">
              <xs:annotation>
                   <xs:documentation>data types for properties</xs:documentation>
              </xs:annotation>
              <xs:restriction base="xs:string">
                   <xs:enumeration value="boolean"/>
                   <xs:enumeration value="char"/>
                   <xs:enumeration value="byte"/>
                   <xs:enumeration value="int"/>
                   <xs:enumeration value="long"/>
                   <xs:enumeration value="float"/>
                   <xs:enumeration value="double"/>
                   <xs:enumeration value="decimal"/>
                   <xs:enumeration value="date"/>
                   <xs:enumeration value="time"/>
                   <xs:enumeration value="dateTime"/>
                   <xs:enumeration value="string"/>
              </xs:restriction>
         </xs:simpleType>
         <xs:complexType name="ContextPropertyType">
              <xs:annotation>
                   <xs:documentation>
                        for holding name/value pair for application data
                   </xs:documentation>
              </xs:annotation>
              <xs:simpleContent>
                   <xs:extension base="xs:string">
                        <xs:attribute name="Name" type="xs:Name" use="required"/>
                        <xs:attribute name="Type" type="context:ContextValueType" use="optional"/>
                   </xs:extension>
              </xs:simpleContent>
         </xs:complexType>
         <xs:complexType name="ExceptionContextType">
              <xs:annotation>
                   <xs:documentation>
                        for holding the data from applications
                   </xs:documentation>
              </xs:annotation>
              <xs:sequence>
                   <xs:element name="Property" type="context:ContextPropertyType" minOccurs="0" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="ExceptionContext" type="context:ExceptionContextType">
              <xs:annotation>
                   <xs:documentation>
                        top level element exception context
                   </xs:documentation>
              </xs:annotation>
         </xs:element>
    </xs:schema>';
    BEGIN
    dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/context', doc);
    END;
    DECLARE
         l_errormsgid VARCHAR2(30);
         l_errorinfo VARCHAR2(100);
         l_error_context          CLOB; -- Error Stack
         l_error_context_data     CLOB;     -- XML Context
         l_var_xml_context     VARCHAR2(4000);
         l_var_error_stack     VARCHAR2(4000);
         l_sqlCode          UTL_ERROR_LOGS.ERROR_CODE%TYPE;
         p_ErrorMsgId NUMBER := '0';
         p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
         l_xml_context SYS.XMLTYPE;
         l_count number :=0;
    l_ret     NUMBER;
    BEGIN
         -- Store XML in a clob
         l_var_xml_context := '<ExceptionContext>
    <Property Name="Name1" Type="boolean">true</Property>
    <Property Name="Name2" Type="string">String</Property>
    </ExceptionContext>';
         l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
    <!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
    <ExceptionContext
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://ibtco.com/common/exception/context"
    >
    <Property Name="Name1" Type="boolean">true</Property>
    <Property Name="Name2" Type="string">String</Property>
    </ExceptionContext>';
         DBMS_LOB.CREATETEMPORARY
    lob_loc => l_error_context_data,
    cache => TRUE
         DBMS_LOB.WRITE
         lob_loc =>l_error_context_data,
         amount => length(l_var_xml_context),
         offset => 1,
         buffer => l_var_xml_context
         l_xml_context := XMLTYPE(l_error_context_data);
         -- validate against XML schema
         --l_xml_context.schemavalidate();
         l_ret := l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
         IF l_ret = 1 then
              dbms_output.put_line('Data is valid:' || l_ret );
         ELSE
              dbms_output.put_line('Data is invalid:' || l_ret);
         END IF;
    END;
    /

    problem was with the parameter you have passed as schema url.
    here is the modified code.
    problem was in this line.
    l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
    you have to pass the url as just a string without the double quotest (").
    now it returns 1.
    SQL> DECLARE
    2 l_var_xml_context VARCHAR2(4000);
    3 l_xml_context SYS.XMLTYPE;
    4 l_ret NUMBER;
    5 BEGIN
    6 l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
    7 <ExceptionContext xmlns="http://ibtco.com/common/exception/context" xmlns:xsi="http://www.w3.o
    rg/2001/XMLSchema-instance" xsi:schemaLocation="http://ibtco.com/common/exception/context
    8 http://ibtco.com/common/exception/context">
    9 <Property Name="Name1" Type="boolean">true</Property>
    10 <Property Name="Name2" Type="string">String</Property>
    11 </ExceptionContext>';
    12 l_xml_context := XMLTYPE(l_var_xml_context);
    13
    14 l_ret := l_xml_context.isschemavalid('http://ibtco.com/common/exception/context');
    15 IF l_ret = 1 then
    16 dbms_output.put_line('Data is valid:' || l_ret );
    17 ELSE
    18 dbms_output.put_line('Data is invalid:' || l_ret);
    19 END IF;
    20 END;
    21 /
    Data is valid:1

  • Execute oracle stored procedure from C# always returns null

    Hi,
    I'm trying to execute a stored procedure on oracle 9i. I'm using .Net OracleClient provider.
    Apparently, I can execute the stored procedure, but it always returns null as a result (actually all the sp's I have there returns null)! I can execute any text statement against the database successfully, and also I can execute the stored procedure using Toad.
    This is not the first time for me to call an oracle stored procedure, but this really is giving me a hard time! Can anyone help please?
    Below are the SP, and the code used from .Net to call it, if that can help.
    Oracle SP:
    CREATE OR REPLACE PROCEDURE APIECARE.CHECK_EXISTENCE(l_number IN NUMBER) AS
    v_status VARCHAR2(5) := NULL;
    BEGIN
    BEGIN
    SELECT CHECK_NO_EXISTENCE(to_char(l_number))
    INTO v_status
    FROM DUAL;
    EXCEPTION WHEN OTHERS THEN
    v_status := NULL;
    END;
    DBMS_OUTPUT.PUT_LINE(v_status);
    END CHECK_CONTRNO_EXISTENCE;
    C# Code:
    string connStr = "Data Source=datasource;Persist Security Info=True;User ID=user;Password=pass;Unicode=True";
    OracleConnection conn = new OracleConnection(connStr);
    OracleParameter param1 = new OracleParameter();
    param1.ParameterName = "v_status";
    param1.OracleType = OracleType.VarChar;
    param1.Size = 5;
    param1.Direction = ParameterDirection.Input;
    OracleParameter param2 = new OracleParameter();
    param2.ParameterName = "l_number";
    param2.OracleType = OracleType.Number;
    param2.Direction = ParameterDirection.Input;
    param2.Value = 006550249;
    OracleParameter[] oraParams = new OracleParameter[] { param1, param2 };
    OracleCommand cmd = new OracleCommand("CHECK_EXISTENCE", conn);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.AddRange(oraParams);
    conn.Open();
    object result = cmd.ExecuteScalar();
    conn.Close();

    Hi,
    Does that actually execute? You're passing two parameters to a procedure that only takews 1 and get no error?
    Your stored procedure doesnt return anything and has no output parameters, what are you expecting to be returned exactly?
    If you're trying to access V_STATUS you'll need to declare that as either an output parameter of the procedure, or return value of the function, and also access it via accessing Param.Value, not as the result of ExecuteScalar.
    See if this helps.
    Cheers,
    Greg
    create or replace function myfunc(myinvar in varchar2, myoutvar out varchar2) return varchar2
    is
    retval varchar2(50);
    begin
    myoutvar := myinvar;
    retval := 'the return value';
    return retval;
    end;
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    public class odpfuncparams
         public static void Main()
          OracleConnection con = new OracleConnection("user id=scott;password=tiger;data source=orcl");
          con.Open();
          OracleCommand cmd = new OracleCommand("myfunc", con);
          cmd.CommandType = CommandType.StoredProcedure;
          OracleParameter retval = new OracleParameter("retval",OracleDbType.Varchar2,50);
          retval.Direction = ParameterDirection.ReturnValue;
          cmd.Parameters.Add(retval);
          OracleParameter inval = new OracleParameter("inval",OracleDbType.Varchar2);
          inval.Direction = ParameterDirection.Input; 
          inval.Value="hello world";
          cmd.Parameters.Add(inval);
          OracleParameter outval = new OracleParameter("outval",OracleDbType.Varchar2,50);
          outval.Direction = ParameterDirection.Output;
          cmd.Parameters.Add(outval);
          cmd.ExecuteNonQuery();
          Console.WriteLine("return value is {0}, out value is {1}",retval.Value,outval.Value);
          con.Close();
    }

  • Select query on table rcv_lots_interface is always returning null

    Hi ,
    I need a help on the below issue.
    The issue is after creating PO in Oracle 11i I receive it in MSCA application.
    When we receive it at that point data gets inserted in the table " rcv_transactions_interface " and we have written a trigger on it.
    From the trigger on table " rcv_transactions_interface " we are calling a package and in the package we have select query on "rcv_lots_interface."
    But the select query is always returning null even though we are passing the correct "interface_transaction_id " and also after the "Receiving Transaction Processor" is executed i can see data in the table " RCV_LOT_TRANSACTIONS " for the same transaction.
    Below is the sample code i am using.
    CREATE OR REPLACE TRIGGER inv.RCV_TRAN_TRIGGER
    AFTER UPDATE
    ON po.rcv_transactions_interface
    FOR EACH ROW
    WHEN (NEW.processing_status_code='PENDING'
    AND NEW.destination_type_code IN ('INVENTORY','RECEIVING')
    AND NEW.mobile_txn = 'Y')
    DECLARE
    PRAGMA AUTONOMOUS_TRANSACTION;
    v_user_id NUMBER;
    v_interface_transaction_id NUMBER;
    v_organization_id NUMBER;
    v_item_id NUMBER;
    v_quantity NUMBER;
    v_resp_id NUMBER;
    v_mobile_txn VARCHAR2(5);
    v_shipment_header_id NUMBER;
    v_bill_of_lading VARCHAR2(100);
    v_group_id NUMBER;
    v_header_interface_id NUMBER;
    BEGIN
    v_interface_transaction_id := :NEW.interface_transaction_id;
    v_organization_id := :NEW.to_organization_id;
    v_user_id := :NEW.created_by;
    v_item_id := :NEW.item_id;
    v_quantity := :NEW.quantity;
    v_resp_id :=fnd_profile.VALUE('RESP_ID');
    v_transaction_type := :NEW.transaction_type;
    v_mobile_txn := :NEW.mobile_txn;
    v_bill_of_lading := :NEW.bill_of_lading;
    v_group_id := :NEW.group_id;
    v_header_interface_id := :NEW.HEADER_INTERFACE_ID;
    INV.INV_RCV_TRX_PKG.INV_RCV_LABEL_GEN_PRC( v_user_id,
    v_interface_transaction_id,
    v_item_id,
    v_quantity,
    v_organization_id,
    v_resp_id,
    v_shipment_header_id,
    v_bill_of_lading,
    v_header_interface_id,
    v_group_id);
    END;
    CREATE OR REPLACE PACKAGE BODY INV.INV_RCV_TRX_PKG
    AS
    PROCEDURE INV_RCV_LABEL_GEN_PRC( p_user_id IN NUMBER,
    p_interface_transaction_id IN NUMBER,
    p_item_id IN NUMBER,
    p_quantity IN NUMBER,
    p_organization_id IN NUMBER,
    p_resp_id IN NUMBER,
    p_shipment_header_id IN NUMBER,
    p_bill_of_lading IN VARCHAR2,
    p_header_interface_id IN NUMBER ,
    p_group_id IN NUMBER
    IS
    v_user_id NUMBER;
    v_print BOOLEAN;
    v_resp_id NUMBER;
    v_resp_appl_id NUMBER;
    v_lot_num VARCHAR2(50);
    BEGIN
    BEGIN
    SELECT application_id
    INTO v_resp_appl_id
    FROM apps.fnd_responsibility_tl frt
    WHERE responsibility_id=p_resp_id;
    END;
    apps.fnd_global.apps_initialize(p_user_id, p_resp_id, v_resp_appl_id);
    BEGIN
    SELECT rli.lot_num , rli.expiration_date
    INTO v_lot_num ,
    v_expiration_date
    FROM apps.rcv_lots_interface rli
    WHERE rli.interface_transaction_id = p_interface_transaction_id ;
    EXCEPTION
    WHEN OTHERS THEN
    v_lot_num :=NULL;
    v_expiration_date :=NULL;
    apps.fnd_file.put_line(fnd_file.log,'Exception while deriving LOT Number ######### '||p_interface_transaction_id||'------'||SQLERRM);
    END;
    END;
    Need your help to understand why the below query is always returning null and what is the solution for it ?
    SELECT rli.lot_num , rli.expiration_date
    FROM apps.rcv_lots_interface rli
    WHERE rli.interface_transaction_id = p_interface_transaction_id ;
    Thanks
    Jaydeep
    Edited by: user10454886 on Mar 25, 2013 6:31 AM
    Hi ,
    I need a solution to this issue at the earliest.
    Appreciate all of your help
    Thanks
    Jaydeep

    Centinul wrote:
    There are a lot of bugs listed in Metalink with respect to wrong results and function-based indexes.
    Here are a few:
    Bug 4028186 Wrong results if function based index exists
    Bug 4717546 Wrong results / poor plan when function based index exists
    Bug 5092688 Wrong results if function based index exists
    Based on reviewing them the workarounds range from dropping the index to setting "_disable_function_based_index" to TRUE.Facinating. It seems to me that if you use the undocumented intitialization parameter you might just as well drop the FBIs too.
    Another hazard of FBIs is the Law of Unintended Consequences. 2 years ago we tried to use one to speed up a query in a PL/SQL package. Worked OK for that purpose, but an unrelated loader on the affected table ran and rand but never finished until the FBI was dropped.

Maybe you are looking for