In Oracle, how we can make database file?

I just recently started a migration from C/C++ file i/o to using database like sql and oracle.?

  • Some one gave me link to the following code. The code is straight forward and understandable except from the stated line. Can any one explain the unclear line to me. #include <stdio.h> // for printf #include <SQLAPI.h> // main SQLAPI++ header int main(int argc, char* argv[]) { SAConnection con; // connection object SACommand cmd; // create command object try { // connect to database (Oracle in our example) con.Connect("test", "tester", "tester", SA_Oracle_Client); // associate a command with connection // connection can also be specified in SACommand constructor cmd.setConnection(&con); //I dont uderstand this line what does fid and fvarchar20 and fblob mean.// create table cmd.setCommandText( "Create table test_tbl(fid integer, fvarchar20 varchar(20), fblob blob)"); cmd.Execute(); // insert value cmd.setCommandText( "Insert into test_tbl(fid, fvarchar20) values (1, 'Some string (1)')"); cmd.Execute(); // commit changes on success con.Commit(); printf("Table created, row inserted!\n"); } catch(SAException &x) { // SAConnection::Rollback() // can also throw an exception // (if a network error for example), // we will be ready try { // on error rollback changes con.Rollback(); } catch(SAException &) { } // print error message printf("%s\n", (const char*)x.ErrText()); } return 0; }

  • Answer:

    This command creates a table named test_tbl. This table has three fields fid (type = integer) fvarchar20 (type = varchar(20) a text field maximum characters in length) fblob (type = blob). With blob you can store i.e. images in the database. Here are some more examples and explanations about the CREATE TABLE command in ORACLE: http://www.adp-gmbh.ch/ora/sql/create_table.html

Gbenga at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

This command creates a table named test_tbl. This table has three fields fid (type = integer) fvarchar20 (type = varchar(20) a text field maximum characters in length) fblob (type = blob). With blob you can store i.e. images in the database. Here are some more examples and explanations about the CREATE TABLE command in ORACLE: http://www.adp-gmbh.ch/ora/sql/create_table.html

MichaelI...

The code before that is establishing a remote socket connection over the network. Then the idea is to open a remote file, to create you table on. The parameters are the fields or columns of the table you want to create. They are arbitrary and up to you, however the first is always fid integer because that is the unique key for each row entry later.

Motorhead

The code before that is establishing a remote socket connection over the network. Then the idea is to open a remote file, to create you table on. The parameters are the fields or columns of the table you want to create. They are arbitrary and up to you, however the first is always fid integer because that is the unique key for each row entry later.

Motorhead

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.