Escape Sequence

Escape Sequence

Post by default-use » Thu, 02 Oct 1997 04:00:00



Hi,
does anyone know how to make an escape sequence for sql so i can get a '
into a data field, ie
 insert into something ( field_name ) values ( ' whatever [esc seq]'
some more ').

Thanx in advance,
Mike

 
 
 

Escape Sequence

Post by steve Robinso » Thu, 02 Oct 1997 04:00:00


Try swapping the ' with " and vice versa. eg

create table test1
(
test1 char(10)
)
go

insert into test1 values ("sd'")
insert into test1 values ('ad"')
go
select * from test1

--
Steve Robinson MCP (SQL /NT)



 
 
 

Escape Sequence

Post by Gaurang Sunkerset » Thu, 02 Oct 1997 04:00:00


You need not use any escape sequence.
Just try
insert table_name
values
("'apostrophe'apostrophe'")

You will get the entire string within the double quotes


> Hi,
> does anyone know how to make an escape sequence for sql so i can get a '
> into a data field, ie
>  insert into something ( field_name ) values ( ' whatever [esc seq]'
> some more ').

> Thanx in advance,
> Mike


--
------------------------------------------------------------------
                          \\\|///
                            - -  
                         (  O O  )
                          \  >  /
                           \ w /
+----------------------oOOo-----oOOo-----+
| Gaurang Sunkersett                     |

| Work Ph 246-4306483                    |
| Res. Ph 246-4243231                    |
|                                        |
+------------------------------Oooo------+
                        oooO   (   )
                       (   )    ) /
                        \ (    (_/
                         \_)
------------------------------------------------------------------
 
 
 

Escape Sequence

Post by Roy Harv » Thu, 02 Oct 1997 04:00:00


Mike,

Quote:>does anyone know how to make an escape sequence for sql so i can get a '
>into a data field, ie
> insert into something ( field_name ) values ( ' whatever [esc seq]'
>some more ').

All you have to do is place two single quotes where you want one to
appear:

  INSERT INTO HotSpots (name) values ('Joe''s Bar & Grill')

Roy

 
 
 

1. ODBC CALL escape sequence versus SQL_NOSCAN_ON

I can call my stored procedures (via ODBC) either using the ODBC CALL
escape sequence
    {call procedure(?,?,..?)}
or using the transact SQL
    execute procedure ?,?..?

the first one is recommended because they say is faster, but to use it i
must set the
SQL_NOSCAN option to SQL_NOSCAN_OFF, which in turn they say it affects
the performance as well...so which of the 2 evil things are better here?

thanks in advance

ionut

2. DA Newsletter 3.0

3. escape sequence for varchar

4. number,smallint...?

5. ODBC Escape Sequence and Outer Joins

6. PRINTING IN COLOR FROM WINDOWS 2000 OR NT

7. Escape sequence for return in a MEMO field

8. action(DataRecalc) Problem - Please Help

9. ODBC Escape Sequence

10. escape sequence

11. ODBC escape sequence

12. Escape sequence in T-SQL

13. escape sequence conflicting w/ backup (i.e. pg_dump)