Questions tagged [bind-variables]

A bind variable is an unspecified value (in other words, a placeholder) in a prepared database statement/command. The actual values of the bind variable is to be assigned when the statement or command is executed.

147 questions
0
votes
1 answer

passed multiple values in the bind parameter

I am running the following query but it is not working select * From table r where account_id = 1111 and phone_number in ( :phone ) I passed these values (1111111111,2222222222,3333333333) But it did not return any result. If I pass one of…
Manish
  • 9
  • 4
0
votes
2 answers

Ignore Null Bind Variables in SQL

I am trying to create a dynamic SQL Statement which can be used to filter based on several parameters. But one of the caveats is that not all parameters will be available, so could 4 variables or could be 0. This is my attempt at creating this query…
Chen
  • 103
  • 1
  • 9
0
votes
0 answers

How to execute Oracle query with parameters in Airflow Python Operator

I'm using Oracle connection of Airflow. import cx_Oracle from airflow.providers.oracle.hooks.oracle import OracleHook from airflow.hooks.base_hook import BaseHook The below code has Worked : last_snap_date = '2021-03-23' value =…
Tarun teja
  • 59
  • 3
  • 7
0
votes
1 answer

How to pass a value to a subtitution variable using select script

I have a SQL script in which I declare some substitution variables at the top. The purpose of the script is to create a set of tables and views on a bunch of Oracle schemas when doing multi tenant deployment. In one of the scripts that creates…
0
votes
1 answer

Struggling to use bind variable in C#

I am trying to use bind variables in C# to get records in select query. The below code is what I've tried but I get exception as: ORA-01006: bind variable does not exist . I'm not getting where is the variable being not present or something else…
Shalini Raj
  • 177
  • 2
  • 19
0
votes
0 answers

Problem using named Oracle bind variables in JDBC

I'm attempting to use JDBC to call a SQL query in Oracle that uses bind variables with the :varName syntax. The query was written for interactive use and looks like this: select * from foo where bar = :mybar; If I could, I would just change the…
L. Blanc
  • 2,150
  • 2
  • 21
  • 31
0
votes
1 answer

Select INTO with binding parameters not working with execute immediate

I have the following query that returns 1 when executed: SELECT COUNT(*) FROM TABLE_NAME WHERE Column1='x' AND Column2='y'; In my PL/SQL block, I need to evaluate the condition above in order to execute the business logic. Below is a simplified…
Rando Shtishi
  • 1,222
  • 1
  • 21
  • 31
0
votes
1 answer

Oracle ORDS 19.2: URI Template with multiple bind variables?

-currently testing through Postman- want a guide for this as: i do not want to expose the parameters and their values in URL. when using URI Template like myuri/:bindvar (single bind variable) then i can send parameters in Body. but when creating…
Oralover
  • 83
  • 2
  • 16
0
votes
3 answers

pass global variable into ajax function, post to php, save to database

I have a global variable that I want to pass into Ajax. Ajax is very new to me and I've done some research and testing but I am stuck. I don't know if the variable is being passed into the Ajax function for my first question. I'm not really…
0
votes
1 answer

Oracle Error ORA-00922 While Compiling Trigger

I have a varchar2 datatype column in a table. User only can insert number to that column and I don't want to change as number. Sometimes while inserting data this column as manual, user can space in column. I create a trigger to avoid it. Trigger i…
bcdyzi
  • 35
  • 8
0
votes
2 answers

How to print unique numbers dynamically with PLSQL

I would like to display Unique numbers dynamically. I have tried below code for the same but same number is displaying all the times. DECLARE a NUMBER; BEGIN FOR i IN 1 .. 3 LOOP DBMS_OUTPUT.PUT_LINE(&a); END LOOP; END; the above code will ask me…
Gani Ganesh
  • 63
  • 2
  • 10
0
votes
1 answer

How to pass bind variable as IN OUT parameter in PLSQL procedure

I want to use 1st parameter of my procedure EMP_ID as IN OUT parameter. Originally it's IN parameter and this procedure is working fine, but as the last line concern htp.p('Inserted for Employee-id '||EMP_ID); I want to use this line in anonymous…
0
votes
2 answers

Conditional where clause in Oracle

I have database table as below +----------+----------+------------+ | emp_code | emp_name | emp_status | +----------+----------+------------+ | 01 | aaa | A | | 02 | bbb | A | | 03 | ccc | A …
Pradeep
  • 33
  • 1
  • 2
  • 8
0
votes
1 answer

How do I execute a SQL script using a bind variable

I'm running Oracle 18.c on a Windows 10 platform. I have a large DOS script which calls SQL Plus to run the first SQL script, passing a parameter to it. The parameter is successfully passed to the first SQL script. In that SQL script I'm trying to…
user3138025
  • 795
  • 4
  • 17
  • 46
0
votes
1 answer

How do I substitute values from the R session into SQL bind variable placeholders?

I want to re-use raw SQL within an R script. However, SQL has variable binding that lets us parameterize the query. Is there a quick way to directly substitute values from the R session into bind variable placeholders when using SQL within…
Kalin
  • 1,691
  • 2
  • 16
  • 22