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

Why is 'invalid length' error message showing when using Oracle_cx?

Using cx_Oracle, I am trying to use a Python script to execute a sql command, using the bind variables 'plat' and 'tick'. When trying to execute this command, it gives me the error "ORA-24373: invalid length specified for statement". To debug, I…
NicholasTW
  • 85
  • 1
  • 10
0
votes
1 answer

How to insert Dynamic SQL in list and labels?

How to write a Dynamic SQL query with bind/substitute variables in List and Labels report server? When creating the Datasource I have the option to enter the query manually, but as soon I enter the bind an error message is displayed. I want to be…
0
votes
1 answer

How to execute bind variables in pl/sql?

I was learning about bind variables in pl/sql and tried to execute the following code on oracle 10g database VARIABLE v_bind1 VARCHAR2(10); EXEC :v_bind1:='shweta'; when i executed it, one pop-up asking for bind variable came as shown in the…
coderina
  • 1,583
  • 13
  • 22
0
votes
1 answer

Selecting float number from FLOAT() column with PHP and mysqli

Good day. I have a problem with selecting float number from MySQL database using bind variables of mysqli class. The type of price column is FLOAT(9,2) and it's value 1.01 Simplified piece of code: $stmt = $dbh->prepare('SELECT price FROM goods…
mortiy
  • 669
  • 7
  • 9
0
votes
4 answers

Oracle ORA-01858 when using parameters in query

I have a table which contains a column of type TIMESTAMP(6), if I try to query this table everything is fine as long as I don't parametrize it. This works: SELECT COUNT(*) FROM t_data WHERE DATA_TS >= TO_TIMESTAMP('13.09.18 11:30:00') AND …
Attix
  • 115
  • 9
0
votes
0 answers

Ignore bind variables in DELETE statements Oracle

I'm running hundreds of SQL DELETE statements in a single go within a BEGIN - END block in Oracle DB. I need to ignore the bind variables to treat the complete text as values. Using Set define off doesn't help as it says BIND variable not…
Osceria
  • 345
  • 2
  • 14
0
votes
1 answer

Can a bind variable be concatenated to a dynamic SQL WHERE clause in order to add an AND statement?

I am attempting to add an AND statement to a dynamic WHERE clause using a bind variable and I am receiving the following Oracle error: ORA-01830: date format picture ends before converting entire input string bind variable Here is the offending…
TheSchnitz
  • 31
  • 1
  • 11
0
votes
1 answer

Oracle Bind Variables and Dynamic PL/SQL with Package

I am new to using dynamic SQL in packages and I have run into an issue when using a bind variable on the left-hand side of the WHERE clause in the code snippet below, specifically the 'WHERE TRUNC( :parm_rec.SRC_DATE_COLUMN )': 'WHERE TRUNC(…
TheSchnitz
  • 31
  • 1
  • 11
0
votes
0 answers

Executing select statements with union all and prepare statements on Oracle

I need to execute the following UNION ALL Select statements, I am using bind variables for the WHERE conditions. I am using PyODBC for Oracle. While the code executes and returns results, it takes a lot of time if compared to running it from TOAD…
Martin
  • 1
  • 1
0
votes
1 answer

Pass an array to bind variables

I have a table that contains queries, for example: select text from queries; TEXT 1 select item from items where item_no between :low_item_no and :high_item_no and description <> :irellevant The queries already contains the place holders for…
user2671057
  • 1,411
  • 2
  • 25
  • 43
0
votes
1 answer

Oracle optional bind variables

I have a query to select users from a table, given user id. This parameter is optional. This is the query: SELECT * FROM USERS WHERE (USER_ID = :USER_ID OR :USER_ID IS NULL) ORDER BY USER_ID; Now I execute the query finding one user, so :USER_ID…
Mr.Joe
  • 25
  • 2
  • 8
0
votes
0 answers

how do i pass a plsql exit code to a shell variable?

My code traps various exit codes for various conditions and stores the value to a local variable; I'm then passing it to a bind var which I am using to store the exit code. My code is something like: variable errflag number begin variable…
0
votes
3 answers

How can I make an entire PL/SQL code block dynamic with bind variables?

Background I'm trying to make a re-usable PL/SQL procedure to move data from one database to another. For this purpose, I'm using dynamic SQL. The procedure executes perfectly if I use a REPLACE with placeholders. However, for security reasons,…
Zesty
  • 2,922
  • 9
  • 38
  • 69
0
votes
2 answers

How to let a column have values reflected automatically, when value is inserted/updated/deleted to/from another column in the same table?

I created 2 tables : INFORMATION AND FEED. INFORMATION has 2 attributes : ID(Primary Key), TOT_AMOUNT. FEED has 4 attributes : ID(Foreign key refer INFORMATION(ID)), S_AMOUNT, S_DATE, TOT_REM. Now, I have to insert/update/delete values to/from…
Am_I_Helpful
  • 18,735
  • 7
  • 49
  • 73
0
votes
0 answers

Oracle explain plan differs when using bind variables

When generating an explain plan for a query my system executes, I notice that if I leave filters in their parameterized form (e.g. "somecolumn=:param1") the explain plan is different when I replace the parameter with a real value (e.g.…
spots
  • 2,483
  • 5
  • 23
  • 38