Limiting solution set for a Select in 7.24
Posted in 1999
Topics: Installation, Setup & Upgrades, Connectivity: ESQL/C, 4GL & Embedded SQL
I am attempting to enhance a script that presently returns the row count and table name when invoked. I would like to add additional functionality to this. I would like to show a few rows (maybe 4 or 5) to give a sample of the data in the table. Some of the tables that I am dealing with have a million or more rows in them. I am looking for a way to just grab a few rows and end the query. I know there is a way to do this in 7.3 but we are not upgrading to that in the near future. I was going to look into writing a small esql/c program to do this. I have just started researching the sqlda structure as a possible way to do this. Does anyone know if this will work? Or does anyone have any ideas (other than an upgrade)? Thanks in advance! Rose Marie Sent via Deja.com http://www.deja.com/ Before you buy.
In article <82qvpn$s3c$1@nnrp1.deja.com>, rml76@my-deja.com wrote: > I am attempting to enhance a script that presently > returns the row count and table name when invoked. > > I would like to add additional functionality to > this. I would like to show a few rows (maybe 4 or > 5) to give a sample of the data in the table. Some > of the tables that I am dealing with have a > million or more rows in them. I am looking for a > way to just grab a few rows and end the query. > > I know there is a way to do this in 7.3 but we are > not upgrading to that in the near future. I was > going to look into writing a small esql/c program > to do this. I have just started researching the > sqlda structure as a possible way to do this. > > Does anyone know if this will work? Or does anyone > have any ideas (other than an upgrade)? > > Thanks in advance! > > Rose Marie > > Sent via Deja.com http://www.deja.com/ > Before you buy. > Yes, an esql/c program will do the trick, but I'm not sure what you mean by researching the sqlda structure. The sqlda structure is very useful, but I don't know how you are expecting to get the data you need from it. However, you can select the information you need from systables in the database you are using. You can get the columns 'tabname' and 'nrows' from it. If you only want a few records, you can set a counter and stop after a certain number of records, or you could write a random number generator to select specific tabid's. Just make sure the tabid is > 99, as any tabid lower than that is a system table. -- # unrm / ksh: unrm: not found # man cpio Sent via Deja.com http://www.deja.com/ Before you buy.