Skip to main content
Advice
0 votes
3 replies
59 views

I'm working in Teradata SQL Assistant and I need to create a stored procedure that, given a table name, returns the percentage of NULL values for each column in that table. Right now, I generate the ...
danny's user avatar
  • 67
1 vote
1 answer
86 views

I have a stored procedure that we are scanning using some AI tools to look for vulnerabilities. I am doing a dynamic SQL statement with an order by clause and that parameter for that order by I am ...
Morgeth888's user avatar
3 votes
1 answer
65 views

I am trying to do some transaction management in calls invoked by dynamic sql (EXECUTE). The following works: CREATE or replace PROCEDURE transaction_test1() LANGUAGE plpgsql AS $$ DECLARE r RECORD; ...
Peter Rilling's user avatar
1 vote
1 answer
87 views

I need this working query as a stored procedure where I can give two databases (one masterdb one testdb), start chainage, end chainage and UniqueRun as input DECLARE @StartChainage FLOAT = 17.00; ...
anonymous123's user avatar
0 votes
1 answer
91 views

I need to replace a certain character inside a field with an empty string. But this simple need becomes complicated because I need to extract data from a remote Oracle server and I need a parameter to ...
tpol's user avatar
  • 195
0 votes
1 answer
93 views

I am trying to build queries to take data from table_1: id path curr_value 1 name Company ABC 2 address 123 Main St 3 name Company 123 And use it as the value AND column header for table_2 in SQL. ...
granger's user avatar
  • 85
-2 votes
1 answer
121 views

I’m trying to write a script to purge all the tables (and views and functions and procedures) from the current dbo schema in the current database. Bolting together what I have learned from other ...
Manngo's user avatar
  • 17k
0 votes
1 answer
172 views

Reason for change I have a main Staging server with multiple linked server's setup. Each one of these Linked Servers have their own DB on the main Staging Server. I have an SP that extracts data from ...
Enzo's user avatar
  • 3
2 votes
2 answers
111 views

I have a UserDAO class where I need to retrieve users based on different search criteria. Initially, I overloaded the method like this: public User getUserByUsername(String username) throws ...
Nhat Nguyen's user avatar
0 votes
1 answer
46 views

I want to include a drop everything section in a script which (re)generates a sample database. I know I can find a list of views in the current schema and generate the DROP VIEW statements this way: ...
Manngo's user avatar
  • 17k
0 votes
0 answers
89 views

I have a comma-separated list of file names, and I want to create multiple text files in MySQL. Each file should contain some static text. For example, if my input is: 'file1,file2,file3,file4' I ...
rMafia's user avatar
  • 85
0 votes
1 answer
78 views

I have a situation where I am trying to create a query using Dynamic SQL in SSMS where I am trying to generate a complete file path by concatenating both the name of a parent folder(s) (which change ...
WJTownsend's user avatar
-2 votes
2 answers
62 views

I am getting incorrect syntax error at 'and Type=0 in the below dynamic sql. What I am trying to achieve is get the volume count of import activities between certain dates where the import id does not ...
Jatin's user avatar
  • 45
1 vote
4 answers
203 views

In PostgreSQL, I am trying to have SQL which orders by multiple columns. The first column will always be priority DESC NULLS LAST. The second one needs to be dynamic based on some conditions (for ease ...
sudoExclamationExclamation's user avatar
2 votes
1 answer
104 views

I get this on Oracle 11g and 19c. Below is a simplified example of the code I am using to process some queries dynamically. It needs to be DBMS_SQL because the actual use case will have various ...
Pro West's user avatar
  • 419

15 30 50 per page
1
2 3 4 5
183