procedure

Mysql calling procedure failed when dynamically alter table in it

牧云@^-^@ 提交于 2019-12-31 04:04:09
问题 I want to alter my tables dynamically based on whether the table has specific column. My database name is summer_cms , and there are over 50 tables in it. What I want are below: If a table has a column named add_time , then I would like to add a column add_user_id in it. Similarly, I would like to add update_user_id in the table if update_time is found. I know I should get it down in the process of creating the database schemas, but my database has been built and I have to alter it by need.

Trying to make a procedure called map-odd-mapper in scheme

坚强是说给别人听的谎言 提交于 2019-12-25 09:08:26
问题 I'm trying to make a procedure called map-odd-mapper where I take a proc that can then be applied to a list ex: ((make-odd-mapper add-one) (list 14 38 29 10 57)) (15 30 58) I was thinking of putting it as a let function as in (define (make-odd-mapper f) (let (..........something using ret-odds to allow for the indices so that you can get the odd numbers.... ret-odds is defined as (define (ret-odds lst) (if (null? lst) null (cons (car lst) (if (null? (cdr lst)) null (ret-odds (cdr (cdr lst))))

Fortran procedure pointer points to a subroutine that does nothing

你说的曾经没有我的故事 提交于 2019-12-25 07:38:32
问题 I have a code like this : procedure(),pointer :: p if () p => job1 else p => job2 endif do i=1,a_big_number call x(...) call p(i,j,k) enddo The subroutine 'job1' does some work, but the subroutine 'job2' does nothing. In other words, under some circumstances, I need to finish 'x' and 'job1'. Under other circumstances, I only need to do 'x'. My question is how should I define job2. It seems simply using null() does not work. What I am doing right now is like: subroutine job2(i,j,k) integer

MySQL: How come the procedure is slower than executing the query?

ぐ巨炮叔叔 提交于 2019-12-25 06:57:25
问题 So i have this superduper query that finds "related articles" based on the number of tags they have in common with the original article (provided in the $id variable). I don't know if the actual query is important, but here it is Justin Case. Now, I've never actually used procedures in a live project, but I've read they should be faster, partially because the MySQL engine doesn't need to interpret the code each time. But when i had put this same code in a procedure and called the procedure,

Calling procedure in oracle apex

陌路散爱 提交于 2019-12-25 06:31:44
问题 I have created a package with two in inputs as shown below, however I am having trouble with testing the package to see if it works. I want to call the procedure and test it works with the inputs being 1 and 1000. Could anyone suggest a way of testing in Oracle Apex please? I'm not sure if I'm producing the output in the correct way inside the package, if I test the code outside of being a procedure and package it works fine. At the minute I just want to test it in the SQL Command. Package

Procedure to delete only if database higher then sysdate

情到浓时终转凉″ 提交于 2019-12-25 05:46:04
问题 Ive currently a procedure that deletes a customer a fairly simple procedure that's inside a package body. Here is the code for the procedure that runs and deletes the customer: PROCEDURE remove_customer (customer_id VARCHAR2) IS BEGIN DELETE FROM order_line WHERE order_line.FK1_order_id in (SELECT order_id FROM placed_order WHERE placed_order.FK1_customer_id = remove_customer.customer_id ); DELETE FROM placed_order WHERE placed_order.FK1_customer_id = remove_customer.customer_id; DELETE FROM

mysql procedure function returning error

◇◆丶佛笑我妖孽 提交于 2019-12-25 01:45:42
问题 I'm trying to create a mysql function, but i keep getting following error. What is the problem with my query? You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BEGIN INSERT INTO order (carID, clientID) Select car.id, client.id FROM' at line 2 My query: DELIMITER // CREATE FUNCTION orderCreate(LicenseNumber varchar(30), Phonenumber varchar(20)) BEGIN INSERT INTO `order` (carID, clientID) Select car.id, client

Output message problems with procedure and function

喜夏-厌秋 提交于 2019-12-25 01:37:01
问题 I have successfully created a function and a trigger but the output does not seem to be showing when i execute it just says procedure completed successfully. It does not display the total cost. 回答1: To see the output from the DBMS_OUTPUT package, you must enable it. That depends on the tool you are using. in SQL+, set the command set serveroutput on before running the procedure in TOAD, click on the Output On/Off button in the DBMS_OUTPUT tab in SQL Developer you also have a tab named DBMS

Pass SELECT STATEMENT as IN parameter to procedure and execute in Oracle

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 00:37:20
问题 I have following procedure CREATE OR REPLACE PROCEDURE p_create_text_file ( loc IN VARCHAR2 , file IN VARCHAR2 , select_statement in varchar2 , line_statement in varchar2 ) IS fid UTL_FILE.FILE_TYPE := UTL_FILE.FOPEN (loc, file, 'W'); line VARCHAR2(2000); BEGIN FOR rec IN ( /*replace this select*/ select parameter , value from nls_database_parameters where parameter in ('NLS_RDBMS_VERSION', 'NLS_CHARACTERSET') /*end of replace*/ ) LOOP line := rec.parameter || ';' || rec.value; UTL_FILE.PUT

Oracle function return rows into c#

本小妞迷上赌 提交于 2019-12-24 21:05:42
问题 I want to create a procedure or function in oracle that returns more than one row of different types to my application. I found some examples on the internet but i can't get it to work... Example: I created a custom type in oracle: create type proc_selectall is object (Mjera varchar2(50), Status number(10,0), Naziv varchar2(50), Stat number(10,0)); Then: create type ret_selectall is table of proc_selectall; Then created function: create or replace function fsp_SelectAll return ret_selectall