(JPA) quotation marks around column names
Hello,
we use postgres in our project.
But the table and column names are not in lowercase, (the first character is upper).
Is there a way that the jpa puts quotation marks around the table and column names in the queries, because postgres converts them all to lowercase if there are no quotation marks.
And then we get the error that the relation does not exist.
thanks!
Dirk
You can quote database identifier by explicitly placing quotes around them. For example as follows
@Table(name="\"TableName\"")
Similar Messages
-
DTW using .txt file adds quotation marks around BP Name
I am importing new Business Partners using .txt file because of comma's in BP names. When I import the BP names, quotation marks are added. How do I get rid of the quotation marks?
Gordon, thanks for the suggestion, it is helpful. However, in this case, there were no quotation marks in the Legacy System, and when I imported using .csv files, I had no problems.
When I switched to .txt, DTW added them somehow.
Thanks,
Avraham -
"Save as csv" sets quotation marks around the whole line
Our client reports:
Data portal->Right click->Save as->Select "Data type": "Textfile - Auto detect (*.csv)"->Save.
Result of saving:
"TIME V V_ABS"
"63.0235776 0.105263157894737 28.6153372301571"
"63.0235936 0.105264137235745 28.6156034598028"
Therefore values of channels with same index (and a header) are compound to one cell due to quotation marks around.
By me it doesn't happen, but by a client.
Client has normal German Windows 7 region/language configuration.
Any idea, how a client can save as csv without quotation marks around the line?
Solved!
Go to Solution.Using a script it is possible to write CSV files Excel natively opens like given in this forum entry.
But be aware that you need different kind of files depening on your country.
In the Excel world CSV means "Character Separated Values".
e.g.:
US
dim targetFilePath : targetFilePath = "C:\temp\EXAMPLE.csv"
Call DataFileSave("<filename>" & replace(targetFilePath, "&", "&") & "</filename><decimalpoint>.</decimalpoint><delimiter>,</delimiter>", "CSV")
Germany
dim targetFilePath : targetFilePath = "C:\temp\EXAMPLE.csv"
Call DataFileSave("<filename>" & replace(targetFilePath, "&", "&") & "</filename><decimalpoint>,</decimalpoint><delimiter>;</delimiter>", "CSV") -
Removing quotation marks from channel names
Firstly - I am new to both DIAdem and VB so please forgive my ignorance!
I have a large data set containg many groups with (almost) identical channel names in each group. For reasons not worth going into some of the channel names have quoation marks around them, while others do not.
I am trying to remove the quoation marks to make all channel names consistent throughout the groups, for this I was hoping to loop through the groups renaming channels as appropriate
I think this should work:-
For
i = 1 to GROUPCOUNT
Call GROUPDEFAULTSET(i)
CN(""ChannelName"")="ChannelName"
Next
Where ChannelName is the name I am trying to replace, But I get the following error:- Expected ')'
Can anyone point out where I am going wrong?
(Note - I also tried using triple quotation marks ("""ChannelName"""), but I get this error instead - CN(""ChannelName""):=ChannelName Close bracket ")" expected for field index)
For bonus points - how to I get the loop to skip over any groups where the channel I am referencing already doesn't have quotation marks in it, rather than giving me an error that the channel can't be found?
Many thanks in advance for any assistance!
Dan
Solved!
Go to Solution.Hello Dan,
You are using an old script syntax to manipulate the data. Please find below the current way to replace quotation marks with an underscote:
dim iLoopG, iLoopC, oGroup, oGroupChns, sQM
sQM = chr(34) ' the " character
set oGroup = Data.Root.ChannelGroups
for iLoopG = 1 to oGroup.Count
set oGroupChns = oGroup(iLoopG).Channels
for iLoopC = 1 to oGroupChns.Count
'msgbox oGroupChns(iLoopC).Name
oGroupChns(iLoopC).Name = Replace(oGroupChns(iLoopC).Name, sQM, "_")
next
next
Greetings
Walter -
Hi all,
From Page 354 of the the Book "Pro T-SQL 2008 Programmer's Guide" written by Michael Coles (published by apress), I copied the following code (Listing 12-9 Retrieving Job Candidates with the query Method):
--Coles12_9.sql // saved in C:/Documemnts/SQL Server Management Studio
-- Coles Listing 12-9 Retrieving Job Candidates with the query Method
-- Doing XQuery and the xml Data Type in AdvantureWorks
-- 17 March 2015 1105 AM
USE AdventureWorks;
GO
SELECT Resume.query
N'//*:Name.First,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level
FROM HumanResources.JobCandidate;
I executed this set of Listing 12-9 code in my SQL Server 2012 Management Studio and I got the following error messages:
Msg 105, Level 15, State 1, Line 4
Unclosed quotation mark after the character string '//*:Name.First,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level
FROM HumanResources.JobCandidate;
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near '//*:Name.First,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level
FROM HumanResources.JobCandidate;
I am not able to figure out why I got the error messages. Please kindly help and advise me how to correct this set of sql codes.
Thanks in advance,
Scott ChangHi Scott,
I don't have that book at hand, but your problem is the "Unclosed quotationmark after the character string",as the error message shows. You have to enclose the 'XQUERY' string quotation in the
query().
SELECT jobcandidateid, Resume.query
N'//*:resume,
//*:Name.Middle,
//*:Name.Last,
//*:Edu.Level' --enclose the quotation here
FROM HumanResources.JobCandidate;
For XQUERY learning, here is a good
link.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
JPA -- Inheritance with duplicate column names
Hi,
I have the following problem:
I have two tables. Let's call them BASE_TABLE and CHILD_TABLE. They are mapped through Join Inheritance in Java. In other words:
@Inheritance(strategy=InheritanceType.JOINED)Let's say, the tables look like:
BASE_TABLE (
ID NUMBER(18),
TYPE VARCHAR2(1),
CODE NUMBER(5))
CHILD_TABLE (
ID NUMBER(18),
CODE NUMBER(5),
NAME VARCHAR2(50))Here's where the problem lies: I have duplicate column names. In my example, this is the CODE column. When mapping to Java classes, I can have something like:
@Entity
@Table(name="BASE_TABLE")
@Inheritance(strategy=InheritanceType.JOINED)
@DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING)
@DiscriminatorValue("0")
class BaseEntity {
@Column(name="CODE")
private Integer code;
public Integer getCode_Base() {
return code;
public setCode_Base(Integer code) {
this.code = code;
@Entity
@Table(name="CHILD_TABLE")
@DiscriminatorValue("1")
@PrimaryKeyJoinColumn(name="ID")
class ChildEntity extends BaseEntity {
@Column(name="CODE")
private Integer code;
public Integer getCode() {
return code;
public setCode(Integer code) {
this.code = code;
}The trouble is, that TopLink only handles ONE of the CODE columns. When SELECTing, it only selects the CODE column from table BASE_TABLE. When generating DML statements, again it only uses the CODE column from table BASE_TABLE.
I wasn't able to make it use BOTH columns.
Please, help. The DB design cannot be changed at the moment. However, I must find a way to make TopLink Essentials use both CODE columns, not just the one from BASE_TABLE.
Thank you in advance!
Best regards,
BisserHi Chris,
I was under the impression, that since the attributes were private, they would be treated as two different attributes by TopLink Essentials.
Java definitely treats them as two different attributes, and not as one overriding the other. I had made sure that I could set both of them with different values (via the differently named accessors) and, indeed, both values were there. I printed them both out on the console, just to make sure. They were printed out ok, the values were indeed different.
But TopLink Essentials was ignoring one of them.
Now that you told me that I should use different names for the attributes, I did just that. And lo and behold, it worked!!! I couldn't even imagine that it would matter to TopLink what the names were, given that they were in two different entities that were mapped to two different tables, inheritance or not.
As I said, Java treats them as two completely different attributes, unlike TopLink Essentials. In future, I will know that even the attribute names matter. Thank you again.
Best regards,
Bisser -
How To Add the Double Quotation Marks Around a String
In the statement below, the recipientField.getEmailAddress() give me an e-mail address:
theEmailAddressList.add( recipientField.getEmailAddress() );The e-mail address has to be wrapped within a pair of double quotation marks. Therefore, I have to do the concatenation. Do I wrap each double quotation mark with a pair of single quotation marks?
theEmailAddressList.add( '"' + recipientField.getEmailAddress() + '"' );I do not understand.
I am asking if the statement below does what I intend to do:
theEmailAddressList.add( '"' + recipientField.getEmailAddress() + '"' ); -
Feature Request "Copy of column-name" in 2.1.1 not working
Scanning all the feature requests added to 2.1.1, i came across to the following one:
Title: Copy of column-name
Description:
after getting the query result it would be greate if we can mark the column-name and the copy the name of the column to the clipboard for further use (e.g. select colum_name from table ...)
Comment:
Try 2.1.1. You can drag a selection of columns to the worksheet. If not, then please provide more detail in future request.
Status: In Release 2.1.1 ;
Now i've tried few times to drag the column from the query result into the worksheet but it doesn't work. The only thing which works is to change the columns orders in the grid result.
Anybody experience the same result?
Dani@Raghu
I'm already aware of this and it's working but the downside is that it copies the cell value too which i don't see the point.
If i want the cell values than i can export or copy them.
The request description was different though.
@K
Unfortunately you can't drag the column name from the navigator or result grid. Would be nice if it would.
Is anything else i can do to get this fix or are you gonna raise a CQ for this?
Regards,
Dani -
Quotation Marks in Description Meta Tag
I want to put quotation marks around a book title in a description meta tag. When I add them using the Description field in Properties, Dreamweaver substitutes " for the quotation mark. I know it is doing this because the content= is in quotes. Will the quotation marks show up okay using these html entities in all search engine results that display what is in my description meta tag?
Also, does it work okay to use html. like <em> </em> in head meta tags?You're spitting into the wind with this. Descriptions in your meta tags are displayed by some but not all search engines. And the manner in which your meta descriptions appear on SERPs is totally out of your control. USE ALL CAPS for BOOK TITLES. Regular case for all the rest.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
Hi, I have put together a grep style that will change any western characters in a Chinese document to a different font. I am having a problem with changing quotation marks around western characters without changing the ones around Chinese text as well. Is there any way to change only quotation marks that are around western characters?
KateSure! It's perfectly possible to scan for anything but Chinese. What exactly do you have now? If you are using something like
".+"
you could change it to
"([\x{0003}-\x{2fff}]+"
(the main bulk of Chinese starts at Unicode u+3000). This will include the text "within". An alternative way, excluding anything but the quote marks themselves, is to use lookbehind and lookahead:
(?<![\x{2fff}-\x{faff}])[~{~}](?![\x{2fff}-\x{faff}])
This may look daunting, but it consist of three fairly easy parts:
(?<! [ \x{2fff}-\x{faff} ] ) Match behind for not anything in the Chinese range
[ ~{ ~} ] Match either opening or closing double quote (this doesn't seem to work with the " any dbl quote wildcard...)
(?! [ \x{2fff}-\x{faff} ] ) Match in front for not anything in the Chinese range again. -
Slideshow Captions - How Can I Delete the Quotation Marks?
I am creating a slideshow in Lightroom 3 using the Caption and Rating preset. There are no quotation marks around the metadata captions, but when I preview the slideshow all my captions have quotation marks. I have searched Edit>Preferences in the Slideshow module, but there is no mention of captions or quotation marks. How can I get rid of the quotes?
Thanks for any help or suggestions!
(3 days later: 55 people have looked at this discussion, but no one has responded. I'm still hoping I can delete the quotation marks around my slideshow captions. Any ideas out there somewhere?)WeeZee67 wrote:
(3 days later: 55 people have looked at this discussion, but no one has responded. I'm still hoping I can delete the quotation marks around my slideshow captions. Any ideas out there somewhere?)
9 views actually...
You will have to change the preset. Just click in the text box, then on the tool bar change Custom Settings, to Caption.
You can then save this as a new preset. -
Renaming quotation marks on FAT32 external drive
I used a quotation mark in a name I gave a folder on my new 500gb external drive. It was fat32, and now I cannot open, right click, or do anything to the folder, it renames itself when i do that to my email backup folder. It goes back to normal when i re-open the drive, but I cannot do anything to it.
I tried using the mv command in terminal, but it doesn't recognize the " marks when i use them. Does anyone have any advice?Figured it out.
-
Write to file string sometimes with quotation marks
Hi Labview community,
I have a VI which creates a string array which I then wire to the "Write To Text File" VI.
One of the elements in the string array is a control input.
I have noticed that when the input is long, and I open the file in wordpad, then the string has quotation marks around it.
But when the control string is short, it appears in wordpad without quotation marks.
Additionally, a later element in the string array is also written with or without quotation marks depending on whether the control input string had quotation marks.
Can anyone explain this behaviour? How can I get more certainty in whether the strings are written with quotation marks or not?
It created a problem for me when another VI parsed the file looking for the line with the string but could not find it when the quotation marks were present.
Jamie
Using Labview version 8.0Hi Jamie,
which LabView version do you use?
Could you attach an eample showing the problem? Normally 'Write to text file' just writes the string that is wired to it. It (normally) doesn't add quotation marks. The only option you can set is 'Convert EOL?' (input up to LV7.1, right-click in LV8+). The help window also didn't mention any quotation marks...
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
Toplink JPA forces database table and column names to UPPERCASE! Why?
I have recently experienced using Toplink JPA while using glassfish ... migrating an existing application to EJB 3.0 persistence. Toplink JPA, as implemented in glassfish, forces tablenames and column names from my code to be uppercase in select statements, etc. as then submitted to the database. Why? I cannot find anything in the EJB 3.0 specs on persistence that even suggests this.
This created a serious problem for me, in my application. For my code to work I had to change the names of the database tables to all uppercase, even though that meant other of my applications, already written using the original mixed case names of the databases, will no longer work unless I revise the code in those applications! (I am using mySQL as my database.)
In both Unix/Linux and Java, which are both case sensitive, If I wanted names of files or other items to be uppercase, I would have written them that way. I do not expect some middleware piece of software to muck around with the case of text I have put into my code.
I am hopeful this 'feature' of the reference implementation of the EJB Persistence API will be corrected in a subsequent version. [Maybe you can tell I am not happy!]
Thanks for listening to my rant.Robert,
I found that the name I specify in all of my @Table, @Column, ... annotations is used with the case as it is provided.
If TopLink determines the schema information through defaults then the names it comes up with are definitely upper cased by default.
Are you specifying the schema information that you want in annotations or XML?
Doug -
Dynamic forms using dynamic column names
I have a table with columns such as level_1, level_2, etc.
until level_11 and I have another table with level_id and
description, i.e. for level with id = 1 the description could be
'Crawl.' Id 2 could be 'Walk' etc.
I'm trying to make a checklist so people can mark when
they've done things on the checklist, and then upload those values
to the appropriate tables to store the information so it's all
still there when they go back to check off a new skill.
I can't figure out how to make the column names in the form
dynamic.
I've played around with the formatting and still can't quite
get it. I've tried evaluate(queryname.level_#level_id#),
queryname.label, a bunch of other ones, and I can't seem to get it
to work.
Thanks for the help!Get to know CF's structure / array notation. This comes in
very handy when dealing with queries and form fields.
- Form.myFieldName can also be referenced by
Form["myFieldName"]
- MyQuery.myField can also be referenced by
MyQuery["myField"][rowNumber]
Anything in the above example surrounded by quotation makes
can be made dynamic by just adding in a cf variable surrounded by
pound signs:
get_dealer_completion["level_#level_id#"][1]
Maybe you are looking for
-
Zen mx 16gb player not recognising id3 tags.
,zen mx 6gb player not recognising id3 tags.I recently bought a zen mx and so far can not get it to recognise over half of my mp3's id3 tags. All of the files are drm free. All of the unrecognised files will play but get stuck in the unknown artist u
-
Not working 2 of 4 usb ports on imac
Why not working 2 of 4 usb ports on imac?
-
LSMW GL load at company code level
I am trying to do a GL master data upload using LSMW. I am using the following attributes for StdBatch/DirectInput method: Object 0010 Method 0001 Program Name RFBISA00 Program Type B Transaction code FSS0 and also tried for FS01. I am not able to cr
-
Can I copy and paste a drop down list into another field?
Can I copy and paste a drop down list into another field?
-
Where is the jar file contain this package
Dear Everybody Could you tell me where is the .jar file that contain this package oracle.security.idm Thanks for your help