Questions tagged [parameter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

sql bigger parameter then specyfied - no error - just taking substring? why?

I have some sql procedure (MSSQL 2019) if relevant Create PROCEDURE [dbo].[test] @tmp varchar(32) AS print @tmp why when i do EXEC @return_value = [dbo].[test] @tmp = N'...
Dorian's user avatar
  • 103
2 votes
0 answers
13 views

Aurora mysql throttle during writes

I came across a situation where I need expert opinion. Our application ingests data into table A in aurora mysql 3.02 every 5 seconds. This is a write intensive process. During this time, I am using ...
Falcon's user avatar
  • 91
0 votes
1 answer
38 views

Can pl/pgsql function take a variable number of parameters?

I have a database with multiple schemas which have the same tables and views, and I want to create a procedure that creates a view from one the views in the schema. CREATE OR REPLACE FUNCTION ...
vfclists's user avatar
  • 1,041
-1 votes
1 answer
58 views

Forced Parameterization in Sql Server. Can datetime and uniqueidentifier be inferred from natural string format?

Reading about the Data Type of parameters inferred when the Forced Parameterization is set, the official documentation doesn't mention either datetime or uniqueidentifier. It seems that these two data ...
AlexMortola's user avatar
0 votes
2 answers
31 views

Setting parameter of other connection

I can set log_statement parameter to 'all' on the current connection. I want to do it for a few other connections on my database that are controlled by a connected web application. I know that I can ...
Trismegistos's user avatar
1 vote
2 answers
273 views

Query Store plan does not include parameter list

I use the query store to get an overview of executed queries on our databases and to generate performance tests where I execute those queries in parallel on multiple hosts. My task is to test how many ...
SteLoe's user avatar
  • 342
2 votes
1 answer
2k views

PostgreSQL: How to use INOUT parameter of a Stored Procedure called in dynamic SQL?

I have a stored procedure with an INOUT parameter, which value is modified inside the SP. I need to call that SP, providing a variable as that parameter, and then use the modified variable. But the ...
Oleksii Cherkas's user avatar
1 vote
3 answers
1k views

Set custom constant in Postgres script

In Postgres 15, how can we define constants that pertain to business logic rather than db configuration settings? I'd like to define them within SQL scripts rather than passed through the psql -v ...
eliangius's user avatar
  • 145
-1 votes
1 answer
98 views

What are the use cases for Out and In-Out Parameters in Postgres?

I understand what Out and In-Out parameters are, but I can't seem to understand a good use case for them. Is it to make functions more descriptive? Or is there a practical benefit/need for using them?
WriterState's user avatar
1 vote
1 answer
819 views

GUI for running parameterized Postgres query

I often have to debug really complicated SQL queries that have placeholders / parameters like $1, $2, and $3 throughout them. When I try to run such a query in pgadmin, I get: ERROR: there is no ...
Ryan's user avatar
  • 375
0 votes
1 answer
61 views

Can I make a parameterized equality based condition in the where clause of a SQL statement always true

I have a series of queries which depend on a where clause which looks like the following: where a = <a> and b = <b> and c = <c> and d = <d> The angular brackets ...
Dargscisyhp's user avatar
1 vote
1 answer
917 views

Why does pg_stat_statement need to be included in shared_preload_libraries?

I am working on AWS RDS Postgres v9.6, and also v14. I noticed that in our shared_preload_libraries parameter, we have pg_stat_statement included. I don't understand why that needs to be there. In the ...
Mark Grobaker's user avatar
0 votes
1 answer
1k views

Unknown column in field list MariaDB

I am using PHPMyAdmin and MariaDB and get this weird error as mentioned in the title. CALL log_total_outstanding(@message); MySQL said: Documentation #1054 - Unknown column 'time' in 'field list' I ...
Mj _'s user avatar
  • 13
-2 votes
1 answer
2k views

Named parameters in queries for SQL Server

ALL, I'm trying to find a proper syntax to do the following: SELECT a, b, c FROM foo WHERE foo.id = :id; (the query above is written as in SQLite). The "normal" query would be written as: ...
Igor's user avatar
  • 217
0 votes
1 answer
272 views

Pentaho does not read sql script (csv)

I was trying to use a different sql script for one job. For doing this i need to pass the script by file csv, so i set the script like a variable and then i make a transformation that "copy to ...
umberto mauro's user avatar
0 votes
1 answer
562 views

SqlCommand using Parameters but still it is creating Multiple Plans for One Query

I have the below code, I'm using parameters, but still it is generating many Duplicate SQL Execution Plans. What is wrong and how it can be fixed, please? string cmdString = @"INSERT INTO ...
Ivan Bonanno's user avatar
2 votes
1 answer
2k views

Column name as an argument of the function called in the trigger (PostgreSQL)

I looked at all similar questions, but it seems I didn't have enough knowledge to apply them to my issue. Take a look at the following code. The bottom line is that I have a function that updates the ...
fallincode's user avatar
0 votes
2 answers
2k views

How can I configure Automatic Memory Management for certain target values?

I am a little confused about the Oracle Database configuration. My server: Operating system: Windows Server 2012 R2 64bit RAM: 40GB Oracle: Oracle Database 12c (12.1.0.2.0) 64bit My aim: Oracle ...
Athris's user avatar
  • 11
0 votes
1 answer
220 views

load text file into db using temp variable as place holder for complex column value

Assume I have a text file with tab terminated fields as below. Where value in row m, column n as vmn. Vmn is a string which could wrapped in double quota. Generally this string variable could have ...
chans's user avatar
  • 1
4 votes
5 answers
8k views

Handling optional parameters in stored procedure

I have a stored procedure, say "Test" with an optional parameter @Param1 int = NULL. In the procedure, the value of @Param1 is used to update the value of some column in some table, if the ...
Andy's user avatar
  • 41
0 votes
2 answers
667 views

Precautions before relocating the RMAN backups?

To preface... I have mentioned this before in a previous question, but I'll add it again: Our Senior Oracle DBA has just recently passed away, and I've been taking over. My level of experience is just ...
Phillip's user avatar
  • 11
0 votes
1 answer
249 views

Forced Parameterization generating duplicate plans

https://www.brentozar.com/pastetheplan/?id=H1qoS7BSu I am using Azure SQL 18 vCore db with Forced Parameterization, and MAXDOP 8. The vCore count may change much lower for other dbs but for the same ...
robertys's user avatar
0 votes
1 answer
1k views

Pass variable as an input argument to a function inside another function in PostgreSQL

I am new to PostgresQL and having some trouble in feeding a function with a variable from an outer function. (maybe it is not possible...) Inside a function I am trying to assign a value from calling ...
Fernando Pimentel's user avatar
0 votes
1 answer
739 views

How to execute a trigger procedure with an expression as an argument?

How can I pass an expression as an argument when calling a trigger function? create trigger my_trigger after insert on my_table for each row execute function trigger_job( 'job_name', (...
Christiaan Westerbeek's user avatar
1 vote
1 answer
627 views

How to define a parameter that will be used as an IN argument inside a function?

I want to make a function that receives two parameters. The first one represents the salaries from a group of employees, and second one, the codes from a group of departments. Both, P_IN_SALARIES and ...
Geison Santos's user avatar
0 votes
1 answer
150 views

What parameters should be modified after upgrading RAM memory in Oracle server

I have a linux server (rhel4) with oracle 9i (9.2.0.8) to which we have recently upgraded the RAM memory from 4G to 16G. I would like to know what server parameters I should modify and even more what ...
miguel ramires's user avatar
3 votes
1 answer
11k views

Passing parameters for dynamic SQL in a function

I am trying to create a function which will dynamically create a unique table name, populate the table with a result set returned from another function, and return the table name to the caller. In ...
khafka's user avatar
  • 79
0 votes
1 answer
2k views

Is there any way in Postgres to parameterise a procedure for sort order column, when the columns are of different types?

I am trying to write a function which does (some complex stuff) and returns the results in different orders based on a parameter. A simplified version would look something like this: CREATE OR REPLACE ...
khafka's user avatar
  • 79
0 votes
1 answer
568 views

Why doesn't the $1 syntax work for all queries?

I tried to do this: COPY postgres_log FROM $1 WITH csv; And with a separately sent file path, like I make all normal queries (SELECT/UPDATE/INSERT/DELETE). However, it gives: ERROR: syntax error at ...
user avatar
0 votes
1 answer
789 views

Query returns NULL - Oracle

I've an Oracle query where I need to get some data on the basis of some records (strings). I am using IN clause and query is working fine in TOAD with hardcoded data. But when I run that query through ...
Naila Akbar's user avatar
1 vote
1 answer
2k views

How to write correct array string parameter for mysql query?

I'm trying to put up a correct string to pass as a parameter to a simple query. Correct query that returns records: SELECT id_s FROM group_of_id_s WHERE date IN ('2020-08-01','2020-08-01','2020-08-02',...
nobsvalo's user avatar
4 votes
1 answer
1k views

How to capture runtime parameters with extended event?

I use rpc_completed event in order to capture executed sprocs. I am also to view the statement and passed parameters by using the following way: right-click extended event -> Watch Live Data and ...
Rauf Asadov's user avatar
  • 1,253
2 votes
1 answer
3k views

In a Postgres function, how to skip expressions if input value is null?

I have a working function. But it only works if I literally supply both the city and country variables. CREATE OR REPLACE FUNCTION gridref_by_address(city text, country text) RETURNS SETOF ...
dnk8n's user avatar
  • 143
5 votes
0 answers
658 views

Hash join hint returns an error when using local variable

The query below is using the StackOverflow2010 sample database: DECLARE @Id INT = 18471 SELECT c.UserId FROM dbo.Comments AS c INNER HASH JOIN dbo.Users AS u ON c.UserId = u.Id AND c.UserId = @Id ...
JieLong's user avatar
  • 167
4 votes
1 answer
316 views

sp_executesql: what can be parameterized

Is there a definitive list published showing what can and cannot be parameterized in a call to sp_executesql. For example, predicates can, table names cannot. Number of rows in TOP can: exec ...
user1443098's user avatar
5 votes
2 answers
486 views

More than 64 parameters to WHERE IN sentence makes MSSQL reading far too many rows

I have some queries where I need to get more than 64 specific rows, like this example with 65 IDs. TableID is primary key, type BigInt. SELECT * FROM TableA WHERE TableID IN (260905384, ...
Ruben's user avatar
  • 51
0 votes
1 answer
31 views

Create function with a parameter, which will become the part of IN (1, 2, 3) clause

Following is the part of function declaration. Unfortunately it doesn't work the way I would like it to. CREATE FUNCTION my_cool_func(some_parameter INTEGER, some_other_parameter INTEGER[]) RETURNS ...
Alexander's user avatar
2 votes
1 answer
2k views

Retrieving the value of $1, $2 etc. from a Postgres Query

I am currently trying to update/modify a number of SQL queries on a system that does not have any internal Documentation (The developer left on short notice and on bad terms). I have enabled Query ...
TheDemonLord's user avatar
1 vote
2 answers
244 views

Why does this stored proc cause a clustered index scan, but seek when using OPTION RECOMPILE?

I think I may know the answer based on my research, but am looking for confirmation on how/why the engine compiles the plan the way it does with Parameters being passed in: @ID int ,@OtherID INT ...
Data Dill's user avatar
  • 231
0 votes
2 answers
4k views

SSRS report does not work with multiple parameters

My data set has the following where clause: WHERE a11.PDPOID LIKE '%' + @POID + '%' My parameter @POID properties are set to single value. The report works, but if I change the parameter properties ...
Elizabeth's user avatar
1 vote
3 answers
501 views

Parameterized Dynamic TSQL - Dynamic Parameters

We have a situation where effectively the same report is requested by different customers but they: Don't want all the columns Want the columns in a different order than we naturally have them Want ...
Kirk Saunders's user avatar
6 votes
1 answer
521 views

Mysterious procedure calls without parameters - but no exceptions generated

I've been tracing a handful of stored procedures with EventClass RPC:Completed that are intermittently called from .Net SqlClient Data Provider without required parameters - just "exec SprocName". ...
Chris's user avatar
  • 63
2 votes
2 answers
1k views

Stored Procedure - Reseed Identity

I have a bunch of LU tables that have values added and deleted all the time. Therefore, I figured writing a quick stored procedure would serve me well and then can call the stored procedure on another ...
DBA_Kyle's user avatar
0 votes
1 answer
2k views

Mysql Command line Parameter passing to sql file

In windows mysql(5.7 version), I want to run mysql commmand using command line for .sql file as input . Also i was to pass some variable whose value should get used in .sql file. somehow I am not able ...
Raj B.'s user avatar
  • 11
1 vote
2 answers
163 views

Forced Parameterization and CASE statements

We have an application which uses an ORM which does not (easily) support parameterized queries. To combat this, I have enabled Forced Parameterization on our database (SQL2008 R2) in order to avoid ...
TimBrown's user avatar
  • 324
2 votes
1 answer
4k views

ORA-48108 / ORA-48140 / ORA-48187 - diagnostic_dest value error(s) - init files / control files

This is all testing / training - none of this is related to a production env Using ORACLE DB 12c + UNIX/LINUX 64-bit on an VM. . Hi Guys! I am running in the below error(s) and seem unable to ...
Iris Catharina's user avatar
1 vote
1 answer
3k views

alternatives to passing temp table as a parameter to a stored procedure

some time ago I was developing a simple procedure to get the database sizes on a particular server. Here it is the procedure: USE MASTER GO ALTER PROCEDURE dbo.sp_getDBSpace @Radhe sysname=null, ...
Marcello Miorelli's user avatar
8 votes
1 answer
2k views

Unfamiliar syntax - Query with Parameters in Braces at the beggining

I have run sp_WhoIsActive on one of our servers using the following syntax: sp_whoisactive @get_plans = 1, @show_sleeping_spids = 0, @get_outer_command = 1, @get_locks = 1 and found a spid with the ...
SE1986's user avatar
  • 1,950
2 votes
1 answer
6k views

How to pass an array to a plpgsql function with VARIADIC parameter

I am trying to define a plpgsql function in Postgresql 10 with several parameters, including an array. I have already defined the function CREATE OR REPLACE FUNCTION mix_table_fields(...
Darth Kangooroo's user avatar
3 votes
1 answer
145 views

Why are there multiple plans for query under forced parameterization?

I see the following query in an Azure SQL Database (that has Forced Parameterization = FORCED, Parameter Sniffing = ON, and Query Optimizer Fixes = ON) from within Query Store: delete from [...
Mark Freeman's user avatar
  • 2,171