I’m making PFP route with EXPRESS and PSQL and I have a little problem. I get an error Syntax error at or near “$” Code: I think there shouldn’t be any problem? Thanks. Answer You just made typo when indicated 1$ instead of $1:
Tag: express
loosing connection to sql server from express js api
Im building this api that gets data from a database and posts data to another database both located on the same server but it seems that im having problems with the connections when i first run the app everything works fine but after making some api calls it just crashes and doesnt work again my guess is connections are not
Changing a column value to several records in a consecutive fashion using clever statements in SQL
I have a Postgres table that has an order view field in her, I’m using Nodejs with express This order view is of type INTEGER and has the constraints of NOT NULL and UNIQUE Inserting a new record may bring problems with that, because, if the existing records have view orders of, say, [1, 2, 3, 4, 5], and the
Node.js display all images of a user in ejs from database
I am new to Node.js and right now I am trying to display all my images of a logged in user from my database to my ejs file. I have set up all the code but i have a problem where I don’t know how to properly display all images. I have also tried async functions but i don’t seem
Getting ‘error: syntax error at or near…’ in Postgresql insert query
I’m fairly new at Postgresql and learning new things everyday. So I have this blog project where I want to use PostgreSQL as a db. But I’m kind of stuck at the most basic insert query which is throwing an error. I have three tables, posts, authors and categories. I could create the table properly I guess but when I
Express-Postgres fails to apply array filter: error: operator does not exist: integer[] && text[]
The same query works on the terminal. But for some reason I’m getting an error: pg.query is unable to process the expression path && Array[$1] using this: https://www.postgresql.org/docs/9.2/functions-array.html Answer This should work: Why? Short answer: type resolution. Long answer: Concluding from the error message that comments.comment_id is of type integer. Forming an array from it with ARRAY[comment_id] produces an integer
store sql queries as string in node server to get them as a response(express)
I am trying to do something may or may not be possible. I have a SQL file called “travel.sql” that I am trying to make an api out of, so I thought the simplest thing to do is to save the queries as strings in an array and then save the array of strings as a response for a node
Make a SQL insert statement inside another [closed]
I’m creating a a workout app for a local gym, but I’m having a difficult time figuring out how to populate the workouts and exercises tables. Right now, I have a ‘Add Workout’ button that displays a …
Why can’t I use a local variable after a SQL query in Node.js?
I have to select all tags available in the database, so I could use them in my function, but I can’t use the variable after I assigned a value to the variable in the callback function of the query, why? Code which is not working: However this works: but why? I want to use the variable tags after that query
How can I read a very long BLOB column in Oracle?
I want to connect a Node Express API with an Oracle 11g Database which has a table with a BLOB column. I want to read it using a SQL query, but the problem is that the BLOB column can have a very long …