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

I want to create a stored procedure by passing input variable and output to be in json format in oracle?

We have a requirement to create a stored procedure in Oracle, passing input variables and output to be in JSON format. I've tried using listagg() but getting error as "result of string concatenation is too long" while executing the procedure.…
0
votes
1 answer

Bind Variable When Creating Table?

I'm trying to create a table that is filtered by a variable date, depending on the current date. Though I'm fairly new to Oracle and PL/SQL, I have already successfully written a number of "high beginner" PL/SQL procs. But I wonder if I'm taking the…
0
votes
1 answer

Oracle - Cannot update table record using bind variable

This query returns 1 row: SELECT col1, col2 FROM table1 WHERE col1 = :column1; But this updates 0 rows: UPDATE table1 SET col2 = :column2 WHERE col1 = :column1; COMMIT; I added this constraint to set col1 as primary key, but it didn't fix…
myrmix
  • 371
  • 3
  • 11
  • 25
0
votes
1 answer

Restrictions on binding variables in dynamic SQL

I came across a tricky situation this morning while I tried to bind variables in a dynamic SQL statement. The situation is that I am trying to use the same bind variable multiple times in a dynamic SQL block. Consider the following code: create or…
Rachcha
  • 8,486
  • 8
  • 48
  • 70
0
votes
1 answer

How to log bind variables on trigger after servererror

I need to track the value of bind variables to a query that returns an Oracle error. Since the queries that return errors are not drawn in v$sql_bind_capture and v$sqlarea, I can't look at these tables. Then I created a trigger after Servererror…
antferr
  • 100
  • 1
  • 10
0
votes
1 answer

How to substitute oracle pl/sql variable in where clause of select

Inside the function , I am having the following function, create or replace FUNCTION DiffMaxMinPrice return double precision is diffprice double precision := 0; minprice long; maxprice long; value long; indexid number(19,0); begin for row…
0
votes
1 answer

declare bind variables in script

I have script that uses this variables with TIME_DATA as ( select $$D:=:DA$$ td from dual), GROUP_INFO as (select $$N:=:GR_ID$$ gr_id_number from dual), and uses them like this A_PLUS_TEK as(select point_id, ml_id, ml_name, val a_plus_month,…
Lavandil
  • 153
  • 2
  • 5
  • 14
0
votes
1 answer

Need help finding cause of PHP Error: Invalid parameter number: parameter was not defined

I have not been able to find the cause of this error. I understand that it usually is caused by the number of params and values not matching during the execute() function. However, I have used var_dump and echo to verify repeatedly that my params…
DonC
  • 75
  • 2
  • 2
  • 5
0
votes
1 answer

Give in date with PHP, get data with SQL

Currently I have a database with each row having a date. In PHP I want to make a input box where the user can input a date (for example 2014/05/11). This will be sent to the sql query to receive the values of that day. I am using MySQL. Now I have…
user3054925
0
votes
1 answer

PHP/MYSQLi Bind Result

I'm writing for a web, that does not have mysqlnd. So I need to quickly change all my code to not use it. I thought I was there with this function, but it repeats results. I would really appreciate any help as to the fix. function…
Denzil Newman
  • 393
  • 1
  • 11
0
votes
1 answer

Customize MySql query with PDO

I'm making a function to query my database, fully, with a keyword search ($wordsToSearch) or with some category tags words($tagsToSearch) if there are. This is my function, and it's not secure since i use the concat to add some part of the query.…
0
votes
1 answer

bindValue and bindParam in mysqli and PDO ignore variable type

I'm having problems in understanding a part of the meaning of binding certain variable types in PDO and mysqli if the type given, in my case, seems to be meaningless. In the following code, the type bound (like i or s) gets ignored. The table row…
sbrue
  • 1
0
votes
4 answers

PL-SQL bind variables in TCL

Could some one explain in the following TCL source code: set sql "SELECT PROD.KEY || ' {' || PARAMETERS || '}' \ FROM PRV_PROD_MAPPING PROD \ WHERE PROD.SERVICE_ID = :service_id \ AND (PROD.KEY || ' ' || PROD.KEY_VAL) \ …
nenito
  • 1,214
  • 6
  • 19
  • 33
0
votes
1 answer

Use a database value in SQLPLUS as a parameter to a batch file

I need to run a batch file and pass in a database value. Depending on the day, a different value needs to be passed into the DOS command. This particular business rule is defined in a view in the database. Our primary scheduling tool is datastage…
Nick.Mc
  • 18,304
  • 6
  • 61
  • 91
0
votes
1 answer

can we use cursor for a UPDATE query?

Can we declare and open a cursor for UPDATE query also or is it only for SELECT queries? EXEC SQL PREPARE S FROM :query; EXEC SQL DECLARE C CURSOR FOR S; DbUtilT::set_bind_variables(bind_dp,¶mList); EXEC SQL OPEN C USING DESCRIPTOR…
user862833
  • 299
  • 2
  • 5
  • 16
1 2 3
9
10