View previous topic :: View next topic |
Author |
Message |
prmohanty Beginner
Joined: 14 Mar 2009 Posts: 1 Topics: 1
|
Posted: Mon Jun 15, 2009 1:09 pm Post subject: How to perform a search operation on a LONGVARCHAR variable |
|
|
Hi ,
Is there any way , I can write a Select statement in SPUFI to extract those records from a table where the column defined as LONGVARCHAR contains specific value.
Regards
PRM |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Mon Jun 15, 2009 4:21 pm Post subject: |
|
|
Am I missing something? Would it not be as easy as:
Select
FIRST_NAME,
LAST_NAME,
FROM YOUR_TABLE
WHERE LAST_NAME = 'SMITH'
LAST_NAME is LONGVARCHAR _________________ Thanks,
NASCAR9 |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12380 Topics: 75 Location: San Jose
|
Posted: Mon Jun 15, 2009 7:04 pm Post subject: |
|
|
NASCAR9 wrote: | Am I missing something? |
Nasacar,
I think OP wanted to search for a specific string any where in the long varchar colum
ex: if the column consists of the following
Code: |
NASCAR
The official site of NASCAR is Nascar.com
NASCAR delivers exciting finish
The National Association for Stock Car Auto Racing (NASCAR) is a family-owned ...
|
Your SQL would only fetch the 1st row where as a LIKE predicate will fetch all the 4 rows
however if you change the where clause to
Code: |
WHERE LAST_NAME LIKE '%NASCAR%'
|
will fetch all the rows |
|
Back to top |
|
 |
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Tue Jun 16, 2009 10:50 am Post subject: |
|
|
Thanks kolusu for clarification. When I read the request it sounded LIKE he was searching for a set string.
Your LIKE example makes perfect sense to me! _________________ Thanks,
NASCAR9 |
|
Back to top |
|
 |
|
|