NVL date do not return null

Hello

I must me NVL date if the date is null, but it returns nothing with the following sql.
SELECT   NVL(TO_CHAR(PRODUCT_DATE,'MM/DD/YYYY'),'NA') dt 
from product_master where product_no = 'SG9800' 
How can I me NA if PRODUCT_DATE is null?

Thank you

Means, in case you have not any metting record the condition of the place where clause, you need the value of NA. Is it? If so, use the below...

SELECT   NVL(TO_CHAR(PRODUCT_DATE,'MM/DD/YYYY'),'NA') dt
from product_master where product_no = 'SG9800'
union
select 'NA' from dual where 0= ( select count(*) from product_master where product_no = 'SG9800' ) ;

Kind regards
Lifexisxnotxsoxbeautiful.

Tags: Database

Similar Questions

  • IOM, API - getData() - no data is not returned by the user account

    Hi all

    I have a question for the AD account data. The problem is when I try to get the account data from any account (account status: enabled, the account Type: primary), the API GetData returns a blank card and I don't know why. I see this account in the accounts of the user to the IOM. This account has been created through reconciliation of AD and this account is only one (primary and active).

    In the test environment my code works very well, but production only.

    Here is part of my code where I get some details of account.

    ...

    accounts = provServ.getAccountsProvisionedToUser (take);

    Logger.Finest ("getUsersToTheLookupTask-> user Details - take:" + take + ", DisplayName:" + userDisplayName);

    Iterator it = accounts.iterator ();

    {while (IT.hasNext ())}

    Account ad_account = (Account) it.next ();

    If (ad_account.getAppInstance () .getApplicationInstanceName () .equalsIgnoreCase (appInstName) & & ad_account.getAccountType () .equals (Account.ACCOUNT_TYPE.) (Primary)) {}

    Logger.Finest ("getUsersToTheLookupTask-> AppInstance ApplicationInstanceName:" + ad_account.getAppInstance () .getApplicationInstanceName ());

    Logger.Finest ("getUsersToTheLookupTask-> AppInstance DisplayName:" + ad_account.getAppInstance () .getDisplayName ());

    Logger.Finest ("getUsersToTheLookupTask-> AccountDescriptiveField:" + ad_account.getAccountDescriptiveField ());

    Logger.Finest ("getUsersToTheLookupTask-> getAccountID:" + ad_account.getAccountID ());

    String UtilisateurDN = getADUserDN (appInstName, take);

    AccountData accountdata = ad_account.getAccountData ();

    Map < String, Object > accdata = accountdata.getData ();                         //THIS RETURN EMPTY map < String, Object >! And I don't know why!

    Logger.Finest ("--> account data:" + accdata);

    String userOrg = accdata.get("UD_ADUSER_ORGNAME").toString ();

    String userCN = accdata.get("UD_ADUSER_COMMONNAME").toString ();

    Logger.Finest ("-> CN an ORG:" + userOrg + "-" + userCN);

    userOrg = userOrg.substring (userOrg.indexOf ("OR ="));

    String UtilisateurDN = "CN =" + userCN + "," + userOrg;

    Logger.Finest ("getUsersToTheLookupTask-> pair key / value:" + UtilisateurDN + ":" + userDisplayName);

    userMap.put (UtilisateurDN, userDisplayName);

    }

    }

    ...

    You have an idea why I'm not able to get user account data?

    Thank you!

    Milan

    Fact.

    The following API does not return the AccountData in the AccountVO. Old API IOM at 11.1.2.0 in 11.1.2.1 IOM Yes.

    accounts = provServ.getAccountsProvisionedToUser (take);

    If you need obtain account data, use:

    Acccriteria SearchCriteria = new SearchCriteria (ProvisioningConstants.AccountSearchAttribute.APPINST_KEY.getId (), "*", SearchCriteria.Operator.EQUAL);

    accounts = provServ.getAccountsProvisionedToUser (take, acccriteria, null, true);

    ...

    AccountData accountdata = ad_account.getAccountData ();

    Card accdata = accountdata.getData ();

    GetData returns then map of attributes as I expected.

  • Web service JSON data do not return does not

    I created an application with a test sample local (active forlder) json file called "contacts.json" as below, just to test if I have any return data. The data returned in a listview without problem.

    [{ "id":1, "firstname": "Mike", "lastname": "Chepesky", "title": "Sr. Editor",
      "image": "images/data/mike_chepesky.png", "active": true, "gender": "m" },
    { "id":2, "firstname": "Westlee", "lastname": "Barichak", "title": "Talent Scout",
      "image": "images/data/westlee_barichak.png", "active": true, "gender": "m" }]
    

    I then changed the source for 'http://... '. "a link is valid and I checked, and it returns the data in a classic web browser (firefox). But he won't be in my application.

    What I noticed, is that the difference between the local json file and the return of web service, the web service does not return the square brackets "[...]" the json... I suspect that maybe that's the problem? If so, how do I manipulate the data source in my application to incorporate media? Is the returned data (without brackets) real...

    {"status":"successful","current_version":"1.1.1","latest_version":"1.2.0.0","details":"1. Item A 2. Item B 3. Item C","type":"Force update"}
    

    Thank you.

    If I'm not wrong, your local file json contains an array of objects, and that you load from your server contains a single object.
    If so, you can not call insertList (data), use insert (data)

  • Why between date is not return data for this query?

    Hello
    I have a table with this structure and I write this query to retrieve a few lines based on certain conditions, but this query returns no data. Can you please tell why?
    ID     DT
    
    003     11/8/2011
    002     10/8/2011
    001     9/8/2011
    And the execution of the query:
    SELECT * FROM TABLE_NAME WHERE DT BETWEEN TO_DATE('08/08/2011','dd/mm/yyyy') AND TO_DATE('12/08/2011','dd/mm/yyyy');
    Published by: starting August 13, 2011 07:10

    >

    >

    But what is the problem with that, why this date does not match when I'm providing the date format?

    What part don't you understand? You have not used TO_DATE when inserting data and default date format is dd/mm/yyyy, right? Same default date format is used if you are running:

    SELECT * FROM TABLE_NAME

    Original of your post States select returns above:

    ID     DT
    
    003     11/8/2011
    002     10/8/2011
    001     9/8/2011
    

    So the dates that you inserted are November 8, 2011, October 8, 2011-September 8, 2011. TO_DATE('08/08/2011','dd/mm/yyyy') is now August 8, 2011 and TO_DATE('12/08/2011','dd/mm/yyyy') is August 12, 2011. Then of course:

    SELECT * FROM TABLE_NAME WHERE DT BETWEEN TO_DATE('08/08/2011','dd/mm/yyyy') AND TO_DATE('12/08/2011','dd/mm/yyyy').

    will return all the lines. Bottome line - never write code that uses the implicit conversions date since your code becomes dependent on the NLS client settings and maybe working for a client and fail or produce erroneous results for other customers.

    SY.

  • How to manage the Data Association output when no line not returned?

    BPM 11 g, I use a Service to select a line in an external database in passing a parameter using a database adapter.  Works fine when a row is returned.  But if no row is returned (which can happen, because no match is not found on the selection based on the value of the parameter), I get an error on the composite as output data Association has return values, including integers, mapped to a data object, I defined in the process.  Well, if no row is found, the integer value is empty and mistakes to try to save him.

    How to handle this situation?

    The specific message is:

    The expression bpmn:getDataOutput('wm91AInterfaceMainCollection') / ns:Wm91AInterfaceMain [1] / ns:board is empty. An attempt to read or copy the referenced data or calculated by the XPath generated invalid data, according to the XML schema, or did not contain some optional data. Ensure that the variable result or expression named in the error message is not empty. Enable related data elements XML schema validation for the enforcement data are valid.

    I must be missing something obvious here, but can't find a way to handle this.  Thanks in advance!

    Hey Joe,

    Of course, others will be have another idea, but opt for the XSLT option for mapping your data.  Using XSLT, you can check for null in an 'if '.

    Dan

  • ODDM 4.1.1.888 transform script function getProperty() does not return NOT NULL;

    Hello

    In the 4.0.0.833 version the funcion getProperty() returns NULL when the dynamic propertyare not out,

    e.g. VRFDA = table.getProperty ("Text"); -Returns a null value if the dynamic property 'Text' does not exist. The Variable VRFDA is nothing

    I have version 4.1.1.888 and the GetFilter() function returns DO NOT null when the dynamic property does not exist.

    Could you tell me what value returns the GetFilter() function when the dynamic property does NOT exist?


    Thank you

    In version 4.1 the getProperty function will return an empty string if the dynamic property does not exist.

    David

  • Between the operator on systimestamp do not return data

    create the table test_ts1 (timestamp);

    insert into test_ts1 values (systimestamp);

    insert into test_ts1 values (systimestamp-interval '1' time);

    commit;

    Select * from test_ts1 where one between systimestamp - interval '1' time and systimestamp;

    do not return data, could you please help? I would if necessary the param values.

    --

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    PL/SQL Release 11.2.0.2.0 - Production

    "CORE 11.2.0.2.0 Production."

    AMT for Linux: Version 11.2.0.2.0 - Production

    NLSRTL Version 11.2.0.2.0 - Production

    Thank you

    Mahesh

    2 options.

    1 convert your datatype of the column of TIMESTAMP WITH time ZONE SCHEDULE

    SQL > create table test_ts1 (a timestamp with time zone);

    Table created.

    SQL > insert into test_ts1 values (systimestamp);

    1 line of creation.

    SQL > insert into test_ts1 values (systimestamp-interval '1' time);

    1 line of creation.

    SQL > commit;

    Validation complete.

    SQL > select *.
    2 of test_ts1
    3 where one between systimestamp - interval '1' time and systimestamp;

    A
    ---------------------------------------------------------------------------
    MAY 19, 14 09.06.01.135799 AM - 04:00

    2 convert SYSTIMESTAMP TIMESTAMP.

    SQL > DROP TABLE TEST_TS1 IS SERVING;

    Deleted table.

    SQL > create table test_ts1 (timestamp);

    Table created.

    SQL > insert into test_ts1 values (systimestamp);

    1 line of creation.

    SQL > insert into test_ts1 values (systimestamp-interval '1' time);

    1 line of creation.

    SQL > commit;

    Validation complete.

    SQL > select *.
    2 of test_ts1
    3 where one between systimestamp - interval '1' time and systimestamp;

    no selected line

    SQL > select *.
    2 of test_ts1
    3 where one between Mount (systimestamp timestamp) - interval '1' time and cast (systimestamp timestamp);

    A
    ---------------------------------------------------------------------------
    MAY 19, 14 09.04.09.132503 AM

  • date field formulas return but not the time

    Hello everyone, I currently have a field in my database to store a date and time. However, the corresponding field in my forms generator seems only to display the date and not the time. Does anyone have an idea why this is happening?

    Thank you.

    Also, check if you have defined a format mask. If so, make sure that the time format is included.

  • Function MAX to get the recent date does not work as expected

    Hello
    I recently started working on Oracle and came across this problem. I've coded below, given the query to obtain the most recent date in the table and compare with Sysdate + 1 timestamp. I am not able to understand what I coded wrong but the query gives me bad such results as explained below:

    Select NVL (MAX (to_char (max (last_update),' dd/mm/yyyy hh12:mi: ss AM')), to_char (sysdate + 1, ' dd/mm/yyyy') |') 12: 00')
    of Audit_Table_Name
    where col1 = 'AA '.
    and location_type = 'STATE '.
    and original_flag = 'Y '.
    Group of col1, location_type, original_flag;


    Here Max (last_update) of value Audit table contains--> 25/08/2009 12:00:00 AM
    Note: The last_update data type is Date
    If ideally, it should give 26/08/2009 12:00:00 AM, but surprisingly it gives 25/08/2009 12:00:00 AM as output. Can someone explain why this is happening and what to do to get the correct results?

    Kind regards
    Amol

    user11826653 wrote:
    Hello
    I recently started working on Oracle and came across this problem. I've coded below, given the query to obtain the most recent date in the table and compare with Sysdate + 1 timestamp. I am not able to understand what I coded wrong but the query gives me bad such results as explained below:

    Select NVL (MAX (to_char (max (last_update),' dd/mm/yyyy hh12:mi: ss AM')), to_char (sysdate + 1, ' dd/mm/yyyy') |') 12: 00')
    of Audit_Table_Name
    where col1 = 'AA '.
    and location_type = 'STATE '.
    and original_flag = 'Y '.
    Group of col1, location_type, original_flag;

    Here Max (last_update) of value Audit table contains--> 25/08/2009 12:00:00 AM
    Note: The last_update data type is Date
    If ideally, it should give 26/08/2009 12:00:00 AM, but surprisingly it gives 25/08/2009 12:00:00 AM as output. Can someone explain why this is happening and what to do to get the correct results?

    Kind regards
    Amol

    Your sysdate + 1 is the second half of your NVL function it will return only sysdate + 1 when max) last_update) is set to null. I think what you need is

    select to_char(greatest(max(last_update),trunc(sysdate)+1),'mm/dd/yyyy hh:mi:ss AM') 
    
  • PersistentObject.getContents () returns null after app update

    Hello

    I'm trying to track down a bug with PersistentStore.
    Usually when I update the app I get the getContents() stored content.
    However, something in the code has changed from one version to the other and now getContents() returns null.

    I made sure the id has never changed for PersistentStore.getPersistentObject (id);
    I made sure that we use the same basic sdk (4.3.0)
    I made sure that there are the data stored in the stored hash table

    Currently, it's a hash table - no subclass (even though I know that I should change it to a subclass when it's fixed);

    I wonder if there are any suggestions on what might cause the getContents() return null - or which could result in the PersistentStore have cleared.

    What information is needed, please let me know and I'll paste.

    I found the problem after.

    Classes have begun to obscure differently. If the hash table was still readable, but because he could not read the content of the hash table, he would return null.

    It was unexpected, because if you have a custom class persisted and you try to read it, you will get the content, but you can't cast. But with the hash table, it does not return the content (uncastable) and it throws no exceptions...

    I hope this helps someone else who has a similar problem.

  • Need help with ics. SQL return null

    Hi experts WCS.

    I have this ics. SQL statement that returns an IList as null and nothing in the errStr in debugging print.

    IList rsATypes is ics. SQL (, sqlATypes, listName, limit, bCache errStr);

    The code is in one of my jsp. He ran very well in my local JSK (HyperSQL Db), but returns NULL in the case of Test (Oracle DB, if this is another).

    I got the sql statement println during execution and run it directly in Oracle DB (same instance) it returns the expected result set.

    The code snippet:

      System.out.println("## ics.GetSSVar(\"pubid\")          : " + ics.GetSSVar("pubid"));
    
        // Get Attribute Types
        String sqlATypes = "SELECT DISTINCT assetpublication.assettype "
                         + "FROM assetpublication "
                         + "LEFT JOIN approvedassets "
                         + "    ON assetpublication.assetid = approvedassets.assetid "
                         + "WHERE pubid = '" + ics.GetSSVar("pubid") + "' "
                         + "AND (tstate is null OR tstate <> 'A') "
                         + "AND (voided is null OR voided <> 'T') "
                         + "ORDER BY assettype; ";
        System.out.println("##0126 sqlATypes : " + sqlATypes);
        String from = "AssetPublication, ApprovedAssets";
        // String listName = null;
        String listName = "ATypesList";
        int limit = -1;
        // boolean bCache = true;
        boolean bCache = false;
        StringBuffer errStr = new StringBuffer("");
        ics.ClearErrno();
        IList rsATypes = ics.SQL(from, sqlATypes, listName, limit, bCache, errStr);
    
        System.out.println("## rsATypes : " + rsATypes);
        if (rsATypes == null) {
            System.out.println("## NO DATA in rsATypes! errStr : " + errStr.toString());
    

    }

    The journal:

    ## ics.GetSSVar("pubid")          : 1374097570685
    ## sqlATypes : SELECT DISTINCT assetpublication.assettype FROM assetpublication LEFT JOIN approvedassets     ON assetpublication.assetid = approvedassets.assetid WHERE pubid = '1374097570685' AND (tstate is null OR tstate <> 'A') AND (voided is null OR voided <> 'T') ORDER BY assettype;
    ## rsATypes : null
    ## NO DATA in rsATypes! errStr :
    


    I got enclosing try catch block, who did not take any exception.


    The funny thing is, in the same piece of code, an ics. Casea used already worked (which I noticed outside because there was not enough for what I want to do):

            StringBuffer errSB = new StringBuffer("");
            ics.SetVar("assetid", id);
            IList approvedAsset = ics.SelectTo("ApprovedAssets", "state,voided,tstate,locked,reason,treason", "assetid", null, -1, null, true, errSB);
    

    Any help/ideas from anyone would be really appreciated.

    Thanks Guddu1223, I discovered why.

    The SQL statement cannot end with a semicolon (see line 11 of my original above codes). Delete who had back all the records provided for in my resultset in the IList.

    The reason why it works in my local, but not stable instance that I guess is my local JSK + HyperSQL, in WCS + Oracle DB instance trying...

  • DataBind method call returns null in the WebCenter content filtering

    Hello

    I got code that has a problem and I am new to the WebCenter content and filters that can be added. We have a FileNameFilter class that begins with the code

    / public class CWEFileNameFilter implements FilterImplementor {}

    public CWEFileNameFilter() {}

    Super();

    }

    public int doFilter (workspace workspace, DataBinder dataBinder,

    ExecutionContext executionContext) throw {DataException

    Service string = dataBinder.getLocal ("IdcService");

    ....

    }

    }

    However, service is sometimes return null and then filter throws a NPE.

    My questions are:

    (1) can we explain what dataBinder.getLocal ("IdcService"); is done and why it might come back as null

    (2) anyone can provide links to documentation that explains the filters and a little more on the object DataBinder as the JavaDoc is not much help.

    Thank you
    Marc

    Hi Marc,

    Below the code will give the name of the service for which the filter is implemented LocalData

    Service string = dataBinder.getLocal ("IdcService");

    for example below

    http://localhost:16200/cs/idcplg? IdcService = DOC_INFO_BY_NAME & dDocName = 1111111 & IsJava

    This example displays the entire response including localdata data and results that are created in the execution of the service. Here is the code snippet

    LocalData @Properties

    DocUrl =https://localhost:16200/cs/weblayout/groups/secure/documents/test/mhdk/mjg1/1111111.pdf

    IdcService = DOC_INFO_BY_NAME

    If String = dataBinder.getLocal ("IdcService") service; Service = "DOC_INFO_BY_NAME."

    Under blog will give an idea about the filter but the best place to learn or start is "The Definitive Guide to Stellent Content Server Development" by Brian Huff

    http://www.redstonecontentsolutions.com/technical-blog/UCM-service-handlers-and-javafilters

    Also, I recommend reading ' WebCenter Content Services Reference Guide '

    http://docs.Oracle.com/CD/E23943_01/doc.1111/e11011/TOC.htm

    Kind regards

    Amol Germain.

  • APEX_ITEM. DATE_POPUP returns NULL Version 4.2.6

    I apologize in advance if I'm misunderstanding here, but should not return the following query a few HTML, etc. ?

    SELECT APEX_ITEM. DATE_POPUP (1, rowNum, to_date(sysdate,'DD-mm-YYYY'), 'DD-mm-YYYY') date_html

    OF the double

    I am confirming my queries through SQL Developer first and then plan to add to a report of the APEX for a manual form.  APEX_ITEM. TEXT Returns HTML can be used in SQL Developer, but I can't understand why APEX_ITEM. DATE_POPUP returns NULL regardless of any parameter combinations I try.  Thanks in advance for the answers.

    user10730448 wrote:

    Please update your forum profile with a recognizable username instead of "user10730448": Video tutorial how to change username available

    I apologize in advance if I'm misunderstanding here, but should not return the following query a few HTML, etc. ?

    SELECT APEX_ITEM. DATE_POPUP (1, rowNum, to_date(sysdate,'DD-mm-YYYY'), 'DD-mm-YYYY') date_html

    OF the double

    Do not apply to_date conversion sysdate . It's already a DATE value.

    I am confirming my queries through SQL Developer first and then plan to add to a report of the APEX for a manual form.  APEX_ITEM. TEXT Returns HTML can be used in SQL Developer, but I can't understand why APEX_ITEM. DATE_POPUP returns NULL regardless of any parameter combinations I try.

    It is the expected behavior. Some API calls can be used successfully since in a valid session of APEX. You can validate apex_item.date_popup query in the APEX SQL Workshop. Note that apex_item.date_popup2 is the recommended method because it shows a more modern jQuery calendar.

  • Procedure do not return my exception

    Hello

    I try to my test procedure, but it is not returning my exception.

    My procedure:

    Header 1

    create or replace PACKAGE BODY PKG_UNIDADE_EMP_ODS

    AS

    PROCEDURE BUSCAR_UNIDADES)

    VI_COD_EMPRESA IN UNIDADE.ID_INSTITUICAO%TYPE,

    VO_DADOSUNIDADE ON TP_EMPREGABILIDADE_UNI_ODS. TC_DADOSUNIDADE,

    VO_CDERROR NUMBER,

    VO_DSERROR OUT VARCHAR2

    )

    IS

    BEGIN

    VO_CDERROR: = 0;

    VO_DSERROR: = 'success ';

    IF (VI_COD_EMPRESA IS NOT NULL AND LENGTH (VI_COD_EMPRESA) > 1) THEN

    OPEN FOR VO_DADOSUNIDADE

    SELECT

    A SEPARATE. CD_UNIDADE AS CD_UNIDADE,

    UNITED NATIONS. NM_UNIDADE AS NM_UNIDADE,

    UNITED NATIONS. DS_UNIDADE AS DS_UNIDADE,

    UNITED NATIONS. UNIDADE_PORTAL AS UNIDADE_PORTAL

    OF UNIDADE UN

    INNER JOIN INSTITUIÇÃO INS ON (UN.ID_INSTITUICAO = INS.ID_INSTITUICAO)

    WHERE UN.ID_INSTITUICAO = DECODE (VI_COD_EMPRESA, NULL, UN.ID_INSTITUICAO), VI_COD_EMPRESA;

    END IF;

    IF (VI_COD_EMPRESA IS NOTHING) THEN

    OPEN FOR VO_DADOSUNIDADE

    SELECT

    A SEPARATE. CD_UNIDADE AS CD_UNIDADE,

    UNITED NATIONS. NM_UNIDADE AS NM_UNIDADE,

    UNITED NATIONS. DS_UNIDADE AS DS_UNIDADE,

    UNITED NATIONS. UNIDADE_PORTAL AS UNIDADE_PORTAL

    OF UNIDADE UNITED NATIONS;

    END IF;

    EXCEPTION

    WHEN NO_DATA_FOUND THEN

    VO_CDERROR: = 2;

    VO_DSERROR: = "no record not found";

    WHILE OTHERS THEN

    VO_CDERROR: = 999;

    VO_DSERROR: = 'unknown error ' | SQLERRM;

    END BUSCAR_UNIDADES;

    END PKG_UNIDADE_EMP_ODS;

    But when I put the parameter that do not exist in the database, do not return my exception:

    VO_CDERRO = 2

    VO_DSERRO = No records were found

    Can someone help me

    Opening of a ref cursor will never give an exception no_data_found. If you want to know that there is no data in the ref cursor, you will need to pick up. But if you look in the procedure as the row won't be available for the application. If you need to know if the cursor has all the data without pick up you will need to do something like this:

    create or replace PACKAGE BODY PKG_UNIDADE_EMP_ODS

    AS

    PROCEDURE BUSCAR_UNIDADES)

    VI_COD_EMPRESA IN UNIDADE.ID_INSTITUICAO%TYPE,

    VO_DADOSUNIDADE ON TP_EMPREGABILIDADE_UNI_ODS. TC_DADOSUNIDADE,

    VO_CDERROR NUMBER,

    VO_DSERROR OUT VARCHAR2

    )

    IS

    v_count pls_integer;

    BEGIN

    VO_CDERROR: = 0;

    VO_DSERROR: = 'success ';

    IF (VI_COD_EMPRESA IS NOT NULL AND LENGTH (VI_COD_EMPRESA) > 1) THEN

    OPEN FOR VO_DADOSUNIDADE

    SELECT

    A SEPARATE. CD_UNIDADE AS CD_UNIDADE,

    UNITED NATIONS. NM_UNIDADE AS NM_UNIDADE,

    UNITED NATIONS. DS_UNIDADE AS DS_UNIDADE,

    UNITED NATIONS. UNIDADE_PORTAL AS UNIDADE_PORTAL

    OF UNIDADE UN

    INNER JOIN INSTITUIÇÃO INS ON (UN.ID_INSTITUICAO = INS.ID_INSTITUICAO)

    WHERE UN.ID_INSTITUICAO = DECODE (VI_COD_EMPRESA, NULL, UN.ID_INSTITUICAO), VI_COD_EMPRESA;

    Select count (*) from v_count

    OF UNIDADE UN

    INNER JOIN INSTITUIÇÃO INS ON (UN.ID_INSTITUICAO = INS.ID_INSTITUICAO)

    WHERE UN.ID_INSTITUICAO = DECODE (VI_COD_EMPRESA, NULL, UN.ID_INSTITUICAO), VI_COD_EMPRESA;

    END IF;

    IF (VI_COD_EMPRESA IS NOTHING) THEN

    OPEN FOR VO_DADOSUNIDADE

    SELECT

    A SEPARATE. CD_UNIDADE AS CD_UNIDADE,

    UNITED NATIONS. NM_UNIDADE AS NM_UNIDADE,

    UNITED NATIONS. DS_UNIDADE AS DS_UNIDADE,

    UNITED NATIONS. UNIDADE_PORTAL AS UNIDADE_PORTAL

    OF UNIDADE UNITED NATIONS;

    Select count (*) from v_count

    OF UNIDADE.

    END IF;

    If v_count = 0 then

    vo_cderror: = 2;

    vo_dserror: not = "no record found where";

    end if;

    EXCEPTION

    WHILE OTHERS THEN

    VO_CDERROR: = 999;

    VO_DSERROR: = 'unknown error ' | SQLERRM;

    END BUSCAR_UNIDADES;

    END PKG_UNIDADE_EMP_ODS;

  • ViewObject getCurrentRow() returns null for a particular VO

    1. I use JDeveloper 12.1.2 and see that one of the VO does not return a current line in the module of the application.

    Table of this VO has an another table foreign key relationship and corresponding EO mapping to a database table is defined.

    I defined the Association and link display to be able to make the key relationship foreign mapping.

    And moved VO belong to the corresponding data model of the parent object.

    However, getCurrentRow running on this instance of VO returns null.

    Runs the code SQL of VO same results as expected in the preview of the VO Editor.

    Can someone further comment on what might cause some getCurrentRow() which returns null despite the lines for VO that corresponds to its definition of SQL or Timo.

    2. one of the posts mentioned earlier setting the following will print the SQL used by VO in the console.

    AddVMOption - Djbo.deguboutput = console

    AddVMOption - Djbo.jdbc.trace = true

    However, my console does not show the SQL code as such to run executeQuery on VO.

    Can someone share your opinion on if these settings are changed in Jdev 12.1.2 charges.

    Thank you

    Rama

    GetCurrentRow() may return null if the vo is not used in the user interface. In this case, the pointer of the current line is set before the first row so that you can browse all lines.

    After execution of the vo, you must call premier() to get the first row, then next() to get the next line.

    Timo

Maybe you are looking for