Hello.
I've written all of MySQL procedures as root@localhost.
Code looks like :
CREATE DEFINER=`root`@`localhost` PROCEDURE `p_add_user`(...)
Trouble is, when deploying on online server. When I replace root with current user and replace localhost with current IP, it works just fine. But that is quite annoyance ....
Is there any way...
EXEC [dbo].[pr_cfgAddFact]
@SettingName = 'TransferBatch',
@RoleFK = SELECT TOP 1 rolepk FROM cfgRole WHERE cfgRole.Name = 'SuperAdmin'
Why would SQL complain about the SELECT clause here? I am trying to run the proc with the sub query getting the data.
...
I can't figure out a way to allow more than 4000 bytes to be received at once via a call to a stored procedure. I am storing images in the table that are around 15 - 20 kilobytes each, but upon getting them and displaying them to the page, they are always exactly 3.91 KB in size (or 4000 bytes).
Do stored procedures have a limit on how ...
I have an Oracle package which contains user-defined functions and procedures, including two user-defined functions which are called from SELECT and UPDATE statements.
The functions in question are defined before the procedures that call them.
This piece of code compiles and works fine on Oracle 10g but won't compile on 9i. The code s...
Hello, I have a stored procedure, which has got executed without any errors, but gives me an error "#1054: Unknown column 'templateName' in where clause" when I run it.
The stored procedure is:
delimiter //
DROP PROCEDURE `getData`//
CREATE DEFINER=`root`@`localhost` PROCEDURE `getData`(IN templateName VARCHAR(45),IN templateVersion VA...
delimiter //
DROP PROCEDURE `getData`//
CREATE DEFINER=`root`@`localhost` PROCEDURE `getData`(IN templateName VARCHAR(45),IN templateVersion VARCHAR(45),IN userId VARCHAR(45))
BEGIN
set @version = CONCAT("SELECT `saveOEMsData_answersVersion` FROM `saveOEMsData` WHERE `saveOEMsData_templateName` = '",templateName,"' AND `saveOEMsData_...
delimiter //
CREATE DEFINER=root@localhost PROCEDUREgetData(IN templateName VARCHAR(45),IN templateVersion VARCHAR(45),IN userId VARCHAR(45))
BEGIN
set @version = CONCAT("SELECT saveOEMsData_answersVersion FROMsaveOEMsData WHERE saveOEMsData_templateName = '",templateName,"' ANDsaveOEMsData_templateVersion = ",templateVersion," AND saveO...
I have a stored procedure:
delimiter //
create procedure userlogin(in eml varchar(50))
begin
select * from users
where email = eml;
end//
delimiter ;
And the php:
$db = new mysqli("localhost","root","","houseDB");
$eml = "[email protected]";
$sql = $db->query("CALL userlogin('$eml')");
$result = $sql->fetch_array();
The error...
I created a query that takes a database backup at certain specified location.
I want to use it as a stored procedure but this should act as a global stored procedure so that whenever this SP is called. Then database backup is taken.
It uses DB_Name() to take database backup of owner database.
Is it possible to create any such SP or Fun...
I have a stored procedure that itself calls a list of other stored procedures in order:
CREATE PROCEDURE [dbo].[prSuperProc]
AS
BEGIN
EXEC [dbo].[prProc1]
EXEC [dbo].[prProc2]
EXEC [dbo].[prProc3]
--etc
END
However, I sometimes have some strange results in my tables, generated by prProc2, which is dependent on the r...
here is code, how I am calling Stored procedure
ISession session = NHibernateHelper.GetCurrentSession();
IQuery q = session.GetNamedQuery("ps_getProgressBarData1");
var t = q.List();
XML mapping
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="ReleaseDAL" assembly="ReleaseDAL">
<sql-query name="ps...
I would like to get the schema name string of a stored proc inside the stored proc itself. I don't know if it's possible because I didn't find any information about it.
Exemple :
DELIMITER $$
DROP PROCEDURE IF EXISTS `exemple` $$
CREATE DEFINER=`root`@`%` PROCEDURE `exemple`()
BEGIN
DECLARE schema_name VARCHAR(100) DEFAULT NULL;
S...
Im using Linq to SQL I have a stored procedure that is returning xml . ie im using for xml outo ,elements
that works fine. what I want to do is expose the result of the stored procedure via a webservice.
Here is some pseudo code: if some could help me replace the ?'s
[WebMethod]
public ? myMethod( int custID)
{
var myCust = d...
Hi all,
There are a few posts about this question around but most concern remote debugging - here everything is on same machine.
Visual studio 2008. I have a data connection to localhost SQL Server 2008 using Windows authentication with an admin account - this account is a member of sysadmin in SQL server. I double click stored proc an...
In the case of MSFT SQL Server 08, it is:
odbcCommand = new OdbcCommand("{call " + SP_NAME + " (?,?,?,?,?,?,?) }", odbcConn);
When I try to do the same thing for Oracle, I get:
OdbcException: ERROR [HYC00] [Oracle][ODBC]Optional feature not implemented.
Feel free to ask for clarification, and please help. I am using .Net 3.5, SQL S...
Why does Oracle 10 R2 not allow use of notational parameters while calling functions in insert statements ?
In my app, I'm calling a function in an insert statement. If use notational method of parameter passing, I get an ORA-00907: Missing right parenthesis error message
INSERT INTO foo
(a,
b,
c)...
Hello
I'm wanting to use variables inside my macro SQL on Teradata.
I thought I could do something like the following:
REPLACE MACRO DbName.MyMacro
(
MacroNm VARCHAR(50)
)
AS
(
/* Variable to store last time the macro was run */
DECLARE V_LAST_RUN_DATE TIMESTAMP;
/* Get last run date and store in V_LA...
I am getting exception when calling Stored Procedure using Nhibernate and here is the exception
No persister for: ReleaseDAL.ProgressBars, ReleaseDAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
here is class file
public class ProgressBars
{
public ProgressBars()
{ }
private Int32 _Tot;
private Int32 _subto...
i am creating a mysql function which takes in a varchar and change it to a int based on a mapping table.
select name, convert_to_code(country) from users where sex = 'male'
here, the convert_to_code() function takes in a country name (e.g. Japan, Finland..) and change it to country code which is an integer (e.g. 1001, 2310..) based on...
Problem:
There are a lot of different databases, which is populated by many different applications directly (without any common application layer). Data can be accessed only through SP (by policy)
Task:
Application needs to track changes in these databases and react in minimal time.
Possible solutions:
1) Create trigger for each ta...