Hi all,
Ich have a problem in postgres function:
CREATE OR REPLACE FUNCTION linkedRepoObjects(id bigint)
RETURNS int AS $$
DECLARE catNumber int DEFAULT 0;
DECLARE cat RECORD;
BEGIN
WITH RECURSIVE children(categoryid,category_fk) AS (
SELECT categoryid, category_fk
...
Hi all,
I'm tryng to build a stored procedure that makes use of another stored proceudre. Taking its result and using it as part of its where clause, from some reason I receive an error:
Invalid object name 'dbo.GetSuitableCategories'.
Here is a copy of the code:
select distinct top 6 * from
(
SELECT TOP 100 *
FROM [dbo].[produ...
Hi,
I'm trying to learn how to use MySQL stored procedures. MySQL accepted my procedure:
CREATE PROCEDURE SimpleProc()
BEGIN
SELECT * FROM myTable;
END
(In phpMyAdmin, I set // for delimiter. The real version has the name of an actual table instead of myTable.).
But, when I call the procedure with CALL SimpleProc();, I get...
Hello All,
I have the following stored procedure:
ALTER PROCEDURE Pro_members_Insert
@id int outPut,
@LoginName nvarchar(50),
@Password nvarchar(15),
@FirstName nvarchar(100),
@LastName nvarchar(100),
@signupDate smalldatetime,
@Company nvarchar(100),
@Phone nvarchar(50),
@Email nvarchar(150),
@Address nvarchar(255),
@Pos...
hey folks,
I'm currently using Stephen Walther's approach to unit testing Linq to SQL and the datacontext (http://stephenwalther.com/blog/archive/2008/08/17/asp-net-mvc-tip-33-unit-test-linq-to-sql.aspx) which is working a treat for all things linq.
My Dal layer takes in an IDataContext, I use DI (via Unity) to concrete that up as the ...
I am working on a .NET project which uses Microsoft SQL server. In this project, I need a CLR stored procedure (written in C#) that uses a remote web service. So, when the stored procedure is executed on the SQL server, it makes web service calls and thus sends packets to a remote location. The problem is that when executing the SP I get...
How many types of parameters are there in a stored procedures and what are they?
Thanks in advance.
And can we delete a table using view? I think yes but in what situation we can't delete it if there are no trigger associated with that table. I mean to say i need to delete a table which has no trigger associated with it using view, in w...
Hi,
I got the following stored procedure from http://dev.mysql.com/doc/refman/5.1/en/functions-that-test-spatial-relationships-between-geometries.html
Does this work?
CREATE FUNCTION myWithin(p POINT, poly POLYGON) RETURNS INT(1) DETERMINISTIC
BEGIN
DECLARE n INT DEFAULT 0;
DECLARE pX DECIMAL(9,6);
DECLARE pY DECIMAL(9,6);
DECLARE ls...
I have an order table in MySQL database, having a field/column which stores the date timestamp of when the order was placed.
I need to calculate when the order must be shipped. I could probably figure out how to write a function to calculate the ship date and call that when ever needed but I think, not sure it may make more sense to ha...
I want to create stored procedures through phpmyadmin and later on use it on php. But I dont know how to?. From what I know, I found out that, we cannot manage stored procedures through phpmyadmin. What other tool can manage stored procedure?
And I am not sure if it is better option to use stored procedure instead?
...
I have a SQL Script that I execute in a job to transform tables periodically. To speed it up I put that script in a stored procedure and executed it with a job. It worked faster.
The problem occurs at times when the stored procedure even though it executes it doesn't work. I use the script manually and run it and everything works fine....
Hi all I wanted to know when I should prefer writing stored procedures over writing programming logic and pulling data using a ORM or something else.
...
Hi,
I have a stored procedure below. I intend this procedure to return the names of all the movies acted by an actor.
Create Procedure ActorMovies(
In ScreenName varchar(50),
OUT Title varchar(50)
)
BEGIN
Select MovieTitle INTO Title
From Movies Natural Join Acts
where Acts.ScreenName = 'ScreenName ';
End;
I mak...
First of all, thank you guys. You always know how to direct me when I can't even find the words to explain what the heck I'm trying to do.
The default values of the columns on a couple of my tables need to be equal the result of some complicated calculations on other columns in other tables. My first thought is to simply have the column...
When sending data to a stored procedure through SubSonic, how can I pass a dbtype.structure?
I have a TVP defined as READONLY, and when SubSonic generates the StoredProcedures.cs file, the parameter shows up as a string type.
What is the way to accomplish this?
Thank you.
...
I would like to create a generic logging solution for my stored procedures, allowing me to log the values of input parameters. Currently I am doing this more or less by hand and I am very unhappy with this approach. Ideally, I would like to say something like the following:
"given my spid, what are my input parameters and their values...
Hi,
I am trying to obtain the stored procedure metadata (procedure name,parameter types,parameter names etc) for a procedure declared within an Oracle package, using the standard ADO.NET API - DbConnection.GetSchema call. I am using the ODP driver.
I see that the Package is listed in the 'Packages' and 'PackageBodies' metadata collecti...
Hello,
I'm trying to make an insertion from one database called suspension to the table called Notification in the ANimals database. My stored procedure is this:
ALTER PROCEDURE [dbo].[spCreateNotification]
-- Add the parameters for the stored procedure here
@notRecID int,
@notName nvarchar(50),
...
Hi All,
Hope you can help.
Is there a way to reliably detect when a stored proc is being run on SQL Server without altering the SP itself?
Here's the requirement. We need to track users running reports from our enterprise data warehouse as the core product we use doesn't allow for this. Both core product reports and a slew of in-hous...
Ok so I have this storedproc in my SQL 2008 database (works in 2005 too / used to) ...
CREATE PROCEDURE [dbo].[SetBinaryContent]
@Ref nvarchar(50),
@Content varbinary(MAX),
@ObjectID uniqueidentifier
AS
BEGIN
DELETE ObjectContent WHERE ObjectId = @ObjectID AND Ref = @Ref
IF DATALENGTH(@Content) > 5
BEGIN
...