Return the string "null" on Ora11

Hi all

I am migrating from a DB ORA11g DB ORA10g and I am currently facing a problem with the data in return.

The thing is that I have a lot of packages in my DB with IN/PARAMETERS in many cases, returning an empty as string ". Below is an example of these packages:

PROCEDURE Test1 (
      inVar                IN       VARCHAR2,   
      fixedOutVar        IN OUT   VARCHAR2,
      inVarOut           IN OUT   VARCHAR2
   )
   IS     
   BEGIN
      fixedOutVar := '';
      inVarOut := inVar;    
      RETURN;
   END Test1;

I am currently using a .net application using the OracleDataAccess client to hit the database

With my old db Ora10, I could capture the "with the right input/OUTPUT parameter, but now, after having migrated to Ora11, my .net application always obtains the string"null"(I get a string that contains the word"null", not a real null...)

Why is this happening? When I used my old Ora10 DB/Client I was able to make it work properly and my .net application received a good empty string of the OUT parameter.

Can I change/set something?

Thank you!

Exact history is somewhat unclear since 10g has been some time ago. .NET framework 2.0 introduced much more than support for all types of null data. ODP.NET introduces the ADO.NET 2.0 support in one of the last 10.2 release, but may not have introduced full support for .NET null immediately. This probably took place in a version 11.x ODP.NET.

When ODP.NET introduced support for null .NET, he now had the ability to represent the values of data type as what most of PL/SQL programs intended to be returned as, which is zero.

Tags: Database

Similar Questions

  • Series read returns the string with excess-need information to extract data from the middle of the string

    I read data from a STI flow meter using the base series writing and reading which used the VISA.  The read string begins with 'OK' or an error code, then a carriage return, then the data follows streaming rate temp pressure flow rate comma comma comma comma Temp... and so on. The string ends with a CR LF.  I need to pull the flow, temperature and pressure data out of the string and write it to a file.  I have difficulties to find a function that will retrieve the data for the string.  Any suggestions?  Thank you.

    Try the subset of string in the palette of the chain.

    Or match the model if you want a more direct control.

    Also a good way is the string analysis, but you must be willing to read oexactly, what happens or an error, pass the entrance.

  • Query must return the values null

    Hi once again, everything

    The query below should return zero values for the date, but instead it brings back each transaction in the table, any ideas why?
    SELECT
    
    CID.transaction_id,
    MMT.ITEM_ORD PART_NUMBER,
    CID.DESCRIPTION,
    CID.TRANSACTION_TYPE_NAME,
    CID.LINE_TYPE_NAME,
    CID.SUBINVENTORY_CODE,
    MMT.TRANSACTION_QUANTITY,
    CID.BASE_TRANSACTION_VALUE TRANSACTION_VALUE,
    GLC.SEGMENT1,
    GLC.SEGMENT2,
    GLC.SEGMENT3,
    GLC.SEGMENT4,
    GLC.SEGMENT6,
    TO_CHAR (MMT.TRANSACTION_DATE, 'DD-MON-YY HH24:MI') transaction_date_and_time,
    TRUNC (MMT.TRANSACTION_DATE) transaction_date
    
    
    
    
    FROM
    
    CST_INV_DISTRIBUTION_DAV_V CID,
    MTL_MATERIAL_TXNS_VAL_V MMT,
    GL_CODE_COMBINATIONS GLC
    
    
    
    
    WHERE
    
    CID.TRANSACTION_ID = MMT.TRANSACTION_ID
    AND CID.REFERENCE_ACCOUNT = GLC .CODE_COMBINATION_ID;
    AND MMT.TRANSACTION_DATE = '26-AUG-11 22:00'

    Yes. It's true. You must use TO_DATE to convert a string to a date and you must use TO_CHAR to convert a date into a string.

  • Return the string Date/time format incorrect output...

    Here's a small sub - VI that I create out the day of the week, day of month, month and year in the form of a table of U16:

    The Date/time string VI get is supposed to produce a string of date in the format "DD/MM/YY" when the enum 'short' is selected. Instead, I get this:

    It seems that the VI is "broken" or documentation is incorrect. Someone at - it to another incountered?

    I'm under LabView 2015 on Windows 7.

    Much too complicated.

  • GetCurrentRow returns the null value while trying to values defined in table advanced VO

    Hi all

    I'm trying to set default values to a bean advanced table according to the selection of LOV in another region. Here is the code and getCurrentRow returns the value null and null pointer exception is throwed. Please let me know where Iam going bad.

       if (pageContext. ) isLovEvent ())

    LovInputSourceId = string pageContext. getLovInputSourceId ();

       if ("poNumber". ) is equal to ()lovInputSourceId))

    pageContext . putDialogMessage (new OAException()"inside Onclick"));

    OAViewObject VO = (OAViewObject) am . findViewObject ()"L3APNonprojbasedpoVO1");

    VO1 OAViewObject = (OAViewObject) am . findViewObject ()"L3APCodingInfoEOVO1");

      VO . setWhereClause (null);

      VO . setWhereClauseParams (null);

      VO . executeQuery ();

      VO1 . setWhereClause (null);

      VO1 . setWhereClauseParams (null);

      VO1 . setWhereClause ("1=2");

      VO1 . executeQuery ();

       if (null! = VO )

       Row ReqRow = (Row) VO.first();  

       if (null ! = ReqRow )

       int idx = VO . getRowCount ();

       for (int xx = 0; xx < idx ; xx ++)

    String Description = (String)VO. getCurrentRow (). getAttribute ()"ItemDescription");

       Number Amount = (Number)VO. getCurrentRow (). getAttribute ("Amount");

       String Company = (String)VO. getCurrentRow (). getAttribute ("Company");

    String ProfitCenter = (String)VO. getCurrentRow (). getAttribute ()'ProfitCenter');

       String Dept = (String)VO. getCurrentRow (). getAttribute ("Dept");

       String Lob = (String)VO. getCurrentRow (). getAttribute ("Lob");

       String Account = (String)VO. getCurrentRow (). getAttribute ("Account");

    pageContext . putDialogMessage (new OAException()"inside loops'));

       if (null! = VO1 )

      { am. invokeMethod ("createRow");

    VO1 . getCurrentRow (). setAttribute ()'Description',Description);

      VO1 . getCurrentRow (). setAttribute ("Amount",Amount);

      VO1 . getCurrentRow (). setAttribute ("Company",Company);

      } ReqRow = (Row)VO.next(); }

       else {}

    }

    }

    Here is the method in AM.

    Public Sub createRow()
    {

    OAViewObject vo = (OAViewObject) getL3APCodingProjectEOVO1 ();

    vo.clearCache ();

    If (!) VO.isPreparedForExecution ())
    {
    System.out.println ("project VO executed");
    vo.setWhereClause (null);
    vo.setWhereClauseParams (null);
    vo.setWhereClause ("1 = 2");
    vo.executeQuery ();
    }
    Line = vo.createRow ();
    vo.insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    I modified your code a bit. This code does not require a method of AM.

    If the problem still not solved.

    If you want you can try this and let us know what happens.

    if (pageContext.isLovEvent())
    {
       String lovInputSourceId = pageContext.getLovInputSourceId();
       if("poNumber".equals(lovInputSourceId))
      {
      pageContext.putDialogMessage(new OAException("Inside Onclick"));
      OAViewObject VO=(OAViewObject)am.findViewObject("L3APNonprojbasedpoVO1");
      OAViewObject VO1=(OAViewObject)am.findViewObject("L3APCodingInfoEOVO1");
      VO.setWhereClause(null);
      VO.setWhereClauseParams(null);
      VO.executeQuery();
    
      VO1.setWhereClause(null);
      VO1.setWhereClauseParams(null);
      VO1.setWhereClause("1=2");
      VO1.executeQuery();
    
      if (VO != null)
      {
      for( Row ReqRow = (Row) VO.first();  ReqRow != null; ReqRow = (Row) VO.next())
      {
      String Description = (String)ReqRow.getAttribute("ItemDescription");
      Number Amount = (Number)ReqRow.getAttribute("Amount");
      String Company = (String)ReqRow.getAttribute("Company");
      String ProfitCenter = (String)ReqRow.getAttribute("ProfitCenter");
      String Dept = (String)ReqRow.getAttribute("Dept");
      String Lob = (String)ReqRow.getAttribute("Lob");
      String Account = (String)ReqRow.getAttribute("Account");
      pageContext.putDialogMessage(new OAException("Inside for Loop"));
    
      if (VO1 != null)
      {
      Row newRow  = VO1.createRow();
      newRow.setAttribute("Description",Description);
      newRow.setAttribute("Amount",Amount);
      newRow.setAttribute("Company",Company);
      VO1.insertRow(newRow);
      }
      }
      }
      }
    }
    

    See you soon

    AJ

  • regexp_substr - how to search for two different words and result based on returning a different part of the string

    Hello everyone

    I fight with this regexp_substr and I wonder if there is a way to deal with it. I have two string type in a column with the following structure:

    structure 1 always starts with "app.catalog.school.", as the following three examples

    app.catalog.school.DB.BT

    app.catalog.school.B.FTA

    app.catalog.school.ACA.CD

    structure 2 always begins with "app.catalog.admin.", as the following three examples

    app.catalog.admin.C.ABC

    app.catalog.admin.BT.AP

    app.catalog.admin.MI.RT

    If the value of the field begins with "app.catalog.school." it should return everything after the last period (.) as follows

    BT

    FREE TRADE AGREEMENT

    CD

    If the value of the field begins with "app.catalog.admin." it should return the string between the third and fourth period (.) as follows

    C

    BT

    MI

    I actually have a solution to this:

    decode)

    regexp_substr (myfield, ' [^.] +' 1, 3), 'school', regexp_substr (myfield, ' [^.] +' 1, 5), "admin", regexp_substr (myfield, ' [^.] +' 1, 4)

    )

    I am not happy with the solution above using decode(). I think I should be able to solve this problem purely with reg_exp but after hours to try again without success. You have better solution/suggestion?

    I use Oracle version 10.2. Thank you very much.

    Oops: Oracle version 10.2, here to use regexp_replace

    WITH testdata UNTIL
    (SELECT 'app.catalog.school.DB.BT' FROM DUAL str

    UNION ALL

    SELECT 'app.catalog.admin.C.ABC' FROM DUAL
    )

    Select
    Str
    , regexp_replace (str, ' ^. * (admin | school\.)) [ ^.] +)\. ([^.] +). (* $', "\2") res
    of testdata

    RES STR

    "app.catalog.school.DB.BT" 'BT '.

    'app.catalog.admin.C.ABC' 'C '.

    to 11.x, we can use regexp_substr because he has this subexpression setting more pure accident.

    WITH testdata UNTIL
    (SELECT 'app.catalog.school.DB.BT' FROM DUAL str

    UNION ALL

    SELECT 'app.catalog.admin.C.ABC' FROM DUAL
    )

    Select
    Str
    , regexp_substr (str, ' (admin | school\.)) [ ^.] +)\. ([^.] +)', 1, 1, null, res) 2.
    of testdata

    STR RES
    app.catalog.school.DB.BT BT
    app.catalog.admin.C.ABC C

    Post edited by: extended chris227

  • Help with Bluetooth receive the string

    Hello

    I am trying to receive data from my paired device (BT - hyperterminal) and to treat once a carriage return is detected '\r '.

    I am able to receive and display the data, but for some reason that each character is stored separately with my efforts of toString().

    My code is as follows when there is incoming data:

          public void dataReceived(int length)
            {
                int len=0;
    
                try
                {
                    // Read the data that arrived.
                if((len = _port.read(_receiveBuffer, 0, length == -1 ? _receiveBuffer.length : length)) != 0)
                    {
    _data.append(new String( _receiveBuffer, 0, _receiveBuffer.length));
    
        if(len == 1 && _receiveBuffer[0] == '\r')
                      {
        _receiveBuffer[1] = '\n';
                ++len;
           _dataReceived = _data.toString();
       _dataReceived = _dataReceived.trim();
    
    DataProcess();
    //clean up the data buffer
             _receiveBuffer = new byte[1024] ;
              _data.delete(0, _data.length());
    
                                }
                    }
    
                } catch(IOException ioex)
                   {
                   //      Catch and re-throw the exception.
                       throw new RuntimeException(ioex.toString());
                   }
    

    First of all, DataProcess() displays the value of _dataReceived, then continues with the treatment...

    When I type something in hyperterminal dialog box. DataProcess alert() returns the string in a tank instead of a row column.

    T

    E

    S

    T

    instead of TEST

    Any suggestions would be greatly appreciated...

    Thank you

    David

    Curve8330 + JDE4.5 (Eclipse)

    Thanks Peter.

    I can now receive characters from hyperterminal.

    I changed my code to:

    try
                {
                    // Read the data that arrived.
    
                    if((len = _port.read())>0){
    
             DataReadChar = (char)len;
    
        _data.append(DataReadChar);             
    
                    Dialog.alert("Data is "+_data);
    
                        if(DataReadChar == '\r')
                        {
    
                     _dataReceived = _data.toString();
                     _dataReceived = _dataReceived.trim();
                    Dialog.alert("Data Received  is: "+ _dataReceived);
                        DataProcess();
                        _receiveBuffer = new byte[1024];
                        _data.delete(0, _data.length());
    
                        }
    
  • DBMS_CRYPTO. HASH returns the value encrypted letters

    Hi all

    SE 12.1

    I'm using dbms_crypto. Hash to encrypt the values. But encrypted the returned string is at the top of the case. Calling WebService Im externally requires the proper case...  I've seen other ciphers (java-based) hash functions that seem to properly encrypt with a mixture of cases, what I need.

    Is it possible to return the string that is encrypted in the proper case.

    DECLARE

    l_ccn_raw RAW (128);

    BEGIN

    l_ccn_raw: = utl_raw.cast_to_raw('1234');

    l_ccn_raw: = dbms_crypto.hash (l_ccn_raw, dbms_crypto.hash_sh256);

    dbms_output.put_line (' TOKEN: ' |) ( l_ccn_raw) ;

    END;

    You can always try dbms_output.put_line (' TOKEN: ': bass (l_ccn_raw));

    But are you sure that you don't need a hashvalue base64-coded?

    dbms_output.put_line (' TOKEN: ' | utl_raw.cast_to_varchar2 (utl_encode.base64_encode (l_ccn_raw)));

  • PersistentStore.getPersistentObject returns the null value?

    I use a random key to retrieve a shape of the object PersistentStore

    persist is PersistentStore.getPersistentObject (KEY);.

    Works fine on the Simulator (OS 5), when I take the code signed to the device (BB OS 5.0 Bold 8900)

    For some reason, it returns null, without exception. Thereafter any API I inoke on PersistentStore / persist returns null without exception persist even when the null value.

    I don't know if it's one thing to eclipse debugger, but even if the debugger shows that objects are null. Controls null applied in the code seems to fail, what does code see these objects as non-null. Pheww! How is it possible.

    In this code still shows up as null, then safetyTable and orderedkeys. However, the value null check in the failure code.

    At a later stage in the code, when I try to access orderedkeys are null again! Are struggling with this problem for two days, all the pointers would be very comfortable.

                        persist = PersistentStore.getPersistentObject( KEY );
                        persistOrderedKeys = PersistentStore.getPersistentObject(KEY_ORDERED_KEYS);
                        safetyTable = (Hashtable)persist.getContents();
                        orderedKeys = (Vector)persistOrderedKeys.getContents();
                        if (safetyTable == null)
                        {
                            safetyTable = new Hashtable();
    
                            persist.setContents(safetyTable);
                            persist.commit();
                        }
    
                        if (orderedKeys==null)
                        {
                            orderedKeys=new Vector();
    
                            if (safetyTable.size()>0)
                            {
                                Enumeration addressKeys = safetyTable.keys();
                                while(addressKeys.hasMoreElements())
                                {
                                    orderedKeys.addElement((String)addressKeys.nextElement());
                                }
                            }
                            persistOrderedKeys.setContents(orderedKeys);
                            persistOrderedKeys.commit();
    
                        }
    

    "I don't know if it's one thing to eclipse debugger.

    I had problems of this kind when I don't have a level of operating system for the device I am debugging on.

  • What is the empty string, the value null in the column, or...?

    I use Oracle 11.2, a table tb_class as follows:

    TB_CLASS (number (3) id, varchar2 (32) nm, seqNum number (3));

    1, 212
    2, "under", 12
    3, 'qq', 12

    Select * from TB_CLASS where id = 1 and n = null;... .no selected line
    Select nvl (nm) in the TB_CLASS where id = 1; ... 1 selected line

    Any know what's in the column of row id = 1 nm? I thought that it is an empty string, but why it returns no rows in the first query?

    Thank you!

    (1) in Oracle there is no difference between NULL and an empty string.

    (2) NULL is never equal to what whatsoever (including another NULL). NULL is never spotty what whatsoever (including another NULL). You must use the IS NULL and IS NOT NULL operators to search for NULL values

    SELECT *
      FROM tb_class
     WHERE nm IS NULL
    

    or

    SELECT *
      FROM tb_class
     WHERE nm IS NOT NULL
    

    Of course, it is also possible that you declare that the NM column contains one or more spaces or it contains one or more non-printable characters and not a NULL value. That's why we asked you what dump (nm) returns

    Justin

  • How to get the query of the region "PL/SQL function body returns the query string"?

    Hello

    is it possible to get the query string from the region of type "PL/SQL function body returns the query string"?

    I can get the definition of the region as a PL/SQL procedure, but I am interested in the returned query. I tried to write something like

    < pre > v_return_query: = «...» » ;
    : P49_QUERY: = v_return_query;
    Return v_return_query; < / pre >

    to save the return on hidden item P49_QUERY string, but it does not work. I get the error message: ERR-1002 cannot find the item for the "P49_QUERY" element ID in the application '4000 '.

    Kind regards
    Przemek

    If you need to make reference to a page element in the block then you can use this type of control to avoid having to use generic column names:

    if apex_application.get_current_flow_sgid(:APP_ID) = apex_application.get_sgid then-- runtime  :P9_SQL := vSQL;else-- design time  null;end if;
    

    But if all you want to do is capture the SQL debugging you can take all the references element in the block and use the insert statement (in a debug table) as I showed earlier.

    Scott

  • AS3 returns a string of XML nodes as null...

    I am working on a project that calls and search in an XML spreadsheet that looks like this:

        <Searchtext Wordlookup="john smith">
            <location>$1</location>
            <Name>john smith</Name>
        </Searchtext>

    and he keeps going for about 100 people.

    Now, my flash takes these data and allows the user to click on a TextBox filled beforehand with a name (whose e.target.data.text is combined with the XML using @Wordlookup) or type the name of the person (new corresponding content of the text box to @Wordlookup) which translates the location of this person to light upward (MC is named the same as the location for each node). This effect works perfectly well by using this code:

      var result:String = xmldata.Searchtext.(@Wordlookup == inputTxt.text.toLowerCase()).location.toString();  

    Now I want to do the opposite; Click on a location, and the code will be able to match the name of the movieclip to node my xm - light to the top of this location, location and name of the person in the output text box. Only problem with this Flash apparently thinks a knot in my xml is now a variable which is not set (it should return the name associated with the location in my xml). I looked up and down for a solution, but I can't seem to solve it (this is probably simple, and I go facepalm myself) inducing code error is the following:

      var resultz:String = xmldata.Searchtext.(location.text() == e.target.name).Name.toString();

    And the error produced is as follows: ReferenceError: Error #1065: location Variable is not defined.

    You don't know exactly why this is the case, thank you in advance for any help!

    All your nodes have a node location? If this isn't the case, you might be better off using child ('location').

  • Returns the null value in HasMap.get ().

    Hi all.
    Just read the docs of java on hashmap and was interested in this topic the get() method:

    A NULL return value does not necessarily mean that the map contains no mapping for the key; It is also possible that the map explicitly maps the key null. The containsKey operation may be used to distinguish these two cases.

    I took in a case, which has been talked about: If the map allow nulls, returned by get() null will be just one key of the pair-> null value. But the second case is not clear to me. Please, show me an example for the latter case, when get() can returned null.

    sphinks wrote:
    I took in a case, which has been talked about: If the map permits null values, returned by get() null will be just a key pair-> null value. But the second case is not clear to me. Please, show me an example for the latter case, when get() can returned null.

    There is no second case. There is a single case, if you put a null value in a map, get() will return null. And because of that, if you need to know if a certain key is in the containsKey() worksheet should be used instead of the get() method.

  • return the names of columns which line values are not null.

    Hi I m a new db admin guy, and I need a sql script that should return the names of columns of the given table. and the returned column must be the value (fyi - if the column contains the value null column name would not come to the o/p of sql).
    Exmple:
    name of the table - A
    fresh status s.no name brand
    1 null aa 45P
    paid 2 null bb 30
    3 cc paid 35P

    (FYI - 1) if I give the table name (A) and s. n. (2) o/p should be - name, mark.
    (2) if I give the status of tablename (A) and s. n (1) the o/p should be - name, brand.

    Thank you
    Krishna.

    Published by: user13294228 on June 14, 2010 22:54

    BTW,
    The previous solution is for all values of the column, if you want a specific line, you can add it in where clause.
    I mean in your example, it you look like:

    SET serveroutput on;
    
    DECLARE
       l_cnt          NUMBER;
       l_str          VARCHAR2 (255) := '';
       l_table_name   VARCHAR2 (255) := 'YOUR_TABLE_NAME';
       l_col_cond     VARCHAR2 (255) := 'S_NO';
       l_val          NUMBER         := 1;
    
       CURSOR c_col
       IS
          SELECT column_name
            FROM user_tab_columns
           WHERE table_name = l_table_name;
    BEGIN
       FOR i IN c_col
       LOOP
          EXECUTE IMMEDIATE    'SELECT COUNT ('
                            || i.column_name
                            || ') FROM '
                            || l_table_name
                            || ' WHERE '
                            || l_col_cond
                            || ' = '
                            || l_val
                       INTO l_cnt;
    
          l_str := l_str || CASE
                      WHEN l_cnt = 0
                         THEN ''
                      ELSE i.column_name
                   END || ',';
       END LOOP;
    
       l_str := SUBSTR (l_str, 1, LENGTH (l_str) - 1);
       DBMS_OUTPUT.put_line (l_str);
    END;
    

    Saad,

    Published by: S.Nayef on June 15, 2010 11:54

  • FIRST analytical functions returns the null line

    The following query returns a null line when there is no such thing as a line for the predicate. Is it a bug or expected behaviour. If so what is the meaning of the null row, is it not logical?



    SELECT NVL (max (ah.fyr_end_dt) KEEP (DENSE_RANK FIRST ORDER BY ah.as_of_dt DESC), ' RETURNED NULL')
    Of account_history ah
    WHERE
    Ah.acct_id = 999
    AND trunc (ah.as_of_dt) < = 31 December 08 '
    ;

    Hello

    user4900730 wrote:
    Moreover, in my example how I distinguish the case where a line really exists, but the column is null when there is no such thing as a line and the FIRST function returns the same value null? Hopefullly I should be able to do it in a single SQL and know the difference?

    COUNT (*) > 0, but COUNT (col_x) = 0, then there is a line, but col_x happened to be null.

    For example, the following query shows that there is 1 row in the group with the lowest name ("ADAMS"), but the column comm in all ranks of this group is null:

    SELECT     COUNT (*)    KEEP (DENSE_RANK FIRST ORDER BY ename)
                              AS total_cnt
    ,     COUNT (comm) KEEP (DENSE_RANK FIRST ORDER BY ename)
                              AS comm_cnt
    FROM     scott.emp
    ;
    

    Output:

     TOTAL_CNT   COMM_CNT
    ---------- ----------
             1          0
    

    The employee whose highest name ("WARD") has a number in the comm column.

Maybe you are looking for