Search Results

Search found 1907 results on 77 pages for 'emergency procedures'.

Page 11/77 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • do you call them functions, procedures or methods?

    - by lowlyintern
    consider a standard c# 'function' public void foo() { //some code } In c or c++ this is called a 'function' - even if taking no parameters and returning no value. In another language maybe it would be a 'procedure'. In object orientation speak it would be called a 'method' if a class member. What would be the correct term to use in c#?

    Read the article

  • Accessing Sub functions /procedures from DPR or other function / procedure in Delphi

    - by HX_unbanned
    Hello, stackoverflowers :) As much I know - Subroutines are with Private access mode to its parent unction / procedure, right? Is there any way to access them from "outer-world" - dpr or other function / procedure in unit? Also - which way takes more calcualtion and space to compiled file? for example: function blablabla(parameter : tparameter) : abcde; procedure xyz(par_ : tpar_); begin // ... end; begin // ... end; procedure albalbalb(param : tparam) : www; begin xyz(par_ : tpar); // is there any way to make this function public / published to access it therefore enabling to call it this way? end; // all text is random. // also, is there way to call it from DPR in this manner? // in C++ this can be done by specifing access mode and/or using "Friend" class .. but in DELPHI?

    Read the article

  • Interesting SQL Sorting Issue

    - by rofly
    It's crunch time, deadline for my most recent contract is coming in two days and almost everything is complete and working fine (knock on wood) except for one issue. In one of my stored procedures, I'm needing to return a result set as follows. group_id | name A101 | Craig A102 | Craig Z101 | Craig Z102 | Craig A101 | Jim A102 | Jim Z101 | Jim Z102 | Jim B101 | Andy B102 | Andy Z101 | Andy Z102 | Andy The names need to be sorted by the first character of the group id and also include the Z101/Z102 entries. By sorting strictly by the group id, I get a result set as follows: A101 | Craig A102 | Craig A101 | Jim A102 | Jim B101 | Andy B102 | Andy Z101 | Andy Z102 | Andy Z101 | Jim Z102 | Jim I really can't think of a solution that doesn't involve me making a cursor and bloating the stored procedure up more than it already is. I'm sure a great mind out there has an elegant solution and I'm eager to see what the community can come up with. Thanks a ton in advance.

    Read the article

  • Sharepoint and SQL server Endpoint

    - by Usman Ahmad
    I created a LinkedServer on MS SQL Server 2005 pointing to my Active Directory. Nothing too fancy. Simple LinkedServer with ReadOnlyAdmin Account assigned to CONNECTAS Property. Then I created some storedprocedures to retreive some data from the LinkedServer. Again nothing too fancy. Just a few simple LDAP Queries. Then I created a SQL Endpoint to expose these stored procedures as Web services. Using Visual Studio 2008, everything is fine and dandy. It finds the endpoint, gets the list of the methods available and runs smoothly. Cool. But the Sharpeoint Add Web Service somehow doesn't work! It finds the WSDL file no prob. Retrieves the list of functions and parameterss n all but just simply doesn't run them! Any advice or where I should start checking?

    Read the article

  • MySQL Stored Procedure: Boolean Logic in IF THEN

    - by xncroft
    I'm looking for the proper syntax (if this is possible in MySQL stored procedures) for using logical operators in an IF THEN statement. Here's something along the lines of what I would like to do, but I'm not certain if I should type "OR" or "||" in the IF ... THEN clause: DELIMITER $$ CREATE PROCEDURE `MyStoredProc` (_id INT) BEGIN DECLARE testVal1 INT DEFAULT 0; DECLARE testVal2 INT DEFAULT 0; SELECT value1, value2 INTO testVal1, testVal2 FROM ValueTable WHERE id = _id; IF testVal1 > 0 OR testVal2 > 0 THEN UPDATE ValueTable SET value1 = (value1+1) WHERE id=_id; END IF; END$$

    Read the article

  • Why might SQL execute more quickly on SQL Server 2000 when NOT using a stored procedure?

    - by Kofi Sarfo
    I could see nothing wrong with the execution plan. Besides, as I understand it, SQL Server 2000 extended many of the performance benefits of stored procedures to all SQL statements by recognising new T-SQL statements against T-SQL statements of existing execution plans (by retaining execution plans for all SQL statements in the procedure cache, not just stored procedure execution plans) It's a fairly straight forward SELECT statement with sensible table joins, no transactions included or linked servers being referenced within the query and WITH (NOLOCK) table hints applied. The stored procedure was created by dbo and the user has all the necessary permissions. So my question is this: What are the likely reasons for a query to take only a few seconds to run but then take several minutes when identical T-SQL is run via a stored procedure?

    Read the article

  • Is it possible to call a procedure within an SQL statement?

    - by darren
    Hi everyone I thought I would use a stored routine to clean up some of my more complex SQL statements. From what I've read, it seems impossible to use a stored procedure within an sql statement, and a stored function only returns a single value when what I need is a result set. I am using mySQL v5.0 SELECT p.`id`, gi.`id` FROM `sport`.`players` AS p JOIN `sport`.`gameinstances` AS gi ON p.`id` = gi.`playerid` WHERE (p.`playerid` IN (CALL findPlayers`("Canada", "2002"))) AND (gi.`instanceid` NOT IN (CALL findGameInstances`("Canada", "2002"))); For example, the procedures 'findPlayers' and 'findGameInstances' are are stored routines that execute some SQL and return a result set. I would prefer not to include their code directly within the statement above.

    Read the article

  • Multilevel nested product categories display with asp.net and sql server?

    - by Kunal
    I have a product category table with the following fields: cat_id (PK) Cat_name Cat_desc Parent_Cat_Id Now when a user wants to add a product he should be able to select multiple categories from a listbox(multiselection enabaled). But to let the user know the hierarchy of the categories, I need to display them in the following style: parent category 1 parent category 1-sub category 1 parent category 1-sub category 1-sub-sub category 1 parent category 1-sub category 1-sub-sub category 2 parent category 1-sub category 2 Parent category 2 ... I know that to achieve this I need to use recursive programming. But how can we do it via stored procedures? That would be much more efficient, right? Thanks in advance for your kind help.

    Read the article

  • How to make VB to execute my SQL SP with parameters?

    - by fema
    Hi, I have a database in MS SQL Server 2008, I have Stored Procedures. One of them does an INSERT with parameters. It works in Server Management Studio. Now I'd like to make a button in Visual Basic 2008 that executes this SP. I have made a DataSet, it contains my 3 SP's, I can easily use 2 of them, because they return data, but the one I'm having trouble with doesn't. Could anyone please tell me how to make VB to execute it? (The command should look like this: "EXECUTE SP2 a, b, c, d".) Thanks in advance

    Read the article

  • oracle plsql: retrieve runtime parameter values when you call a procedure

    - by Luca Vaccaro
    I need a generalized method to get list of runtime parameters (values) when I call a procedure. I need something similar to the $$PLSQL_UNIT that returns the name of the running procedure. (plsql Oracle 10g) E.g. look at this sample procedure: (it simply prints its own name and parameters ) CREATE OR REPLACE PROCEDURE MY_PROC(ow in varchar2, tn IN varchar2) IS BEGIN dbms_output.put_line('proc_name: '||$$PLSQL_UNIT||' parameters: '|| ow||' '||tn ); EXCEPTION WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('ERRORE: ' ||SQLERRM); END MY_PROC; / Running procedure produces the following output: SQL> 1 BEGIN 2 IBAD_OWN.MY_PROC('first_par', 'second_par'); 3 END; 4 / proc_name: MY_PROC parameters: first_par second_par PL/SQL procedure successfully completed. I'm not satisfy because I can't copy and paste in all my procedures because I have to hard code each procedure to set their right parameter variables. Thanks in advance for the help.

    Read the article

  • Variable collation with MySQL stored function?

    - by Chad Johnson
    I want to do something like this in a stored procedure: IF case_sensitive = FALSE THEN SET search_collation = "utf8_unicode_ci"; ELSE SET search_collation = "utf8_bin"; END IF; INSERT INTO TABLE1 (field1, field2) SELECT * FROM TABLE 2 WHERE some_field LIKE '%rarf%' collate search_collation; However, when I do this, I get ERROR 1273 (HY000): Unknown collation: 'search_collation' Also, if I do what's suggested at http://stackoverflow.com/questions/1680850/mysql-stored-procedures-use-a-variable-as-the-database-name-in-a-cursor-declara/2070021#2070021 I get Dynamic SQL is not allowed in stored function or trigger How can I use a dynamic collation?

    Read the article

  • Trouble creating stored procedure

    - by MatW
    I'm messing around with stored procedures for the first time, but can't even create a simple select! I'm using phpMyAdmin and this is my SQL: DELIMITER // CREATE PROCEDURE test_select() BEGIN SELECT * FROM products LIMIT 10; END // DELIMITER ; After submitting that, my localhost does some thinking for a loooong time and eventually loads a page with no content called /phpmyadmin/import.php. After reloading phpMyAdmin and trying to invoke the procedure: CALL test_select(); I get a "PROCEDURE doesn't exist" error. Any ideas?

    Read the article

  • oracle display for every stored procedure the execution time

    - by CC
    Hi all. I'm working on a stored procedure. Inside this one, there are many call to the other stored procedures. There are a bunch of them. I was wondering if there is a option to be able to have the execution time of every stored procedure involved, every function (with a start and end time, ior something like that). The idea is that I need to optimise it and I should touch every part, and since I not sure where is the longest execution time, is a bit difficult. And after a modification I would like the see the hole process if it's shorter or not. If I call the procedure from unix, using sql plus, I have no log. If I call it from TOAD, it's blocked until the end. Any idea? I'm not a dba, so I don't have many rights on the database, I'm just a regular user. Thanks for any advice. C.C.

    Read the article

  • Caching stored procedure results in Linq'u

    - by itdebeloper
    In our web application we have a lots of stored procedures look like this one: getSomeData(/* 7 diffrent params */) This stored procedure don't make any updates. We are using Linq'u. I know that the date are changing no often than once per day so the results for the same sets of parameters values will be the same. Does Linqu have cache simple solution? I know how to 'manually' write cache mechanism in .net, but I supposed that in Linqu this problem was solved. I'm a lazy guy :) so I'm looking for something realy simple like: Linqu_global_store_procedure_configuration.CacheDuration="600" Linqu_global_store_procedure_configuration.CacheVaryByParam="*" I'm using .net 3.5 but its not any problem to move for 4.0.

    Read the article

  • Copy a Table's data from a Stored Procedure

    - by Niike2
    I am learning how to use SQL and Stored Procedures. I know the syntax is incorrect: Copy data from one table into another table on another Database with a Stored Procedure. The problem is I don't know what table or what database to copy to. I want it to use parameters and not specify the columns specifically. I have 2 Databases (Master_db and Master_copy) and the same table structure on each DB. I want to quickly select a table in Master_db and copy that table's data into Master_copy table with same name. I have come up with something like this: USE Master_DB CREATE PROCEDURE TransferData DEFINE @tableFrom, @tableTo, @databaseTo; INSERT INTO @databaseTo.dbo.@databaseTo SELECT * FROM Master_DB.dbo.@tableFrom GO;

    Read the article

  • Is directly executing SQL bad app design?

    - by Michael Lowman
    I'm developing an iOS application that's a manager/viewer for another project. The idea is the app will be able to process the data stored in a database into a number of visualizations-- the overall effect being similar to cacti. I'm making the visualizations fully user-configurable: the user defines what she wants to see and adds restrictions. She might specify, for instance, to graph a metric over the last three weeks with user accounts that are currently active and aren't based in the United States. My problem is that the only design I can think of is more or less passing direct SQL from the iOS app to the backend server to be executed against the database. I know it's bad practice and everything should be written in terms of stored procedures. But how else do I maintain enough flexiblity to keep fully user-defined queries? While the application does compose the SQL, direct SQL is never visible or injectable by the user. That's all abstracted away in UIDateTimeChoosers, UIPickerViews, and the like.

    Read the article

  • How to use a value from one stored procedure in another?

    - by RoguePlanetoid
    I have the following statement in a Stored Procedure: DECLARE @Count INT EXEC @Count = GetItemCount 123 SELECT @Count Which calls another stored procedure with the following statement inside: SELECT COUNT(Item) FROM tblItem WHERE ID = @ID However when I test the call the EXEC outputs the value correctly but it is not assigned to the @Count Variable correctly. I've seen examples or stored procedures used like this, including here but none had a parameter and a return value used (that I could find). The ID Parameter is passed into the second statement which returns a count value used by the first StoredProcedure - all the info I have read seems to indicate this should work - but it doesn't the @Count value is aways zero, even when the GetItemCount returns always the correct value. This is in Microsoft SQL Server 2008 if that helps.

    Read the article

  • LINQ to SQL DB Connections not closing

    - by Joe
    I am using LINQ to SQL in an asp.net mvc application. I am calling stored procedures via ajax calls. The active connections for 2-3 users goes to 100 active connections. and then server timeouts happen. I then used IOC -autofac to resuse the same repository that has a datacontext. now tho i get an active connection on the SQL server per loggedin user plus one. I have never seen this before. Why wouldnt Lin2sql not drop a connection when not in use? would calling a stored procedure in an ajax call in a loggedin session creat an a new active connection? Could a Stored Procedure with loops and or a waitfor hold open a connection??

    Read the article

  • TSQL - create a stored proc inside a transaction statement

    - by Chris L
    I have a sql script that is set to roll to production. I've wrapped the various projects into separate transactions. In each of the transactions we created stored procedures. I'm getting error messages Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword 'procedure'. I created this example script to illustrate Begin Try Begin Transaction -- do a bunch of add/alter tables here -- do a bunch of data manipulation/population here -- create a stored proc create procedure dbo.test as begin select * from some_table end Commit End Try Begin Catch Rollback Declare @Msg nvarchar(max) Select @Msg=Error_Message(); RaisError('Error Occured: %s', 20, 101,@Msg) With Log; End Catch The error seems to imply that I can't create stored procs inside of transaction, but I'm not finding any docs that say otherwise(maybe google isn't being freindly today).

    Read the article

  • IQueryable<> from stored procedure (entity framework)

    - by mmcteam
    I want to get IQueryable<> result when executing stored procedure. Here is peace of code that works fine: IQueryable<SomeEntitiy> someEntities; var globbalyFilteredSomeEntities = from se in m_Entities.SomeEntitiy where se.GlobalFilter == 1234 select se; I can use this to apply global filter, and later use result in such way result = globbalyFilteredSomeEntities .OrderByDescending(se => se.CreationDate) .Skip(500) .Take(10); What I want to do - use some stored procedures in global filter. I tried: Add stored procedure to m_Entities, but it returns IEnumerable<> and executes sp immediately: var globbalyFilteredSomeEntities = from se in m_Entities.SomeEntitiyStoredProcedure(1234); Materialize query using EFExtensions library, but it is IEnumerable<>. If I use AsQueryable() and OrderBy(), Skip(), Take() and after that ToList() to execute that query - I get exception that DataReader is open and I need to close it first(can't paste error - it is in russian). var globbalyFilteredSomeEntities = m_Entities.CreateStoreCommand("exec SomeEntitiyStoredProcedure(1234)") .Materialize<SomeEntitiy>(); //.AsQueryable() //.OrderByDescending(se => se.CreationDate) //.Skip(500) //.Take(10) //.ToList(); Also just skipping .AsQueryable() is not helpful - same exception. When I put ToList() query executes, but it is too expensive to execute query without Skip(), Take().

    Read the article

  • Package creation issues using SQL Developer

    - by Carter
    So I've never worked with stored procedures and have not a whole lot of DB experience in general and I've been assigned a task that requires I create a package and I'm stuck. Using SQL Developer, I'm trying to create a package called JUMPTO with this code... create or replace package JUMPTO is type t_locations is ref cursor; procedure procGetLocations(locations out t_locations); end JUMPTO; When I run it, it spits out this PL/SQL code block... DECLARE LOCATIONS APPLICATION.JUMPTO.t_locations; BEGIN JUMPTO.PROCGET_LOCATIONS( LOCATIONS = LOCATIONS ); -- Modify the code to output the variable -- DBMS_OUTPUT.PUT_LINE('LOCATIONS = ' || LOCATIONS); END; A tutorial I found said to take out the comment for that second line there. I've tried with and without the comment. When I hit "ok" I get the error... ORA-06550: line 2, column 32: PLS-00302: component 'JUMPTO' must be declared ORA-06550: line 2, column 13: PL/SQL: item ignored ORA-06550: line 6, column 18: PLS-00320: the declaration of the type of this expression is incomplete or malformed ORA-06550: line 5, column 3: PL/SQL: Statement ignored ORA-06512: at line 58 I really don't have any idea what's going on, this is all completely new territory for me. I tried creating a body that just selected some stuff from the database but nothing is working the way it seems like it should in my head. Can anyone give me any insight into this?

    Read the article

  • nested insert exec work around

    - by stackoverflowuser
    i have 2 stored procedures usp_SP1 and usp_SP2. Both of them make use of insert into #tt exec sp_somesp. I wanted to created a 3rd stored procedure which will decide which stored proc to call. something like create proc usp_Decision ( @value int ) as begin if (@value = 1) exec usp_SP1 -- this proc already has insert into #tt exec usp_somestoredproc else exec usp_SP2 -- this proc too has insert into #tt exec usp_somestoredproc end Later realized I needed some structure defined for the return value from usp_Decision so that i can populate the SSRS dataset field. So here is what i tried: within usp_Decision created a temp table and tried to do "insert into #tt exec usp_SP1". Didn't work out. error "insert exec cannot be nested" within usp_Decision tried passing table variable to each of the stored proc and update the table within the stored procs and do "select * from ". That didnt work out as well. Table variable passed as parameter cannot be modified within the stored proc. Pls. suggest what can de done?

    Read the article

  • Debugging in VS 2008 locks a stored procedure

    - by larryq
    Hi everyone, I've got a strange one here. I have a .Net executable that, under the hood, calls a few stored procedures. For whatever reason, one of the stored procs hangs when I'm debugging. If I run the executable outside of visual studio things go fine, including this stored proc. It's when I'm debugging that this hangs, and it really hangs. If I stop the debugging session the IDE freezes and I have to kill it via taskmanager. I know which stored procedure has the trouble, as well as the actual statement within it that's the problem. It's calling an update statement that doesn't stand out as particularly special. I can run the identical statement (and the stored procedure itself) from SQL management studio wtih no problem. And, as I mentioned, the exe runs just fine outside the debugger. If I use the SQL activity monitor to see why things are hanging, the wait type says PREEMPTIVE_DEBUG. I'm not sure if that's helpful but if you need more info I'll try to get it to you. I've rebooted my machine (the SQL Server in question is on this box as well) and that didn't do anything, nor did rebuilding the executable. I'm scratching my head on this one and if you have any ideas what to check on next, I'm be happy to listen. Thanks!

    Read the article

  • Why does stored procedure invalidate SQL Cache Dependency?

    - by Fabio Milheiro
    After many hours, I finally realize that I am working correctly with the Cache object in my ASP.NET application but my stored procedures stops it from working correctly. This stored procedure works correctly: CREATE PROCEDURE [dbo].[ListLanguages] @Page INT = 1, @ItemsPerPage INT = 10, @OrderBy NVARCHAR (100) = 'ID', @OrderDirection NVARCHAR(4) = 'DESC' AS BEGIN SELECT ID, [Name], Flag, IsDefault FROM dbo.Languages END But this (the one I wanted) doesn't: CREATE PROCEDURE [dbo].[ListLanguages] @Page INT = 1, @ItemsPerPage INT = 10, @OrderBy NVARCHAR (100) = 'ID', @OrderDirection NVARCHAR(4) = 'DESC', @TotalRecords INT OUTPUT AS BEGIN SET @TotalRecords = 10 EXEC('SELECT ID, Name, Flag, IsDefault FROM ( SELECT ROW_NUMBER() OVER (ORDER BY ' + @OrderBy + ' ' + @OrderDirection + ') as Row, ID, Name, Flag, IsDefault FROM dbo.Languages) results WHERE Row BETWEEN ((' + @Page + '-1)*' + @ItemsPerPage + '+1) AND (' + @Page + '*' + @ItemsPerPage + ')') END I gave the @TotalRecords parameter the value 10 so you can be sure that the problem is not from the COUNT(*) function which I know is not supported well. Also, when I run it from SQL Server Management Studio, it does exactly what it should do. In the ASP.NET application the results are retrieved correctly, only the cache is somehow unable to work! Can you please help? Maybe a hint I believe that the reason why the dependency HasChanged property is related to the fact that the column Row generated from the ROW_NUMBER is only temporary and, therefore, the SQL SERVER is not able to to say whether the results are changed or not. That's why HasChanged is always set to true. Does anyone know how to paginate results from SQL SERVER without using COUNT or ROW_NUMBER functions?

    Read the article

  • How to get IQueryable<> from stored procedure (entity framework)

    - by mmcteam
    I want to get IQueryable<> result when executing stored procedure. Here is peace of code that works fine: IQueryable<SomeEntitiy> someEntities; var globbalyFilteredSomeEntities = from se in m_Entities.SomeEntitiy where se.GlobalFilter == 1234 select se; I can use this to apply global filter, and later use result in such way result = globbalyFilteredSomeEntities .OrderByDescending(se => se.CreationDate) .Skip(500) .Take(10); What I want to do - use some stored procedures in global filter. I tried: Add stored procedure to m_Entities, but it returns IEnumerable<> and executes sp immediately: var globbalyFilteredSomeEntities = from se in m_Entities.SomeEntitiyStoredProcedure(1234); Materialize query using EFExtensions library, but it is IEnumerable<>. If I use AsQueryable() and OrderBy(), Skip(), Take() and after that ToList() to execute that query - I get exception that DataReader is open and I need to close it first(can't paste error - it is in russian). var globbalyFilteredSomeEntities = m_Entities.CreateStoreCommand("exec SomeEntitiyStoredProcedure(1234)") .Materialize<SomeEntitiy>(); //.AsQueryable() //.OrderByDescending(se => se.CreationDate) //.Skip(500) //.Take(10) //.ToList(); Also just skipping .AsQueryable() is not helpful - same exception.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >