Solved

pipe & SQL

Posted on 2004-08-31
10
2,098 Views
Last Modified: 2008-02-01
I just found a nice little thing today (our DBA's didnt know about it either), you cant insert a pipe ( | ) directly with sql

ie

insert into tblMyTable ( myField ) values ( "|" )

so, easy enough to change it to chr(124) and everything works well.

My Q is,  How am i suposed to know that??  Is there some doc's / people know of what other things i cann't just go striaght out and add (of course " and ', but any other whacky ones )

Open for any input (on topic)! -

points for all!!!

Dave
0
Comment
Question by:flavo
  • 6
  • 3
10 Comments
 
LVL 10

Expert Comment

by:kiranghag
ID: 11948317
hi,
seems u have used double qoutes to delimit a string.
this is not allowed in ms-sql...double qoutes are used to name variable/columns which include space.
to enclose a string, u need to use single qoute  

i tried following command and it worked
insert into tblMyTable ( myField ) values ( '|' )

chr(124) refers to the ascii value of the character and that you can use anytime to refer any other character, not limited to special character

if u need to insert a single qoute itself, u need to insert two of them after each other...
e.g. '''' = a single qoute
0
 
LVL 34

Author Comment

by:flavo
ID: 11948340
opps.. Yeah i know that.

the SQL bit refers to MS Access general garden variety of SQL.. sorry for the mis-understanding.

What im really after is what else to i have to convert to Chr(int)???

I can do " and '

You could cay i kinda know how to use access, and  i am well aware of such issues... (see profile)
0
 
LVL 34

Author Comment

by:flavo
ID: 11948354
>> insert into tblMyTable ( myField ) values ( '|' )

Didn't seem to in Access 97
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 500 total points
ID: 11948404
Better explanation than I can provide:
http://support.microsoft.com/default.aspx?scid=kb;en-us;178070&Product=acc

Only the | character has this problem.
0
 
LVL 34

Author Comment

by:flavo
ID: 11948435
good enough for me!
0
 
LVL 34

Author Comment

by:flavo
ID: 11948438
you can goto sleep now shane
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 11948448
Not yet, I'm still working :(
0
 
LVL 34

Author Comment

by:flavo
ID: 11948475
It must be about 2:30am..
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 11948483
3:30am, to be precise, but I have a data conversion that must be done by 9AM tomorrow morning and the data only arrived at 9PM.....
0
 
LVL 34

Author Comment

by:flavo
ID: 11948574
crazy!  I did 13hrs yesterday, that's enough (way too much considering i work for the gevernment.. that's 3weeks worth of work in 1 day)...
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can i Import Access Table Into Oracle Using Toad 36 171
Access 2016 importing text files 13 21
vba sql wild card passing in code 3 23
Trying to open FORM in specific record !! 6 44
Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question