Questions tagged [environment-variables]

22 questions
10
votes
2 answers

How can I use an environment variable in a Postgres function?

Let's say I have a windows user environment variable SOME_STRING. Is it possible to use its value in a PL/pgSQL function? If not, do I need to use an untrusted language (like PL/pythonu) or can I use a trusted one? I am on PG 9.2
Neil McGuigan
  • 7,653
  • 3
  • 36
  • 52
4
votes
1 answer

How do I map SSIS 2012 Package Variables to Parameters?

I have created multiple packages that use variables to assign Connection Manager Expressions such as Connection String. However in the new SQL 2012 Project Deployment Model I don't seem to be able to configure these variables. Would I therefore…
PeterX
  • 167
  • 1
  • 2
  • 10
3
votes
1 answer

MATCH AGAINST one character words returns empty rows with ft_min_word_len = 1

I've set ft_min_word_len = 1 to my.cnf file, also SHOW VARIABLES LIKE 'ft_min_word%' displays ft_min_word_len as 1. Then I've reloaded all database tables and it still doesn't search for one character words. My table: CREATE TABLE IF NOT EXISTS…
2
votes
1 answer

SQLCMD mode: environment variable syntax?

I assume the best way to set my SSMS (SQL Server 2005) output file path during runtime of T-SQL, is to use SQLCMD mode. How do I use environment variables (e.g. %systemroot%) in the code? The following bombs: :set mypath %systemroot% :out…
Relaxed1
  • 123
  • 1
  • 6
2
votes
2 answers

How to change SESSION_CACHED_CURSORS for all sessions

how Can I do to change SESSION_CACHED_CURSORS for all sessions? I found on google and oracle website: Alter Session... but I need to changed it for all the session and not only for one of them. How can I do it? UPDATE 1: SQL> alter session set…
jcho360
  • 1,960
  • 7
  • 23
  • 31
2
votes
1 answer

Environment variables in Postgres C extension

I cannot get environment variable in my PostgreSQL C extension code. For example, this function always returns 111: #include "postgres.h" #include "fmgr.h" #include…
2
votes
1 answer

Identifying elements in SSIS package built in MS Visual Studio 2008

I recognize that these are variables, but I am not sure how to add these elements to the package (or how they are added to begin with), what effect that have or even how to manipulate them. No right click, no left click. I can hover the mouse over…
2
votes
1 answer

Variable to select database in SQL query

If I want use a variable in the FROM clause of a SQL query I need to use dynamic SQL. Which might be a pain if the query is long and complex. There are few different ways of running a query from a database you are not currently connected to. The…
1
vote
1 answer

Mysql row-based binary logging behaving different in some versions of mysql (rows grouping)

Mysql row-based binary logging seems to have a different behaviour when grouping rows changes in some versions of mysql. Let's assume the following statement update three rows: UPDATE table_name SET a=1 WHERE id IN (1, 2, 3); In mysql 5.7.21:…
1
vote
0 answers

Converting and/or enforcing an Ascii Character Set in Informix database from 819 or ISO Latin 1

Overview: In Informix is it possible to enforce ASCII for a database or instance. Details: I am trying to enforce ASCII in an instance of informix for a while. This is to help have a smooth transition between char sets: ISO Latin-1 (819) and UTF8. I…
1
vote
2 answers

Best Practice to Store an Admin Configured Variable

Some background: Users submit a form that has a category. If (category has manager) { send manager email } else { send 'default' manager an email } For the sake of argument, manager_category has 2 columns; Manager's Email and Category Admins…
1
vote
0 answers

Partition of tables with constraint exclusion doesn´t optimize queries

Over an existing table in PostgreSQL (version 9.0.2) I created nine others which inherited the former with check constraints. I turned on the constratint_exclusion variable and runned some queries, demanding part of the table and performing JOINS…
1
vote
1 answer

sql_safe_updates set to ON by default

This is fresh mysql install from Debian apt. mysql> \s -------------- mysql Ver 14.14 Distrib 5.5.47, for debian-linux-gnu (x86_64) using readline 6.3 .. Server version: 5.5.47-0+deb8u1-log (Debian) Protocol version: 10 Connection: …
pawel7318
  • 45
  • 2
  • 8
0
votes
2 answers

Store LDAP bind credentials in environment variables for pg_hba.conf

I am working on setting up LDAP authentication for a PostgreSQL database and have added the following in my pg_hba.conf file: # TYPE DATABASE USER ADDRESS METHOD host all all all ldap…
0
votes
2 answers

Scripts for setting the environment for Oracle Database Multitenant

When working on shared database servers with several Oracle Container Databases installed in different homes and different versions it can be hard to find the pdb you are looking for quickly. We used a shell script to set the environment and I added…
r0tt
  • 850
  • 6
  • 22
  • 41
1
2