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
3 answers

How to use bind variable for null value?

I have below SQL with bind variables. UPDATE Table1 SET column1='102.0', column2='12-OCT-1999', column3='AG' WHERE column4 =:1 and column5 =:2 and column6 =:3 and column7 =:4 AND column8=:5 AND column9=:6 AND NVL(column10,0) <=:7; When the 3rd and…
Arpan Paliwal
  • 234
  • 1
  • 7
  • 20
1
vote
1 answer

Combining Bind variables for webpage lookup

I have this sql that uses the same variable (:Item) for 3 different tables in the where clause. It runs fine in Oracle SQL developer. It pops up and asks for the Item and returns the correct data. I want to create a web page using this sql to allow…
ready4data
  • 65
  • 6
1
vote
0 answers

Defining bind variable in ORACLE SQL

Please help me to create a bind variable I'm doing like this SELECT Period FROM POWER WHERE Period = :F1; EXEC :F; Result: Shows Null Values. Period column is of Date datatype.
drill
  • 134
  • 1
  • 12
1
vote
1 answer

Oracle SQL Developer: can bind variables begin with upper case letter?

I'm using Oracle SQL Developer to test a query to be used in an ADF application's read only view object. ADF documentation recommends using an uppercase letter to begin the name of a bind variable. So... I've creatively named mine…
IdusOrtus
  • 1,005
  • 1
  • 16
  • 24
1
vote
1 answer

ORA-06550 line 10, column 41: PLS-00103: Encountered the symbol "," when expecting one of the following:

I am executing an anonymous PL/SQL block from C# but I am getting an error like below: ORA-06550 line 10, column 41: PLS-00103: Encountered the symbol "," when expecting one of the following: My code: OracleDB AppConn = new…
Sachu
  • 7,555
  • 7
  • 55
  • 94
1
vote
2 answers

Execute Immediate bind variable

I have the following function that calculates content of the table but when I pass any param it throws: EXEC DBMS_OUTPUT.PUT_LINE(get_size('employees')) Error report - ORA-00903: invalid table name ORA-06512: at "HR.GET_SIZE", line 5 ORA-06512: at…
ashur
  • 4,177
  • 14
  • 53
  • 85
1
vote
0 answers

Oracle ASCII Database with C# Unicode Bind Variables Not Working - ODP.NET

We have a US7ASCII 11gr2 database that I'm trying to build parameterised queries against. public CustDetailsModel SelectCustDetails(string CustCode) { string sql; OracleDataReader reader; OracleConnection OraConn =…
radiator
  • 51
  • 13
1
vote
1 answer

MSSQL + PHP - Error to insert oriental char

I'm having a problem to insert a oriental character with bind variables in SQL Server. i'm using MSSQL commands and PHP. My PHP code is like this: $sql = " CREATE TABLE table_test ( id int ,nvarchar_latin …
Deiwys
  • 243
  • 1
  • 5
  • 15
1
vote
0 answers

JDBC statements performance (setObject vs setInt , setString)

I have a program in which I bind the variables in a loop all using: // Loop Start on i=1 preparedStatement.setObject(i , Val); i++; //Loop End Some values are INT some are String etc. I just want to know is is bad performance wise ? In other words…
Noman K
  • 277
  • 1
  • 5
  • 15
1
vote
1 answer

Array Binding for Select Statement in dbms_sql (Oracle 11g)

My Problem is that I want to execute a dynamic SQL-Query within PL/SQL where I have a List of IDs as my Array Bind. In the Oracle-Documentation I found some Examples how to join Lists of Numbers to an DML-Statement.…
1
vote
1 answer

How to get Preparedstatement.executeBatch() to work for the good records if one record fails to insert

In my java code I have a Prepared statement ps_temp. PreparedStatement ps_temp; // loop ps_temp.setString(1,'abc'); .... .... ps_temp.addBatch(); // end loop ps_temp.executeBatch(); Now one of the records in the batch created a Unique Index…
Noman K
  • 277
  • 1
  • 5
  • 15
1
vote
1 answer

Toad for Oracle bind variables with IN clause

I have a query that looks like this: select * from foo where id in (:ids) where the id column is a number. When running this in TOAD version 11.0.0.116, I want to supply a list of ids so that the resulting query is: select * from foo where id in…
pierus
  • 283
  • 4
  • 14
1
vote
1 answer

rails 3 sqlite pass array in query via placeholder

How can i give an array as a placeholder without sqlite seeing as 1 value but several values that are in the array value = Array.new value.push(broadcast_date_from) value.push(broadcast_date_to) puts value #["a", "2006-01-02…
mamesaye
  • 2,033
  • 2
  • 32
  • 49
1
vote
2 answers

Example of SQL injection attack?

What is an example of an SQL injection attack for compromising the database? What classes of SQL injection attacks cannot be prevented by the use of bind variables and why not? How do bind variables help in preventing SQL injection attacks?
user1978333
  • 127
  • 6
1
vote
1 answer

Bind variables in case statement in MonetDB

I seem to have come across a strange restriction in using bind variables in MonetDB. If i use bind variables in the normal way by saying where field=${var} then it works. But not in this case: Here is a sample: select case when ${Brand} = 'All' And…
Codek
  • 5,114
  • 3
  • 24
  • 38