Inserting null values from FileAdapter to DB Adapter thru Transform activit

Hi,
i am trying to insert a record from a file to DB for that i have used FileAdapter and DB Adapter in between it have used Tranform activity for passing from fileadpter receive var to Db Adapter Invoke var can .in the Bpel Instance values are passed up to tranform activity
below the xsl code and Bpel code
Xsl
+<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper
<!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
<mapSources>
<source type="XSD">
<schema location="test3_1.xsd"/>
<rootElement name="readrecord" namespace="http://TargetNamespace.com/pickfile"/>
</source>
</mapSources>
<mapTargets>
<target type="XSD">
<schema location="insertintoTbl_table.xsd"/>
<rootElement name="XxempCollection" namespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/insertintoTbl"/>
</target>
</mapTargets>
<!-- GENERATED BY ORACLE XSL MAPPER 10.1.3.5.0(build 090730.0200.1754) AT [FRI MAY 20 16:46:20 IST 2011]. -->
?>
<xsl:stylesheet version="1.0"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="http://xmlns.oracle.com/pcbpel/adapter/db/top/insertintoTbl"
xmlns:tns="http://TargetNamespace.com/pickfile"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
exclude-result-prefixes="xsl xsd nxsd tns ns0 bpws ehdr hwf xref xp20 ora orcl ids">
<xsl:template match="/">
<ns0:XxempCollection>
<ns0:Xxemp>
<ns0:empcode>
<xsl:value-of select="/tns:readrecord/tns:C1"/>
</ns0:empcode>
<ns0:emptr>
<xsl:value-of select="/tns:readrecord/tns:C2"/>
</ns0:emptr>
<ns0:name>
<xsl:value-of select="/tns:readrecord/tns:C3"/>
</ns0:name>
<ns0:division>
<xsl:value-of select="/tns:readrecord/tns:C4"/>
</ns0:division>
<ns0:dept>
<xsl:value-of select="/tns:readrecord/tns:C5"/>
</ns0:dept>
<ns0:doj>
<xsl:value-of select="/tns:readrecord/tns:C6"/>
</ns0:doj>
<ns0:designation>
<xsl:value-of select="/tns:readrecord/tns:C7"/>
</ns0:designation>
<ns0:qualification>
<xsl:value-of select="/tns:readrecord/tns:C8"/>
</ns0:qualification>
</ns0:Xxemp>
</ns0:XxempCollection>
</xsl:template>
</xsl:stylesheet>
+
Bpelcode
+
<?xml version = "1.0" encoding = "UTF-8" ?>
<!--
Oracle JDeveloper BPEL Designer
Created: Thu May 19 19:43:57 IST 2011
Author: naveenv
Purpose: Empty BPEL Process
-->
<process name="FileToTbl" targetNamespace="http://xmlns.oracle.com/FileToTbl"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:ns4="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/BPELINSERT/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns5="http://xmlns.oracle.com/pcbpel/adapter/db/insertintoTbl/"
xmlns:client="http://xmlns.oracle.com/FileToTbl"
xmlns:ns6="http://xmlns.oracle.com/pcbpel/adapter/db/top/insertintoTbl"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/pickfile/"
xmlns:ns3="http://TargetNamespace.com/pickfile"
xmlns:ns2="http://xmlns.oracle.com/pcbpel/adapter/db/inserttoTbl/"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc">
<!--
PARTNERLINKS
List of services participating in this BPEL process
-->
<partnerLinks>
<partnerLink myRole="Read_role" name="pickfile"
partnerLinkType="ns1:Read_plt"/>
<partnerLink name="insertintoTbl" partnerRole="insertintoTbl_role"
partnerLinkType="ns5:insertintoTbl_plt"/>
</partnerLinks>
<!--
VARIABLES
List of messages and XML documents used within this BPEL process
-->
<variables>
<variable name="Receive_1_Read_InputVariable"
messageType="ns1:readrecord_msg"/>
<variable name="Invoke_1_insert_InputVariable"
messageType="ns5:XxempCollection_msg"/>
</variables>
<!--
ORCHESTRATION LOGIC
Set of activities coordinating the flow of messages across the
services integrated within this business process
-->
<sequence name="main">
<receive name="Receive_1" partnerLink="pickfile" portType="ns1:Read_ptt"
operation="Read" variable="Receive_1_Read_InputVariable"
createInstance="yes"/>
<assign name="Transform_1">
<bpelx:annotation>
<bpelx:pattern>transformation</bpelx:pattern>
</bpelx:annotation>
<copy>
<from expression="ora:processXSLT('Transformation_1.xsl',bpws:getVariableData('Receive_1_Read_InputVariable','readrecord'))"/>
<to variable="Receive_1_Read_InputVariable" part="readrecord"/>
</copy>
</assign>
<invoke name="Invoke_1" partnerLink="insertintoTbl"
portType="ns5:insertintoTbl_ptt" operation="insert"
inputVariable="Invoke_1_insert_InputVariable"/>
</sequence>
</process>
+
can anyone please help me

