Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SQL Code -305 in Join

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Suhaas

New User


Joined: 16 Apr 2009
Posts: 1
Location: Pune

PostPosted: Thu Nov 10, 2011 2:26 pm    Post subject: SQL Code -305 in Join
Reply with quote

I have below query in cursor...

SELECT A.A1
,A.A2
,B.B1
,B.B2
FROM
(SELECT X.A1
,Y.A2
FROM TABLE1 X
,TABLE2 Y
WHERE X.A3=Y.A4)
AS A
LEFT OUTER JOIN
TABLE3 B
ON B.B2=A.A2

Here A1, A2 and B2 are NULLable columns and B1 in NOT NULL

Resultant Data Set
A1 A2 B1 B2
1 2 1 2
2 10 5 10
3 12 -- --
7 11 -- --

However due to left outer join...For non matching rows from left side table i.e. TABLE1 and TABLE2, its making values of B1 and B2 as NULL (Though B1 is defined as NOT NULL)

While fetching its giving me -305 for column B1

I tried applying NULL indicator to column B1...Gave me Sql Code -303...Incomparable data items.

Please help...
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Nov 10, 2011 2:34 pm    Post subject: Reply to: SQL Code -305 in Join
Reply with quote

This question is already posted in the Beginners forum. Where, quite frankly, your responses to suggestions cross way over the borders of rudeness.

It is no one else's code but yours, or your site's, that is not working. You have not been able to work out how, so maybe first you spend a further day followig your own advice?
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Nov 10, 2011 2:58 pm    Post subject:
Reply with quote

-305 THE NULL VALUE CANNOT BE ASSIGNED TO OUTPUT HOST VARIABLE NUMBER
position-number BECAUSE NO INDICATOR VARIABLE IS SPECIFIED
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Thu Nov 10, 2011 3:10 pm    Post subject: Reply to: SQL Code -305 in Join
Reply with quote

do not double post.
people providing help on both forums are pretty much the same,
asking twice will not provide You with better help!
topic locked ( will be delete shortly )
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm

Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us