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
1
vote
1 answer

Outerjoining a Bind-Variable in SQL-Statement (Oracle 11g)

we have a lot of Select Statements which use Bind-Variables that can be Null. Null means that the Bind-Value should not restrict the statement. Here is a simple example what we are doing: CREATE TABLE PERSON AS SELECT LEVEL AS ID, 'Person_'||LEVEL…
0
votes
3 answers

Difference Between "&" and "&&" in oracle

I'm studying the differences between bind variables(:) and ampersand operator(& / substitution variables). I realized that "double ampersand is stored variable values and reused these values where it is the same session.". According to this fact, if…
kkudo
  • 3
  • 2
0
votes
1 answer

python oracle excute error(ORA-01036: illegal variable name/number)

hi i am korean so not native english speaker anyway i have question when i learning sql and python flask connect this is my code sql='''select count(*) from member where id = :1 ''' result=curs.execute(sql,(join_id)) …
ewise
  • 1
  • 1
0
votes
1 answer

Passing Bind Variable in case statements in Oracle query

I want to pass Bind Variable (a Date) in a Case statement in order to achieve the following: When User inputs a date and if that Date is falling on Monday, then the Case statement should fetch the value of Friday (meaning it should bypass the…
0
votes
1 answer

Is it possible to pass bind variable as parameter?

Is it possible to pass a bind variable to a procedure? Here a simplified snippet, to show what I'm trying to do: CREATE OR REPLACE PROCEDURE TEST_CSV ( :d1 IN DATE DEFAULT null, :n1 IN NUMBER DEFAULT null) IS BEGIN SELECT DISTINCT * from…
hajduk
  • 103
  • 8
0
votes
1 answer

Error(20,56): PLS-00049: bad bind variable 'NEW.NEW_NAME'

I am facing this error while creating a trigger. error - Error(20,56): PLS-00049: bad bind variable 'NEW.NEW_NAME' if anyone can help it will be appreciated. Please refer to my code below Thanks in Advance :) CREATE OR REPLACE TRIGGER…
sona
  • 3
  • 2
0
votes
3 answers

Pass BOTH single bind variable and list variable to SQL query cx_Oracle Python

I have a Oracle SQL query: SELECT * from table1 WHERE deliveredDate = ? AND productID IN (?,?,?,...); I would like to pass a single variable to deliveredDate and a list with length unknown to the productID using cx_Oracle and Python From the Oracle…
hhp
  • 109
  • 1
  • 7
0
votes
2 answers

How to iterate over binary string in Oracle?

enter image description here declare str varchar2(2000) := :inputstr; v_len number; currChar CHAR(1); begin v_len := length(str); for i in 1..v_len Loop currChar :=…
netcoredev
  • 35
  • 2
  • 7
0
votes
0 answers

bind variable substitution in oracle sql string

I am trying to get the default dbf file location from a select statement and use this location to create tablespaces later on. I am having some trouble doing it in the sql script. I tried to use pl/sql and bind variables. Please let me know how i…
jiii
  • 71
  • 4
0
votes
0 answers

Why aren't my bind variables working in APEX 19?

I've been using APEX ever since version 4, and I remember making Classic Reports with queries like "select b, c, d from my_table where a = :P1_A_VALUE" :P1_A_VALUE might have been created on page 1 as a static value for page item P1_A_VALUE, with a…
0
votes
1 answer

PHP MySQL bind variable not working with REGEXP_INSTR

MySQL version is 10.1.19-MariaDB. PHP version is 7.0.13. I have a table called words2: CREATE TABLE words2 (word varchar(64)); INSERT INTO words2 VALUES ('ABSCESS'), ('ABSCISE'),('ABSCOND'),('ABSENCE'); INSERT INTO words2 VALUES ('ABSINTH'),…
TenG
  • 3,843
  • 2
  • 25
  • 42
0
votes
1 answer

How to initialize a value on a bind variable in the oracle apex?

I'm having problems when executing this code in oracle apex: VARIABLE b_var NUMBER(20); BEGIN :b_var := 100; END; PRINT b_var; what I am trying to do is initialize a value to a bind variable then display it to the console. But it always asks…
Renzm.6958
  • 33
  • 6
0
votes
1 answer

Plsql / jdbc date input argument as string

I have a sql that retrieves data based on certain date and my Java application calls a plsql — Oracle to do so. The new request is to get data based on more than one date selection made on the screen . I tried to form these dates as comma separated…
dsreddy
  • 9
  • 3
0
votes
1 answer

Trying to extract data through bind variables in cx_oracle python

I am trying execute below block of code with cx_oracle by bind variables, but getting below mentioned error everytime. Not sure what is missing. Anyone has idea on this Code : a = input("Please enter your name ::") conn =…
0
votes
2 answers

ORA-01008: not all variables bound - "not all variables bound"

This is my plsql block, dynamic SQL. I can't find a reason why it comes up with an error 'no ORA-01008: not all variables bound ORA-06512: at line 23'. I can't find the error on my EXECUTE IMMEDIATE statement. DECLARE form_name …