Setting values for dbVisualizer Pro directly in the SQL code - dbvisualizer

In dbVisualizer I can define variables for which I need to provide values once I run the code, in the figure it was e.g. ${Table}. Is it possible to set the values for these variable directly in the SQL?

Define a default value for a variable: ${Table||myDefaultTable}. Read more about variables in DbVisualizer.

Related

How to nest variables in grafana?

I have a simple Custom variable called route with e.g. this value:
/foo/bar,/foo/baz,/foo/baz/foo
I'm trying to map these values to some more understandable values, e.g. Custom route_names:
bar,baz,foo
Searching on google resulted in people doing nested variables, but whatever I try in Grafana 5.3.4, I can't get it to work. If I do a Query variable and use -- Grafana -- as source, I don't know what to put in the query field. route.* didn't do anything, $route neither.
What is the correct way of selecting a value from one variable and map it to the other? I.e. What is the query language being used when selecting -- Grafana -- as datasource?
As a side note, I have two datasources at the moment, my actual data source where I get my graph data from and -- Grafana --.
There are correct answers on the first floor. solve "key/value pairs" by SELECT 'txt1' AS __text, 'value1' AS __value UNION SELECT 'txt2' AS __text, 'value2' AS __value
This is not possible with Custom template variables (unless smth changed in recent Grafana versions). It can be done with variables coming from mysql, postgres and clickhouse datasource queries. See examples in https://community.grafana.com/t/key-value-style-for-custom-template-variable-configuration-and-usage/3109 thread. Can't tell about this feature support in other datasource types.

Getting a table name from a variable in Oracle

Is it possible to store the name of the table as a variable in Oracle? In other words, assume that I have two tables TXN-A and TXN-B in my database. In my script, I have a variable called PRESENT_TABLE.
Depending upon the situation, I want this variable to refer to either TXN-A or TXN-B.
Yes, it's possible. Search for native dynamic SQL in Oracle PL/SQL.

Using Entity Framework -Is there a way to pass a string of commands to be executed in a manner similar to a stored procedure?

I want something that achieves a simmilar effect to passing the text of a stored proc to SQL Server and then executing it?
For example to set identity_insert and then insert a value
You mean something like this?
context.Database.ExecuteSqlCommand("INSERT INTO....");
This can take multiple commands if you wish.

How to set DTS variable value as stored procedure name in Execute Sql Task

I have execute sql task control ,which is intended to execute a stored procedure , how can i pass the dts variable value as stored procedure name in execute sql task.
Change SQLSourceType from "Direct input" to "Variable" and then select the variable you want from the SourceVariable dropdown.
I believe you can write "exec ?" in the SQLStatementfield and map the variable in the Parameter Mappingsections. This assumes you are not passing extra parameters to the stored procedure though.
Also, this method works for OLEDB connectors. I believe this is different in ADO.NET connectors
To pass parameters to an ADO.NET connector, you use #VariableName Instead of the "?".
http://msdn.microsoft.com/en-us/library/cc280502.aspx
In the link above scroll down to the section "Passing parameters to a stored procedure". It describes the process in detail

Dynamic input to t-sql task in SSIS

I have a package that includes a T-SQL step. I have created som variables to use in the t-sql statement. But I don't find the correct syntax for using the variable in my t-sql statement.
My variable is QuarterID. And in my t-sql I want to use this variable.
t-sql:
DECLARE #myQuarterId int
select #myQuarterId = User::QuarterID
I have tried "#(User::QuarterID)", "#QuarterID", and all different syntax. Is there anyone out there who could help me on this one?
YOu open the Execute SQL task and got to the parameter mapping tab and add the variables inteh order you want to reference them. Make sure to change the parameter names to numbers starting with 0 for the first variable you use and incrementing by one for each other variable. Then go back to the general tab and write your query
DECLARE #myQuarterId int select #myQuarterId =?