Hi,
yes i could see the values in the trsnaform activity
Receive_1
[2011/05/20 06:02:49 PM] Received "Receive_1_Read_InputVariable" call from partner "pickfile" less
-<Receive_1_Read_InputVariable>
-<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="readrecord">
-<readrecord xmlns="http://TargetNamespace.com/pickfile">
<C1>579
</C1>
<C2>EMPLOYEE
</C2>
<C3>NITIN RAO
</C3>
<C4>IME
</C4>
<C5>ORACLE
</C5>
<C6>4-Jan-99
</C6>
<C7>Senior Consultant
</C7>
<C8>B.TECH
</C8>
</readrecord>
</part>
</Receive_1_Read_InputVariable>
Transform_1
[2011/05/20 06:02:49 PM] Updated variable "Receive_1_Read_InputVariable" less
-<Receive_1_Read_InputVariable>
-<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="readrecord">
-<readrecord xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/BPELINSERT/" xmlns="http://TargetNamespace.com/pickfile">
<db:EMPCODE>579
</db:EMPCODE>
<db:EMPTR>EMPLOYEE
</db:EMPTR>
<db:NAME>NITIN RAO
</db:NAME>
<db:DIVISION>IME
</db:DIVISION>
<db:DEPT>ORACLE
</db:DEPT>
<db:DOJ>4-Jan-99
</db:DOJ>
<db:DESIGNATION>Senior Consultant
</db:DESIGNATION>
<db:QUALIFICATION>B.TECH
</db:QUALIFICATION>
</readrecord>
</part>
</Receive_1_Read_InputVariable>
Invoke_1
[2011/05/20 06:02:50 PM] Invoked 1-way operation "inserttoDb" on partner "inserttoDb". less
-<Invoke_1_inserttoDb_InputVariable>
-<part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="InputParameters">
<InputParameters xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/APPS/BPELINSERT/"/>
</part>
</Invoke_1_inserttoDb_InputVariable

