![]() Printf("! require CNCTSTRING env variable\n") ĮXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error-\n") * read Connection String from environment - or, it could have been hardcoded here */ * Oracle Pro*C includes from $ORACLE_HOME/precomp/public */ Here is the code of the source Pro*C file : The Compilation script specifies the LD_LIBRARY_PATH and the Paths to the Include (.h Header) files. Gcc instancedbinfo.c -o instancedbinfo -L /opt/oracle/product/19c/dbhome_1/lib -l clntsh ![]() LD_LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include:/usr/include/linux:/opt/oracle/product/19c/dbhome_1/precom/lib:/opt/oracle/product/19c/dbhome_1/libĬ_INCLUDE_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include:/usr/include/linux:/opt/oracle/product/19c/dbhome_1/precom/lib:/opt/oracle/product/19c/dbhome_1/lib:/opt/oracle/product/19c/dbhome_1/precomp/publicĮcho "*****PreCompile Pro*C program file"Įcho "*****Compile using C Compiler and specifying Oracle Client library file libclntsh.so" ![]() Here is the code for the two shell scripts : The file "instancedbinfo.pc" is my Pro*C source code. ![]() This is ORCLPDB1 database running in READ WRITE mode since 01-MAY-21 05.55.21.573 PM 08:00 1 oracle oinstall 14424 May 1 18:15 instancedbinfoĪt ORCLCDB which is on oracle-19c-vagrant running 19.0.0.0.0 and is OPEN, started at 01-MAY-21 17:54:52 1 oracle oinstall 11875 May 1 18:15 instancedbinfo.c 1 oracle oinstall 0 May 1 18:15 instancedbinfo.lis *****Compile using C Compiler and specifying Oracle Client library file libclntsh.so System default option values taken from: /opt/oracle/product/19c/dbhome_1/precomp/admin/pcscfg.cfg 1 oracle oinstall 356 May 1 18:15 Run_my_ProC.SH 1 oracle oinstall 786 May 1 18:14 Compile_my_ProC.SH 1 oracle oinstall 2255 May 1 18:07 instancedbinfo.pc Here is a quick demo with the command line display and then the actual code below. Of course, you need the Pro*C Developer Licence to use this product. You can execute ":help new-filetype" for more information.Oracle also ships a Pro*C Precompiler that can convert a Pro*C source file to a C source file which can then be compiled using a C Compiler (e.g using "gcc"). What I did was create the file $HOME/.vim/filetype.vim with these contents:Īu! BufRead,BufNewFile *.pc setfiletype proc Essentially it loads up the C syntax file, and then does additional highlighting of text that begins with EXEC SQL.ĭrop this file into your $HOME/.vim/syntax directory, and then set up the new filetype for *.pc to load proc.vim. This is a start towards a customization of the C syntax, for code that uses the Oracle Pro*C/C precompiler code. ![]() You can get the same functionality with esqlc.vim in the standard distribution. Note: I have recently learned that this syntax is redundant. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |