Showing posts with label instead. Show all posts
Showing posts with label instead. Show all posts

Sunday, March 25, 2012

accessing fake data inside an INSTEAD OF trigger

Hello,
Is it possible to access inserted data through an UPDATE INSTEAD OF
trigger if the condition of the query does not match any row in a
table?
For example :
UPDATE myTable SET myColumn1 = 'abc' WHERE myColumn2 = 'xyz'
If there is no row inside myTable matching the condition "WHERE
myColumn2 = 'xyz'", the INSTEAD OF trigger is activated without any
error but the inserted table remains empty.
Is there a way to access the value 'abc' in such a situation?
thank you
sNo, you do not have access to the originating command, nor any
parameters of that command. What you have access to are the DELETED
and INSERTED tables, and the table that was updated.
Roy Harvey
Beacon Falls, CT
On 2 Mar 2006 15:34:44 -0800, "steven" <stevenshawk@.gmail.com> wrote:

>Hello,
>Is it possible to access inserted data through an UPDATE INSTEAD OF
>trigger if the condition of the query does not match any row in a
>table?
>For example :
>UPDATE myTable SET myColumn1 = 'abc' WHERE myColumn2 = 'xyz'
>If there is no row inside myTable matching the condition "WHERE
>myColumn2 = 'xyz'", the INSTEAD OF trigger is activated without any
>error but the inserted table remains empty.
>Is there a way to access the value 'abc' in such a situation?
>thank you
>s|||OK ... but this data should exist somewhere.
I mean if the server returns an empty cursor when I do a SELECT * FROM
INSERTED within the trigger, it is because it has access to myColumn2 =
'xyz'. Any API to access the query content, even if it does not match
anything in the table?
thank you
Roy Harvey wrote:
> No, you do not have access to the originating command, nor any
> parameters of that command. What you have access to are the DELETED
> and INSERTED tables, and the table that was updated.
> Roy Harvey
> Beacon Falls, CT
>
> On 2 Mar 2006 15:34:44 -0800, "steven" <stevenshawk@.gmail.com> wrote:
>|||On 3 Mar 2006 07:30:03 -0800, "steven" <stevenshawk@.gmail.com> wrote:

>OK ... but this data should exist somewhere.
>I mean if the server returns an empty cursor when I do a SELECT * FROM
>INSERTED within the trigger, it is because it has access to myColumn2 =
>'xyz'. Any API to access the query content, even if it does not match
>anything in the table?
>thank you
Nothing like that I've ever heard of. Or imagined, for that matter.
Roy Harvey
Beacon Falls, CT

Accessing Delivery Extension UI WebControls

hi,
We are developing a custom web application that will interact with the
Reporting Services web service (instead of using the ReportManager). I need
to manage subscriptions from my custom web app just like ReportManager does.
I would like to programmatically access the web controls located in each
extension dll (e-mail, fileshare, or my own custom dlls) used to gather
information from the client instead of having to write new ones. I know the
ReportManager accesses these objects (for example, the
PrinterDeliveryUIProvider in the printer delivery sample), so there must be a
way to do this. (Reflection?)
I couldn't find any helpful documentation (might have missed something), and
wondered if anyone knew how the best way to go about this.
Thanks,
MattThe Report Manager obtains the list of the registered UI controls from the
<DeliveryUI> element in the RSWebApplication.config file. Then, it proceeds
by loading dynamically the user control presumably by calling LoadControl().
Since the UI controls implement ISubscriptionBaseUIUserControl the Report
Manager knows how to manipulate them in a standard fashion.
You may find my custom Web Service delivery extension (included in the book
source code) useful to understand how the UI controls work.
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"mshumaker" <mshumaker@.discussions.microsoft.com> wrote in message
news:14595C36-8130-481F-8DC9-7C356DF66314@.microsoft.com...
> hi,
> We are developing a custom web application that will interact with the
> Reporting Services web service (instead of using the ReportManager). I
need
> to manage subscriptions from my custom web app just like ReportManager
does.
> I would like to programmatically access the web controls located in each
> extension dll (e-mail, fileshare, or my own custom dlls) used to gather
> information from the client instead of having to write new ones. I know
the
> ReportManager accesses these objects (for example, the
> PrinterDeliveryUIProvider in the printer delivery sample), so there must
be a
> way to do this. (Reflection?)
> I couldn't find any helpful documentation (might have missed something),
and
> wondered if anyone knew how the best way to go about this.
> Thanks,
> Matt|||Ah, that would be the link I was looking for. I focused on obtaining the
info straight from the ReportServer and didn't think of using my own config
file. And after the time I've already spent with the config files while
getting my custom delivery extension to work...
I will also look into the LoadControl() method.
Thanks for your help.
Matt
"Teo Lachev [MVP]" wrote:
> The Report Manager obtains the list of the registered UI controls from the
> <DeliveryUI> element in the RSWebApplication.config file. Then, it proceeds
> by loading dynamically the user control presumably by calling LoadControl().
> Since the UI controls implement ISubscriptionBaseUIUserControl the Report
> Manager knows how to manipulate them in a standard fashion.
> You may find my custom Web Service delivery extension (included in the book
> source code) useful to understand how the UI controls work.
> --
> Hope this helps.
>|||LoadControl() won't work - it loads a UserControl where a control used for a
delivery extension UI is a WebControl.
I'll look into this more - maybe try loading it with reflection.
"mshumaker" wrote:
> Ah, that would be the link I was looking for. I focused on obtaining the
> info straight from the ReportServer and didn't think of using my own config
> file. And after the time I've already spent with the config files while
> getting my custom delivery extension to work...
> I will also look into the LoadControl() method.
> Thanks for your help.
> Matt
>
> "Teo Lachev [MVP]" wrote:
> > The Report Manager obtains the list of the registered UI controls from the
> > <DeliveryUI> element in the RSWebApplication.config file. Then, it proceeds
> > by loading dynamically the user control presumably by calling LoadControl().
> > Since the UI controls implement ISubscriptionBaseUIUserControl the Report
> > Manager knows how to manipulate them in a standard fashion.
> >
> > You may find my custom Web Service delivery extension (included in the book
> > source code) useful to understand how the UI controls work.
> >
> > --
> > Hope this helps.
> >
>|||My bad :-)
Than, it is probably dynamically loading the assembly using Load or LoadFrom
and adding the control to a placeholder, e.g.
PlaceHolder1.Controls.Add(ctrl);
--
Hope this helps.
---
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---
"mshumaker" <mshumaker@.discussions.microsoft.com> wrote in message
news:01BF60A4-B199-4A2C-B494-5741ADAD650E@.microsoft.com...
> LoadControl() won't work - it loads a UserControl where a control used for
a
> delivery extension UI is a WebControl.
> I'll look into this more - maybe try loading it with reflection.
> "mshumaker" wrote:
> >
> > Ah, that would be the link I was looking for. I focused on obtaining
the
> > info straight from the ReportServer and didn't think of using my own
config
> > file. And after the time I've already spent with the config files while
> > getting my custom delivery extension to work...
> >
> > I will also look into the LoadControl() method.
> >
> > Thanks for your help.
> > Matt
> >
> >
> > "Teo Lachev [MVP]" wrote:
> >
> > > The Report Manager obtains the list of the registered UI controls from
the
> > > <DeliveryUI> element in the RSWebApplication.config file. Then, it
proceeds
> > > by loading dynamically the user control presumably by calling
LoadControl().
> > > Since the UI controls implement ISubscriptionBaseUIUserControl the
Report
> > > Manager knows how to manipulate them in a standard fashion.
> > >
> > > You may find my custom Web Service delivery extension (included in the
book
> > > source code) useful to understand how the UI controls work.
> > >
> > > --
> > > Hope this helps.
> > >
> >

