Questions tagged [procedure]

A procedure is a subroutine that does not return a value. Do not use this tag for stored procedures. Use 'stored-procedures' tag instead.

A procedure is a subroutine that does not return a value.

Do not use this tag for stored procedures.
Use tag instead. If question is about stored procedures in Oracle then you can also use tag.

2740 questions
0
votes
1 answer

perl sybase : capture stored procedure print and select statement

i have a stored procedure which has a lots of print statement and it results both print statement and a resultset how do i capture print statement and select statement seperately using perl and (DBI/DBD or CTLib or DBLib)
0
votes
1 answer

Multiple INTOs in procedure query

Is it possible to add multiple INTOs into one query in a procedure to write the values into variables. I tried to do the followng, which does not work. CREATE PROCEDURE slave (IN lat double, IN lon double, OUT var_procId BIGINT, OUT lati…
Meng
  • 191
  • 9
0
votes
2 answers

Call procedure inside procedure with multiple variables mysql

I have written a long MySQK query which I want to reuse in another query. I struggle with the part of connecting the variables from the first procedure within the second. CREATE PROCEDURE proc1(lat double,lon double) BEGIN SELECT * FROM…
Meng
  • 191
  • 9
0
votes
0 answers

Trying to use rollback in mysql procedure

I have a mysql procedure that makes 4 insert queries. I want to rollback all of them if at least one fails. I tried START TRANSACTION, COMMIT and ROLLBACK with no success. Theres is a way to rollback the inserts or i have to make the delete queries…
0
votes
1 answer

How to use DELIMITER statement in PopSQL app?

I'm stuck to create FUNCTION and PROCEDURE through DELIMITER statement in PopSQL. The app keeps throwing an error when I try to use DELIMITER statement: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your…
sniffingdoggo
  • 398
  • 4
  • 16
0
votes
1 answer

mysql procedure if condition

I have a mysql procedure that it doesn´t work an IF condition with AND. I'm not sure what is the correct syntax. CREATE PROCEDURE insere_orcamento( IN ida VARCHAR(10), IN volta VARCHAR(10), OUT result INT ) BEGIN IF (ida='sim' AND volta=NULL)…
0
votes
3 answers

Calling mysql procedure in python with parameter and getting errors

I use pymysql to connect to db. Here is the way I call the procedure. cur.execute("call delete_shop_tables(?,?,?,?,?)", args) The procedure expects 5 string variables. args has five string variables in an array (args = ["one","two","three","four",…
0
votes
2 answers

How to identify rows that have the same value in same columns in mysql? and also i have to add condition to those rows

id bid status time 1 c1 close 2019.10.11 2 c2 close 2019.12.12 3 c2 open 2019.12.11 4 c3 close 2019.12.14 here I want to capture both c2 s and I have to find the time difference
V2rson
  • 137
  • 1
  • 10
0
votes
1 answer

Oracle SQL run batch

So what we trying to do is create a procedure that execute a batch file. We been messing around with job instruction, but it seems like it doesn't work properly. CREATE OR REPLACE PROCEDURE launch_bat AS BEGIN DBMS_SCHEDULER.create_job…
outsider
  • 45
  • 9
0
votes
1 answer

getting one random row from a table inside a function- sql server

i have this procedure in sql. the requirment is: if condition (for example i put 1=1 ..) then [run another procedure or function that will random from table with values one value and return it.] else 1 for example: case when 1=1 then (dbo.myFunc…
malka
  • 19
  • 1
  • 8
0
votes
0 answers

CodeIgniter - AJAX,STORED PROCEDURE

I don't know how to begin this but here's the statement before the problem. THE URL -> my.com/kustomer/customerListOfApplication/24669 I got a modal that accepts more than 10 fields. I got the PROCEDURE call in a model. public function…
oscar1925
  • 25
  • 10
0
votes
0 answers

When call stored procedure in php, returns value =1 , but data don't insert in table

I use mssql, The procedure is in php. The stored procedure parameter is XML. so.. $Conn = mssql_connect('servername','username','password'); $stmt = mssql_init('procedureName',$rCon); mssql_bind($stmt, '@XML1', $TEST_DATA, SQLVARCHAR); …
0
votes
1 answer

Oracle [Procedure] - Sum function ignores WHERE clause

I have a problem with a ORACLE Procedure, it seems that SELECT SUM ignores my WHERE clause, and Sums up ALL of the columns instead of only those that i want to (deptno). However if i use one of this functions like this for example : select…
Mr Robot
  • 57
  • 7
0
votes
0 answers

How to convert a SQL SERVER function to PROCEDURE

I have a data table as follows: +----+--------------+---------------------------+ | Id | Pid | Title | +----+--------------+---------------------------+ | 1 | 0 | System | | 2 | 1 …
Jacdy Xu
  • 11
  • 3
0
votes
2 answers

Oracle. If record exists by the first statement, ignore second one

I'm having a question how to resolve my problem. I have procedure where inside i'm having this SELECT inside LEFT OUTER JOIN witch are returning me some values: SELECT * FROM database1 data1 JOIN database2 data2 ON data2.id =…
Viktor
  • 323
  • 4
  • 15