Hello,
Does X# supports the quoting mechanismn of C# like
string sqlCommand = @"Select Nachname ""Nachnahme"" From Adressen";
which results to Select Nachname "Nachnahme" From Adressen
this would bei helpful for building SQL commands with aliases that works with Postgre for example.
Right now we would use something like Nachname 'Nachname' and StrTran() for replacing ' with Chr(34) which works well
Kind regards,
Peter
Escaping quotes like in C#?
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
Escaping quotes like in C#?
Hi Peter,
Yespemo18 wrote: Does X# supports the quoting mechanismn of C# like
Code: Select all
string sqlCommand = @"Select Nachname ""Nachnahme"" From Adressen";
LOCAL sqlCommand := "Select Nachname ""Nachnahme"" from Adressend" // Double quote notation AS STRING
or
LOCAL sqlCommand := e"Select Nachname "Nachnahme" from Adressend" // Escaped string nrt etc...
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
Escaping quotes like in C#?
Oh, thats good (so I did no try hard enough to make it work;)
Regards,
Peter
Regards,
Peter
Escaping quotes like in C#?
Hi Johan,
Are you sure about the first option?
I could only make it work with the second option (e and ) which I like better because its more readable.
Regards,
Peter
Are you sure about the first option?
I could only make it work with the second option (e and ) which I like better because its more readable.
Regards,
Peter
Escaping quotes like in C#?
I think, Johan mixed the " and ' ...
And don't forget, there are differences in behaviour between core and the dialects!
@Chris, now you have the reason, why 'Chris is "great" ' should work, too, as does "Chris is 'great' "
Some time ago we discussed why that's not handled equal
And don't forget, there are differences in behaviour between core and the dialects!
@Chris, now you have the reason, why 'Chris is "great" ' should work, too, as does "Chris is 'great' "
Some time ago we discussed why that's not handled equal
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Escaping quotes like in C#?
Never said that they should not both be supported! (the features I mean, not the content )
This is why they are both allowed now in X# for VO and other dialects (while single quotes were not supported in vulcan). In Core, this is not supported, in order to make the syntax more .Net-friendly, because .Net languages use single quotes for the Char type.
About the "abc""def""ghi" syntax, this is indeed not supported, I remember we had discussed about it, but can't remember what was decided . Will open a feature request for it.
This is why they are both allowed now in X# for VO and other dialects (while single quotes were not supported in vulcan). In Core, this is not supported, in order to make the syntax more .Net-friendly, because .Net languages use single quotes for the Char type.
About the "abc""def""ghi" syntax, this is indeed not supported, I remember we had discussed about it, but can't remember what was decided . Will open a feature request for it.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Escaping quotes like in C#?
Guys,
Do you really want another string format ?
We already have
- double quoted strings ("abc'[]")
- single quoted strings ('abc"[]')
- bracketed strings ([abc'"])
- interpolated strings (i"abc{i}")
- extended strings ( e"trn")
- extended interpolated strings (ei"r{i}" and ie"r{i}")
- character literals ('a' or c'a')
We are planning to add binary literals like in FoxPro (0h202020), but I personally think that is enough.
Robert
Do you really want another string format ?
We already have
- double quoted strings ("abc'[]")
- single quoted strings ('abc"[]')
- bracketed strings ([abc'"])
- interpolated strings (i"abc{i}")
- extended strings ( e"trn")
- extended interpolated strings (ei"r{i}" and ie"r{i}")
- character literals ('a' or c'a')
We are planning to add binary literals like in FoxPro (0h202020), but I personally think that is enough.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Escaping quotes like in C#?
Robert,
i'd say, if ' "abc" ' works, like " 'abc' " does, it would be enough - but this variant indeed would come handy for the SQL writers...
i'd say, if ' "abc" ' works, like " 'abc' " does, it would be enough - but this variant indeed would come handy for the SQL writers...
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Escaping quotes like in C#?
Robert,
The problem is that single quoted strings do not work in Core dialect. Only way to workaround this is with escaped strings, but this syntax is difficult to read. So since c# supports the syntax "abc""def", I think it would be nice to support it in X# as well. Of course it's not high priority...
The problem is that single quoted strings do not work in Core dialect. Only way to workaround this is with escaped strings, but this syntax is difficult to read. So since c# supports the syntax "abc""def", I think it would be nice to support it in X# as well. Of course it's not high priority...
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu