Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #1987

Re: Joining MSSQL and Firebird tables

From "Willie Moore" <williem@wmconsulting.com>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Joining MSSQL and Firebird tables
Date 2011-09-09 08:26 -0500
Organization Aioe.org NNTP Server
Message-ID <j4d45j$ems$1@speranza.aioe.org> (permalink)
References (2 earlier) <j49v0a$nsd$1@news.siol.net> <j4abnn$psp$1@speranza.aioe.org> <j4akp5$472$1@news.siol.net> <j4an2f$pqb$1@speranza.aioe.org> <j4cqn5$8hi$1@news.siol.net>

Show all headers | View raw


Andrej,

The easiest way to solve your issue would be to write a stored proceedure. 
but if you want to do it all in VO you must include the entire SQL command 
in one line so it is executed as a script. Use ";" in between lines. Have 
you ever downloaded Geoff's SQLMaster. It is a very good tool to run your 
SQL scripts. It is written entirely in VO.

Regards,
Willie

// stored proceedure
cbErr := ErrorBlock({|oErr|_Break(oErr)})
begin sequence
    oConn := OpenConnection()
    oCmd := AdoCommand{}
    oCmd:ActiveConnection := oConn
    oCmd:CommandText := "exec spMyStoredProc"
    oCmd:CommandType := AdCmdText
    oRS := oCmd:Execute(nil, nil,nil)
recover using oErr
end sequence

// recordset
cbErr := ErrorBlock({|oErr|_Break(oErr)})
begin sequence
    cSQL :=  "BEGIN DISTRIBUTED TRANSACTION; "
    cSQL += " Select PART_NAZIV,PART_NASLOV from 
IBPROVIDER_FIREBIRD...TASK_LOKASTOR"
    oConn := OpenConnection()
    oCmd := AdoCommand{}
    oCmd:ActiveConnection := oConn
    oCmd:CommandText := cSQL
    oCmd:CommandType := AdCmdText
    oRS := oCmd:Execute(nil, nil,nil)
recover using oErr
end sequence

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:        <Author,,Name>
-- Create date: <Create Date,,>
-- Description:    <Description,,>
-- =============================================
CREATE PROCEDURE <spMyStoredProc>
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

    BEGIN DISTRIBUTED TRANSACTION;
    Select PART_NAZIV,PART_NASLOV from IBPROVIDER_FIREBIRD...TASK_LOKASTOR
END
GO

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Joining MSSQL and Firebird tables "andrej Terkaj" <aterkaj@task.si> - 2011-09-07 10:38 +0200
  Re: Joining MSSQL and Firebird tables "Willie Moore" <williem@wmconsulting.com> - 2011-09-07 07:36 -0500
    Re: Joining MSSQL and Firebird tables "andrej Terkaj" <aterkaj@task.si> - 2011-09-07 16:25 +0200
      Re: Joining MSSQL and Firebird tables "Willie Moore" <williem@wmconsulting.com> - 2011-09-07 10:45 -0500
  Re: Joining MSSQL and Firebird tables E®!k \\/!$$E® <nospam@nospam.url> - 2011-09-07 18:23 +0200
    Re: Joining MSSQL and Firebird tables "andrej Terkaj" <aterkaj@task.si> - 2011-09-08 10:20 +0200
      Re: Joining MSSQL and Firebird tables "Willie Moore" <williem@wmconsulting.com> - 2011-09-08 07:17 -0500
        Re: Joining MSSQL and Firebird tables "andrej Terkaj" <aterkaj@task.si> - 2011-09-08 16:31 +0200
          Re: Joining MSSQL and Firebird tables "Willie Moore" <williem@wmconsulting.com> - 2011-09-08 10:30 -0500
            Re: Joining MSSQL and Firebird tables "andrej Terkaj" <aterkaj@task.si> - 2011-09-09 12:25 +0200
              Re: Joining MSSQL and Firebird tables "Willie Moore" <williem@wmconsulting.com> - 2011-09-09 08:26 -0500
                Re: Joining MSSQL and Firebird tables "andrej Terkaj" <aterkaj@task.si> - 2011-09-13 16:27 +0200
      Re: Joining MSSQL and Firebird tables E®!k \\/!$$E® <nospam@nospam.url> - 2011-09-08 19:30 +0200
        Re: Joining MSSQL and Firebird tables "andrej Terkaj" <aterkaj@task.si> - 2011-09-09 11:57 +0200

csiph-web