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
259
votes
18 answers

What is the difference between a "function" and a "procedure"?

Generally speaking, we all hear about the functions or procedures in programming languages. However, I just found out that I use these terms almost interchangeably (which is probably very wrong). So, my question is: What is the difference in terms…
rpr
  • 3,768
  • 2
  • 22
  • 20
159
votes
26 answers

Are there any suggestions for developing a C# coding standards / best practices document?

I'm a recent AI graduate (circa 2 years) working for a modest operation. It has fallen to me (primarily as I'm the first 'adopter' in the department) to create a basic (read useful?) C# coding standards document. I think I should explain that I'm…
TK.
  • 46,577
  • 46
  • 119
  • 147
89
votes
5 answers

How to make a Clojure function take a variable number of parameters?

I'm learning Clojure and I'm trying to define a function that take a variable number of parameters (a variadic function) and sum them up (yep, just like the + procedure). However, I don´t know how to implement such function Everything I can do…
rodrigoalvesvieira
  • 7,895
  • 15
  • 63
  • 84
62
votes
1 answer

How to call a mysql stored procedure, with arguments, from command line?

How can I call a stored procedure from command line? I have a procedure: CREATE DEFINER=`root`@`localhost` PROCEDURE `insertEvent`(IN `dateTimeIN` DATETIME) NO SQL BEGIN SET @eventIDOut = NULL; IF EXISTS(SELECT * FROM `events` WHERE…
Gábor DANI
  • 2,063
  • 2
  • 22
  • 40
47
votes
3 answers

Creating a procedure in mySql with parameters

I am trying to make a stored procedure using mySQL. This procedure will validate a username and a password. I'm currently running mySQL 5.0.32 so it should be possible to create procedures. Heres the code I've used. All I get is an SQL syntax…
Peter Rasmussen
  • 16,474
  • 7
  • 46
  • 63
29
votes
6 answers

How To Get the Name of the Current Procedure/Function in Delphi (As a String)

Is it possible to obtain the name of the current procedure/function as a string, within a procedure/function? I suppose there would be some "macro" that is expanded at compile-time. My scenario is this: I have a lot of procedures that are given a…
Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384
22
votes
3 answers

ORA-00900: invalid SQL statement- when run a procedure in oracle 10g

I am using Oracle 10g database and trying to run a procedure using SQL commands. create or replace procedure "exam" is begin DBMS_OUTPUT.PUT_LINE('Test'); end; Then click on Run button. It shows: "procedure created". When I try to execute it…
kumar
  • 317
  • 1
  • 6
  • 15
21
votes
1 answer

PL/SQL Inserting 1 row for each result in a select

I am writing a PL/SQL Procedure that performs a select based on input variables and then inserts a row for each result in the select. I am having trouble debugging what is wrong with my query due my newness to PL/SQL. I know this must be easy, but…
Craig
  • 1,295
  • 3
  • 16
  • 29
20
votes
3 answers

Get the name of the calling procedure or function in Oracle PL/SQL

Does anyone know whether it's possible for a PL/SQL procedure (an error-logging one in this case) to get the name of the function/procedure which called it? Obviously I could pass the name in as a parameter, but it'd be nice to make a system call or…
Paul Yeoman
  • 344
  • 1
  • 3
  • 11
19
votes
4 answers

the functions (procedures) in MIPS

I'm new in MIPS language and I don't understand how the functions (procedures) in the MIPS assembly language work. Here are but I will specify my problem : What does: jal jr $ra mean in mips language and the important thing How can we use them…
Snymeh
  • 255
  • 1
  • 3
  • 9
18
votes
1 answer

Rename a mysql procedure

Does anyone know what is the syntax for renaming a mysql stored procedure/function? Or is this even supported in MySQL? I've been googling this for several minutes...
Ferenc Deak
  • 34,348
  • 17
  • 99
  • 167
16
votes
1 answer

How do I remove a Tcl procedure?

How do I remove a tcl procedure? One can unset a variable, override an alias with interp alias {} myproc {} otherproc, override a proc with one defined inside another namespace with namespace import -force. But I did not find a way to make a…
cfi
  • 10,915
  • 8
  • 57
  • 103
14
votes
2 answers

How to list out the user defined functions and procedures in PostgreSQL

Trying to find out the stored functions and procedures on PostgreSQL. I found some of the solutions where "join" has been used. I am looking for an optimal solution/command to it.
Bisu
  • 183
  • 1
  • 1
  • 14
13
votes
1 answer

How to Pass Functions as Parameters in Procedures in Delphi?

Is it possible to pass an object function as a parameter in a procedure rather than passing the whole object? I have a record definition with a function defined as a public class parameter such as: TMyRecord = record public class…
Trojanian
  • 692
  • 2
  • 9
  • 25
12
votes
3 answers

Why FreeAndNil implementation doing Nil before Free?

If you will look at the code of FreeAndNil procedure you will see: procedure FreeAndNil(var Obj); var Temp: TObject; begin Temp := TObject(Obj); Pointer(Obj) := nil; Temp.Free; end; What is the reason they assigning Nil to an object…
Andrew
  • 3,696
  • 3
  • 40
  • 71
1
2 3
99 100