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.
Questions tagged [bind-variables]
147 questions
1
vote
1 answer
Oracle - "bad bind variable" with bind variable inside function
Why does this code:
with
function qry(v in varchar2) return varchar2 is
begin
return owa_util.ite(v like ('%' || lower(:param) || '%'),'Y','N');
end;
select * from my_table where qry(my_col) = 'Y'
Gives me the following…

user5507535
- 1,580
- 1
- 18
- 39
1
vote
2 answers
Oracle - BULK COLLECT INTO VARRAY used with Bind Variables only collecting column headers
Quick Disclaimer:
First thing out of the way, I know the preferred way of handling dynamic SQL in Oracle now is the DBMS_SQL package but unfortunately my application team does not have the grants to execute these procs at the moment and I am hoping…
user2858650
1
vote
1 answer
Cassandra select query with Bind Variables in java8
I am trying to execute a Cassandra query in Java8.
My query is
SELECT * FROM customer where aor='north'
and I execute it with
session.execute(query)
and got correct answer.
But then I changed my query to SELECT * FROM customer where…

Ankitha Abhilash
- 37
- 5
1
vote
2 answers
How do i solve the following sql syntax error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':Username, :passw, :addrss, :DOB, :emil, :ag)' at line 1
THE CODE:
def submit():
my_cursor =…

tyzion
- 260
- 1
- 10
1
vote
1 answer
Oracle Compound Trigger After Statement Ignoring When Clause
I have a compound trigger using a when clause. My when clause is working as expected for the AFTER EACH ROW statement but not for the following AFTER STATEMENT. If the WHEN clause is not met the AFTER EACH ROW is not running but the AFTER Statement…

cdbean
- 21
- 3
1
vote
2 answers
Bind variable with single quotes in Oracle dynamic sql
I'm receiving different versions of an xml file each defined in different namespace. So i need to use the namespace as bind variable in my dynamic query.
On Oracle 12.1, the statement runs well with hardcoded namespace: XMLNAMESPACES (DEFAULT…

dbspecialist
- 13
- 4
1
vote
1 answer
Bind variables for Oracle select Query in Python
I am trying to execute a select statement for an Oracle database. In my select statement instead of giving the table name directly , I need to retrieve it from an check box and give it in the query. Tried some code but ended up with error...Pls find…

Shri
- 99
- 1
- 1
- 6
1
vote
1 answer
Bind variables in SQL Developer - data type
I'm trying to use bind variables in SQL Developer. The problem is that I can't set the variable to type NUMBER - it's type is always set to VARCHAR2(32):
create view test1v as select 1 as abc from dual;
VARIABLE X NUMBER;
EXEC :X := 1;
explain plan…

usingnamespace
- 93
- 1
- 8
1
vote
2 answers
Appropriate Use of Bind Variables
In the following PL/SQL block, a bind variable is used in the WHERE clause:
declare
symbol varchar2(6) := 'EPIC';
begin
execute immediate 'delete from stock where symbol = :symbol'
using symbol;
end;
/
This block executes successfully, however,…

JTruant
- 387
- 2
- 6
- 19
1
vote
1 answer
Using bind variable as table name in Alter table script
FOR k in c2 LOOP
l_sql := 'ALTER TABLE :TABLE_NAME DISABLE CONSTRAINT
:CONSTRAINT_NAME CASCADE';
l_sql :='INSERT INTO TMP_CONSTRAINT (TABLE_NAME,CONSTRAINT_NAME)
VALUES ('':TABLE_NAME'',…

user2102665
- 429
- 2
- 11
- 26
1
vote
3 answers
parameter reference using dynamic SQL
Below statement use a mixture of bind variable, constant and Oracle keyword for insertion. ABC REVIEW and N are actual values to be inserted.
l_sql :='INSERT INTO EMP
(BUSINESS_DATE,GROUP_NAME, DELETED,UPDATE_DATE) VALUES
…

user2102665
- 429
- 2
- 11
- 26
1
vote
2 answers
APEX substitution string disappearing
I'm running APEX 5.1 on ORACLE 12.1.
I have ca. 80 APEX similar applications running on the same database - each application is using the same substitution string :CLIENT_ID with its own value (storing a code name of the application).
:CLIENT_ID…

PiC
- 137
- 10
1
vote
1 answer
How can I use bind variable in plsql function
I have a function like this:
create or replace function params
(
p_pr varchar2,
p_qu_id varchar2,
p_date date := sysdate,
p_param varchar2 := null
)
return varchar2
as
...
sql_stmt varchar2(4000);
rc …

onur
- 5,647
- 3
- 23
- 46
1
vote
2 answers
Oracle APEX: Built-in User Group Variable
I was wondering if there is a variable like :APP_USER, but instead of the username it should return the user group, so I can check if the current user is administrator.

Markus Appel
- 3,138
- 1
- 17
- 46
1
vote
2 answers
Unable to pass string value 1,2 as input to an oracle query
Below is my query and i am passing a string value 1,2 as bind value but it is showing an error as it is not a valid number. I know IN accepts only number but here i need to pass the string value
SELECT e.*
FROM employee_detail e
WHERE e.emp_id…

manikandan
- 139
- 1
- 2
- 15