Solved

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

Posted on 1998-09-09
5
246 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 50 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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