Click here to Skip to main content
15,887,027 members
Home / Discussions / Database
   

Database

 
Questionmysql conncetion for absolute beginner Pin
Sasuko17-Sep-05 23:46
Sasuko17-Sep-05 23:46 
QuestionDatabase Error at Enterprise Manager Pin
YoungLearner17-Sep-05 22:32
YoungLearner17-Sep-05 22:32 
QuestionI NEED A QUERY SAMPLE IF POSSIBLE Pin
MAGICIANMERLIN17-Sep-05 11:10
MAGICIANMERLIN17-Sep-05 11:10 
AnswerRe: I NEED A QUERY SAMPLE IF POSSIBLE Pin
Colin Angus Mackay17-Sep-05 12:41
Colin Angus Mackay17-Sep-05 12:41 
GeneralRe: I NEED A QUERY SAMPLE IF POSSIBLE Pin
MAGICIANMERLIN18-Sep-05 2:07
MAGICIANMERLIN18-Sep-05 2:07 
QuestionMANIPULATING VIEWS Pin
Wisdom200417-Sep-05 3:53
Wisdom200417-Sep-05 3:53 
QuestionLike Query & Null Values Pin
rich_wenger16-Sep-05 12:08
rich_wenger16-Sep-05 12:08 
AnswerRe: Like Query & Null Values Pin
turbochimp16-Sep-05 17:39
turbochimp16-Sep-05 17:39 
I'm not really sure why you'd create a search like the this intentionally. It's going to wreak havoc on any indexes the execution planner might have taken advantage of.

Why not just use separate arguments for the first, middle and last names?

SELECT <br />
    docIndex, docLName, docFName, docMName<br />
FROM <br />
    tblStaffPhysicians<br />
WHERE<br />
    (docFName LIKE '%' + ? + '%') AND<br />
    ((docMName IS NULL) OR (docMName LIKE '%' + ? + '%')) AND<br />
    (docLName LIKE '%' + ? + '%')


If there is a compelling reason why the statement must use a single parameter value, there are other ways of approaching this, but since you're concatenating a string with spaces right in the SQL statement, it seems like it would be equally sensible to split the parameter value in code on the location(s) of spaces and provide multiple parameters to the command.

Hope this helps,


The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’

GeneralRe: Like Query &amp; Null Values Pin
rich_wenger17-Sep-05 1:18
rich_wenger17-Sep-05 1:18 
GeneralRe: Like Query &amp; Null Values Pin
rich_wenger17-Sep-05 3:21
rich_wenger17-Sep-05 3:21 
GeneralRe: Like Query &amp; Null Values Pin
turbochimp17-Sep-05 5:56
turbochimp17-Sep-05 5:56 
GeneralRe: Like Query &amp; Null Values Pin
turbochimp17-Sep-05 5:36
turbochimp17-Sep-05 5:36 
GeneralRe: Like Query & Null Values Pin
rich_wenger18-Sep-05 14:49
rich_wenger18-Sep-05 14:49 
GeneralRe: Like Query &amp; Null Values Pin
turbochimp18-Sep-05 18:06
turbochimp18-Sep-05 18:06 
AnswerRe: Like Query &amp; Null Values Pin
Mike Dimmick17-Sep-05 10:43
Mike Dimmick17-Sep-05 10:43 
GeneralRe: Like Query &amp; Null Values Pin
rich_wenger18-Sep-05 14:53
rich_wenger18-Sep-05 14:53 
Questionuse mySQL with c# applications Pin
Sasuko16-Sep-05 0:55
Sasuko16-Sep-05 0:55 
AnswerRe: use mySQL with c# applications Pin
enjoycrack16-Sep-05 1:32
enjoycrack16-Sep-05 1:32 
GeneralRe: use mySQL with c# applications Pin
Sasuko16-Sep-05 4:05
Sasuko16-Sep-05 4:05 
AnswerRe: use mySQL with c# applications Pin
André Ziegler17-Sep-05 11:55
André Ziegler17-Sep-05 11:55 
GeneralRe: use mySQL with c# applications Pin
Sasuko17-Sep-05 23:20
Sasuko17-Sep-05 23:20 
GeneralRe: use mySQL with c# applications Pin
André Ziegler18-Sep-05 1:14
André Ziegler18-Sep-05 1:14 
QuestionConsolidation of database Pin
utsav_verma15-Sep-05 23:07
utsav_verma15-Sep-05 23:07 
AnswerRe: Consolidation of database Pin
Hesham Amin16-Sep-05 2:49
Hesham Amin16-Sep-05 2:49 
QuestionMSDE not connecting in windows 98 Pin
Nilesh Gambhava15-Sep-05 21:28
Nilesh Gambhava15-Sep-05 21:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.