Similar Messages

  • Inserting NULL values from getParameterValues("name");

    I want to get values from collection of checkboxes in JSP into servlet through getParameterValues("name");
    But the problem is if the user does not tick a particular checkbox I want null to come in the array where getParameterValues("name") is storing values.
    How to acheive that.

    I don't think that is possible, checkboxes which are not checked are simply not submitted at all.
    What you can do is take the array and turn it into a Map, put the checkbox form element names as your keys. Then you can fetch the values from the Map, and the keys (form element names) that don't exist will turn up as null.

  • How to insert a value from sequence in Bussiness Components?

    How to insert a value from sequence in Bussiness Components?
    I would like to do it, but without a triger that would do it before insert.
    I know that there is a type DBSequence in BC where you can insert a sequence name but it does not work when I type there my sequence name.
    Do you now how to fix that problem?
    Bart.

    The newer way to do it is to make the type DBSequence and enter the name of the Sequence object in the sequence field. It must match the same name of the sequence object in the database. Next, you have to create a before insert for each row trigger on the table. Basically, something like this:
    CREATE OR REPLACE TRIGGER TGB_THEME_SEQ
    BEFORE INSERT ON THEME
    FOR EACH ROW
    DECLARE
    BEGIN
    -- Assign the id from the sequence if null
         IF( :new.theme_id IS NULL ) THEN
              SELECT THEME_ID_SEQ.nextval
              INTO :new.theme_id
              FROM dual;
         END IF;
    END;
    In the above example, THEME_ID_SEQ is the seuence object name in the database. If you have the name right but it still fails, then the user you are logging in as probably doesn't have access to the sequence in the database.
    Hope this helps.
    Erik

  • APEX post restful service inserts null value

    Oracle APEX 4.2.5
    Oracle Rest Data Service 2.0.7
    Apache Tomcat 7
    Oracle database 11.2.0.4
    Oracle APEX PUT web service inserts null value into column. This is either a bug or the documentation does not properly cover how to correctly set PUT restful services. 
    GET web services works fine. 
    I have granted the role of apex_rest_public_user to both apex_public_user and the schema owner. 
    The payload is a small xml document, but even a text document will yield the same result. 
    I am using the Oracle REST Data Service 2.0.5
    Web service code: 
    RESTful Service Module: software_details/
    URI Template: xml_parser
    Method: POST
    Source Type: PL/SQL
    MIME: Types Allowed: application/xml
    Requires Secure Access: NO
    Source :
    begin
    insert into clob_test (x)
    values (blob_to_clob(:body)); ## according to some online post,  :body is where APEX places any data being transferred through a web service. I have yet to find any official  ##documentation on it. 
    commit:
    end;
    ##Blob_to_clob function code
    CREATE OR REPLACE FUNCTION blob_to_clob (blob_in IN BLOB)
    RETURN CLOB
    AS
          v_clob    CLOB;
          v_varchar VARCHAR2(32767);
          v_start      PLS_INTEGER := 1;
          v_buffer  PLS_INTEGER := 32767;
    BEGIN
          DBMS_LOB.CREATETEMPORARY(v_clob, TRUE);
          FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(blob_in) / v_buffer)
          LOOP
             v_varchar := UTL_RAW.CAST_TO_VARCHAR2(DBMS_LOB.SUBSTR(blob_in, v_buffer, v_start));
                DBMS_LOB.WRITEAPPEND(v_clob, LENGTH(v_varchar), v_varchar);
               v_start := v_start + v_buffer;
          END LOOP;
        RETURN v_clob;
    END blob_to_clob;
    #Table code 
    create table clob_test(
    x clob));
    Thank you,

    I am experiencing the same issue.
    I implemented the 'chunked file loading' example from Kris Rice's blog at Kris' blog: August 2013 in y workspace at the Oracle hosted APEX site and everything works fine.
    However, I get a null value for 'data' when I implement the same example at my work site.
    Work Site config is
    Apache Tomcat 7
    Oracle REST Data Services version : 2.0.6.27.18.06
    Application Express 4.2.2.00.11
    Oracle RDBMS 11.2.0.3
    I am NOT using SSL at my work site. However this does not seem to affect a POST with form values.
    Varad.

  • Need help Take out the null values from the ResultSet and Create a XML file

    hi,
    I wrote something which connects to Database and gets the ResultSet. From that ResultSet I am creating
    a XML file. IN my program these are the main two classes Frame1 and ResultSetToXML. ResultSetToXML which
    takes ResultSet & Boolean value in its constructor. I am passing the ResultSet and Boolean value
    from Frame1 class. I am passing the boolean value to get the null values from the ResultSet and then add those
    null values to XML File. When i run the program it works alright and adds the null and not null values to
    the file. But when i pass the boolean value to take out the null values it would not take it out and adds
    the null and not null values.
    Please look at the code i am posing. I am showing step by step where its not adding the null values.
    Any help is always appreciated.
    Thanks in advance.
    ============================================================================
    Frame1 Class
    ============
    public class Frame1 extends JFrame{
    private JPanel contentPane;
    private XQuery xQuery1 = new XQuery();
    private XYLayout xYLayout1 = new XYLayout();
    public Document doc;
    private JButton jButton2 = new JButton();
    private Connection con;
    private Statement stmt;
    private ResultSetToXML rstx;
    //Construct the frame
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    //setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]")));
    contentPane = (JPanel) this.getContentPane();
    xQuery1.setSql("");
    xQuery1.setUrl("jdbc:odbc:SCANODBC");
    xQuery1.setUserName("SYSDBA");
    xQuery1.setPassword("masterkey");
    xQuery1.setDriver("sun.jdbc.odbc.JdbcOdbcDriver");
    contentPane.setLayout(xYLayout1);
    this.setSize(new Dimension(400, 300));
    this.setTitle("Frame Title");
    xQuery1.setSql("Select * from Pinfo where pid=2 or pid=4");
    jButton2.setText("Get XML from DB");
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    catch(java.lang.ClassNotFoundException ex) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(ex.getMessage());
    try {
    con = DriverManager.getConnection("jdbc:odbc:SCANODBC","SYSDBA", "masterkey");
    stmt = con.createStatement();
    catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    jButton2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jButton2_actionPerformed(e);
    contentPane.add(jButton2, new XYConstraints(126, 113, -1, -1));
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jButton2_actionPerformed(ActionEvent e) {
    try{
    OutputStream out;
    XMLOutputter outputter;
    Element root;
    org.jdom.Document doc;
    root = new Element("PINFO");
    String query = "SELECT * FROM PINFO WHERE PID=2 OR PID=4";
    ResultSet rs = stmt.executeQuery(query);
    /*===========This is where i am passing the ResultSet and boolean=======
    ===========value to either add the null or not null values in the file======*/
    rstx = new ResultSetToXML(rs,true);
    } //end of try
    catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    ======================================================================================
    ResultSetToXML class
    ====================
    public class ResultSetToXML {
    private OutputStream out;
    private Element root;
    private XMLOutputter outputter;
    private Document doc;
    // Constructor
    public ResultSetToXML(ResultSet rs, boolean checkifnull){
    try{
    String tagname="";
    String tagvalue="";
    root = new Element("pinfo");
    while (rs.next()){
    Element users = new Element("Record");
    for(int i=1;i<=rs.getMetaData().getColumnCount(); ++i){
    tagname= rs.getMetaData().getColumnName(i);
    tagvalue=rs.getString(i);
    System.out.println(tagname);
    System.out.println(tagvalue);
    /*============if the boolean value is false it adds the null and not
    null value to the file =====================*/
    /*============else it checks if the value is null or the length is
    less than 0 and does the else clause in the if(checkifnull)===*/
    if(checkifnull){ 
    if((tagvalue == null) || tagvalue.length() < 0 ){
    users.addContent((new Element(tagname).setText(tagvalue)));
    else{
    users.addContent((new Element(tagname).setText(tagvalue)));
    else{
    users.addContent((new Element(tagname).setText(tagvalue)));
    root.addContent(users);
    out=new FileOutputStream("c:/XMLFile.xml");
    doc = new Document(root);
    outputter = new XMLOutputter();
    outputter.output(doc,out);
    catch(IOException ioe){
    System.out.println(ioe);
    catch(SQLException sqle){

    Can someone please help me with this problem
    Thanks.

  • Null values from DB2 cause problems

    Hi,
    I have another problem with database link to DB2 using IBM iSeries Access for Linux on 64 bit OEL5 with Oracle Database gateway and unixODBC 2.2.14.
    DB link works. However, null values from DB2 cause problems. Date columns that are null on db2 return a date '30.11.0002', and character columns that are null return an error ORA-28528: Heterogeneous Services datatype conversion error.
    isql returns correct results.
    How can i fix this? Perhaps set some parameters for data conversion on the gateway?
    Thank you.

    If the driver is not fully ODBC level 3 compliant and misses functions, we're lost. But sometimes the drivers are ODBC level 3 compliant but miss the correct 64bit implementation. In those cases we can tell the gateway to use the 32bit ODBC level 3 standard by setting in the gateway init file:
    HS_FDS_SQLLEN_INTERPRETATION=32

  • How can I delete null values from List Item?

    Hi Friends,
    I used List item for field job_Type, I entered values in List item at design time through property pallet. When I run form I will see null values in this List Item.
    How can I remove these null values from the List?
    Best regards,
    Shahzad

    Dear Shahzad,
    It can be removed by adding the following code in the When-new-Form-Instance.
    Set_item_property('List name', required, property_true);
    :block_name.list_name := <put your default value here>; (If you didn't oput the default value, then you will get some problem and the cursor may not navigate away from the list).
    Senthil Alagu .P.

  • How to post null values from h:inputText?

    Hello,
    I have a form made of h:inputText fields that map to an entity class as the backing bean. Whenever I post the form from a web page, all the fields that I did not fill out and that are mapped to String fields in the entity class are set to "" (empty string) instead of null.
    However, I would like to post null values to my entity, because that would indicate that the user did not fill out the field. In other contexts (outside of the web app) it is possible to set the fields to empty strings, but from the web app it should always be null. How can I get JSF to do this correctly?
    Also, when reading entitys with null values from the database, these are converted to empty h:inputText fields, so this direction works as expected.
    Ulrich

    I haven't seen a solution for this as far.
    This is how I do it:
    public void action() {
        if (isEmpty(inputValue)) {
            // do your thing
        } else {
            // do your thing
    public static boolean isEmpty(Object value) {
        if (value == null) {
            return true;
        if (value instanceof String && ((String) value).trim().length() == 0) {
            return true;
        if (value instanceof Collection && ((Collection) value).size() == 0) {
            return true;
        // And go so on .. make it an utility method.
        return false;
    }

  • How to replace NULL values from main table

    Dear all,
    I like to remove the NULL values from a main table field. Or the question is how to replace any part of the string field in MDM repository main table field.
    e.g.   I have a middle name field partly the value is NULL in some hundreds of records, I like to replace NULL values with Space
    any recommendation.
    Regards,
    Naeem

    Hi Naeem,
    You can try using Workflows for automatically replacing NULLs with any specific value.
    What you can do is: Create a workflow and set trigger action as Record Import, Record Create and Record Update. So, that whenever any change will occur in the repository; that workflow will trigger.
    Now create an assignment expression for replacing NULLs with any specific value and use that assignment expression in your workflow by using Assign Step in workflow.
    For exiting records, you will have to replace NULLs manually using the process given by Preethi else you can export those records in an Excel spreadsheet which have NULLs and then replace all NULLs with any string value and then reimport those records in your MDM repository.
    Hope this will solve your problem.
    Regards,
    Varun
    Edited by: Varun Agarwal on Dec 2, 2008 3:12 PM

  • Wants to eliminate null values from mapping queue

    Hi All,
    How can I eliminate null values from 'display queue' of a target mapping.
    Can it be done through a UDF? Kindly help.
    Because of null value, it is creating issue in the mapping logic.
    Thanks,
    John

    We can remove null values using node functions.
    Check the below thread:
    Re: How to remove [] form Message Mapping Display Queue
    Or
    Try with the below UDF:
    for (int i=0; i<a.length;i++)
    if (! a<i>.equals(ResultList.SUPPRESS) || ! a<i>.equals(""))
    result.addValue(a<i>);
    Thanks,

  • Eliminating the null values from popup list item

    Dear All,
    i create a popup list,at runtime it shows a null blank value among the values i specified while the combo box is not,
    i want to eleminate the blank null value from the popup list.
    Need Help.
    Thanks & Regards.

    Okay,
    i create a popup list, populate it in runtime with create_group_from_query builtin.
    now when i run the form and click the list item, it display a null value among the other values which are
    return from the create_group_from_query .
    the procedure is below
    procedure Department_proc is
    rg recordgroup;
    n number;
    begin
    remove_record_group('RG');------  this is another procedure which checks for Record group existance and remove it.
    rg=:=create_group_from_query('RG4','SELECT NAME,TO_CHAR(DEPT_ID) FROM TAB_DEPT_SECTION
    UNION
    SELECT '||'''All Departments'''||'as name,'||'''0'''||' as name from dual');
    n:=populate_group(rg4);
    populate_list('control_block.department',rg4);
    end;
    it display a null value among the other values for the first time is run the form,but when i click it and select a value from it
    and the onward click dont show the null value.i want to eleminate the null value even for the first time when the user run the
    from.
    Best Regards

  • To extract null Values from the source in Infopackage selections - Very Urg

    Hi All,
    I need to pull the data which has null values from source. I tried to write routine by giving l_t_range-low = '' , space. nothing is working.
    Please guide me with sample code.
    Very Urgent.
    Regards
    Mano

    Hi Mario.
    Assuming that you want to avoid uploading of records having
    zero for a keyfigure:
    Create a startroutine for transfer rules and add this coding:
    DELETE DATAPAK WHERE VALUE = '0'.
    OR
    LOOP AT DATAPAK.
    IF DATAPAK-VALUE = 0..
    DELETE DATAPAK.
    ENDIF.
    ENDLOOP.
    'VALUE' represents the fieldname in transferstructure
    Please let me know if i misundersttod the issue.
    Regards
    Joe

  • Remove null values from query

    Hi All;
    Below is my query and the output and i need to remove null values from the output
    Any help regarding same is much appreciated
    Thanks
    ; WITH CTE AS
    select a.opportunityid,a.new_entrypoint_displayname,c.parentcustomerid,c.contactid,c.fullname,a.new_mainprogramme_idname,
    a.new_subprogramme_idname,
    a.owneridname,
    a.new_dateofapplication,count(appt.activityid) as NoOfAppointments,
    ap.scheduledstart,
    ap.scheduleddurationminutes
    from opportunity a
    left join contact c on (c.contactid = a.parentcontactid)
    inner join activitypointer ap on ( ap.regardingobjectid = c.contactid )
    inner join appointment appt on (appt.activityid = ap.ActivityId)
    where
    appt.new_didmeetingtakeplace = 1
    and appt.statecode = 1 and
    (a.SCRIBE_DELETEDON is null and c.SCRIBE_DELETEDON is null and ap.SCRIBE_DELETEDON is null and appt.SCRIBE_DELETEDON is null)
    group by a.opportunityid,a.new_entrypoint_displayname,c.parentcustomerid, c.contactid,c.fullname,a.owneridname,
    a.new_mainprogramme_idname,a.new_subprogramme_idname,
    a.new_dateofapplication,ap.scheduledstart,
    ap.scheduleddurationminutes
    union
    select a.opportunityid,a.new_entrypoint_displayname,c.parentcustomerid,c.contactid,c.fullname,
    a.new_mainprogramme_idname,a.new_subprogramme_idname,a.owneridname,
    a.new_dateofapplication,count(appt.activityid) as NoOfAppointments,
    ap.scheduledstart,
    ap.scheduleddurationminutes
    from opportunity a
    left join contact c on (c.contactid = a.parentcontactid)
    inner join activitypointer ap on (ap.regardingobjectid = a.opportunityid)
    inner join appointment appt on (appt.activityid = ap.ActivityId)
    where
    appt.new_didmeetingtakeplace = 1
    and appt.statecode = 1 and
    (a.SCRIBE_DELETEDON is null and c.SCRIBE_DELETEDON is null and ap.SCRIBE_DELETEDON is null and appt.SCRIBE_DELETEDON is null)
    group by a.opportunityid,a.new_entrypoint_displayname,c.parentcustomerid,c.contactid,a.owneridname,
    a.new_mainprogramme_idname,a.new_subprogramme_idname,
    c.fullname,a.new_dateofapplication,
    ap.scheduledstart,
    ap.scheduleddurationminutes
    CTE2 As
    select opportunityid,parentcustomerid,new_entrypoint_displayname,contactid,fullname,
    new_mainprogramme_idname,new_subprogramme_idname,cte.owneridname,
    ac.new_businessstartdate,new_dateofapplication,(NoOfAppointments),
    case when ac.new_businessstartdate > = CTE.scheduledstart
    then (CTE.scheduleddurationminutes) end as PreStartHours,
    case when ac.new_businessstartdate < CTE.scheduledstart
    then (CTE.scheduleddurationminutes) end as PostStartHours
    pp.new_outputs,
    case when po.new_outputsname = 'Pre Start Assist'
    then 'Yes' else 'No' end as Precheck,
    case when po.new_outputsname = 'Business Assist'
    then 'Yes' else 'No' end as Buscheck
    from CTE
    join account ac on (ac.accountid = CTE.parentcustomerid)
    join dbo.new_programmeoutput as po on (CTE.opportunityid = po.new_relatedopportunity)
    join dbo.new_programmeprofile pp on (
    po.new_mainprogrammeid = pp.new_mainprogrammeid and
    po.new_subprogrammeid = pp.new_subprogrammeid
    and pp.new_claimstartdate = po.new_claimdate
    and pp.new_outputsname = po.new_outputsname)
    where (ac.SCRIBE_DELETEDON is null)
    group by opportunityid,parentcustomerid,new_entrypoint_displayname,contactid,fullname,ac.new_businessstartdate,new_dateofapplication,NoOfAppointments,
    scheduledstart,new_mainprogramme_idname,new_subprogramme_idname,cte.owneridname,scheduleddurationminutes
    select opportunityid,parentcustomerid,new_entrypoint_displayname,contactid,fullname,
    new_mainprogramme_idname,new_subprogramme_idname,cte2.owneridname,
    new_businessstartdate,new_dateofapplication,(NoOfAppointments),
    PreStartHours, PostStartHours,po.new_programmeoutputid,
    case when (new_outputsname) = 'Pre Start Assist'
    then 'Yes' else 'No' end as Precheck,
    case when (new_outputsname) = 'Business Assist'
    then 'Yes' else 'No' end as Buscheck --po.*
    from cte2
    left join dbo.new_programmeoutput as po on (cte2.opportunityid = po.new_relatedopportunity)
    where po.new_claimmonthidname is not null and po.statuscode_displayname = 'claimed'
    group by opportunityid,parentcustomerid,new_entrypoint_displayname,contactid,fullname,
    new_mainprogramme_idname,new_subprogramme_idname,cte2.owneridname,
    new_businessstartdate,new_dateofapplication,(NoOfAppointments),
    PreStartHours, PostStartHours,po.new_programmeoutputid,new_outputsname
    --where new_claimmonthidname is not null --and CTE2.PreStartHours is not null and CTE2.PostStartHours is not null
    Pradnya07

     i need to remove null values from the output
    Hello,
    What exactly do you mean with "remove", to filter the rows out from result set or to replace the null value by an other value e.g. 0? This can be done with the
    ISNULL function:
    ISNULL(case when ac.new_businessstartdate > = CTE.scheduledstart
    then (CTE.scheduleddurationminutes) end, 0) as PreStartHours, ...
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Prevent null values from displaying in answers OBIEE 11g

    Is there any possibilities in OBIEE to Prevent null values from displaying in answers
    For example, If i have two records in table
    TV         cost=NULL(having agg rule sum in BMM layer)
    RADIO   cost=10(having agg rule sum in BMM layer)
    in answers i get two records
    TV       NULL
    RADIO 10
    but i want to get one, only with not null cost

    Just want to clarify your question,You want to eliminate the NULL values from the report am i right? If that is the case then put the filter COST <> NULL.
    Do let me know the updates?
    Thanks,

  • Error while selecting NULL value from Popup Key LOV(numeric or value error)

    Hi,
    I have a item P1_DEPTNO with following properties.
    P1_DEPTNO - Popup Key LOV (Displays description, returns key value)
    LOV - P1_DEPT_LOV
    select deptname d, deptno r from deptP1_DEPTNO item properties
    List of Values
      Named LOV - P1_DEPT_LOV
      Display Null - Yes // changed to Yes, so that it can accept NULL values.
      Null display value - NULL
      Null return value -   (blank)PL\SQL Process -
    declare
    v1 number;
    begin
    if :P1_DEPTNO is null OR :P1_DEPTNO = '' then
        v1 := 0;
    else
        v1 := :P1_DEPTNO;
    end if;
    // rest of the PL\SQL process
    end;Now, when I run the page and select NULL value from Popup LOV and submit, I get the following error.
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error.When, I select any other value other than NULL, then it's working perfectly fine.
    Only in case of NULL value, I am getting this error.
    ANY idea, why this error is coming??
    Thanks,
    Deepak

    Hi Varad,
    I did the following change
    Null display value - (blank) // by default it is displaying '%' in the select this
    Null return value - -1
    but when I select % (null value) from the popup list, it displays the return value -1 in the text field.
    My question is why it is displaying the return value -1 in the text field...*It should display the display value in the text field (i.e blank in this case)*
    then, I did the following change
    Null display value - (blank) // by default it is displaying '%' in the select this
    Null return value - // a single space, so that when I select %(null value) from the list, it should display blank in the text field...
    then I did the following change in the PL\SQL process.
    PL\SQL process
    declare
    v1 number;
    begin
    if :P1_DEPTNO = ' ' then // -- checking the value of single space ' ' when we select %(null) in the popup list, BUT even I select %(null), control is not coming here.
        v1 := 0;
    else
        v1 := :P1_DEPTNO;
    end if;
    // rest of the PL\SQL process
    end;Thanks,
    Deepak

Maybe you are looking for

  • Report to Identify Parked Invoices and Invoices without PO#

    Experts: Is there a report out there that will provide me 1. All Parked Invoices 2. All Parked Credit Notes 3. All invoices without ref to PO# Thanks! Rahul

  • Missing "Select a Template" when editing asset?

    Okay, I need some input here! We recently upgraded from Fatwire 7.5 to Webcenter Sites. I now a have question about something, for which I don't know if it is caused by an error, a misconfiguration, or is just a new feature, in the Webcenter Sites UI

  • Firefox 3.6.12 is painfully slow

    Running Windows XP home edition on Asus netbook. All add-ons are disabled except for McAfee site advisor. IE is working with great response time, so it's not FiOS. I am running Firefox 3.6.12. It's been like this since the last update. Please, I need

  • Help with small office PBX system.

    Hello all, I'm looking for any help or advice here. We have an old Panasonic PABX, 3 external CO lines and 16 extension lines (only 8 in use). Question 1. We have CO1 connected to the fax/broadband number. C02 and CO3 connected to our other number. H

  • Client wants to upgrade his 'academic' version?

    Client wants to upgrade his FCP Studio 5.1.4 to 7.x, but he's got an Academic version.  Which Apple Store says they don't upgrade.  Does this mean he has to buy a complete new Academic version? My assumption is yes.  But I'm always wary of my assumpt