Compiling embedded SQL into a Win32 program using PRO*C/C++

Hello,
I have desperately been trying to precompile a Win32(C++) including embedded SQL with the pro*c editor. When I try to build my project I get linker errors telling me that sqliem was already declared in sqlcpr.h (which it wasn't). And I only seem to get these errors when I try to declare external variables or files in my program.
Any help would be greatly appreciated.
THANKS!!

Hi,
I hadn't got errors.
Bit, i solved my problem using dynamic sql.
exemple:
void function(char name[50]){
EXEC SQL BEGIN DECLARE SECTION;
char *varsql;
EXEC SQL END DECLARE SECTION;
char toto[150]="CREATE TABLE test AS SELECT * FROM tutu WHERE employe='";
varsql=strcat(toto,name);
strcat(varsql,"'");
EXEC SQL EXECUTE IMMEDIATE :varsql;
I hope that could help somebody.
Bye and thank you for your answer.
Edited by: 899981 on 20 déc. 2011 05:28

Similar Messages

  • How to store txt file into Oracle 7 Database using Pro*C

    Hi,
    I want to store a txt file into Oracle 7 database table using
    Pro*C application. But do not know what type of column to use.
    At first glance it appeared to me as LONG can serve the purpose
    but later I noticed that I can not do the sequential read/write
    in LONG type of column. That is, I have to use chunks of max of
    2GB (or file lenght) to read/write into such columns.
    I want something simiar to CLOB of Oracle 8.
    I would appreciate if you can provide me solution.
    Thanks,
    Anurag

    You store images in a BLOB column in the database.
    However, inserting image in that column and displaying data/image from that column are 2 very different tasks.
    If you are using Oracle forms, displaying is easy. Default block sitting on the table with BLOB column, can be easily mapped to image box (or similar control), which will display that image.
    Inserting images will be a different ball game. If your forms are web based (i.e. run from browser) and you want to insert images from client machine, some special arrangements are required.
    If images are on database server and you want to insert them in database, the stored procedure given in the earlier thread (posted above) will do the job.

  • How do I break a pdf into smaller pdf files using Pro?

    How do I make a smaller pdf (i.e. pgs 17-22) from a larger pdf file using Adobe Acrobat Pro?

    It would help if you told us what version of Acrobat Pro you have. (The interface changed substantially in Acrobat X Pro.)
    If you're using Acrobat 9 Pro or Acrobat 8 Professional, choose Document > Extract Pages.

  • How can I translate this from PL/SQL into embedded SQL!?

    CURSOR TEMP1 is
    SELECT emp.fname fname, emp.lname lname, emp.ssn, dname,emp.salary salary, emp1.fname supervisor_fname, emp1.minit supervisor_mdlname,emp1.lname supervisor_lname FROM employee emp, employee emp1,department d
    WHERE emp.superssn=emp1.ssn(+) and emp.dno=dnumber order by ssn;
    PNTR_TEMP1 TEMP1%ROWTYPE;
    --calcualting values for the cursor TEMP1
    for PNTR_TEMP1 in TEMP1 loop
    fname:= PNTR_TEMP1.fname;
    lname:= PNTR_TEMP1.lname;
    ssn := PNTR_TEMP1.ssn;
    dname:=PNTR_TEMP1.dname;
    sup_name:=PNTR_TEMP1.supervisor_fname||' '|| PNTR_TEMP1.supervisor_mdlname||' '||PNTR_TEMP1.supervisor_lname;
    salary := PNTR_TEMP1.salary;
    n_deps:=0 ;
    /* how can I translate this to embedded SQL...I'm using C++*/

    Hi,
    you can follow this link to use cursor in Pro*c /C++
    http://www.csee.umbc.edu/help/oracle8/server.815/a68022/sql.htm
    Regards

  • Passing arguments into main program using eclipse

    If I want to pass a file into my Main program using "file redirection" I would do the following when running my program from the command prompt:
    C:\ MainProgram < inputfile.txt
    How do I do this using Eclipse SDK(WinXP)? I have investigated the options for passing in "Program Arguments" and still can't figure it out. Can anyone please help? What do I type in the Program Arguments text box?
    Thank you,
    Mark

    Well, input redirection is a shell thing, so Eclipse may not support it like that. (Maybe it does, somehow, but if it does it's just aping shell behavior for convenience.)
    What I'd suggest, is to create an option to your program to read a specified file. Maybe something like
    MainProgram -input intputfile.txt
    Then give that as an argument in Eclipse.
    If this is for testing purposes, another option is to create a test class, and hardcode the filename in there.

  • Embedded SQL blues

    I have some embedded SQL in a C program in UNIX (PRO*C). I've been trying to make what I thought was a simple enhancement, but I'm totally stumped at why I'm getting the results (or lack thereof) I'm getting. I added the below statement to the code in order to get an additional piece of data:
    EXEC SQL
    SELECT format_id_desc
    INTO :gtd_struct[j].format_id_desc
    FROM label_format
    WHERE format_id = :gtd_struct[j].format_id;
    I added some debug code to verify that the gtd_struct[j].format_id is indeed set to a valid value. And using that value, I can go into PL/SQL Developer and run the SQL statement against the same data, and the proper results display. But when I compile and link the C program, then run, I keep getting ORA-1403 (no data found) errors. I'm absolutely stumped as to why this is the case. Is there something else I can check, like possibly the C file that resulted from precompiling the .PC file, and if so, what could I check to see if anything strange is happening? Thank you for any help that you could give.

    What if you declare a VARCHAR type C variable (note that is Pro*C type VARCHAR not the SQL or PL/SQL type) of same size as gtd_struct[j].format_id
    and initialize that with the value of gtd_struct[j].format_id and use that in your where clause instead?
    EXEC SQL BEGIN DECLARE SECTION ;
    VARCHAR l_format_id[5] ;
    EXEC SQL END DECLARE SECTION ;
    strcpy (l_format_id.arr, gtd_struct[j].format_id) ;
    l_format_id.len = strlen(l_format_id.arr) ;
    /* now use l_format_id in your where clause of the query and see what happens? */
    .

  • Copy standard giu status into user defined program

    how to copy stanadard gui-status 'STANDARD' into user defined program using se41

    Hi,
    Open Se41,
    Give the standard program's name and the GUI Status Name.
    Click on COPY button.
    Now enter your ZPROGRAM name and desired GUI STATUS Name in the popup that appears.
    Hope its done.

  • Native Compiled PL/SQL on WindowsXP (Visual Studio)

    Has anyone tried to native compile PL/SQL packages on Windows XP using Visual Studio?
    Please give me your values for PLSQL* initialization parameters and a makefile that works.
    /Hakan

    Hi,
    Sorry to bump this thread, but I would like to validate something.
    Is it possible, or does it make sens, to have a database that has both native and interpreted?
    Our PLSQL_CODE_TYPE is set to interpreted but everthing else is configured for native.
    When i do the bellow query:
    select type, plsql_code_type, count(*)
    from dba_plsql_object_settings
    where plsql_code_type is not null
    group by type, plsql_code_type
    order by type, plsql_code_type
    We have bunch of functions in native/interpreted, same thing for package, package body, procedure, trigger, type, type body.
    Thank you,
    Felix

  • Error using PRO C++

    Folks, im making a program using PRO C++, but i receiving this
    error:
    Error occured..err_handler() -> ORA-01480: trailing null missing
    from STR bind value....
    I think it is caused by a OUT variable....

    No need to specify the length if the data type is number and pointing to Long.
    You can directly map the values using INTO clause.

  • Program using Xalan 1.10 doesn't compile

    Hi all,
    I have to port some server code from Windows to Solaris. Normaly this works fine, but now I have a problem using Xalan 1.10.
    Platfrom: SunOS sun4 5.8 Generic_108528-24 sun4u sparc SUNW,Ultra-80
    Compiler: Sun C++ 5.7 Patch 117830-07 2006/03/15
    By including a Xalan header and compile it with "CC -I/opt/xalan/src -I/opt/xerces/src -library=stlport4 xalan.cpp" I got the errorlist below.
    Without stlport4 it compiles. I have to use this library, because I am using boost and I have had only success building the boost stuff with stlport4.
    Do I have to modify the Xalan header? Has anybody some suggestions?
    Thanks for your help
    Arno
    Here is the example code:
    #include <xalanc/XalanTransformer/XalanTransformer.hpp>
    int main ()
    return 0;
    Here are the error messages from the compiler:
    "/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 102: Error: Too many arguments for template std::reverse_iterator<xalanc_1_10::Type*, std::random_access_iterator_tag, xalanc_1_10::Type>.
    "/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 1101: Where: While specializing "xalanc_1_10::XalanVector<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>".
    "/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 1101: Where: Specialized in non-template code.
    "/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 106: Error: Too many arguments for template std::reverse_iterator<const xalanc_1_10::Type*, std::random_access_iterator_tag, const xalanc_1_10::Type>.
    "/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 1101: Where: While specializing "xalanc_1_10::XalanVector<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>".
    "/opt/xalan/src/xalanc/Include/XalanVector.hpp", line 1101: Where: Specialized in non-template code.
    "/opt/xalan/src/xalanc/Include/XalanDeque.hpp", line 186: Error: Too many arguments for template std::reverse_iterator<xalanc_1_10::XalanDequeIterator<xalanc_1_10::XalanDequeIteratorTraits<xalanc_1_10::Value>, xalanc_1_10::XalanDeque<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>>, std::random_access_iterator_tag, xalanc_1_10::Type>.
    "/opt/xalan/src/xalanc/XPath/XalanQName.hpp", line 73: Where: While specializing "xalanc_1_10::XalanDeque<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>".
    "/opt/xalan/src/xalanc/XPath/XalanQName.hpp", line 73: Where: Specialized in non-template code.
    "/opt/xalan/src/xalanc/Include/XalanDeque.hpp", line 190: Error: Too many arguments for template std::reverse_iterator<xalanc_1_10::XalanDequeIterator<xalanc_1_10::XalanDequeConstIteratorTraits<xalanc_1_10::Value>, xalanc_1_10::XalanDeque<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>>, std::random_access_iterator_tag, const xalanc_1_10::Type>.
    "/opt/xalan/src/xalanc/XPath/XalanQName.hpp", line 73: Where: While specializing "xalanc_1_10::XalanDeque<xalanc_1_10::Type, xalanc_1_10::ConstructionTraits>".
    "/opt/xalan/src/xalanc/XPath/XalanQName.hpp", line 73: Where: Specialized in non-template code.
    4 Error(s) detected.

    On Solaris, Posix threads are implemented on top of native threads; the interfaces are different. There are no conflicts between the two libraries or their interfaces. You can mix Posix and native thread usage.
    libCstd and STLport are different implementations of the same interface. The size and layout of the standard types are different. The names of the standard functions are the same, but the definitions of those functions are different.
    Suppose both parts of the program use the standard string class. One part was compiled for use with libCstd, and creates the libCstd version of a string object. If that object gets passed to the part of the program compiled for use with STLport, it will have a different idea of how the class is defined.
    If you link both libCstd and libstdlport to the program, all the standard objects (like cin and cout) and functions (class members and free functions) will have the same names. You wil pick up the version from whichever library is linked first. Calling libCstd function on an STLport object won't work, and neither will the reverse.
    Finally, recall that much of the standard library consists of inline functions. The bodies of those functions are embeded in the .o files of your application code. The application code will therefore depend on a particular layout of standard class objects; the layout is different in the two libraries.
    We have not made a serious effort to compile BOOST using libCstd -- much of BOOST depends on too many missing features. Some suggestions:
    1. You can try experimenting with BOOST configuration macros and see if you can get the code to compile.
    2. You could wirte your own version of the BOOST components you are using, removing dependencies on features that are not in libCstd.
    3. You could ask the 3rd-party library supplies to provide a version compiled with -library=stlport.

  • Could we use embedded SQL for XML in .pc ?

    Hi,
    Can we use embedded SQL for XML in .pc ?
    <1> assume we have run SQL statements in Oracle9i:
    SQL>create table MY_XML_TABLE
    (Key1 NUMBER,
    Xml_Column SYS.XMLTYPE);
    SQL>insert into MY_XML_TABLE(key1, Xml_Column) values
    (1, SYS.XMLTYPE.CREATEXML
    ('<book>
    <chapter num="1">
    <text>This is the my text</text>
    </chapter>
    <book>')
    <2> Could we directly translate it in .pc as usually:
    <outlined, not exactly)
    int emp_number = 1;
    XML_Data emprec; /* ?????? */
    EXEC SQL SELECT M.Xml_Column.GETCLOBVAL() as XML_Data
    INTO :emprec INDICATOR :emprec_ind
    FROM MY_XML_TABLE M
    WHERE Key1 = :emp_number;
    Thanks
    MJ

    reply by myself.
    No problem!!
    ===============================
    int emp_number = 1;
    struct emprec{
    char feature[1280]
    EXEC SQL SELECT M.Xml_Column.GETCLOBVAL() as XML_Data
    INTO :emprec INDICATOR :emprec_ind
    FROM MY_XML_TABLE M
    WHERE Key1 = :emp_number;

  • When I try to open an embedded PDF file I get an error "The program used to create this object is AcroExch.exe.

    When I try to open an embedded PDF file (Word doc) I get an error "The program used to create this object is AcroExch.exe. That program is either not installed on your computer, or is corrupt..."  I've tried  about everything from unchecking
    protected mode at startup to removing & reinstalling Adobe.  Nothing seems to fix this issue.  Any other ideas?
    This is happening on Adobe reader 9, 10 & 11 with MS Word 2010 & 2013.  I've uninstalled, cleaned & reinstalled Reader 9, 10 & 11, as well as Acrobat 10 Pro & 11 Standard.  Removed "Protected mode at startup, and changed
    the default program for viewing from reader to Acrobat.  This will not go away.  It is affecting production at our company.

    " Help > Troubleshooting Information > Profile Directory: Open Containing Folder" . i can't find open containing folder in profile directory. it does give me the option to open the places.sqlite file using graphic converter. when i try that, graphic converter gives me a window saying that it can't be opened because it is corrupted or is not a file type supported by graphic converter.
    i appreciate your help with a workaround to get the old bookmarks. that works. however, the problem has morphed from that concern to why adobe reader [the default app.] won't open firefox .sqlite files. is the problem in adobe reader or firefox? also, how can i tell if the places.sqlite file is corrupt?
    i'm getting in over my head here and do appreciate your help.

  • Can window and aggregate SQL functions used in Pro*C embedded SQL?

    It appears that the window functions such as dense_rank() over(partition by ... order by ...) are not available in Pro*C embedded SQL. Can somebody please confirm that that is really the case?
    Thanks
    Rawender Guron

    Please refer to this thread: "Is this forum also used for Pro*'C Questions? "
    Is this forum also used for Pro*'C Questions?

  • Hi. I recently got a new computer and transferred all my files across using TimeMachine. Whenever I try to sign into any CC program (including CC) the program instantly shuts down and an Apple error message comes up. I have uninstalled and reinstalled CC

    Hi. I recently got a new computer and transferred all my files across using TimeMachine. Whenever I try to sign into any CC program (including CC) the program instantly shuts down and an Apple error message comes up. I have uninstalled and reinstalled CC twice with no avail and deleted every Adobe product on my computer and nothing is working.

    I have seen similar discussions before... transferring does not work, you must install
    Discussions of RE-installing
    -http://forums.adobe.com/thread/1408331?tstart=0
    -http://forums.adobe.com/thread/1398961?tstart=0
    -and http://helpx.adobe.com/creative-cloud/help/install-apps.html
    -using the cleaner after uninstalling and before reinstalling will usually help
    -http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html

  • Use of Pro*C with embedded SQL

    Is it possible to reuse existing Pro*C with embedded SQL written for an Oracle 9i database on an Oracle Lite running on Windows CE/PocketPC plattform? Wich steps and tools are required to transform (compile, precompile) this code?
    Can the functionality then be easily accessed from java code?
    Thanks in advanced!

    Oracle already did. Pradeep is an Oracle developer working in Oracle9i Lite group. This is this Product Manager speaking

Maybe you are looking for