Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1998-09-09
5
Medium Priority
?
250 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
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

927 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