Query null value

How can query detail block if one of master items (which is in relaton) is sometimes null

i don't know your problem.
you are doing a select?
if it is sou you can made an outer-join
where det_mast_id = mast_id (+)
(the (+) on the id whitch can be null
null

Similar Messages

  • JDBC Querying Null Values

    I'm using the JDBC Query Multiple Rows as XML to query an Oracle database. Many of the fields I'm querying are nullable and in fact some contain null values. I can't figure out why the JDBC component queries a null value as the string "null". I've tried to work with nvl() or replace() in my SQL statement, but I haven't got either of them to work.
    I would assume someone else has run into this. Anyone have any advice on how to get around this?

    I just found a solution that worked for my situation.
    On the form being merged with the xml data, select the field(s) you want to hide the null value for.
    Then go into the 'Field' tab in the 'Object' palette, click on the patterns button.
    In the Data tab click 'Allow empty' and in the text box below it type
    null
    This should hide any null values from being displayed as 'null' on the form. This also works for numeric fields and date/time fields.

  • About xml and null values in 10g

    Hi, I have an UCM GetFile webservice component wich receives 4 arguments, two of them are null values (rendition and extraPops), and the xml request generated by obpm is:
    <GetFileByName xmlns="http://www.stellent.com/GetFile/">
      <dDocName>V_123410</dDocName>
      <revisionSelectionMethod>latestReleased</revisionSelectionMethod>
      <rendition/>
      <extraProps/>
    </GetFileByName>The problem is: On UCM web service, an empty tag like <rendition/> is treated like a "empty string" value, instead of a null value, and then the response i get isn't the expected.
    What I want do to is change this behavior, and when I put null values in requests, the obpm should not write those tags. Is that possible?
    Should be like that:
    <GetFileByName xmlns="http://www.stellent.com/GetFile/">
      <dDocName>V_123410</dDocName>
      <revisionSelectionMethod>latestReleased</revisionSelectionMethod>
    </GetFileByName>Thanks!

    Hi,
    I have question regarding aggregates. It's possible to read data from BW aggregates? We have webi reports on a SAP BW multi cube and we would like to optimize retriving query.
    >> Because you are using the BW Query as the source all the items that you have done so far in terms of aggregation, indexing, ... is all valid and there are no specific steps required to leverage it with Web Intelligence. Make sure the aggregates are "correct" meansing that they do reflect what you are asking for in the Web Intelligence query panel
    How can we filter in webi query null (#) values. If we create condition that some variabe is diffrent from # we still get null (#) values in report.
    >> You should be able to create a variable. in case you tried that already could you be more specific ?
    thanks
    Ingo

  • Replace NULL values from PIVOT query

    Hi,
    I'm querying a table for sales, for some values, when now columns, the finish with a null value. How can I handle these values as 0 (zeros).
    WITH PIVOT_DATA AS (
    SELECT S.ZONE_CODE,Z.ZONE_NAME,S.YEAR,S.PERIOD,S.SALES
    FROM STAT_TABLE_SALES VTA
    JOIN ZONES Z ON S.COMP=Z.COMP AND S.ZONE_CODE=Z.ZONE_CODE
    WHERE S.COMP = '001'
    AND S.BRAND_CODE = '001'
    SELECT *
    FROM PIVOT_DATA
    PIVOT(
    SUM(SALES) FOR (YEAR,PERIOD) IN ((2009,1),
    (2009,2),
    (2009,3),
    (2009,4),
    (2009,5),
    (2009,6),
    (2009,7),
    (2009,8),
    (2009,9),
    (2009,10),
    (2009,11),
    (2009,12),
    (2010,1),
    (2010,2),
    (2010,3),
    (2010,4),
    (2010,5),
    (2010,6),
    (2010,7))
    ORDER BY 14 DESC NULLS LAST;
    This query returns the following:
    COD_ZONA NOM_ZONA 2009_1 2009_2 2009_3
    01 YEDUSIJH. 1382367.75 1559943.27 1441279.64
    02 DO,ASKAK 711897.82 865854.05 1583232.3
    03 ASDFG 130443.03 205409.84 178633.69
    04 OSOIDSD 320118.32 439008.83 409251.18
    05 ODFSDF 300908.21 276301.59 260188.53
    06 CH 242749.65 325196.71 464938.9
    07 SOA 610312.31 606312.93 754569.82
    08 SAN 89426.8 81360.04 61649.27
    09 YP 284487.79 328281.31 267210.85
    10 TC 87043.28 158594.43 85195.8
    11 BAGNN 76778.78 68180.76 118530.04
    12 CRTS 122023.7 143442.21 134744.85
    13 OCC 209992.79 196477.03 185222.14
    14 IDLB
    15 YA 23870.41 4137.33 16660.53
    **These are not all the columns and rows, but this is a piece of what it returns.
    How can I replace these NULLS with 0(zeros).

    Still not sure why nvl shouldn't suit your needs:
    SQL> select ename, nvl (clerk_20, 0) clerk_20, nvl (sal_30, 0) sal_30
      from emp pivot (sum (sal)
               for (job, deptno)
               in ( ('CLERK', 20) clerk_20, ('SALESMAN', 30) sal_30))
    ENAME             CLERK_20          SAL_30
    WARD                     0            1250
    JONES                    0               0
    TURNER                   0            1500
    ADAMS                 1100               0
    ALLEN                    0            1600
    SMITH                  800               0
    CLARK                    0               0
    KING                     0               0
    BLAKE                    0               0
    JAMES                    0               0
    FORD                     0               0
    SCOTT                    0               0
    MARTIN                   0            1250
    MILLER                   0               0
    14 rows selected.

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

  • How to restrict the Null Values for Key Figules in the Bex Query

    Hi Friends,
        I want to restrict the Null values of a perticular key figure in the Bex Query Output.
    I will explain in details. i have 3 key figures in my query.. let us assume.. key1 key2key3
    key1           key2                key3
    4                4                   100.00
    5                0                   200.00
    1                0                    19.00
    0                1                    10.00
    i don't want to see the the records for which key 2 is 0.
    we have a setting in the Bex Query for restricting the Zero values in the query properties. If we enable that setting it will show
    4               4          100.00
    but i want the report to display..
    4               4           100.00
    0               1           10.00
    can any body guide me. <b>i want to display the values if key2 <> 0.</b>
    Regards,
    Nagesh.

    Hi AVR,
    nice to see reply.
    can you eloborate your view...how can i put the condition.
    <b>i want to put the condition key2 <> 0.</b>
    Regards,
    Nagesh.

  • Sql query slowness due to rank and columns with null values:

        
    Sql query slowness due to rank and columns with null values:
    I have the following table in database with around 10 millions records:
    Declaration:
    create table PropertyOwners (
    [Key] int not null primary key,
    PropertyKey int not null,    
    BoughtDate DateTime,    
    OwnerKey int null,    
    GroupKey int null   
    go
    [Key] is primary key and combination of PropertyKey, BoughtDate, OwnerKey and GroupKey is unique.
    With the following index:
    CREATE NONCLUSTERED INDEX [IX_PropertyOwners] ON [dbo].[PropertyOwners]    
    [PropertyKey] ASC,   
    [BoughtDate] DESC,   
    [OwnerKey] DESC,   
    [GroupKey] DESC   
    go
    Description of the case:
    For single BoughtDate one property can belong to multiple owners or single group, for single record there can either be OwnerKey or GroupKey but not both so one of them will be null for each record. I am trying to retrieve the data from the table using
    following query for the OwnerKey. If there are same property rows for owners and group at the same time than the rows having OwnerKey with be preferred, that is why I am using "OwnerKey desc" in Rank function.
    declare @ownerKey int = 40000   
    select PropertyKey, BoughtDate, OwnerKey, GroupKey   
    from (    
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,       
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]   
    from PropertyOwners   
    ) as result   
    where result.[Rank]=1 and result.[OwnerKey]=@ownerKey
    It is taking 2-3 seconds to get the records which is too slow, similar time it is taking as I try to get the records using the GroupKey. But when I tried to get the records for the PropertyKey with the same query, it is executing in 10 milliseconds.
    May be the slowness is due to as OwnerKey/GroupKey in the table  can be null and sql server in unable to index it. I have also tried to use the Indexed view to pre ranked them but I can't use it in my query as Rank function is not supported in indexed
    view.
    Please note this table is updated once a day and using Sql Server 2008 R2. Any help will be greatly appreciated.

    create table #result (PropertyKey int not null, BoughtDate datetime, OwnerKey int null, GroupKey int null, [Rank] int not null)Create index idx ON #result(OwnerKey ,rnk)
    insert into #result(PropertyKey, BoughtDate, OwnerKey, GroupKey, [Rank])
    select PropertyKey, BoughtDate, OwnerKey, GroupKey,
    RANK() over (partition by PropertyKey order by BoughtDate desc, OwnerKey desc, GroupKey desc) as [Rank]
    from PropertyOwners
    go
    declare @ownerKey int = 1
    select PropertyKey, BoughtDate, OwnerKey, GroupKey
    from #result as result
    where result.[Rank]=1
    and result.[OwnerKey]=@ownerKey
    go
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Show NULL values in an SQL query

    Hi,
    Please excuse my ignorance, but I am very green in Oracle.
    I am trying to create a simple function in PHP to return a list of the entire table row in an Oracle DB, however no matter I do Oracle skipps the columns with NULL values, which means that I don't even get the number of the columns corect. The query is as simple as it can get:
    SELECT * FROM table_name;
    I've tried NVL, DECODE and god knows what else. Please give me a hand with this.
    Cheers,
    Pimmy

    Once you can use ODBC it should be possible to use MySQL with HS:
    http://www.idevelopment.info/data/Oracle/DBA_tips/Heterogeneous_Services/HETERO_2.shtml
    What concerns the licenses: We are not referring to transparent gateways but to heterogenous services (generic connectivity) which come free with the DB:
    http://www.oracle.com/technology/products/gateways/faq.html#A707

  • How to check the sql:query is return null value

    I have use :
    <sql:query var="sql1" dataSource="${db}">
    select col_name from table_name
    where a=<c:out value="${row.test1}"/>
    and b='<c:out value="${row.test2}"/>'
    </sql:query>
    So, how can I check this statement return null value which is no record within this table?

    The Result should never be null but can be empty. You can check if the Result is empty using an if tag and checking the rowCount property:
        <sql:query var="books"
          sql="select * from PUBLIC.books where id = ?" >
          <sql:param value="${bookId}" />
        </sql:query>
         <c:if test="${books.rowCount > 0}">
         </c:if>http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSTL7.html#wp84217
    Look for query Tag Result Interface

  • Issue with Results from Another Query (Error on Null value)

    Hi All,
    We have a WebI report using "Result from Another Query" option of BO XI R3.1. The report was running fine till recently the dimension object using result from another query had a null value. Report suddenly throwed error as the query filters are invalid.
    Is there a way to make this filter optional if no data/null value is there ? Because we need those null values in report as well.
    Thank you for your time.
    Thanks & Regards
    LN

    Hi Vivek,
    It was not directly solved but I applied alternate logic to over come the issue.
    Here's what I did to overcome:
    I used a sub query in place of the whole result from another query.
    For Ex:
    Dim1 inlist result from another query1
    I made it as
    Dim1 inlist (Dim0)
    where Conditions.
    Here Dim0 is the object which we use for Result from another query and Conditions will be the necessary filter conditions to arrive proper Dim0.  Make sure proper context is formed for the sub query.
    Even though it resolved my problem, It introduces an new issue. It causes increase in query run time when huge set of data is returned from sub query.
    Please let me know if i haven't explained clearly.
    Hi Aris_BO,
    Sorry for not responding earlier.  The logic would probably make more queries null & not null. Thats why I was not advised to use it.
    Thanks
    LN

  • Update table all null values to 0 single query

    hi dear ;
    How Can I do , update table all null values to 0 using single query or procedure

    declare @tableName nvarchar(100)
    declare @querys varchar(max)
    set @querys = ''
    set @tableName = 'YOUR TABLE NAME HERE'
    select @querys = @querys + 'update ' + @tableName + ' set ' +
    QUOTENAME(t.[name]) + '=0 where ' + QUOTENAME(t.[name]) + ' is null;'
    from (SELECT [name] FROM syscolumns
    WHERE id = (SELECT id
    FROM sysobjects
    WHERE type = 'U'
    AND [NAME] = @tableName))t
    select @querys
    execute sp_executesql @sqlQuery
    Reference:
    http://stackoverflow.com/questions/6130133/sql-server-update-all-null-field-as-0
    -Vaibhav Chaudhari
    this code is return update TABLE set [FIELD]=isnull([FIELD],''),update TABLE set [FIELD2]=isnull([FIELD2],'')
    I want to use UPDATE TABLE SET FIELD1=ISNULL(FIELD1,0),FIELD2=ISNULL(FIELD2,0),FIELD3=ISNULL(FIELD3,0)  So CUT another update and set statement .

  • How to query for a NULL value?

    Hi all,
    how can I query for a NULL value in a ViewObject. I tried to set null as where-clause param [setWhereClauseParam(0, null)]. But the created statement looks like this:
    SELECT ...
    FROM ...
    WHERE param = null
    I would expect it to create something like WHERE param IS NULL. I hope anybody has a solution for this.
    Thanks,
    Axel

    I think you should use setWhereClause("COL_NAME IS NULL")
    You could use setWhereClauseParam(0, "NULL"), but only if you have a predefined query similar to: "SELECT X, Y, Z FROM A WHERE X IS :0" (which is a pretty useless query, as you can ONLY set "NULL" as the value for ":0").

  • Index (or not) for excluding NULL values in a query

    Hello,
    I have table that can become very large. The table has a varchar2 column (let's call it TEXT) that can contain NULL values. I want to process only the records that have a value (NOT NULL). Also, the table is continuously expanded with newly inserted records. The inserts should suffer as little performance loss as possible.
    My question: should I use an index on the column and if so, what kind of index?
    I have done a little test with a function based index (inspired by this Tom Kyte article: http://tkyte.blogspot.com/2006/01/something-about-nothing.html):
    create index text_isnull_idx on my_table(text,0);
    I notice that if I use the clause WHERE TEXT IS NULL, the index is used. But if I use a clause WHERE TEXT IS NOT NULL (which is the clause I want to use), a full table scan is performed. Is this bad? Can I somehow improve the speed of this selection?
    Thanks in advance,
    Frans

    I build a test case with very simple table with 2 columns and it shows that FTS is better than index access even when above ratio is <= 0.01 (1%):
    DROP TABLE T1;
    CREATE TABLE T1
               C1 VARCHAR2(100)
              ,C2 NUMBER
    INSERT INTO T1 (SELECT TO_CHAR(OBJECT_ID), ROWNUM FROM USER_OBJECTS);
    BEGIN
         FOR I IN 1..100 LOOP
              INSERT INTO T1 (SELECT NULL, ROWNUM FROM USER_OBJECTS);
         END LOOP;
    END;
    CREATE INDEX T1_IDX ON T1(C1);
    ANALYZE TABLE T1 COMPUTE STATISTICS
         FOR TABLE
         FOR ALL INDEXES
         FOR ALL INDEXED COLUMNS
    SET AUTOTRACE TRACEONLY
    SELECT
              C1, C2
         FROM T1 WHERE C1 IS NOT NULL;
    3864 rows selected.
    real: 1344
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=59 Card=3864 Bytes=30912)
       1    0   TABLE ACCESS (FULL) OF 'T1' (Cost=59 Card=3864 Bytes=30912)
    Statistics
              0  recursive calls
              0  db block gets
           2527 consistent gets
           3864 rows processed
    BUT
    SELECT
         --+ FIRST_ROWS
              C1, C2
         FROM T1 WHERE C1 IS NOT NULL;
    3864 rows selected.
    real: 1296
    Execution Plan
       0      SELECT STATEMENT Optimizer=HINT: FIRST_ROWS (Cost=35 Card=3864 Bytes=30912)
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'T1' (Cost=35 Card=3864 Bytes=30912)
       2    1     INDEX (FULL SCAN) OF 'T1_IDX' (NON-UNIQUE) (Cost=11 Card=3864)
    Statistics
              0  recursive calls
              0  db block gets
           5052 consistent gets
           3864 rows processed
    and just for comparison:
    SELECT * FROM T1 WHERE C1 IS NULL;
    386501 rows selected.
    real: 117878
    Execution Plan
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=59 Card=386501 Bytes=3092008)
       1    0   TABLE ACCESS (FULL) OF 'T1' (Cost=59 Card=386501 Bytes=3092008)
    Statistics
              0  recursive calls
              0  db block gets
         193850 consistent gets
         386501 rows processedHence you have to benchmark you queries with and w/o index[es]

  • JDBC MS Access--- cannot extract entry with null value with data type Meta

    I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
    The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
    Any advice will be appreciated! thanks!
    Following are the table description and JDBC code:
    test table has the following attributes:
    Field name Data Type
    name Text
    label Memo
    table contents:
    name label
    me null
    you gates
    Code:
    String query = "SELECT name, label FROM test where name like 'me' ";
    ResultSet rs = stmt.executeQuery(query);
    while (rs.next())
    String name = rs.getString("name");
    rs.getString("val");
    String label = rs.getString("label");
    System.out.println("\t"+name+"\t"+label);
    catch (SQLException ex)
    System.out.println(ex.getSQLState());
    System.out.println(ex.getErrorCode());
    System.out.println("in sqlexception");
    output:
    C:\Temp\SEFormExtractor>java DBTest
    yet SELECT name, label FROM test
    null
    0
    in sqlexception

    The question is how to extract null entry with data type memo?Okay, what you need to do is this:
    if (rs.getString("val") == null)
      // do something
    }This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception.

  • Reading Numeric UDF null value in DI

    We have a UDF of Numeric(4) that can be NULL, 0, 1, 2, etc. We try to read it from DI, and if it is NULL, then set the result to be -1 (the default value we difined), so we can differentiate NULL and 0.
    The C# code we have look like this:
    int LineNumber = -1;
    SAPbobsCOM.Company oCompany;
    // Code to get Company
    SAPbobsCOM.Documents oDoc = oCompany.GetBusinessObject(BoObjectTypes.oQuotations);
    oDoc.GetByKey(100); // Get the document by DocEntry
    LineNumber = (int)oDoc.UserFields.Fields.Item("U_XX_LN").Value;
    The problem is LineNumber gets 0 even if in the database U_XX_LN is NULL. We tried the code below and got the same result because oDoc.UserFields.Fields.Item("U_XX_LN").Value.ToString() always return '0' if it is NULL.
    if (string.IsNullOrEmpty(oDoc.UserFields.Fields.Item("U_XX_LN").Value.ToString()))
        LineNumber = -1;
    else
        LineNumber = (int)oDoc.UserFields.Fields.Item("U_XX_LN").Value;
    The question is: how can we set it to default -1 if in the database the value is NULL?
    Thank you,
    Grace

    Hi Grace,
    Unfortunately the DI API automatically converts database null values to a default value for the datatype (eg null for numeric becomes 0 and null for strings is an empty string). If you want to differentiate between null and zero you will need to query the table using the isnull command rather than reading the table through the UserTables object:
    oRecordSet.DoQuery("select isnull(U_XX_LN, -1) as U_XX_LN from [@MYTABLE] where Code = 'MYCODE')
    This will convert the null value to a -1 in the recordset so you can tell the difference between nulls and zeros.
    Kind Regards,
    Owen

Maybe you are looking for

  • Publishing in iWeb page With MONTH view being the default view

    Hi I'm using iWeb to publish a page, then editing the HTML code to include a non-scrolling frame that is my iCal calendar on it. It works ok EXCEPT that it defaults to a Week View on the web page, and that looks lame because for our purposes it shoul

  • IPOD CANNOT UPDATE

    please help Have just got my first Ipod. when I try transfering play list to my Ipod I get this message 'The Ipod FM cannot be updated. The required file cannot be found'.

  • Kernel Panic at Startup

    I recently got my first kernel panic, about one week ago. Never before had one occur. It happened immediately after startup. I had done nothing different prior to it happening. Since then, I have had 3-4 more, all of them at startup. I force shutdown

  • (Current Build: 9841) PC Settings - Preview Builds - Download Now - Failed to download new preview build, please try again later. 0x80246017

    Hey , I hope someone can help.. been trying to upgrade from 9841 to 9860 for the last few days.. and I cant seem to get the preview build download part to work.. Seems like "80246017 Flight Settings Failure Content Download Error: Download failed" is

  • Error in upgrade from 46c to ecc 6.0

    hi experts, we are facing an error at the time of upgrade from 46c to ecc 6.0 in the phase JOB_RSUPGAIMEXE. did anyone face this error anytime during upgrade on windows plotform? Please let us know your comments.. regards raghu