View previous topic :: View next topic
|
Author |
Message |
bh
New User
Joined: 19 Mar 2006 Posts: 26 Location: India
|
|
|
|
Hi,
Can anyone tell me what happens if one uses
'select * from <table name'> in a COBOl pgm ?
Regards,
bh. |
|
Back to top |
|
|
saiprasadh
Active User
Joined: 20 Sep 2006 Posts: 154 Location: US
|
|
|
|
Hi
If you not using the Cursor in the Program for a query whose result set is more than 1 row,then you will get Sqlcode -811
Thanks
Sai |
|
Back to top |
|
|
bh
New User
Joined: 19 Mar 2006 Posts: 26 Location: India
|
|
|
|
Thank u |
|
Back to top |
|
|
prasadvrk
Active User
Joined: 31 May 2006 Posts: 200 Location: Netherlands
|
|
|
|
select * would get all the rows meeting the criteria for all columns , which you may not need instead it is always a good practice to name the coulmns that you need in the query. Also when a column in the tbale is dropped you need not compile again if you use the column names in the query. Performance also would be better if you use specific column names |
|
Back to top |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
Agree with Prasadvrk's advice. Where I work "SELECT *" is forbidden in COBOL programs. The DBAs would raise a bloody stink if someone coded it.
However, SELECT * is perfectly fine for SPUFI. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
One drawback of SELECT * is that it can make impact analysis more time consuming. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
With
in a cobol program you have to have a structure to receive all the data items and a structure to receive null indicators for all the data items.[/u] |
|
Back to top |
|
|
pingte
Active User
Joined: 03 Dec 2005 Posts: 120 Location: india
|
|
|
|
Analyse the program and figure out which all columns u need in the program...
Put only those cols in select statement.
This will make ur program more efficient and easier to maintain.
Also in future if there are any changes to table strusture (like columns added), then impact on ur program will be less. |
|
Back to top |
|
|
|