Solved

pipe & SQL

Posted on 2004-08-31
10
2,099 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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