Hi, I have this two tables:
data
id |email
_
1 |[email protected]
2 |[email protected]
3 |zzzgimail.com
errors
_
error |correct
@gmial.com|@gmail.com
gimail.com|@gmail.com
How can I select from data all the records with an email error? Thanks.
...
Hi All,
I have 4 tables Customers, Orders, Order details and Comments in my db.
Customer can have many orders/Comments.
Orders can have multiple OrderItems(OrderDetails).
What I need is the SQL statement to return the following:-
Customerid, CustomerName, TotalOrders, Total OrderItems and NoOfRecentComments.
TotalOrders would be the t...
I have a stored procedure(SP) where one of it's param passes the operator.
The operator can be: <=, >=, =
How can I use this in the query?
How the operators are passed is not built yet, it can be string represented <= or by using a custom code 1, 2 or 3. What do you think?
...
I need to pass an array from C#.net application to oracle stored procedure.
Can anyone please let me know how to go about it?
Also, which OracleType type do I use in C# when passing input parameter to stored procedure?
FYI, am using System.Data.OracleClient in my C# app.
Thanks.
...
Hi,
I have a stored proc, say, "call_Me" with few parameters:
Declare @Greet varchar(100) = 'Hi ||User||'
Exec Call_Me 1,'something', @Greet --parameters: bit, string, string
during the call, I want to be able to replace the
||User||
bit with something else. normally, in a select statement, I would do this:
select 1, 'somethin...
From C# with EF, I call a long stored procedure with ExecuteStoreCommand
30 sec after the procedure starts, I have a timeout exception.
How can I configure timeout ? On the server or in my C# client ?
Thanks
...
Solution 1 :
foreach (var item in itemList)
{
myContext.ExecuteStoreCommand("EXEC MyProc {0};", item); // Insertion
}
or
Solution 2 :
StringBuilder sb = new StringBuilder();
foreach (var item in itemList)
{
sb.AppendLine(String.Format("EXEC MyProc {0};", item)); // Insertion
}
myContext.ExecuteStoreCommand(sb.ToString());
...
Hi
I just installed iReport(Product Version: iReport Professional 3.7.1.1) and try to create exiting crystal report file using iReport to see it makes my life easier.
First bump that I faced was Oracle stored procedure. I found below post and tried to apply it.
1) Set the Query language in the Report Query to plsql
2) Use the...
I have researched online but most examples or instructions don't seem to apply to what I am trying to accomplish.
In short my code should accomplish the following:
A stored procedure is called from my php script which returns a dataset I want to loop through and produce rows in a table (for online display purposes). One of the fields ...
I have a SP that I have created to check for validations and return an OUTPUT Parameter of 0 (No Error) or 1 (Error). However, I have to run this SP within Dynamic SQL since it will be ran through a loop of different data.
Can I pull the OUTPUT from the SP through the EXEC sp_executesql @SQL?
I can not post the actual code, but I can g...
hi. we're in the process of designing an enterprise application & our technical architects suggest that "lets have no sql queries in the code. even if its a simple select call to the database a stored procedure should be written for it in the database & the code should call it."
my issue with this is that it seems like a dumb idea to ha...
I want to insert/update record with a specific stored-procedure which performs some business-logic on new record values. I can do this by trigger to ignore new record from directly to be inserted and pass new record values to my stored-procedure to perform appropriate action for passed values?
...
public class TestProcedure extends StoredProcedure {
TestProcedure(BasicDataSource dataSource, String procName) {
this.setDataSource(dataSource);
this.setSql(procName);
this.declareParameter(new SqlParameter("@test", Types.INTEGER));
}
public List<Detail> executeProcedure(Integer studentId) {
Map inParams = new HashMap(...
I want to have a construct in a stored procedure that defines a temporary table one way in one branch of an if-else and another way in the other branch, but this won't compile b/c it says the table is already created. I am imagining something like the following:
if
begin
IF OBJECT_ID(N'tempdb..#tbl') IS NOT NULL DROP TABLE #tbl
cr...
Hi,
I'm running a procedure which takes around 1 minute for the first time execution but for the next time it reduces to around 9-10 seconds. And after some time again it takes around 1 minute.
My procedure is working with single table which is having 6 non clustered and 1 clustered indexes and unique id column is uniqueidentifier data...
I have a query which is working fine:
BULK INSERT ZIPCodes
FROM 'e:\5-digit Commercial.csv'
WITH
(
FIRSTROW = 2 ,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
but now I want to create a stored procedure for it.
I have written below code to make its stored procedure:
create proc dbo.InsertZipCode
@filepath varcha...
Hello,
I have 2 tables of identical schemea. I need to move rows older than 90 days (based on a dataTime column present in the table) from table A to table B. Here is the pseudo code for what I want to do
SET @Criteria = getdate()-90
Select * from table A
Where column X<@Criteria
Into table B
--now clean up the records we just moved ...
I never used these two features in PostgreSQL. Which language is used to write stored procedures and triggers in PGSQL? Is it the same that Oracle or SQL Server follows or it is C?
...
I have worked on SQL stored procedures and I have noticed that many people use two different approaches -
First, to use select queries i.e. something like
Select * from TableA where colA = 10 order by colA
Second, is to do the same by constructing a query i.e. like
Declare @sqlstring varchar(100)
Declare @sqlwhereclause varchar(1...
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[spGetQualityReport]
(
@providerKey INT
)
AS
-- declare @providerKey INT
-- set @providerKey = 1;
--Get Database providerId first
DECLARE @realProvId INT;
SET @realProvId = (SELECT TOP(1) providerId from providerKeyTranslation where keyVa...