$OpenBSD: patch-sqlplusint_sql_query_cc,v 1.2 2004/01/06 11:16:53 wilfried Exp $
--- sqlplusint/sql_query.cc.orig	2001-05-19 18:44:48.000000000 +0200
+++ sqlplusint/sql_query.cc	2004-01-05 00:10:32.000000000 +0100
@@ -10,9 +10,11 @@
 #include "exceptions.hh"
 //#include "result3.hh"
 
+using namespace std;
+
 SQLQuery::SQLQuery(const SQLQuery &q) {
   *this << q.str();
-  Success = q.Success;
+  Success_ = q.Success_;
   def = q.def;
 }
 
@@ -20,7 +22,7 @@ SQLQuery::SQLQuery(const SQLQuery &q) {
 SQLQuery& SQLQuery::operator = (const SQLQuery &q) {
   reset();
   *this << q.str();
-  Success = q.Success;
+  Success_ = q.Success_;
   def = q.def;
   return *this;
 }
@@ -35,17 +37,10 @@ void SQLQuery::reset() {
 
 char * SQLQuery::preview_char() {
   *this << ends;
-#ifdef __USLC__
-  strstreambuf *tmpbuf = rdbuf();
-  uint length = tmpbuf->pcount();
-#else
-  uint length = pcount();
-#endif
-  char *s = new char[length+1]; 
-  get(s, length, '\0'); 
-  seekg (0,ios::beg);
-  seekp (-1,ios::cur);
-  return s;
+  std::string s = this->str();
+  seekg (0,std::ios::beg);
+  seekp (-1,std::ios::cur);
+  return (char*)s.c_str();
 }
 
 SQLString * pprepare (char option, SQLString &S, bool replace = true) {
@@ -99,15 +94,7 @@ string SQLQuery::str(const SQLQueryParms
   SQLQuery *const_this = const_cast<SQLQuery *>(this);
   if (!parsed.empty()) const_this->proc(const_cast<SQLQueryParms&>(p));
   *const_this << ends;
-#ifdef __USLC__
-  strstreambuf *tmpbuf = const_this->rdbuf();
-  uint length = tmpbuf->pcount() + 1;
-  char *s = new char[length]; 
-#else
-  uint length = const_this->pcount() + 1;
-  char s[length]; 
-#endif
-  const_this->get(s, length, '\0'); 
+  std::string s = this->str();
   const_this->seekg (0,ios::beg);
   const_this->seekp (-1,ios::cur);
   return string(s);
