| |

VerySource

 Forgot password?
 Register
Search
View: 911|Reply: 4

Hybrid Programming

[Copy link]

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-3-24 08:30:01
| Show all posts |Read mode
How to embed SQL code in C?
Reply

Use magic Report

0

Threads

41

Posts

28.00

Credits

Newbie

Rank: 1

Credits
28.00

 Singapore

Post time: 2020-7-4 14:45:01
| Show all posts
Don't understand, is it not good to use the SQL statement directly to connect to the database?
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-4 16:30:01
| Show all posts
ANSI C itself does not support SQL statements, but different databases provide corresponding tools to embed SQL statements in C. As far as I know, informix, oracle, and sybase have similar tools, such as PRO C (QA000726) provided by oracle "Use Pro*C and ODBC to develop applications based on ORACLE database"), is such a tool. Of course, its syntax and compilation environment are also special, so it is not strictly C. Now database products have provided client/server development tools, the application is also quite simple, such as DbLibaray of Sybase. Unlike embedded C, client/server mode program maintenance is more convenient. For example, when there are more clients connected to a database server, is it convenient to modify the program of each client, or is it convenient to modify the program in the server? It is recommended to use client/server to develop products instead of embedding C. Of course, if the selected database product does not have a corresponding client/server development package, it is another matter!
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-7-5 14:30:01
| Show all posts
Embedded SQL statements in C, becoming the ANSI SQL standard, widely used are ANSI SQL86 and ANSI92 standards
Oracle's proc, informix and sybase's esql are all embedded compilation of SQL server (the name is forgotten)
Their compilation principle is to put SQL statement
Is similar to C/C++ code, pre-compiled into C/C++ code, and then compiled into an executable file
Each database system provides corresponding demo code examples for reference
Reply

Use magic Report

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-7-17 09:15:01
| Show all posts
Did you put some prefix in front of the embedded SQL statement?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list