Tuesday, March 6, 2012

Access Subforms not updatable

Hello,
I have an Access client that has a subform based on a VIEW. I wrote the view
with an instead of insert trigger. I also included the WITH VIEW_METADATA
option. The problem is this. If I have the VIEW_METADATA option in my VIEW,
the forms recordset is not updatable, but if it ALTER the VIEW, excluding the
option, then the recordset is updatable, but the trigger won't work. I need
the trigger to work. Is there anything that I can do.
Thank you,
Brandon
What is the trigger doing? Perhaps you can handle the whole process a
different way. Triggers often introduce unwanted complexity and have
unintended consequences.
--Mary
On Sat, 11 Sep 2004 19:39:02 -0700, "Brandon Campbell"
<BrandonCampbell@.discussions.microsoft.com> wrote:

>Hello,
>I have an Access client that has a subform based on a VIEW. I wrote the view
>with an instead of insert trigger. I also included the WITH VIEW_METADATA
>option. The problem is this. If I have the VIEW_METADATA option in my VIEW,
>the forms recordset is not updatable, but if it ALTER the VIEW, excluding the
>option, then the recordset is updatable, but the trigger won't work. I need
>the trigger to work. Is there anything that I can do.
>Thank you,
>Brandon

Friday, February 24, 2012

Access Query: Need to return a month name instead of number in the query result

Here's part of my code for my Access query:

SELECT [Enter Month 1 - 12] AS ["Month"], Sum(IIf([ProductName] Like 'FHA30*',1,0)) AS ["FHA 30"]
FROM Calculations2
WHERE (((Month([LockDate]))=[enter month 1 - 12]));

It works fine, but I'm wanting it to return the name of the month in the first column instead of the number that the user inputs. I have another table that simply has a column with the month number and a column with the month name so I thought I might be able to have a second select statment with somewhere with in the SELECT [Enter Month 1 - 12] AS ["Month"], part, but I don't know how to do that. I'm real slow when it comes to coding so any help is appreciated.I did something similar but it was to return the day name, this might be of some help:

SET SERVEROUTPUT ON;

DECLARE

v_date VARCHAR2 (15);

BEGIN

SELECT TO_CHAR(sysdate, 'day')
INTO v_date
FROM dual;

DBMS_OUTPUT.PUT_LINE('The Day Today Is: '|| v_date);

END;
.|||If I understand your code, that will return the system date. In my query, the user inputs what month they want the query to run on by inputting the month number, like 1 for January. Right now, my first SELECT statement returns whatever number they input in the first column just so when it returns the query you can use that if you put the qurey results in excel or something. I just want it to convert that number into the name January. I hope I'm explaining it correctly.