Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Selece Query..

Former Member
0 Likes
816

Hi,

Is there any select statement <b>to select all the fields from a table xyz, except one field ???</b>

Thanks!!

Kode

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
787

Get all the fields into an internal table and then do a modify blanking out just that one field that you don't want. Something like this.

select * from dbtab into itab where <...>.

clear itab-dontwantthisfield.

modify itab transporting dontwantthisfield where dontwantthisfield is not initial.

8 REPLIES 8
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
787

No, there is no syntax like that, but you could simply get all records, then delete the one that you don't want using the DELETE statement.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
788

Get all the fields into an internal table and then do a modify blanking out just that one field that you don't want. Something like this.

select * from dbtab into itab where <...>.

clear itab-dontwantthisfield.

modify itab transporting dontwantthisfield where dontwantthisfield is not initial.

Read only

Former Member
0 Likes
787

HI Priya,

No it is not possible.

either u have to use select * or u use select field1 field2 .. to select the data from a table.

use the second option<b> select field1 field2 ..</b> if you really want to exclue one field

Thanks

Mahesh

Read only

0 Likes
787

Hi Priya,

You can do this..

Create an internal table with all the fields required.

Write select * from dbtab into CORRESPONDING FIELDS OF TABLE ITAB

WHERE...

This avoid writing every field in the query.

Hope this solves your problem.

-Kriss

Read only

Former Member
0 Likes
787

This problem is solved ..Thanks to all.

Read only

0 Likes
787

Please let me know how is it resolved. Award the points please..

-Kriss

Read only

Former Member
0 Likes
787

Hi Kriss,

Actually they changed the requirement a bit. So I didn't get a chance to use any of these solutions. But I got a very good information.

Anyways I will reward points..

Read only

0 Likes
787

Thanks for the info and rewards!!!