Skip to content
Advertisement

Tag: stored-procedures

How to fix that procedure in sql

I created procedure which count not null rows in the column, but query throws errors: @tableName is not declared and invalid object name tempTable. I don’t know why code throws that errors, because all variables are declared. Also when I make that program in another way, that code throw Msg 1087, Level 15, State 2, Line 11 error. Is it

Create and Run Query in Postgresql Procedure

I want to create a postgresql procedure which creates a query and run it. I tried and research on forums. But i can not solve my problem. Procedure should get user input as a parameter and use it in query. My code like that : And this is the error : edit: form_field is a table. create statement : Answer

Capture logging for stored procedure in Postgresql

We are working on a reporting project where we are executing stored procedures to perform transformations on the source data and convert it into the desired format. The transformed data will be inserted into a different table. We would like to know what are the best practices that needs to be implemented in the stored procedures mainly for To get

Stored procedure to unpivot

I have a table with these columns: Where fields from 01 to 50 are dates. I need to have a table like this: Where title code should be the column name from 01 to 50, data should be the value of that column in mytable I did this stored procedure by looking in older questions: but I’m getting a syntax

SQL GroupBy for Stored Procedure caused Error

I have a quick question that why my SQL Stored Procedure did not work properly. Can someone explain what is wrong with my Stored Procedure Query? Error: “Each GROUP BY expression must contain at least one column that is not an outer reference.” Answer It can never work the way you are trying it, because by definition, all column names

Advertisement