C Text Processing to SQL Problem !!

Updated on workplace 2024-02-09
10 answers
  1. Anonymous users2024-02-05

    String together the content with a delimiter, and then pass the result to a stored procedure for processing. This storage process is broken out one by one according to the split separator, and the judgment is added (insert the school table if there are schools, insert the grade chart if it contains ages, and insert the class table if it contains classes).

  2. Anonymous users2024-02-04

    There's a tutorial above, learn it yourself, or you can't do it.

  3. Anonymous users2024-02-03

    Forehead.. Do you have to change the data type first, then use case when to determine the lower length, len() function, and then add 0

  4. Anonymous users2024-02-02

    Do you turn in SQL or C.

  5. Anonymous users2024-02-01

    If you want to paste it into a text file, then the SQL query result is displayed in the form of text, and you can paste it directly, which is neat.

  6. Anonymous users2024-01-31

    That's because you install or uninstall the software! No problem

  7. Anonymous users2024-01-30

    Tan Haoqiang's "C Programming".

  8. Anonymous users2024-01-29

    This young man is really impatient.

    Connect to the sample database and query the FirstName information whose lastname is Johnson.

    #include

    #include

    #include

    #include ""

    #include

    exec sql include sqlca; (1)

    main()

    Above is a simple application statically embedded with SQL statements. It includes the main parts of embedding SQL:

    1) defines and describes the structure of SQLCA. SQLCA is used for communication between the application and the database, where SQLCode returns the result status after the SQL statement is executed.

    2) The host variable is defined between begin declare section and end declare section. The host variable can be referenced by either an SQL statement or a C statement. It is used to pass the data in the program to the database manager through SQL statements, or to receive the results of queries from the database manager.

    In SQL statements, the primary variables are preceded by a ":" flag to indicate the difference.

    3) Connect must be done before each access to the database to connect to a certain database. At this point, you should ensure that the DB instance is already up.

    4) is a choice statement. It finds the firstname of the row data whose lastname is "johnson" in the employee table and puts it in the firstname variable. The statement returns a result.

    Multiple results can be returned via a cursor. Of course, it can also contain update, insert, and delete statements.

    5) Finally, disconnect the database.

    As you can see from the above example, each embedded SQL statement starts with exec SQL, indicating that it is an SQL statement. This is also what tells the precompiler in exec sql and "; is embedded in SQL statements. If an embedded SQL statement occupies more than one line, you can use the line continuation "" in the C program

  9. Anonymous users2024-01-28

    Find information in it, it's best to look at the source**. Learn the fastest!

    Generally, you can use the cdatabase and crecordset classes to achieve the function you want.

    Two examples of database programming.

    Both examples are connected to databases, one using the ODBC API and the other using the cdatabase class. The program is triggered by a button, compiled by VC++, and the database is SQL.

    api:sqlreturn sr;

    sqlhandle hodbcenv;

    sqlhandle hdbconn;

    sqlchar sqlstate[6];

    sqlinteger nativeerror;

    sqlchar errmsg[sql_max_message_length];

    int i = 1;

    char szdsn =

  10. Anonymous users2024-01-27

    Menu-Tools-Options-Query Results has a default output method setting.

Related questions