View previous topic :: View next topic
|
Author |
Message |
chitra_chaturvedi
New User
Joined: 24 Jul 2007 Posts: 18 Location: india
|
|
|
|
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 |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
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 |
|
|
chitra_chaturvedi
New User
Joined: 24 Jul 2007 Posts: 18 Location: india
|
|
|
|
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 |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
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.
Correct me if I am wrong |
|
Back to top |
|
|
Rajesh S Warnings : 1 New User
Joined: 11 Jul 2007 Posts: 54 Location: Chennai
|
|
|
|
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 |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
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 |
|
|
Rajesh S Warnings : 1 New User
Joined: 11 Jul 2007 Posts: 54 Location: Chennai
|
|
|
|
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 |
|
|
chitra_chaturvedi
New User
Joined: 24 Jul 2007 Posts: 18 Location: india
|
|
|
|
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 |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
|