INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

NullPointerException

NullPointerException

(OP)
Need some assistance with this. The expresion below runs fine as is, but I'm getting the above listed error whenever I change line 5 from:

and e.timestampnbr >= a.timestampnbr),

TO

and e.timestampnbr >= a.timestampnbr + 2 and e.timestampnbr < a.timestampnbr + 5),

 

Trying to mimic line 3, but it keeps failling out. Any thoughts?

 

----

 

1: ifnull((select top 1 c.time from timestmp c where a.date = c.date
2: and a.wrkordnbr = c.wrkordnbr and c.status in (60)
3: and c.timestampnbr >= a.timestampnbr + 2 and c.timestampnbr < a.timestampnbr + 5),
4: ifnull((select top 1 e.time from timestmp e where a.date = e.date
5: and a.wrkordnbr = e.wrkordnbr and e.status in (102)
6: and e.timestampnbr >= a.timestampnbr),
7: (select top 1 f.time from timestmp f where a.date = f.date
8: and a.wrkordnbr = f.wrkordnbr and f.status in (70)
9: and f.timestampnbr >= a.timestampnbr)
10: )) as Exp1
 

RE: NullPointerException

A few questions:
- What version of Pervasive are you using?
- What tool are you using to execute the query?
- What is the full and complete error?  
 

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com

RE: NullPointerException

(OP)
@Mirtheil - Using Summit V10, and just the standard Pervasive Control Center for now. However, this query is being wrapped into software written in vb.net.

NullPointerException is the full and complete error, with no description on what is causing the error. I narrowed it down to the line mentioned in the original post. By itself, it runs fine, but IFNULL seems to be causing it trouble.

RE: NullPointerException

Can you try the query in VB.NET or ODBC Test or something other than the PCC?  If it's an engine problem, there should be more to the error than just "NullPointerException."  That might be a PCC issue.  Are you running the query into "Grid" or "Text" mode?  Try running it using the other mode.   

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com

RE: NullPointerException

(OP)
When I run in vb.net, it gives the following error:

Year, Month, and Day parameters describe an un-representable DateTime.

I ran the query in both grid and text mode in PCC, and both come up with the nullpointerexception.

RE: NullPointerException

Okay, what are the data types for both e.timestampnbr and a.timestampnbr?

What's the result of the following query:

CODE

select top 1 e.time from timestmp e where a.date = e.date and a.wrkordnbr = e.wrkordnbr and e.status in (102) and e.timestampnbr >= a.timestampnbr

and this one:

CODE

select top 1 e.time from timestmp e where a.date = e.date and a.wrkordnbr = e.wrkordnbr and e.status in (102) and e.timestampnbr >= a.timestampnbr + 2 and e.timestampnbr < a.timestampnbr + 5

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com

RE: NullPointerException

(OP)
They are integers

The top query returns a successful result and the bottom query also returns a successful result so long as it's by itself. It works okay on the first IFNULL, but not on the second nested IFNULL (returns Year, Month, and Day parameters describe an un-representable DateTime) .

RE: NullPointerException

What values are returned from each query?  
WHat about this one:

CODE

select top 1 e.timestampnbr, a.timestampnbr  from timestmp e where a.date = e.date and a.wrkordnbr = e.wrkordnbr and e.status in (102) and e.timestampnbr >= a.timestampnbr + 2 and e.timestampnbr < a.timestampnbr + 5

Mirtheil
Certified Pervasive Developer
Certified Pervasive Technician
http://www.mirtheil.com

RE: NullPointerException

(OP)
"01:00:00" are returned on both queries.

That query you just listed won't run in a subselect since it has two expressions. I took a.timestampnbr out (so only e.timestampnbr) and ran it, and that returns the same error.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close