Subject | Re: Creating triggers/procedures using ASP/ODBC |
---|---|
Author | whyzzi |
Post date | 2002-08-16T21:10:50Z |
--- In ib-support@y..., "whyzzi" <whyzzi@y...> wrote:
An example then, for the archives:
<!-- #include file = "inc/header.asp" -->
<%
Dim adoCn 'As adoDb.Connection
Dim sqls 'As String
Set adoCn = Server.CreateObject("ADODB.Connection")
adoCn.ConnectionString = "DRIVER={XTG Systems Interbase6 ODBC
Driver};" _
& "DB=localhost:C:\sum\database\links.fdb;" _
& "UID=sumuser;" _
& "PWD=sumpass;" _
& "CHARSET=WIN1250;" _
& "ROLE=;"
adoCn.Open
sqls = "CREATE PROCEDURE SELECTCLKS_N (start INTEGER, num
INTEGER)" & VBCrLf _
& "RETURNS (total INTEGER, lid INTEGER)" & VBCrLf _
& "AS " & VBCrLf _
& "DECLARE VARIABLE icounter INTEGER;" & VBCrLf _
& "BEGIN" & VBCrLf _
& " icounter = 0;" & VBCrLf _
& " FOR SELECT COUNT(lid) as total, lid FROM link_clicks GROUP
BY lid ORDER BY 1 DESC" & VBCrLf _
& " INTO :total, :lid" & VBCrLf _
& " DO " & VBCrLf _
& " BEGIN" & VBCrLf _
& " IF (icounter = :start + :num) THEN EXIT;" & VBCrLf _
& " ELSE" & VBCrLf _
& " IF (icounter >= :start) THEN SUSPEND;" & VBCrLf _
& " icounter = icounter + 1;" & VBCrLf _
& " END" & VBCrLf _
& "END"
adoCn.Execute(sqls)
%>
<!-- #include file = "inc/footer.asp" -->
> Hi. I've been writing web base links database application, and I wasvia
> wondering how I might create triggers and procedures via web
> pages/odbc instead of using the isql client in firebird/interbase.
>
> I'm currently using the XTG ODBC driver, and use direct sql calls
> subroutines/functions.advance.
>
> An example in ASP would be greatly appriciated, and thanks in
An example then, for the archives:
<!-- #include file = "inc/header.asp" -->
<%
Dim adoCn 'As adoDb.Connection
Dim sqls 'As String
Set adoCn = Server.CreateObject("ADODB.Connection")
adoCn.ConnectionString = "DRIVER={XTG Systems Interbase6 ODBC
Driver};" _
& "DB=localhost:C:\sum\database\links.fdb;" _
& "UID=sumuser;" _
& "PWD=sumpass;" _
& "CHARSET=WIN1250;" _
& "ROLE=;"
adoCn.Open
sqls = "CREATE PROCEDURE SELECTCLKS_N (start INTEGER, num
INTEGER)" & VBCrLf _
& "RETURNS (total INTEGER, lid INTEGER)" & VBCrLf _
& "AS " & VBCrLf _
& "DECLARE VARIABLE icounter INTEGER;" & VBCrLf _
& "BEGIN" & VBCrLf _
& " icounter = 0;" & VBCrLf _
& " FOR SELECT COUNT(lid) as total, lid FROM link_clicks GROUP
BY lid ORDER BY 1 DESC" & VBCrLf _
& " INTO :total, :lid" & VBCrLf _
& " DO " & VBCrLf _
& " BEGIN" & VBCrLf _
& " IF (icounter = :start + :num) THEN EXIT;" & VBCrLf _
& " ELSE" & VBCrLf _
& " IF (icounter >= :start) THEN SUSPEND;" & VBCrLf _
& " icounter = icounter + 1;" & VBCrLf _
& " END" & VBCrLf _
& "END"
adoCn.Execute(sqls)
%>
<!-- #include file = "inc/footer.asp" -->