procedures

How to run procedure from another unit?

青春壹個敷衍的年華 提交于 2019-12-05 05:26:22
Well this kind of n00b question but I still can't figure it out. I have unit main with procedure Discard() in it. Now I have another unit engine and I want to run from it procedure Discard() of unit main . I have main in uses section of engine.pas . I tried to call procedure with main.Discard() but no good. What am I doing wrong? You need to put the procedure's signature in your interface, like so: unit main; interface procedure Discard(); implementation procedure Discard(); begin //do whatever end; Other units can only "see" whatever's listed in the interface section. In unit "Main" you

How do I get Oracle, see what procedures are running?

混江龙づ霸主 提交于 2019-12-04 09:44:48
Good afternoon. How do I get Oracle, see what procedures are running? Depending on your needs, this might suffice (but relies on access to v$session and dba_objects): select 'CALLED PLSQL', vs.username, d_o.object_name -- whatever info you need from dba_objects d_o inner join v$session vs on d_o.object_id = vs.plsql_entry_object_id union all select 'CURRENT PLSQL', vs.username, d_o.object_name from dba_objects d_o inner join v$session vs on d_o.object_id = vs.plsql_object_id As per the docs: PLSQL_ENTRY_OBJECT_ID - ID of the top-most PL/SQL subprogram on the stack; NULL if there is no PL/SQL

Calling another PL/SQL procedure within a procedure

回眸只為那壹抹淺笑 提交于 2019-12-02 23:51:16
问题 I'm new to PL/SQL & would greatly appreciate help in this. I've created a procedure to copy contracts. Now I want to call another procedure from within this procedure which shall copy all the programs related to the contract I'm copying. One contract can have multiple programs. 回答1: You cal call another procedure in another package by using PackageName.ProcedureName(vcParameters => 'InputParameter1'); If the procedure is in the same package you could do it without the PackageName , so just

How to execute stored procedure multiple times in C#

南楼画角 提交于 2019-11-30 20:36:53
I have a time sheet app where users enter their time in/out for different days of the week. The form processes the in/out from each day, stuff them as parameters into a stored procedure and add them to the database. How would I accomplish this most efficiently? I don't have access to the DB, just the stored procedures. This is the bare code behind, I've stripped out some unnecessary codes. SqlConnection conn = new SqlConnection(connString); conn.Open(); SqlCommand cmd = new SqlCommand("insertINOUT", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("

SQL Server - copy stored procedures from one db to another

浪尽此生 提交于 2019-11-27 18:14:35
I am new to SQL, and what I needed to do was to combine 2 .mdf databases into one. I did that using SQL Server 2008 Manager - Tasks > Import/Export tables.The tables and views were copied successfully, but there are no Stored procedures in the new database. Is there any way to do that? Right click on database Tasks Generate Scripts Select the objects you wish to script Script to File Run generated scripts against target database ShaQue This code copies all stored procedures in the Master database to the target database, you can copy just the procedures you like by filtering the query on

How to program a MySQL trigger to insert row into another table?

 ̄綄美尐妖づ 提交于 2019-11-26 15:22:57
I'm looking to create a MySQL trigger on a table. Essentially, I'm creating an activity stream and need to log actions by users. When a user makes a comment, I want a database trigger on that table to fire and: Grab the ID of the last inserted row (the id of the comment row). perform an INSERT into an activities table, using data from the last inserted row. I'll essentially replicate this trigger for deleting comments. Questions I had: Is LAST_INSERT_ID() the best way to grab the id? How do I properly store the data from the last inserted comment row for use in my "INSERT into activities"

How to program a MySQL trigger to insert row into another table?

混江龙づ霸主 提交于 2019-11-26 04:24:37
问题 I\'m looking to create a MySQL trigger on a table. Essentially, I\'m creating an activity stream and need to log actions by users. When a user makes a comment, I want a database trigger on that table to fire and: Grab the ID of the last inserted row (the id of the comment row). perform an INSERT into an activities table, using data from the last inserted row. I\'ll essentially replicate this trigger for deleting comments. Questions I had: Is LAST_INSERT_ID() the best way to grab the id? How