Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 03-06-2003
__cadetill __cadetill is offline
Miembro
 
Registrado: may 2003
Posts: 3.387
Poder: 27
__cadetill Va por buen camino
Pues SI que te dara problemas

Para solucionarlo, existe la funcion Trim

Sacado de la ayuda del LocalSQL.hlp

Cita:
Removes the trailing or leading character, or both, from a string.

TRIM([LEADING|TRAILING|BOTH] [trimmed_char] FROM column_reference)

Description

Use TRIM to delete the leading or trailing character, or both, from a character value (column, literal, parameter, or caculated values). The TRIM function only deletes characters located in the specified position.

The first parameter indicates the position of the character to be deleted, and has one of the following values:

Value Description

LEADING Deletes the character at the left end of the string.
TRAILING Deletes the character at the right end of the string.
BOTH Deletes the character at both ends of the string.

The trimmed character parameter specifies the character to be deleted, if present. Case-sensitivity is applied for this parameter. To make TRIM case-insensitive, use the UPPER function.

FROM specifies the character value from which to delete the character. The column reference for FROM can be a table column or a character literal.

Example variations:

TRIM syntax Result

TRIM(LEADING "_" FROM "_ABC_") "ABC_"
TRIM(TRAILING "_" FROM "_ABC_") "_ABC"
TRIM(BOTH "_" FROM "_ABC_") "ABC"
TRIM(BOTH "A" FROM "ABC") "BC"

When applied to retrieved data of a SELECT statement, the effect is transient and does not affect stored data. When applied to the update atoms of an UPDATE statement, the effect is persistent and permanently converts the case of the stored values.

Applicability

TRIM can only be used with character columns or literals. To use on values of other data types, the values must first be converted to CHAR using the CAST function.

Note: the TRIM function cannot be used with memo or BLOB columns.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 16:11:53.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi