Store Procedure Like

Store Procedure Like

am 25.04.2006 22:26:13 von Hotmail

------=_NextPart_000_012B_01C6688D.59A52370
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello
I have a ST that it receives one In entrance this variavel use to =
generate:=20
TSQL with like:=20
Where pagto_boleto.RefTrans like _ RefTrans % return erro, can make? =20

Where pagto_boleto.RefTrans like ' %_RefTrans % ' did not function=20

can help me?

Julio Cesar
------=_NextPart_000_012B_01C6688D.59A52370--

Re: Store Procedure Like

am 26.04.2006 00:41:31 von Daniel da Veiga

On 4/25/06, Hotmail wrote:
> Hello
> I have a ST that it receives one In entrance this variavel use to genera=
te:
> TSQL with like:
> Where pagto_boleto.RefTrans like _ RefTrans % return erro, can make?
>
> Where pagto_boleto.RefTrans like ' %_RefTrans % ' did not function
>
> can help me?
>
> Julio Cesar
>

Sorry, I coudn't understand your question, it was a question, right?
Did you use an automatic translator or something?

I don't think anyone will bother answering, because we sincerely need
telepatic capabilities to know what you want and what is the problem.

PS: Se voc=EA =E9 brasileiro ou fala algo parecido com portugu=EAs/espanhol=
,
me poste privadamente uma descrição em l=EDngua nativa do problema e
posso tentar traduzir para a lista. Ningu=E9m vai responder, seu email =E9
completamente incompreens=EDvel em ingl=EAs.

--
Daniel da Veiga
Computer Operator - RS - Brazil
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
------END GEEK CODE BLOCK------

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=3Dgcdmw-win32@m.gmane.org

Re: Store Procedure Like

am 26.04.2006 01:04:16 von Randy Clamons

Looks like you have named your variable the same as your column name.
That could cause some confusion--both to you and ythe query processor.

Looks like you want to find rows where RefTrans contains the phrase
passed to the parameter.

The first example doesn't work because the _ and % are 'bare
words'--strings not enclosed by quotes.

The second one returns rows that begin with a space, followed by any
number of any character followed by 'RefTrans' (literal) followed by a
space then any number of any character followed by a space. I'm guessing
it returns nothing.

Try this:

CREATE PROCEDURE procName (IN lReftrans)
BEGIN
....
WHERE pagto_boleto.RefTrans LIKE CONCAT('%',lReftrans,'%')
....
END;

That will find rows containing the parameter phrase.

It might be simpler for you, and maybe mySql too, to use a regular
expression for this:

WHERE pagto_boleto.RefTrans REGEXP lRefTrans


Randy Clamons
Systems Programming
randy@novaspace.com


Hotmail wrote:
> Hello
> I have a ST that it receives one In entrance this variavel use to generate:
> TSQL with like:
> Where pagto_boleto.RefTrans like _ RefTrans % return erro, can make?
>
> Where pagto_boleto.RefTrans like ' %_RefTrans % ' did not function
>
> can help me?
>
> Julio Cesar

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org