URGENT . .. SELECT clause doubt

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
abh_kol
Member
Posts: 2
Joined: Thu Nov 06, 2008 8:40 am

URGENT . .. SELECT clause doubt

Post by abh_kol » Thu Nov 06, 2008 8:44 am

I have a doubt in a DB2 Query. The query is like...

SELECT 1 FROM <tablename> WHERE . . . . .

It returns the value 1111111111111111111111111 (specific no of 1's). If the query is changed to

SELECT 2 FROM <tablename> WHERE . . . . .

It returns the value 2222222222222222222222222 (specific no of 2's).

Can any one please explain me what's happening here??

User avatar
Natarajan
Moderator
Posts: 537
Joined: Fri Oct 10, 2008 12:57 pm
Location: chennai
Contact:

Post by Natarajan » Thu Nov 06, 2008 9:41 am

simple answer is -
If n rows are satisfied for that condition given in where clause, those many number of one's/two's are got displayed in the output.

Let me know, if my answer not cleared your doubt
Natarajan
Chennai

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Thu Nov 06, 2008 2:52 pm

are you running this as spufi/qmf or imbedded sql?

are you really getting 1111111
or
1
1
1
1
1
?
Natarajan provided you with an accurate answer.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

abh_kol
Member
Posts: 2
Joined: Thu Nov 06, 2008 8:40 am

Thanks a Ton !!!!!

Post by abh_kol » Mon Nov 10, 2008 8:55 am

Yeah .. . That clears me the doubt I had. . . .

Thanks a Ton . . ..

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others