I must be overlooking something simple. I'm setting a variable from a query result in a MySQL stored procedure like this:
SELECT @myName := username FROM User WHERE ID=1;
So, @myName is storing the username of userid 1, which is 'Paul'. Great.
But later in the stored procedure I run an update on this record:
UPDATE User SET username...
I've created an Entity Data Model and imported several stored procedures as Function Imports. I'm exposing the EDM through ADO.NET Data Services (ANDS). Does ANDS automatically expose the functions through its REST API, or do I need to manually add operations to the service?
...
I have an sp with the following pseudo code...
BEGIN TRANSACTION
set @errorLocation='Deleting Permissions'
DELETE [tblUsrPermissions]
WHERE
lngUserID = @lngUserID
if @@error>0
begin
goto roll_back
end
COMMIT TRANSACTION
set @errorLocation='' --clear error messages
...
Hi,
I'm working with some nested datalist controls and cannot get the SP parameters for my nested stored procedure to work.
In debug I can see that SqlDataSource2.SelectParameters.Add("Section",oLabel.Text.ToString()); is getting the correct value from the label but when the results display I always get the results for the last parame...
I'm trying to make a class that will execute any one of a number of stored procedures with any amount of variables
Im using php and mysqli
My class enumerates an array and constructs a string based on the number of elements if any
giving something like this CALL spTestLogin(?,?) for example
I now need to bind the input from my array u...
Is there an application , which can parse a given set of stored procedures (SQL Server 2000) and gets all tables and associated columns that are being used in it.
The stored procedure can have tables from different databases.
Output should be like
TableA
columnA
columnC
columnD
TableB
columnE
columnF
columnG
I ha...
I have an existing Stored Procedure which I am trying to now call with LINQ to SQL, here is the stored procedure:
ALTER procedure [dbo].[sp_SELECT_Security_ALL] (
@UID Varchar(15)
)
as
DECLARE @A_ID int
If ISNULL(@UID,'') = ''
SELECT DISTINCT
App_ID,
App_Name,
App_Description,
DB,
DBNameApp...
I am about to embark on a rewrite of a VB6 application in .NET 3.5sp1. The VB6 app is pretty well written and the data layer is completely based on stored procedures. I'd like to go with something automated like Linq2SQL/Entity Framework/NHibernate/SubSonic. Admittedly, I haven't used any of these tools in anything other than throwawa...
Does anyone know if NHibernate supports returning output parameters from stored procedures? I've had a search in the documentation but can't really find anything that confirms either way.
...
Hi everyone,
I've got a quick question about default values in PL/SQL functions in Oracle. Take this program as an example;
create or replace
FUNCTION testFunction
(
varNumber IN NUMBER DEFAULT 0
)
RETURN NUMBER
AS
BEGIN
dbms_output.put_line(varNumber);
RETURN varNumber;
END;
The idea here being that if no value is specified fo...
I've inherited a rather large application that really could use some cleanup. There is data access code littered throughout the application. In code behinds, some in business logic classes, some inline in in classic asp pages.
What I'd like to do is refactor this code, removing all the data access code into a few DAL classes.
All the...
I know what I'm looking for is probably a security hole, but since I managed to do it in Oracle and SQL Server, I'll give it a shot:
I'm looking for a way to execute a shell command from a SQL script on MySQL. It is possible to create and use a new stored procedure if necessary.
Notice: I'm not looking for the SYSTEM command which the ...
I want a query that returns a list of all the (user) stored procedures in a database by name, with the number of lines of code for each one.
i.e.
sp_name lines_of_code
-------- -------------
DoStuff1 120
DoStuff2 50
DoStuff3 30
Any ideas how to do this?
...
If you have a lot of Stored Procedures and you change the name of a column of a table, is there a way to check which Stored Procedures won't work any longer?
Update: I've read some of the answers and it's clear to me that there's is no easy way to do this. Would it be easier to move away from Stored Procedures?
...
I've got a sproc and some C# calling it. My problem is that both the (N)VARCHAR values only have the first character returned. Everything else is fine. Why would only the 1st character be returned?
So
Content = (string)cmd.Parameters["@SmsContent"].Value,
ToNumber = (string) cmd.Parameters["@ToNumber"].Value,
both only get the 1st ch...
By convention our DB only alows the use of stored procedures for INSERT, UPDATE and DELETE. For some tables / types there is no DELETE stored procedure, because it is not allowed to delete rows. (You can only update the status of such a type to "deleted"). e.g. a customer may be marked as deleted but is never really removed from the DB.
...
I have a couple of tables in a SQL 2008 server that I need to generate unique ID's for. I have looked at the "identity" column but the ID's really need to be unique and shared between all the tables.
So if I have say (5) five tables of the flavour "asset infrastructure" and I want to run with a unique ID between them as a combined gr...
I've been wondering if it's possible to have Fluent-NHibernate communicate with stored procedures that already exist and assign mapping from the result set to my own domain objects.
Also is Fluent-NHibernate able to directly execute procedures with no result set returned?
Basically I've been considering the implications of using Fluent...
I think the question title pretty much says it all, I'm preferably looking for a PL/SQL query to accomplish this, but other options might be useful too.
...
Is it possible to write a PL/SQL query to identify a complete list of a stored procedures dependencies? I'm only interested in identifying other stored procedures and I'd prefer not to limit the depth of nesting that it gets too either. For example, if A calls B, which calls C, which calls D, I'd want B, C and D reported as dependencies ...