HDTenEightyP/NetNews huggingface dataset:
From: cs_mj@gsbacd.uchicago.edu (Mark Jaeger)
Subject: Re: SQL Errorcodes
Organization: 
Date: Thu, 15 Oct 1992 22:27:43 GMT

In article <1992Oct14.122302.7557@tpghq.com>, sfc@tpghq.com (Steve Caswell)
writes:
> In article <lindsay.718941123@giaeb> lindsay@giaeb.cc.monash.edu.au
(lindsay smith) writes:
>> ...Recently a student while running an ESQL
>> program written in C received an SQLCODE error of -40204...
>> a. what is this particular error triggered by?
>
> This is a generic error that means "A data handling error occurred"...
> To get the INGRES-specific error, you can do one of two things.  The first is
> to set up a logical name (VMS) or environment variable (UNIX) before running
> the application or query.  This will tell INGRES to put the INGRES-specific
> error number into SQLCODE, rather than the generic error. To create this
> logical name/environment variable, do the following:
>
>    (On VMS)  $ DEFINE II_EMBED_SET "DBMSERROR"
>    (On UNIX) % setenv II_EMBED_SET DBMSERROR     (C Shell)
>              $ II_EMBED_SET=DBMSERROR            (Bourne Shell)

This has the unfortunate side effect of causing code to break if it was
written to expect only one type of error code (generic or
dbms-specific).  Luckily, the two sets of codes don't overlap.  

Thus, we have the generic code for serialization error:

	#define GE_SERIALIZATION   49900 /* Serialization failure (deadlock) */

and the dbms-specific cases (these are our home-brewed definitions):

	#define SQL_DEADLOCK 4700
	#define SQL_LOG_FULL 4706
	#define SQL_XXX      4708 /* Does anyone know what this is? */

No dbms-specific error has the code 49900, and no generic errors are in
the range 4700-4799.

When writing code to test the SQLCODE, you can check everything:

	SQLCODE = sqlca.sqlcode ;

	if ( SQLCODE == -GE_SERIALIZATION 
	|| SQLCODE == -SQL_DEADLOCK 
	|| SQLCODE == -SQL_LOG_FULL
	|| SQLCODE == -SQL_XXX ) 
		...retry once or twice...

	else if ( SQLCODE < 0 ) 
		...rollback and quit...

	else 
		...okay...

This code will continue to work regardless of the ii_embed_set setting.

We prefer to leave the SQLCODE with the ANSI-standard generic
definition, and use inquire_ingres if we want to get the dbms-specific
error as well.  We automatically trap errors and log them to an error
log for later analysis.

> Confusing, isn't it?

Amen.

--Mark Jaeger				internet: cs_mj@gsbvax.uchicago.edu
Graduate School of Business		yellnet:  (312) 702-0328
University of Chicago			faxnet:   (312) 702-0233
Disclaimer: My opinions are my own and not those of my employer.
Ich bin ein Virus.  Mach' mit und kopiere mich in Deine .signature.

Newsgroups: comp.databases.ingres
From: joser@gfimda.uucp (Joe Rodriguez)
Subject: Re: Tabbing on a read-only form?
Date: Wed, 14 Oct 1992 22:31:30 GMT
Organization: Kraft General Foods

From article <1992Oct9.123952.7753@dcs.qmw.ac.uk>, by amandla@dcs.qmw.ac.uk (Jackie Saul):
> Can anyone enlighten me please. I have a form and have used the command
> set_forms form (mode = 'read'); in my abf code.
> However, when I do this the user can not tab between fields and they need to 
> do this as the form is longer than the window size. Is there any way of making 
> the form read only but also allowing tabbing/movement between fields?
> Any help would be appreciated.
> --
> Jackie Saul
> 
Jackie,

   It sounds like you would like the user to be able to scroll the form
   up or down to allow for viewing of the rest of the fields.  This can
   be done by using the scrollup and scrolldown keys.  Check your INGRES key map
   file for your terminal. This will allow you to determine what keys you 
   need to press to scroll the form up or down.  This is an INGRES forms 
   feature.


+--------------------------+------------------------------------+
| Joe Rodriguez            |    ||   //    /====\    +=======   |
+--------------------------+    || //     ||         ||         |
| Kraft General Foods      |    |</       ||  ====   ||====     |
| General Foods-USA, IMD   |    || \\     ||    ||   ||         |
| Mailcode:  T12-1         |    ||   \\    \====/    ||         |
| 555 South Broadway       |------------------------------------+ 
| Tarrytown, NY  10591     | joser@gfceb   - ICES INGRES Host   |
| (914) 335-6059           | joser@gfimda  - IMD System         |
|                          | INTERNET/UUCP:  gfimda!joser@uunet |
| Pager: (212) 356-5116    |                 uunet!gfimda!joser |
+--------------------------+------------------------------------+
-- 
+--------------------------+------------------------------------+
| Joe Rodriguez            |    ||   //    /====\    +=======   |
+--------------------------+    || //     ||         ||         |
| Kraft General Foods      |    |</       ||  ====   ||====     |
From: adamsm@woods.ulowell.edu
Newsgroups: comp.databases.ingres
Subject: Need help from SQL wizards out there!
Date: 14 Oct 92 22:06:43 GMT
Organization: University of Lowell

I have a simple question for all you SQL wizards out there as I haven't the
experience as yet to solve this problem.  I have three tables BIO,EMP,DON all
indexed by unique social secutity number (SSNUM).  How can I select the records
that are in BIO where there exists the same SSNUM in EMP but not include the
records that have the same SSNUM in DON.  I tried:

select BIO.SSNUM
from   BIO,EMP
where 	   BIO.SSNUM=EMP.SSNUM
      and  BIO.SSNUM not in (select DON.SSNUM
                             from   DON);

This looks logial but dosn't seem to work as it always produces an empty list.

help

-Mike Adams (University of lowell, Massachusettes)
                             
