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
124
votes
4 answers

cannot get simple PostgreSQL insert to work

I'm trying to do a simple insert into a postgres table, but am getting an error that the value I'm trying to insert is being interpreted as a column name INSERT INTO "imageTagBusinessMainCategory" (id, businessMainCategory) VALUES (DEFAULT, "auto…
1252748
  • 14,597
  • 32
  • 109
  • 229
25
votes
4 answers

static string constants in class vs namespace for constants [c++]

I want to declare string constants that will be used across various classes in the project. I am considering two alternatives Option 1: #header file class constants{ static const string const1; }; #cpp file const string…
Asif Mohammed
  • 790
  • 4
  • 11
  • 25
14
votes
2 answers

Simple Postgresql Statement - column name does not exists

I've been pulling my hair out. I have a very simple postgre database, one specific table has a column named lName (uppercase N). Now I know with postgre I must quote lName since it contains an uppercase N. I am trying to query the database with the…
meenxo
  • 1,176
  • 2
  • 11
  • 12
10
votes
2 answers

How to add a string literal as one selected column for select queries?

I want to have query like below select "RETRY" as code , name from process ; then the results are code | name _____________ RETRY PX1 RETRY PX1 RETRY PX3 RETRY PX4 RETRY PX5 I want to add one string literal as column for all rows returned…
Bravo
  • 8,589
  • 14
  • 48
  • 85
10
votes
2 answers

Column 'mary' does not exist

i'm doing a simple query here and it returns that column 'Mary' does not exist: SELECT telephone.telephonenumber as tel FROM person, telephone WHERE person.idperson = telephone.idperson AND person.personname = ‘Mary’; Can someone explain what…
Gabriel Sotero
  • 155
  • 1
  • 13
8
votes
1 answer

SQL WHERE - Column (value) does not exist

I'm attempting to do the most basic WHERE statement in psql and I'm getting a strange error: ERROR: column "rom_tut" does not exist LINE 1: SELECT * FROM pg_roles WHERE rolname="rom_tut"; Why is it complaining that the value isn't a column?
Danny Santos
  • 1,090
  • 2
  • 10
  • 30
7
votes
2 answers

postgres - where in (list) - column does not exist

I'm coming from SQL Server and I was suprised to see that the following query does not work: DELETE FROM user_job_titles WHERE id IN…
Rares Mardare
  • 193
  • 1
  • 4
  • 13
4
votes
1 answer

Why does Postgres say column does not exist?

So I have been working on the following sql script and I can't seem to figure out why it keeps telling me that the data I am inserting is in a column that doesn't exist. Can anyone more experianced with Postgre help me out? DROP SCHEMA pomodoro…
bmacrevolution
  • 553
  • 2
  • 6
  • 14
3
votes
1 answer

String.intern() shows strange result, how does it work

I know that String.intern() adds string to pool if it does not contain the object, but how to explain the results. The code below: public static void main(String[] args) { char[] abc = new char[]{'a','b','c'}; String str = new…
周雪静
  • 153
  • 1
  • 3
  • 10
3
votes
1 answer

delete "column does not exist"

I'm trying to execute a very simple delete query in Postgres Query: delete from "Tasks" where id = "fc1f56b5-ff41-43ed-b27c-39eac9354323"; Result: ERROR: column "fc1f56b5-ff41-43ed-b27c-39eac9354323" does not exist LINE 1: delete from "Tasks"…
Catfish
  • 18,876
  • 54
  • 209
  • 353
2
votes
2 answers

Column doens't exists in PostgreSQL (WHERE column_name = column_value)

I have the following table in PostgreSQL: id and grade are INTs, note and subject both VARCHARs When I run the command: SELECT * FROM grades WHERE subject = "latin"; I get the following error: In pgAdmin4: ERROR: column "latin" does not…
2
votes
2 answers

Why can I have a const char pointer point to a mutable char array?

Why is this fine: char a[2]; a[0]='a'; const char* b; b=a; printf("%s\n",b); a[0]='b'; printf("%s",b); why can a pointer to a constant string point to a non constant string? Also how do string constants work when assigning them to variables? Why…
RSA
  • 21
  • 1
2
votes
1 answer

Query with the postgreSQL database

I already have a database created by postgresql (provided by another administrator than me), the command is created as shown below. CREATE TABLE "Districts" ( "Name" character varying(500), "ProvinceCode" text ); The query Insert value to…
ngtonhung
  • 55
  • 1
  • 7
2
votes
5 answers

What is the difference between a String Constant and String Literal in C?

What's the difference between a String Constant and String Literal in plain C? This question is similar to another: What's the difference between a string constant and a string literal? ...except that one was regarding Objective-C (using NSString)…
Dave
  • 12,408
  • 12
  • 64
  • 67
1
vote
1 answer

When defining a new variable, how to decide its type according to the string value of a constant (or other variable)?

I want to be able to decide the type of a new variable by the name of a previous variable, for example: //the text of this variable must determine the type of the second variable const TYPE_NAME: &str = "u16"; fn main() { //if this worked, this…
algo
  • 108
  • 1
  • 11
1
2 3 4 5 6