Questions tagged [string-constant]

String constans refer to quoted string literals, or in some languages also to constant expressions formed from them, usually via concatenation.

79 questions
1
vote
0 answers

Column doesn't exist using CASE statement in PosgreSQL

I am trying to calculate the payments for each age range in PostgreSQL. select case when age < 50 then "0-50" else "50+" end as age_range, SUM(payment_amount) as sum_payment_amount from ( select age, …
1
vote
1 answer

Postgres mistaking value as a colum

I have a section of a larger query, which we are working on converting from SQL to postgres that is giving an error of (Error: column "CEL" does not exist) and I am not sure why as CEL is a value nota column. I get the same result if I change "CEL"…
1
vote
2 answers

PostgreSQL can't insert data into table (column does not exist)

PostgreSQL 13, pgAdmin 4. I have a table "Student" with the following columns: student_id (text, primary key) last_name (text) first_name (text) major (text) credit_hours (int) I'm simply trying to add another student to this table, which I am…
tanman
  • 19
  • 1
  • 4
1
vote
1 answer

How to make a string from Array in plpgsql

I've got a result from my function EXECUTE format('SELECT ARRAY (SELECT tvmid from "%s".tvmtable order by tvmid)', operatorName) INTO tvms; that gives mi array of tvms in format {1,2,3}. I need it to have a String divided with , so I'm trying…
mario
  • 186
  • 3
  • 16
1
vote
2 answers

Getting column does not exist error in postgresql sql table

I have an sql table that looks like this in postgresql called test. date | data | source ------------+---------+------------------ 2015-09-23 | 128 | aaamt 2015-09-24 | 0 | aaamtx2 ..... I type SELECT * FROM test…
anarchy
  • 3,709
  • 2
  • 16
  • 48
1
vote
3 answers

Does string pool store literals or objects?

Stackoverflow is full of questions related to different types of String initialization. I understand how different is String s = "word" to String s = new String("word"). So no need to 'touch' that topic. I noticed that different people refer that…
Stefan
  • 969
  • 6
  • 9
1
vote
1 answer

postgres error: column doesn't exist error in Postgesql 11.6

I am trying to run an update command on postgresql 11.6 by below syntax update "YP_SUPPLIERS" set "YP_SUPPLIERS.supplierName" = "update" where "YP_SUPPLIERS.supplierID" = da68e9d0-1100-43e2-0011-db8fbe654321; I am getting this below error ERROR: …
1
vote
1 answer

SQL unknown column in where clause

I get this error: Error: UPDATE stats SET stat2='2' WHERE name=views Unknown column 'views' in 'where clause' In the table 'name' is the column, and 'views' is a value in that column. As far as I can tell from the documentation the statement "WHERE…
1
vote
1 answer

I have created a PostgreSQL table but I can't SELECT if I use the WHERE parameter

I am really new at coding in general. I have created a table but when I try to use SELECT * FROM users WHERE (username = "adminis"); I get ERROR: column "adminis" does not exist. What I am trying to do is to find the user 'adminis' and get the other…
Steven31st
  • 11
  • 1
1
vote
2 answers

SQL Single quote and double quote inserting values

Im trying to create a table and insert this value here: ("Where I'm Calling From: Selected Stories", 'Raymond', 'Carver', 1989, 12, 526), Im having an issue with using single and double quotes. How would I amend this ? and what should I keep in…
user11119334
1
vote
3 answers

SQL domain ERROR: column does not exist, setting default

I created a DOMAIN: CREATE DOMAIN public."POSTAL_CODE" AS character(5) NOT NULL; I tried to set the default value: ALTER DOMAIN public."POSTAL_CODE" SET DEFAULT "00000"; but got the error: ERROR: column "00000" does not exist Then I…
banan3'14
  • 3,810
  • 3
  • 24
  • 47
1
vote
0 answers

String literal and object relation in Java

Suppose I have a string literal like, String s1 = "ABC"; And another String object like, String s2 = new String("ABC"); So is there any connection or relation between String s1 and s2 from java's memory point of view, as s1 is in the string…
shaggy007
  • 69
  • 8
1
vote
0 answers

How does the JVM lookup the String in the String constant pool?

I understand that the string constant pool is essentially a ConcurrentHashMap. JVM uses the FlyWeight Design Pattern to save some memory. The JVM will lookup the pool(ConcurrentHashMap) and return the reference of the old object else it will create…
1
vote
2 answers

What is the difference between const string & str and string const & str when passed as an argument to a function in c++

I am using pass by reference to const string in a function argument like below: class Super { void alignment(const string & str); }; void Super::alignment(const string & str) { //do some stuff } Now if I use as below it gives the same…
apb_developer
  • 321
  • 2
  • 9
1
vote
1 answer

Declare HTML tag as a string in VB.NET

I'm trying to assign the following HTML as a value to variable type string 'here's the tag '$("#close").click(function(){$.notifyBar({ html: "Click 'close' to hide notify bar", close: true, delay: 1000000 });}); Dim htmltag =…
plas
  • 13
  • 3