Newsgroups: comp.lang.c++
Path: utzoo!sq!sqwest!brad
From: brad@sqwest.sq.com (Brad Might)
Subject: Re: C++ interfaces to Relational Databses.
Message-ID: <1989Dec12.211723.24008@sqwest.sq.com>
In-reply-to: dsa@dlogics.UUCP's message of 6 Dec 89 17:38:35 GMT
Organization: SoftQuad Inc.
References: <6515@pbhyf.PacBell.COM> <1989Dec5.010812.3485@sjsumcs.sjsu.edu> <253@dlogics.UUCP>
Date: Tue, 12 Dec 89 21:17:23 GMT


>   You can't really have a set of classes to implement SQL because when you
>   have an embedded SQL statement, you must include the table name and the
>   column name.  This is then precompiled into calls to some generic routines.

	You can however send sql statements to Oracle at run-time and have it
	execute (dynamic sql).  You will have to build internal structures based
	on the information that Oracle returns about the statement

	- number, type, size of columns

	You could have an object which receives and holds this info as a buffer
	between you application and db.

	DBInterface.sendSQL(SQLStatement);

	ncols =	DBInterface.getNumCols() ;

	while (DBInterface.getNextRow()){
		for (i = 0 ; i < ncols; i++){
			switch (DBInterface.colType(i)) {
				case Chars:
				    printf("%s ", DBInterface.getString(i);
				    break;
				case Integer:
				    printf("%d ", DBInterface.getInt(i);
				   break ;
			}
		}
	}

-- 
Brad Might					brad@sq.com (brad@sq ?)
SoftQuad West					brad!sq!utzoo!...
(604) 585-1999
