473,388 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

double quotes inside single quotes => ' " ... " '

1
Hi everyone !

I'm new to PostgreSQL and I'm just reading about sequences.
If a sequence is created with upper and lower letters, e.g.

Expand|Select|Wrap|Line Numbers
  1. create sequence "MySeq"
then when one want to use it, it must be done like this:

Expand|Select|Wrap|Line Numbers
  1. insert into table values (nextval('"MySeq"')
I thought that single quotes are enough for that purpose :/
If you do:

Expand|Select|Wrap|Line Numbers
  1. delete from table where something='Test';
it looks only for "Test", not "test" and it used single quotes.
Why isn't it enough for nextval ? Why is it done this way ?

Also, is there a way to automatically insert an incremented
value ? I thought it could be done by inserting null values,
but it inserts a null value - it doesn't trigger the nextval function
to be called, even when a field is defined as default nextval(' ')
Is there a way to achieve it ?

Cheers,

Adrian
Oct 27 '07 #1
1 5019
rski
700 Expert 512MB
Hi everyone !

I'm new to PostgreSQL and I'm just reading about sequences.
If a sequence is created with upper and lower letters, e.g.

Expand|Select|Wrap|Line Numbers
  1. create sequence "MySeq"
then when one want to use it, it must be done like this:

Expand|Select|Wrap|Line Numbers
  1. insert into table values (nextval('"MySeq"')
I thought that single quotes are enough for that purpose :/
If you do:

Expand|Select|Wrap|Line Numbers
  1. delete from table where something='Test';
it looks only for "Test", not "test" and it used single quotes.
Why isn't it enough for nextval ? Why is it done this way ?

Also, is there a way to automatically insert an incremented
value ? I thought it could be done by inserting null values,
but it inserts a null value - it doesn't trigger the nextval function
to be called, even when a field is defined as default nextval(' ')
Is there a way to achieve it ?

Cheers,

Adrian

Put the default value of the column as nextval(sequence_name) when creating table.
Oct 28 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Jakanapes | last post by:
Hi all, I'm looking for a way to scan a block of text and replace all the double quotes (") with single quotes ('). I'm using PHP to pull text out of a mySQL table and then feed the text into...
2
by: girish | last post by:
In my XML document, some node attributes data contains both single quot and double quote characters, such as <input msg="Hello "World", What's up"/>. The double quotes are in form of escape...
4
by: (PeteCresswell) | last post by:
Is his just a flat-out "No-No" or is there some workaround when it comes time for SQL searches and DAO.FindFirsts against fields containing same? I can see maybe wrapping the value searched for...
6
by: G. | last post by:
This is an obvious bug in the String.Replace function: //load a XML string into a document XmlDocument doc = new XmlDocument(); doc.LoadXml("<test id='' />"); //Obtain the string...
7
by: gar | last post by:
Hi, I need to replace all the double quotes (") in a textbox with single quotes ('). I used this code text= Replace(text, """", "'" This works fine (for normal double quotes).The problem...
1
by: karen987 | last post by:
I have an ASP news page to which you can add comments. The comments open up in a new window, and users can click reply to reply to them after which they are taken to the parent page which has a...
15
by: bill | last post by:
I am trying to write clean code but keep having trouble deciding when to quote an array index and when not to. sometimes when I quote an array index inside of double quotes I get an error about...
6
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello, I have some XML that is returned to my application from another vendor that I cannot change before it gets to me. I can only alter it after it gets to my application. That being said, I...
7
by: JohnF | last post by:
I have a function textag($expression){...} whose $expression argument is a string that can contain substrings like \alpha with one backslash or like a&b\\c&d with two backslashes. If I write...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.