Showing posts with label equivalent. Show all posts
Showing posts with label equivalent. Show all posts

Tuesday, March 20, 2012

An 'OnClientConnected' on the Server side

Upon a client connecting to the server, is there an 'OnClientConnected'
-equivalent event on the server side that I can put some code to check who
has just connected or what application or workstation is connecting? I'm
looking for some way to check for 'valid' client applications.You can execute queries to view connection, session
information. In SQL Server 2000, query the sysprocesses
table in the master database. In SQL Server 2005, you can
query the dynamic management view sys.dm_exec_sessions. Both
have login times, host, program name and other info.
What you do from there depends on what you are trying to do
and what version of SQL Server may determine what options
are available to use.
-Sue
On Tue, 14 Feb 2006 13:25:28 -0800, "Trex"
<Trex@.community.nospam> wrote:

>Upon a client connecting to the server, is there an 'OnClientConnected'
>-equivalent event on the server side that I can put some code to check who
>has just connected or what application or workstation is connecting? I'm
>looking for some way to check for 'valid' client applications.|||Hello Trex,
You may want to consider to capture the audit logon/logoff event and store
them to a SQL table. Then you could use notification service to notfiy when
the insertion meets to requirment.
Best Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>Thread-Topic: An 'OnClientConnected' on the Server side
>thread-index: AcYxrS0jasuUvcWgTpCZHnrqfgbL3A==
>X-WBNR-Posting-Host: 152.130.15.18
>From: "examnotes" <Trex@.community.nospam>
>Subject: An 'OnClientConnected' on the Server side
>Date: Tue, 14 Feb 2006 13:25:28 -0800
>Lines: 4
>Message-ID: <C4E19CC4-603C-4FD8-8044-96A28661C246@.microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.sqlserver.connect
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.sqlserver.connect:46902
>X-Tomcat-NG: microsoft.public.sqlserver.connect
>Upon a client connecting to the server, is there an 'OnClientConnected'
>-equivalent event on the server side that I can put some code to check who
>has just connected or what application or workstation is connecting? I'm
>looking for some way to check for 'valid' client applications.
>|||Sounds like a solution. I can monitor this and kill a process if I don't
like what I see. Thank you Sue!
"Sue Hoegemeier" wrote:

> You can execute queries to view connection, session
> information. In SQL Server 2000, query the sysprocesses
> table in the master database. In SQL Server 2005, you can
> query the dynamic management view sys.dm_exec_sessions. Both
> have login times, host, program name and other info.
> What you do from there depends on what you are trying to do
> and what version of SQL Server may determine what options
> are available to use.
> -Sue
> On Tue, 14 Feb 2006 13:25:28 -0800, "Trex"
> <Trex@.community.nospam> wrote:
>
>|||Thank you Peter...this may be another possiblity for me!
"Peter Yang [MSFT]" wrote:

> Hello Trex,
> You may want to consider to capture the audit logon/logoff event and store
> them to a SQL table. Then you could use notification service to notfiy whe
n
> the insertion meets to requirment.
> Best Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
=============
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
> --
>

Thursday, February 9, 2012

Alternative of Multistatement table-valued function in oracle

Hi all,
Can anybody tell me what is the equivalent of Multistatement table-valued function<UDF> in Oracle. I want to make a function which can return a table.
Thanks
AlokOriginally posted by Alokg
Hi all,
Can anybody tell me what is the equivalent of Multistatement table-valued function<UDF> in Oracle. I want to make a function which can return a table.

Thanks
Alok

You're in a different dimension now...

No table or cursor pointers...

but here's some sample code theft...

Create Function dbo.GetCSVTable
(
@.Array varchar(8000),
@.Delimiter varchar(8000) = ','
)
Returns @.table Table (
IndexID int Identity Not Null,
Value varchar(8000),
ValueInt int,
ValueDateTime datetime
)|||I want to write an UDF in ORACLE which can return a table. IN MSSQL we can use Multistatement table-valued functions but do we have some equivalent in ORACLE..
Can someone help me?

Thanks
Alok|||i think they call it "parameterized view" (it's been a while :)|||I see...got it backwards...

This is a sql server board though...

Oracle, unlike sql server doesn't move stuff around they supply pointers..

You should google "reference cursors" or go to tech net (or how about the right forum)

But here's a procedure that uses a ref cursor...I would imagine a function might make use of this way as well

PROCEDURE Get_EligPlanTypes_sp (I_EMPLID IN VARCHAR2,
EligPlanTypesCur OUT CurRefType) IS

BEGIN

--* Retrieve eligible plan types for entry into the plan object.

OPEN EligPlanTypesCur FOR SELECT DISPLAY_PLN_SEQ
,PLAN_TYPE
,OPTION_CD
,ELECTION_MADE
FROM ENR_PARTIC_PLAN
WHERE EMPLID = I_EMPLID
ORDER BY DISPLAY_PLN_SEQ;

EXCEPTION
WHEN OTHERS THEN
RAISE;

END Get_EligPlanTypes_sp;|||Here's a sample function..

CREATE OR REPLACE PACKAGE dba_Functions_Package
AS

Function InstrCount (strValue Varchar2
,strTarget Varchar2)
RETURN NUMBER;

END dba_Functions_Package;

/

CREATE OR REPLACE PACKAGE BODY dba_Functions_Package
AS
-- ************************************************** *******************
-- *** F U N C T I O N (InstrCount) D E C L A R A T I O N S *****
-- ************************************************** *******************

Function InstrCount (strValue IN Varchar2
,strTarget IN Varchar2)
RETURN Number
IS
numOccurs Integer := 0;
numReturn Number := -1;
BEGIN

While numReturn != 0 Loop
numReturn := Instr(strValue,strTarget,1,numOccurs+1);
If numReturn <> 0 Then
numOccurs := numOccurs + 1;
End If;
End Loop While;

RETURN(numOccurs);

EXCEPTION
WHEN OTHERS THEN RAISE;

End InstrCount;

END dba_Functions_Package;

/