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

Avoid Exception when there is no data

I am working on a project and I have a database schema written in Oracle DB. I have some issues. I'll show you my existing code -> PACKAGE BODY pkg_customer_overview IS PROCEDURE get_invest_agreement_info ( opassport_no OUT VARCHAR2, …
R0b1n
  • 513
  • 1
  • 5
  • 28
0
votes
1 answer

SQL Server - Backup server through

Is there a way to backup the SQL Server to an external hard drive daily (automatically) through a procedure (query)? I am using SQL Server 2014
kevin
  • 1
0
votes
2 answers

finding records with cursors and procedures

i dont kno whow to write a proper procedure wtih cursors. i am doing somehtings wring ? procedure1: for given student show all titles of books he ever rented --no such student no recordsexcep SET SERVEROUTPUT ON create or replace procedure…
0
votes
1 answer

plsql procedures with cursors

for the firsrt part using ORACLE PLsql Procedure 2: for every book written by author given by last name change all ISBN OF HIS BOOKS FOR WHAT IS A SECOND PARAMETER OF PROCEDURE?? how can I get and change ISBN of the book? set serveroutput…
0
votes
0 answers

SQL can I create an if statement if subquery returns more than 1 row?

Hi I'm making a procedure "AddToCart" I want to check if there is row with the same column values and if there is update it, if not insert a new row. I keep getting subquery returns more than 1 row. CREATE PROCEDURE AddToCart(thisCustomerID INT,…
0
votes
2 answers

Loop through Query and Update field

I'm trying to loop through a fields defined in a query to an update statement. I have the following SQL: Declare @SQL varchar(max) @SQL= 'Select [a],[b],[c],[d],[e]....[z] From Table1;' I want to be able to loop through all the fields…
0
votes
1 answer

while loop is ending to early in SAP Hana Sql Procedure

I have the following SQL-Script: PROCEDURE "P_OVERVIEW" () LANGUAGE SQLSCRIPT READS SQL DATA AS BEGIN DECLARE I INT = 0; WHILE :I < 24 DO SELECT A, B, COUNT(A) AS COUNT, LAST_DAY(ADD_MONTHS(CURRENT_TIMESTAMP, -:I)) AS "DATE", I FROM…
lisa
  • 107
  • 5
  • 12
0
votes
2 answers

Delphi: One procedure to change all the fields of a record?

I have a record like this: Tcustomer=record Name: string; IDNumber: Integer; IsMarried: boolean; end; And I have a TCustomers_Manager class that stores a list of all the customers. Is it possible to have a procedure like this: Procedure…
Mahm00d
  • 3,881
  • 8
  • 44
  • 83
0
votes
1 answer

Oracle Procedure with out parameter and ArrayBindCount/ArrayBindSize

I am testing a simple Oracle procedure and somehow I am getting an error, which I couldn't see why. using (var dbConnection = new OracleConnection(ConfigurationManager.ConnectionStrings["KWC"].ConnectionString)) { using…
KWC
  • 109
  • 1
  • 8
0
votes
1 answer

MySQL Difference Between last two rows

I Have a simple mysql table with three columns: ID (autoincrement), Value (float) and difference (float). Every 5 seconds a new row is inserted adding a Value and NULL in difference column. I want to set up a stored procedure, triggered…
Joe
  • 145
  • 1
  • 1
  • 11
0
votes
1 answer

Create Oracle Procedure with rdsadmin.rds_file_util.listdir

How do you create a procedure in Oracle with a select from rdsadmin? Environment: Oracle Database 11g 11.2.0.4.0 AWS RDS SQL query `SELECT * FROM TABLE(rdsadmin.rds_file_util.listdir(p_directory => 'DATA_PUMP_DIR'));` Returns (fig.1) Store…
0
votes
1 answer

PL/SQL ORA-00903: invalid table name during EXECUTE IMMEDIATE

here is my code : procedure test IS tn varchar2(99); i number(6); cursor c1 is select tname from tab where tabtype='TABLE' and tname NOT LIKE 'BIN%' order by tname; begin open c1; loop fetch c1 into tn; …
0
votes
0 answers

Oracle SQL- procedure- insert into foreign table from own table not updating the table

Problem- cannot insert data from own schema's table to foreign schema's table. Details- I am trying to insert the latest data from my own schema table to a foreign schema table. I have all the rights on the foreign schema table. The table structures…
Manish
  • 1
  • 2
0
votes
1 answer

Encountered the symbol "2"

In this procedure I want to make a list of all procedures in my code and the user chooses a number to execute a certain procedure or function. Here's my code CREATE OR REPLACE PROCEDURE calling IS chosen VARCHAR2(1); V_count…
0
votes
1 answer

Trying to query data where string has a single quote

Trying to go through a list of values where there might be one with a single quote in it. When I try to pass it through a function, it fails. It gives the error, Execution error in store procedure REPORT_PRESENTATION_DATA: SQL compilation error:…