|
Hi All,
I'm trying to send an email using a SQL procedure within SQL Anywhere 11. I have the following SQL statements to do this:
ALTER PROCEDURE "DBName"."WebFormNotify"()
begin
call xp_startsmtp('*A*@***.org', 'SMTP_Relay_server_name');
call xp_sendmail(recipient = '*B*@***.org',subject = 'SMTP SYBASE TEST',"message" = 'SMTP SYBASE TEST');
call xp_stopsmtp()
end
This is being ran from the server that has SMTP Relay setup on it. I am able to use telnet and send an email successfully. The procedure runs with no errors but the email is never recieved by the recipient. I have also replaced the second parameter passed into xp_startsmtp with the name of the actual SMTP server itself, but still no email was recieved by the recipient.
Any help on this would be really appreciated. Pleas elet me know if additional information is needed.
Thank you,
Mel
|
|
|
|
|
I'd start by capturing the return code from the calls. The MAPI errors will likely tell you what is failing. At a guess, it is possible that some form of authentication may be necessary to get this to work.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
xp_startsmtp is a system procedure that starts a mail session for a specified email address by connecting to an SMTP server. This connection can time out. Therefore, it is recommended that you call xp_startsmtp just before executing xp_sendmail.
If you specify smtp_auth_username and smtp_auth_password, and the server does not support the SMTP authentication capability, error code 104 is returned.
Virus scanners can affect xp_startsmtp, causing it to return error code 100. For McAfee VirusScan version 8.0.0 and later, settings for preventing mass mailing of email worms also prevent xp_sendmail from executing properly. If your virus scanning software allows you to specify processes that can bypass the mass mailing protections, specify dbeng12.exe and dbsrv12.exe. For example, with McAfee VirusScan you can prevent mass mailing by adding these two processes to the list of Excluded Processes in the Properties area.
Documentation[^]. Which error-code is it returning btw?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I am creating report for displaying continuous absent for more than 2 days.Query is build and working fine.Range is passed by using @StartDate and @EndDate. but problem is if In between two absent week off comes then it is also considered as continuous absent.i want to add that functionality to the existing query.How can i do that?
Existing query is:
WITH Dates
(
EntryDate,
EmployeeNumber,
Status,
Days,
EmployeeCode,
EmployeeName,
DeptName,
JobName,
HOD,
Supervisor
)
AS
(
SELECT
a.[DATE],
a.EmployeeID,
a.Status,
1,a.EmployeeCode,a.EmployeeName,a.DeptName,a.JobName,a.HOD,a.Supervisor
FROM
tblEmployeeAttendance1 a
WHERE
a.[Date] between @StartDate and @EndDate and (a.status='AB' OR a.Status='O')
UNION ALL
SELECT
a.[DATE],
a.EmployeeID,
a.Status,
CASE WHEN (a.Status = Parent.Status) THEN Parent.Days + 1 ELSE 1 END,
a.EmployeeCode,a.EmployeeName,a.DeptName,a.JobName,a.HOD,a.Supervisor
FROM
tblEmployeeAttendance1 a
INNER JOIN
Dates parent
ON
datediff(day, a.[DATE], DateAdd(day, 1, parent.EntryDate)) = 0
AND
a.EmployeeID = parent.EmployeeNumber where a.[Date] between @StartDate and @EndDate and (a.status='AB' OR a.Status='O')
)
SELECT * FROM Dates where days>=2 order by EmployeeNumber, EntryDate
|
|
|
|
|
You may need to build a calendar of work days. Saw a link a couple of days ago but do not remember where.
|
|
|
|
|
WITH Dates
(
EntryDate,
EmployeeNumber,
Status,
Days,
EmployeeCode,
EmployeeName,
DeptName,
JobName,
HOD,
Supervisor
)
AS
(
SELECT
a.[DATE],
a.EmployeeID,
a.Status,
1,a.EmployeeCode,a.EmployeeName,a.DeptName,a.JobName,a.HOD,a.Supervisor
FROM
tblEmployeeAttendance1 a
WHERE
a.[Date] between @StartDate and @EndDate and (a.status=
-- RECURSIVE
UNION ALL
SELECT
a.[DATE],
a.EmployeeID,
a.Status,
CASE WHEN (a.Status = Parent.Status) THEN Parent.Days + 1 ELSE 1 END,
a.EmployeeCode,a.EmployeeName,a.DeptName,a.JobName,a.HOD,a.Supervisor
FROM
tblEmployeeAttendance1 a
INNER JOIN
Dates parent
ON
datediff(day, a.[DATE], DateAdd(day, 1, parent.EntryDate)) = 0
AND
a.EmployeeID = parent.EmployeeNumber where a.[Date] between @StartDate and @EndDate and (a.status=
)
SELECT * FROM Dates where days>=2 order by EmployeeNumber, EntryDate
I have added AND datepart(dw,a.[Date]) NOT IN (1,7), which will excludes weekly off days.
this would work perfactly.
|
|
|
|
|
i have three comboboxes and a sub form whose recordsource is from same table.these both and a save button are present in a main form .according to combo box selected values the sub form displays the corrresponding data. i can edit the sub form and when i click on save button the values in the combo boxes and corresponding data in sub form should be updated in the msaccess table from where they come..can any body tell solution to this?
|
|
|
|
|
Is it possible to specify from the override of onmodelbuilding() the starting value to use for a table primary key and the seed value to use for generating the rest columns? I'm using 4.1 code first
|
|
|
|
|
your description doesn't tell us what you are using? what is 4.1 code?
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
I think he might mean Entity Framework 4.1. Just a guess.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
You might start here and read the documentation: Tutorial: Code First with EF 4.1[^]. Maynot have the answer but might point you in the right direction.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
To add to the rest of the advice; It's a bad idea to tinker with the seed-values. You should NOT be wasting time on having them start from a particular range (like 1).
Why? Because the artificial key does not hold information, it is merely a link to another record. It's contents should not be relevant outside that purpose. Ever.
Second, having an artificial key does not mean that you no longer need to find the "real" primary key, the combination of (non-identity) fields that make the record unique. Why? Because the user needs to be able to differentiate between the records, based on something else than an artificial identity that holds no information.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I have someone who stores a modest amount of data by file path in different directorys on a network share. The path to the network share identifies the data. They now want to store some data in a database and whould like to store the data in different database files in each of the shared network folders. My question is, is this even a remotely good idea.
|
|
|
|
|
Until they tell you the reason behind it I'd say: Not even a remotely good idea.
|
|
|
|
|
Unless there is a very good reason, it sounds like a moderately horrible idea to me.
|
|
|
|
|
Thanks, I think the reason they want to do this is that it would tie into their existing scheme for backing up data.
|
|
|
|
|
John Robert Wilk wrote: existing scheme for backing up data
I would argue that creating and backing up 50 files uneccessarily is 50 times worse than backing up one file...
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Thanks guys I appreciate I'm not very confident when it comes to databases.
|
|
|
|
|
John Robert Wilk wrote: I'm not very confident
When in doubt just stamp their request, "Disapproved. Resubmit in 90 days for further disapproval."
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
John Robert Wilk wrote: . They now want to store some data in a database and whould like to store the
data in different database files in each of the shared network folders.
Certainly doesn't suggest a database which is performant.
And what happens when one of those servers goes down? It means the database would disappear. Might be interesting to see if MS SQL Server would even let you create the DB files on a shared folder. If it won't then that would rule it out completely. If it does then I would next test what happens to the database server if the share goes away when the server is running.
You know that they can create it in different directories right? Wouldn't that be sufficient? You might also mention that there are other back up strategies possible with the database rather than just doing a file copy.
|
|
|
|
|
To be honest I think they are looking for the easiest way out on their end which would be to do nothing and continue with the current process as is.
|
|
|
|
|
If I was getting paid for it and they really wanted to do it I would still try it out in MS SQL Server with the shared directories just to see what would happen. It sounds like an interesting experiment.
|
|
|
|
|
John Robert Wilk wrote: My question is, is this even a remotely good idea.
It merely proves that someone does not understand what a database-server is, and how it's being used. Whoever came with the proposal should not be doing any work outside of Microsoft Access.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I have a stored procedure that is updating, but causing an insert error. Never seen that before.
Update MyCoolTable
Set MyValue=@passedInValue, SecondaryIdentifier=@secondID
WHERE PrimaryID = @primaryID
There is an index on (SecondaryID,PrimaryID) that is being violated and I'm not sure why. :
Quote: Cannot insert duplicate key in object 'dbo.MyCoolTable'. The duplicate key value is (secondaryIDValue, primaryIDValue).
Why is it trying to insert on an update?
--edit--
Nevermind, I figured out what was happening (though not from the error message). It can't update the secondaryID because there can be more than one, which is what is causing the problem. I guess when they wrote it that could never ever happen.
If it moves, compile it
modified 17-Sep-12 13:41pm.
|
|
|
|
|
loctrice wrote: I guess when they wrote it that could never ever happen
You might wanna post this a tip/trick. Maybe in this way it'll get searchable more easily by others having the same problem (and hopefully avoid another This is failing dunno why plz provide codez Q&A question)
Full-fledged Java/.NET lover, full-fledged PHP hater.
Full-fledged Google/Microsoft lover, full-fledged Apple hater.
Full-fledged Skype lover, full-fledged YM hater.
|
|
|
|
|