I'd need to have a function that allows me to extract 'fields' from
within the string
I.E. (kinda pseudo code)
declare @foo as varchar(100)
set @foo = "Robert*Camarda*123 Main Street"
select EXTRACT(@foo, '*', 2) ; -- would return 'Camarda'
select EXTRACT(@foo, '*', 3) ;-- returns '123 Main Street'
select EXTRACT(@foo, '*', 0) ;-- would return entire string
select EXTRACT(@foo,'*' , 9) ;-- would return null
Extract( string, text delimiter, occurance)
Anyone have something like this as a user defined function in SQL?
TIA
Rob 1 4490
rcamarda (ro**************@gmail.com) writes:
I'd need to have a function that allows me to extract 'fields' from
within the string
I.E. (kinda pseudo code)
declare @foo as varchar(100)
set @foo = "Robert*Camarda*123 Main Street"
select EXTRACT(@foo, '*', 2) ; -- would return 'Camarda'
select EXTRACT(@foo, '*', 3) ;-- returns '123 Main Street'
select EXTRACT(@foo, '*', 0) ;-- would return entire string
select EXTRACT(@foo,'*' , 9) ;-- would return null
Extract( string, text delimiter, occurance)
Anyone have something like this as a user defined function in SQL?
A whole bunch of them here: http://www.sommarskog.se/arrays-in-sql.html.
OK, so none of them returns a specific field from the string,
but several returns a list position to filter on.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se
Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Penn Markham |
last post by:
Hello all,
I am writing a script where I need to use the system() function to call
htpasswd. I can do this just fine on the command line...works great
(see attached file, test.php). When my...
|
by: ThurstonHowl |
last post by:
Hello, my task is the following:
Input are tables with fields containing strings where the strings are
actually delimited lists. For example, one field could contain
'AB|CD|EF|GH'
I've...
|
by: Fresh Air Rider |
last post by:
Hello
Could anyone please explain how I can pass more than one
arguement/parameter value to a function using <asp:linkbutton> or is
this a major shortfall of the language ?
Consider the...
|
by: Gary Kahrau |
last post by:
I want to create a function and can only get half way to my goal.
dim sStr as string
sStr = Entry(2,"a,b,c,d") ' Sets sStr = "b"
Entry(2,sStr) = "B" ' Sets sStr = "a,B,c,d"...
|
by: Lance Hoffmeyer |
last post by:
Hey all,
I'm new to python. I keep getting an error when running this.
I'm sure there is an easy fix but I can't figure it out.
What am I doing wrong? How do I fix it?
def...
|
by: fool |
last post by:
Dear group,
Extract the integer value present in a given string. So I tried the
following:
int main(void)
{
int val;
char *data;
data = malloc(sizeof *data);
if(data)
|
by: napolpie |
last post by:
DISCUSSION IN
USER nappie writes:
Hello, I'm Peter and I'm new in python codying and I'm using parsying
to extract data from one meteo Arpege file. This file is long file and
it's composed by...
|
by: Umesh |
last post by:
Can anyone do it? ARMY1987- what say?
|
by: someusernamehere |
last post by:
Hey, I need to create an application wich extract data from a .csv
text (delimited by commas), the problem is that I only need some
relevant data, its posssible extract what I want (may be with...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
|
by: BLUEPANDA |
last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
|
by: Ricardo de Mila |
last post by:
Dear people, good afternoon...
I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control.
Than I need to discover what...
| |