Newsgroups: comp.databases.ingres
From: jonm@Ingres.COM (DON'T TEST AN M16 IN A CHINA SHOP. (ANCIENT PROVERB))
Subject: Re: Tabbing on a read-only form?
Summary: 
News-Software: VAX/VMS VNEWS 1.4-b1  
Keywords: 
Organization: ASK Computer Systems, Ingres Product Division
Date: 15 Oct 92 11:13:27 GMT

In article <1992Oct9.123952.7753@dcs.qmw.ac.uk>, amandla@dcs.qmw.ac.uk (Jackie Saul)                              writes...
>Can anyone enlighten me please. I have a form and have used the command
>set_forms form (mode = 'read'); in my abf code.
>However, when I do this the user can not tab between fields and they need to 
>do this as the form is longer than the window size. Is there any way of making 
>the form read only but also allowing tabbing/movement between fields?
>Any help would be appreciated.
>--

Try using 

mode read;

instead.

Jon
From: laut@alien.gici.com (Bill Laut)
Newsgroups: comp.databases.ingres
Subject: SUMMARY:  Steroids for Transactions
Date: 15 Oct 92 13:32:57 GMT
Organization: Gull Island Consultants, Inc.


	Thanks to everyone who has been responding to my earlier posting
about "Steroids for your Transaction Logs."  Generally, there is quite a
bit of latitude in opinion on the subject.  To summarize:

OPTION #1 - Buy a formal RAM disk.

	To be honest, this option I myself would prefer, simply because 
	support for the thing gets stuck with the manufacturer.  In our
	case, this would be an ESE-20 from DEC.  However, we need at
	least 200mb of RAM space for our transaction files, and so the
	ESE-20 solution would be a bit pricey.  Plus, it really should
	be shadowed for additional protection.  More money.

OPTION #2 - Install a RAM disk driver.

	Under VAX/VMS, a RAM disk can allocate its space from either paged
	or non-paged dynamic memory.  Judging from the concensus of opinion,
	we would need to allocate it out of non-paged memory, so that in
	case of a system crash, we could extract the disk out of the system
	dump file.  CAVEAT:  This also implies that the system dump file
	be extended out to its full length and that non-abbreviated dumps
	are taken.

CAUTIONS:

	In this scenario, it is recommended that RAM disks of equal size
	be created on all principal nodes which run INGRES, and that they
	be shadowed together using Host-based shadowing, so that they all
	are hot-backups of one another.

	A write operation will be propogated out automatically to the other
	RAM disks, thus updating them.

	A READ operation will likely be completed on the local disk, thus
	hopefully reducing CI bus load.

	N.B.:  If your current bottleneck is the transaction log disk, it
	may be likely that a RAM disk will push the bottleneck out into
	some other section of your system.  It is advisable to have a good
	performance monitoring tool that can do accurate, predictive
	analysis of your system, to help predict where the next bottleneck
	likely will occur.

MISC:

	Although it does not involve the transaction files, another
	VAX/VMS observation has it that after you do the SYSMOD to clean
	up the internal formatting of a table/database, do an ANA/RMS/FDL
	on the individual tables, and then (off-line, of course) do a
	CONVERT/FDL to copy over the table, adding additional disk space
	to the table.  Then, do a BACKUP/IMAGE to the entire disk to
	finish cleaning it up.  This will cause the table to be physically
	contiguous on the disk, with extra contiguous space allocated to
	the table, and ready for utilization when INGRES calls upon the
	XQP to extend the table.

	The above item is intended primarily for tables that tend to grow
	at a fairly predictive rate.


-- 
Bill Laut			Internet:  laut@alien.gici.com
Gull Island Consultants, Inc.	Phone:     (616) 780-3321
Muskegon, MI  49440		>> "Usual disclaimers, apply within" <<
From: tio_on@tac.fi (Ossi Numminen)
Newsgroups: comp.databases.ingres
Subject: Table level locking
Date: 15 Oct 92 10:17:24 +0200
Organization: City of Tampere


If I have a table which resides on - say - three different
locations on three different disks and some application
escalates to table level locking, does Ingres always lock
all those three locations, or only that one where the data
actually is?
 
*******************************
Ossi Numminen
City of Tampere
Dept. of Information Technology
P.O. Box 87
SF-33211 Tampere, Finland
e-mail: tio_on@tac.fi
fax:_-358-31-196044
From: cs_mj@gsbacd.uchicago.edu (Mark Jaeger)
Newsgroups: comp.databases.ingres
Subject: Re: Adding new users
Date: 14 Oct 92 21:50:42 GMT
Article-I.D.: gsbacd.1992Oct14.155042.1
Distribution: usa

In article <1992Oct7.185132.3203@athena.mit.edu>, thomasl@mtl.mit.edu 
(Thomas J Lohman) writes:
> I'm currently updating a program which we have used to add new users
> to our system, which includes adding them as Ingres users.  It appears
> the Ingres part dies now, most likely due to the upgrade into 6.3/6.4
> territory.  
> 
> What I was wondering, does anyone know the most straightforward way to 
> add Ingres users through a C program?  Is it possible?  If so, is it
> anywhere in the documentation?  If it isn't possible, then is accessdb
> the only way to add users to Ingres?

The only _supported_ way to add users is through "accessdb".  However,
you can write an ESQL/C program to do the same.  Connect to the iidbdb
database with the "+Y" switch, and insert a row into the "iiuser" table. 
That's all there is to it.  If you want to be compulsive, you can add a
row to the file (VMS) ii_system:[ingres.files]users. or (UNIX)
$II_SYSTEM/ingres/files/users., but you can also do this
after a bulk load by re-saving any existing user in "accessdb".

Depending on what you need, you may also have to add rows to the
iidbaccess, iiusergroup, and iidbprivilege tables.  Look in the SQL
Reference Manual appendix for more documenation on these tables, or do
"help" from the terminal monitor and figure it out for yourself.  It's
really not that hard.

You'll need to specify the status flags for a user, and they are
documented in the I & O Guide.  In my edition, release 6.4, Dec. 1991,
it's on p. 1-41. 

You can also reverse engineer the whole thing by running accessdb and
then creating a user with this logical defined:

		$ define ing_set "set printqry;"

In UNIX, use this:

		$ ING_SET='set printqry;' ; export ING_SET 

--Mark Jaeger				internet: cs_mj@gsbvax.uchicago.edu
Graduate School of Business		yellnet:  (312) 702-0328
University of Chicago			faxnet:   (312) 702-0233
Disclaimer: My opinions are my own and not those of my employer.
Ich bin ein Virus.  Mach' mit und kopiere mich in Deine .signature.
Newsgroups: comp.databases.ingres
From: sergio@Ingres.COM (Sergio L Aponte)
Subject: Re: Lock_trace output to a file?
Organization: Ingres, an ASK Company, Alameda CA 94501
X-Newsreader: Tin 1.1 PL5
Distribution: net
Date: 9 Oct 92 19:10:11 GMT

Ossi Numminen (tio_on@tac.fi) wrote:
: I've got a problem with lock_trace output in our Ingres 6.3/03 (VAX/MVS).
: How can I get it into a file?
: 
: *******************************
: Ossi Numminen
: City of Tampere
: Dept. of Information Technology
: P.O. Box 87
: SF-33211 Tampere, Finland
: e-mail: tio_on@tac.fi
: fax:_-358-31-196044
: 
	No way on 6.3 other than redirect output, which is why for 6.4 you can

	Set II_EMBED_SET to "printtrace" will direct any tracing info into
	a file in your current directory.

	Set II_EMBED_SET to "printtrace;tracefile mytrace.out" to specify the
	file were you want the output to go.

	Set ING_SET to "set lock_trace"
	Set II_EMBED_SET to "printtrace;tracefile mytrace.out"
	and you will have lock_trace info sent to mytrace.out

--
===============================================================   _|||_
Sergio L. Aponte, SMTS @ Ingres, an ASK Company                   <*,*>
Internet : sergio@coqui.ingres.com                                [`-']  Keko
UUCP     : {sun,mtxinu,pyramid,pacbell}!ingres!coqui!sergio       _"_"_  Jones
Newsgroups: comp.databases.ingres
From: melkor!valandil!mal (Michael A Leo)
Subject: Re: Time limit for SQL statement
Organization: National Radio Astronomy Observatory
Date: Wed, 14 Oct 1992 13:14:59 GMT

	
	I'm looking for a way to specify an upper limit on the time taken for
	an SQL statement to execute (using embedded C/SQL on various Unix
	systems, Ingres 6.4).
	
	Perhaps I've missed a little option somewhere in Ingres, but here's my
	suggestion.  Does anyone know the implications of using an alarm signal
	in this way to interrupt an SQL statement?
	
	For example, using a really crude approximation to C,
	
		set sigalarm ( 30_seconds, my_alarm_handler )
		EXEC SQL :mystatement
	
	    alarm_continue:
		set sigalarm ( off )
		...
	
	
		my_alarm_handler()    /* Called when the timer expires */
		{
		    goto alarm_continue;    /* Yuk.  But it serves my point (I hope) */
		}
	
	Would this break the application's back-end link or something else
	equally nasty?  Any suggestions and comments would be appreciated, please!
	
	Ta,
	Chris
	--
	            VISIONWARE LTD, 57 Cardigan Lane, LEEDS LS4 2LE, England
	  Tel +44 532 788858 x238.  Fax +44 532 304676.  Email chris@visionware.co.uk
	---------- "VisionWare:   The home of DOS/SQL/UNIX/X/VMS integration" ---------
	

Well, If I were forced to do this, I would put a call to 
iiresync or iibreak just before the "goto alarm_continue" 
statement.

However, iiresync and iibreak(which I believe just calls iiresync),
are NOT supported by Ingres.

iiresync will abort any transactions that are in process in
the connected session.

I would LOVE to see Ingres support this.  I would also love to 
see Ingres support asynchronous I/O, i.e. I would like to be able
to have an embedded program that could have 5 sessions (connected
via Ingres/NET) to five different databases, and be able to start
5 queries simultaneously.

This is not as hard to program as one might think, if opening
a cursor could be asynchronous.  Then one could:

   1) open cursor1 on machine 1 (getting an immediate return as Ingres 
      goes off and starts the work)

   2) open cursor2 on machine 2 (getting an immediate return as Ingres 
      goes off and starts the work)

   3) open cursor3 on machine 3 (getting an immediate return as Ingres 
      goes off and starts the work)

   4) open cursor4 on machine 4 (getting an immediate return as Ingres 
      goes off and starts the work)

   5) open cursor5 on machine 5 (getting an immediate return as Ingres 
      goes off and starts the work)

   6) if cursor1 is ready ....  (this would be something like the
      "select" BSD socket routine)

This scheme could be used to easily implement timeouts if one could
close the cursor before it is ready to output data.

I know.  It's not useful for everyday stuff, but gee its neat! ;-)

Of course, who out there does "everyday stuff".  Everyone 
seems to need wierd things.

Even Ingres must use iiresync since one can abort queries in the SQL
terminal monitor!  Why not make the interface public?  I don't
know how many times my users have asked for the ability to interrupt
queries in an embedded program.

Mike Leo
mike.leo@adc.com      Don't "reply" as my header is busted.
From: mclo@rtf.bt.co.uk (John McLoughlin)
Newsgroups: comp.databases.ingres
Subject: CREATE TABLE help needed
Keywords: create table, variable name
Date: 16 Oct 92 14:03:52 GMT
Organization: BT Customer Systems, Brighton, UK

Hello,

Is there any way to create a table using a variable for the table name 
instead of explicitly declaring the table name ?
i.e

	CREATE TABLE :tab_variable .....

	instead of

	CREATE TABLE my_table ...

I know this is not possible in ingres 6.3, is it possible in 6.4 ?

Does any one know if it will be a feature of later releases ?

Thanks in advance,

John.
Newsgroups: comp.databases.ingres
From: cs_mj@gsbacd.uchicago.edu (Mark Jaeger)
Subject: Re: Access to iidbdb
Organization: 
Date: Mon, 12 Oct 1992 22:02:55 GMT

In article <9210062149.AA04493@bear.cis.ohio-state.edu>, 
doug@news.cis.ohio-state.edu (Doug Kerr) writes:
> We have just started using Ingres on DECstations.  The documentation
> says that all information about the databases is stored in the iidbdb
> database, which is owned by the user $ingres.  However I am unable to
> access any of those tables even with ingres user privileges.  I can
> access the database, but am told it contains no tables.
> 
>  Douglas S. Kerr, Department of Computer and Information Science
>  The Ohio State University; 2036 Neil Ave. Columbus OH USA 43210-1277
>  doug@cis.ohio-state.edu                    614/292-1519

As other folks have pointed out, most access to this database is through
the "accessdb" command, for both reporting and updating.

If what you're looking for is background information about databases,
you may find the "infodb" command helpful.  It is documented in the SQL
Reference Manual.  The "infodb" command basically does a formatted dump
of the information in the database's configuration file, which is
located in the data directory under the name aaaaaaaa.cnf (but don't
mess with it).  It contains a copy (under normal circumstances) of the
information in the tables in the iidbdb, such as iidatabase,
iilocations, iiextend, and iidbaccess.

--Mark Jaeger				internet: cs_mj@gsbvax.uchicago.edu
Graduate School of Business		yellnet:  (312) 702-0328
University of Chicago			faxnet:   (312) 702-0233
Disclaimer: My opinions are my own and not those of my employer.
Ich bin ein Virus.  Mach' mit und kopiere mich in Deine .signature.
From: astinus+@pitt.edu (Mark E Porterfield)
Newsgroups: comp.databases.ingres
Subject: RE:Selecting a few rows from a whole table.
Date: 9 Oct 92 19:47:25 GMT
Organization: Pittsburgh Supercomputing Center

I've never had this request personally but I am sure some depatment has made it
at one time or another and I can even see some practical use for it.  I'll say
this...I haven't thought about it too long yet...but I think this would be 
easier with a flat data file rather than and INGREs table file.  It sounds like
a weekend challenge.
Newsgroups: comp.databases.ingres
From: ask@sei.cmu.edu (Alan Koch)
Subject: Ingres 6.4/02 experience?
Organization: The Software Engineering Institute
Date: Thu, 8 Oct 1992 12:50:54 GMT


We are contemplating upgrading from Ingres 6.4/01 to 6.4/02.  
(We run Ingres on a Sun4.)

If you have any experience with this new version (good OR bad), 
please send me mail.

Thank you.

ask@sei.cmu.edu

Alan S. Koch
Software Engineering Institute
Carnegie Mellon University
Pittsburgh, PA  15213
From: someone-who-might-know
Newsgroups: comp.databases.ingres
Subject: Re: Blobs in Ingres 6.5
Date: 13 Oct 1992 02:13:11 GMT
Organization: University of California, Berkeley
Distribution: world
NNTP-Posting-Host: tweety.cs.berkeley.edu

In article <1992Sep21.055338.2578@csc.canberra.edu.au>, mmr@asgserver.canberra.edu.au (Micheal Rainford-Watson) writes:
|> In article <1992Sep11.015342.1249@tpghq.com> sfc@tpghq.com (Steve Caswell) writes:
|> >I believe that the 2000 byte (actually, the real limit is 2010 bytes) limit is
|> >a historical limit.  An INGRES page is actually 2048 bytes, which makes writing
|> ^^^^^^^^^^^^^^^^^^^
|> 
|> Another thought is there are less system resources (such as memory) required
|> to lock a page of data compared to every row.

The *real* reason is that it is too complex to modify all the code that 
depended on tuples fitting on one page. 
Estimated development time for this feature was 12-18 person-months when 
you included all the additional utilities that had to be modified.  (Remember
you have to modify the logging system, the load/unload utilities, the
indexing system, the sort package, etc.)  
	DeepThroat
From: jcross@ec.uwa.oz.au (Jennifer Cross)
Newsgroups: comp.databases.ingres
Subject: Re: Large databases
Date: 12 Oct 1992 06:15:27 GMT
Organization: The University of Westrn Australia
NNTP-Posting-Host: decel.ecel.uwa.edu.au

sriram@tcs.com (Sriram Srinivasah) writes:

>I was wondering if anyone has had trouble with fairly large databases using
>Ingres 6.4 on a Sun SparcStation 2.
  No, trouble as such, but we have been doing this is "just enough" disk
  space, which has made things tricky at times

>My parameters are ...

>table 1  ..........      300,000 records, 1/2 Gigabyte, 200 columns
>table 2  ..........      10 million records, each 30 bytes

  Ok, mine is fairly similar...
  with my main table being 8.5 million rows, about 50 bytes each
  primary host is a sun sparcII, disks are 980mb formated

>The kind of areas I need clarification on are ....

>1. If I create an index on table1 for a couple of columns, do I need to greatly
>    increase swap space on the workstation?
  Swap space? no.  Location for Ingres temp files and log file, yes
  we have specified the disk area for ingres to use for it's temp files... and
  our tables have all been created with the no journaling option.  My log space
  is pretty big for while we were loading the data into the tables. (our 
  applications are all read only, with yearly updates - this is important for us,
  and the way which I have structured the database)


>2. What kind of adminstration problems do you run into, for such large databases?
>   What steps have you taken?
  well, in order to save space on disk, we have structured the large table into a
  btree (normally you would leave it HEAP and create and external index... but this
  took an additional 150mb)  Of course this meant the disk has to be pretty empty
  when we do the modify to btree on that file.
  BTW we ALWAYS use btree indexes.. the ingres optimiser seems to work _much_ better
  at using the index that way.

>3. It'd be nice to have some ballpark figures of performance ("selecting 1 item out
>   of 10 million records of x size took Ingres 40 seconds")
  humm, accessing the record by the key, usually gives sub-second response on our 
  sparcII... (eg select on a key pair which returns about 1400 rows in isql
  takes about 3.5 seconds.  if I add a selection criteria on a non indexed (date)
  field to return just one row, total response time is about .5 sec

>Forgive my naivete.
not naivete.. and of course there are a lot of ways to do this stuff  *grin*

>Sriram
>(sriram@tcs.com)
--    ___
     (   >                  /)                        (voice) +61 9 362 6680
      __/_/> ____  ____  o //  _  __            (home)  cjcross@DIALix.oz.au
     / / (__/ / <_/ / <_<_//__</_/ (_ @ Beautiful Perth, Western Australia
    <_/                  />                     (work) jcross@ecel.uwa.oz.au
                        </                            (voice) +61 9 380 3968
Newsgroups: comp.databases.ingres