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 Usergroups Profile Log in to check your private messages Log in
 

 

how to insert LOW VALUES in a DB2 table?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
chitra_chaturvedi

New User


Joined: 24 Jul 2007
Posts: 18
Location: india

PostPosted: Tue Jul 24, 2007 9:48 am    Post subject: how to insert LOW VALUES in a DB2 table?
Reply with quote

Hi All

Please can anybody tell me how to insert LOW VALUES in a DB2 table?

As Low Values is a COBOL key word we can't use it in DB2.
Back to top
View user's profile Send private message

amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Tue Jul 24, 2007 10:10 am    Post subject:
Reply with quote

Are you doing this insert thru a COBOL program or u are just running the query thru spoofi? Please let me know the process!
Back to top
View user's profile Send private message
chitra_chaturvedi

New User


Joined: 24 Jul 2007
Posts: 18
Location: india

PostPosted: Tue Jul 24, 2007 10:19 am    Post subject:
Reply with quote

Hi Amitava


I have to do it without using cobol program.

I think we need to insert hexadecimal equivalent of low values into DB2 table, but i don't know how to do it?
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Tue Jul 24, 2007 10:29 am    Post subject:
Reply with quote

U can use the following query -
Code:
insert into <Table Name> values(X'00000000','X','SSS',100.09,23)

The first field represent the low values to be inserted in the table but take care of the datatype defined for the corresponding field! I think it should not be INT.

icon_razz.gif Correct me if I am wrong icon_wink.gif
Back to top
View user's profile Send private message
Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Tue Jul 24, 2007 10:37 am    Post subject:
Reply with quote

Low values or NULL values?


I think you means NULL values.. You want make NULL values for the perticular column means..

In that table three columns. They are E-number, Ename, Ecity.

Now i want to make Ecity column as null means.... This is the Query.


Insert into <table name> values(102,'Ajey',NULL);
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Tue Jul 24, 2007 10:51 am    Post subject:
Reply with quote

Hi chitra,
Be specific to your query! I got confused to see what u r looking for low values or null? However I apologize for my mistake - the query I have sent you requires little modification -
Code:

insert into <Table Name> values([b]X'00000000'[/b],'X','SSS',100.09,23)


U will try this query in spufi or some editor! My suggestion will be to set the profile to HEX ON and under the first field, set the HEX VALUE to 00000000. This will insert the low values to your table.
Back to top
View user's profile Send private message
Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Tue Jul 24, 2007 1:18 pm    Post subject:
Reply with quote

Hello amitava,

I'm not getting you... When i set my profile to HEX ON means. Its giving some other symbol for these [ and ]. How can i give these symbols.

Please explain me....
Back to top
View user's profile Send private message
chitra_chaturvedi

New User


Joined: 24 Jul 2007
Posts: 18
Location: india

PostPosted: Tue Jul 24, 2007 2:13 pm    Post subject:
Reply with quote

Hi

I am not asking for null values I a want to insert Low values into a db2 table.

I tried your querry and it is giving following error

Incorrect hexadecimal data found in value starting X'00000000000'
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Tue Jul 24, 2007 4:54 pm    Post subject:
Reply with quote

Hey Chitra,
Use the following query -
Code:
insert into xa2ctso.emp values(000,X'00000000','bss',100.09,23)

But mind that the low-values will be only inserted into CHAR datatype field of DB2 table. This will work![/code]
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jul 24, 2007 5:58 pm    Post subject:
Reply with quote

chitra_chaturvedi wrote:
Hi

I am not asking for null values I a want to insert Low values into a db2 table.

I tried your querry and it is giving following error

Incorrect hexadecimal data found in value starting X'00000000000'


When you are expressing a literal as hex value there must be an even number of hex characters.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts How can we create a flat file in JAVA... rakesh.v18 Java & MQSeries 7 Fri Sep 23, 2016 10:46 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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