Board index » cppbuilder » EMBEDDED SQL

EMBEDDED SQL


2005-10-24 06:42:46 PM
cppbuilder72
Hi,
how to use embedded SQL format in c++ builder?
 
 

Re:EMBEDDED SQL

What do you mean by embedded SQL?
Dynamic SQL?
------------------------------------------------------------------------------------------
"I sense many useless updates in you... Useless updates lead to
defragmentation... Defragmentation leads to downtime...Downtime leads
to suffering..Defragmentation is the path to the darkside.. DBCC
INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with
you" -- sqlservercode.blogspot.com/
 

Re:EMBEDDED SQL

Hi,
i wanna use embedded SQL statements in my application, would you please tell
me how?
thanks.
 

{smallsort}

Re:EMBEDDED SQL

Cenk wrote:
Quote
i wanna use embedded SQL statements in my application, would you
please tell me how?
Wrong newsgroup section. .language.cpp is for questions relating to the
C++ language, its standard libraries and non-visual VCL classes.
Newgroups guidelines suggest that if you aren't sure where to post a
question you should post it into .non-technical
In this case you are also asking a very general and open-ended question
and .non-technical is well suited for that.
Thanks.
--
Andrue Cope [TeamB]
[Bicester, Uk]
info.borland.com/newsgroups/guide.html
 

Re:EMBEDDED SQL

Hi,
How can i use embedded sql in my applicatoin? i m using BCB 5.
thanks
 

Re:EMBEDDED SQL

Cenk wrote:
Quote
How can i use embedded sql in my applicatoin? i m using BCB 5.
In your post to .cpp you spoke of 'embedded sql statements'.
Now what are you looking for ?
And what do you consider 'embedded sql' ?
Hans.
 

Re:EMBEDDED SQL

"Hans Galema" wrote:
Quote
Now what are you looking for ?
And what do you consider 'embedded sql' ?
I suppose he wants to embed SQL statements in his C++ code. If the dbms he's
using provides a preprocessor for C than he should read the manuals. If he
still needs help he should ask again in a usergroup devoted to that
particular dbms.
He has to write something like this in his C++ source:
std::string theName; // if the preprocessor understands C++, otherwise
char[20]
EXEC SQL
select name from employees into :theName where id = 12;
END SQL
Then run the C++ file through the preprocessor which translates the
statements between the exec sql and end sql tags to C statements so the file
can be compiled in normal way.
Peter
 

Re:EMBEDDED SQL

i wanna use SQL statement embedded, thats all i wanna know.
"If the dbms he's using provides a preprocessor for C " what does this mean?
i need more information please.
Thanks
 

Re:EMBEDDED SQL

"Cenk" < XXXX@XXXXX.COM >wrote:
Quote
i wanna use SQL statement embedded, thats all i wanna know.
The C++ compiler doesn't understand SQL, so your file won't compile because
of syntax errors.
Quote
"If the dbms he's using provides a preprocessor for C " what does this
mean? i need more information please.
A preprocessor is a program that reads your C++ file for EXEC SQL tags
before the file gets compiled. When it finds someone, it tries to parse the
SQL statements and translate it in the necessary C-API calls, and replace
the SQL statements. Because every dbms has it's own API every dbms has to
provide its own preprocessor. Some preprocessors can translate to more than
one programming language, eg. to Pascal too.
What dbms do you use?
Peter
 

Re:EMBEDDED SQL

i m using MSSQL Server.
 

Re:EMBEDDED SQL

"Cenk" < XXXX@XXXXX.COM >wrote:
Quote
i m using MSSQL Server.
You are out of luck :-(
msdn.microsoft.com/library/default.asp
Why do you want to use embedded SQL, and why MS SQL Server? Is this a
constraint for your application?
Peter
 

Re:EMBEDDED SQL

What do you suggest? i m using SQL server because i m kinda familiar with
it.
 

Re:EMBEDDED SQL

"Cenk" wrote:
I got 'framed' by the site of Microsoft. The link I copied and pasted was
not the page I was looking at and wanted to show to you. I wanted to show
this remark which is on many pages about MS SQL Server:
<quote MS>
Warning While the ESQL/C API is still supported in Microsoft SQL Server
2000, no future versions of SQL Server will include the files needed to do
programming work on applications that use this API. Connections from
existing applications written using ESQL/C will still be supported in the
next version of SQL Server, but this support will also be dropped in a
future release. When writing new applications, avoid using ESQL/C. When
modifying existing applications, you are strongly encouraged to remove
dependencies on ESQL/C. Instead of ESQL/C, you can use Microsoft ActiveX?
Data Objects (ADO), OLE DB, or ODBC to access data in SQL Server.
</quote MS>
(you can find this text on the item 'Programming Embedded SQL for C', right
above the item in the tree which is opened when using the link I provided
you)
Quote
What do you suggest? i m using SQL server because i m kinda familiar with
it.
Because I don't know anything about your application I can't suggest
anything. What I ment to say is that when using embedded SQL and using MS
SQL Server both are constraints for your application, one constraint should
be removed.
FWIW I dropped years ago the SQL preprocessor (for Interbase) because it
generated C wich did not compile. Since then I used component sets like IBX
and never regretted it.
Peter