Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to process SQL statement by Database Server not by BDE or Delphi?

Posted on 1998-09-09
5
Medium Priority
?
249 Views
Last Modified: 2013-11-23
I'd like to code SQL statement and process it by Database Server but now I must code it in Delphi SQL statement or SQL-92. Am I right?    
0
Comment
Question by:ceds98
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 10

Expert Comment

by:Lischke
ID: 1339206
I don't get your question currently. If I understand you right you want to know whether and how you have to use SQL statements in Delphi. Is this correct? if not, please clarify your question a bit.

Ciao, Mike
0
 
LVL 10

Accepted Solution

by:
Jacco earned 150 total points
ID: 1339207
You can set the properties of an alias to SHARED AUTOCOMMIT (which I believe is the default). Then you can code any SQL statement your DB understands. (The passthrough SQL will be automatically commited).

You can setup your Database component so that the BDE doesn't parse your SQL statements.

Delphi SQL is very useful very say Paradox databases which don't support SQL. You can use the SQL of your server (which could be SQL-92).

Be careful though. The BDE decides wether a statement is passthrough or not, and sometimes a complex SQL statement get interpreted wrong by the BDE. What you can do is setup a special DataBase component for passthrough and one for normal SQL.

(Do you use IntrBase? I have a lot of examples for that one!)

Regards Jacco.
0
 

Author Comment

by:ceds98
ID: 1339208
I do not understand how to set that Jacco told me. And I set like this  pls tell me what's wrong.

I set 2 BDE aliases to the same instance(database) of ORACLE  
    Properties of 2 BDE
aliasname               PIS                    THRUPIS  
SQL passthroughmode     Shared autocommit      Not Shared

and I have 2 database components
    Properties of 2 database components
databasename            dbPIS                  dbTHRUPIS
alias                   PIS                    THRUPIS

and I have 2 TQuery
    Properties of 2 Tquery components
database                dbPIS                  dbTHRUPIS
SQL             SQL statement in SQL-92 format
                                   SQL statement in ORACLE format

But the second query failed. How to write the SQL statement in ORACLE format and process it by ORACLE not by BDE?  
0
 
LVL 1

Expert Comment

by:EmmDieh
ID: 1339209
How does the second query fail ?
I suppose that you have to use explicit transaction control
with DataBase.StartTransAction and DataBase.Commit.

0
 

Author Comment

by:ceds98
ID: 1339210
Forget my above comment. My sql statement failed because its complex so I applied some tricks with it and it work fine.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question