Skip to content

SP2-0552: Bind variable “N3” not declared

This is a code for comparing three numbers and to print the greatest value. When i try to run this pl sql code in oracle it says Can u tell me where it is wrong???I would be very grateful Answer You have 3 errors (typos): You need the DECLARE keyword before you start declaring variables. n2:=&n2: should b…

Redshift SQL — transposing rows by id into columns

I am using Redshift SQL. I would like to transpose the distinct rows of “Id1” in “Table” into columns. Thus the output should be like the bottom most table, providing weights as columns for each “Id2”.Or Alternatively, concatenate weights into one column. Any guidance on fu…

Oracle View loop on specific tables only

I got many tables of which some end with digits (date). Due to technical reasons I had to create a view on every table (just a workaround) The current state is something like: All it does is creating views for every table which begins with ‘XXX_’. Its almost what I need. But now, sometimes tablena…

How to prevent duplicate entry key when update

Problem explain I won’t update the last primary key of the 3 primary key concatenate. But the problem is sometimes the first and second primary key was the same for multiple records. And in this case, when I set my new value I have a duplicate entry key even I use sub-request to avoid that problem. Some…

VB.NET cmd.CommandText is not working properly with sql update

This is my subtract button, it will just subtract the qty in my database but the math logic is wrong, for example, If I said 12-2 it updates the qty to 6 Any of this 5 “cmd.CommandText is not working properly, it add and subtracts but the qty it updates to the database is wrong, it produces a wrong outp…

Query on how to replace numerical data from a string/column

I have values in my column as below. Can anyone help me with how to replace any numeric data present in a column or string to blank using SQL Server query? Below is the column data. How do I replace the numbers to blank and display only underscores. Answer You could approach this by counting the number of und…