IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

how to insert LOW VALUES in a DB2 table?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top