🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.database.dotnet
Article #573

Re: Determine if a statement is non-SELECT

#573
From: Marc Rohloff TeamB
Date: Sat, 15 Jan 2005 01:07
11 lines
1613 bytes
On 13 Jan 2005 20:55:58 -0800, Steven Taylor wrote:

> Is there an easy way to determine whether a certain SQL statement (supplied by a user) is a non-SELECT sql string, or a Stored Procedure?
> If so then ExecuteNonQuery can be used instead of ExecuteReader for an OleDbCommand to execute the statment.

At the risk of sounding facetious, why don't you compare the first 7
characters to 'SELECT ' ?

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Technical Details
Message-ID: <et1fvexys0wu$.dlg@marcrohloff.40tude.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41e750de$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1effe6,92635b97b205b3ed
X-Google-Attributes: gid1effe6,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Marc Rohloff [TeamB]" <"on request">
Subject: Re: Determine if a statement is non-SELECT
Newsgroups: borland.public.delphi.database.dotnet
User-Agent: 40tude_Dialog/2.0.14.1
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
References: <41e750de$1@newsgroups.borland.com>
Date: Fri, 14 Jan 2005 20:07:55 -0500
Message-ID: <et1fvexys0wu$.dlg@marcrohloff.40tude.net>
X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ :0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR
NNTP-Posting-Host: 4.225.100.208
X-Trace: newsgroups.borland.com 1105751165 4.225.100.208 (14 Jan 2005 17:06:05 -0800)
Lines: 11
X-Authenticated-User: mrohloff
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news2.euro.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail