Questions tagged [embedded-sql]

Embedded SQL is the term used for a method of inlining SQL statements with the source code of another programming language, called host language.

Embedded SQL is the term used for a method of inlining SQL statements with the source code of another programming language, called host language.

Examples of embedded SQL are:

111 questions
9
votes
1 answer

SQL query in Pro-C fails with Error:02115

I am getting some weird behavior of Pro-C procedure as shown below: #define BGHCPY_TO_ORA(dest, source) \ { \ (void)strcpy((void*)(dest).arr, (void*)(source)); \ (dest).len = strlen((const char *)(dest).arr); \ } #define BGHCPY_FROM_ORA(dest,…
7
votes
1 answer

Move record from Oracle array to Cobol occurs

How can I move a record from oracle to a Cobol array? When I move a single field, everything works as expected. When I try to move a record in an Oracle VARRAY I cannot get it to work. The PRO*COBOL precompiler gives the following error…
6
votes
7 answers

Is ESQL used in industry?

I'm taking a database course and I have to write a command line application. The prof wants us to write an ESQL (embed SQL) application. I have a feeling that this kind of technology is depreciated. We have to use oracle precompiler to translate a…
Guillaume Massé
  • 7,057
  • 6
  • 37
  • 54
6
votes
3 answers

What's the correct way to check sql found condition in ILE RPG?

When working with embedded SQL in RPG, you often end up with a cursor and a dow-loop for processing all rows in your result. The condition in the loop is somehow dependent on SQLCOD and/or SQLSTT, some globally available variables in an…
kratenko
  • 6,652
  • 4
  • 32
  • 57
5
votes
1 answer

PostgreSQL Cursor Re-open error in GnuCOBOL

I am trying to move from Oracle to PostgreSQL on GnuCOBOL. I have a piece of code which uses cursors and need opening a cursor multiple times. However when trying to open the cursor again I get the error ERROR: cursor "fetchtbl_c1" already exists …
Ankit Jain
  • 265
  • 2
  • 9
4
votes
2 answers

Eclipse CDT and ESQL syntax errors

I am using Eclipse CDT (Helios release) to edit the source code of an (old) C application, which also uses ESQL. In this project, by convention, files containing ESQL code have a .sc extension (instead of the default .c) All ESQL sections e.g.…
Adrian
  • 5,571
  • 9
  • 41
  • 68
3
votes
1 answer

Dynamic number of host-variables in embedded SQL

I have this code in MicroFocus COBOL: move 'select * from TABLE where a = ? and b = ? and c = ? to w-sql exec sql open cur_read_2 using :w-a, :w-b, :w-c end-exec But this select can be variable,…
Pavel Matras
  • 291
  • 1
  • 4
  • 13
3
votes
1 answer

How to get previous executed sql in informix

On my esql program when an sql fails and generates the exception I want to print the SQL that generated the exception. For that I need to find out how to get the previously executed SQL. I am running informix 11.5. I tried the following but nothing…
Ramanan T
  • 31
  • 2
3
votes
2 answers

How can I write a shell script program to go through all my esql files and then execute that file to create exe files

This is what I mean: ls -l *.ec For each result found, I would like to compile it one at a time. e.g., for $something.ec: esql $something.ec -o $something $something.ec is original file $something is target exe file. My question is: how can I put…
3
votes
1 answer

Need help copying c-strings from embedded SQL fetch to another c-string in a separate struct

I've hit a wall with a program that uses embedded SQL to fetch rows from a database table, stores the row data in a struct, and then has that data processed with results being stored in another struct and pushed to a linked list. The struct that…
PSUlion01
  • 115
  • 2
  • 10
2
votes
0 answers

EXEC SQL DECLARE variable in .h header files preprocessed by Oracle pro*c

I am porting some C++ code with embedded SQL into a linux server with oracle database. The data Access Objects are C++ classes providing .select() .insert() .findByPrimaryKey() etc, methods for database interactions. This is the testdao.h header…
ProC-Guy
  • 21
  • 2
2
votes
0 answers

Access violation in postgres embedded sql libecpg.dll when pulling network cable

I have a connection from a postgres client (Windows 7) to a remote Postgres server (Ubuntu) - Postgres version 9.5. The postgres client is a c-program using embedded sql (libecpg.dll). When I pull the network cable after the connection is…
walter t
  • 21
  • 2
2
votes
1 answer

Must declare scalar variable when using parameterized sql query

I am trying to access a SQL database using embedded SQL in VBA. The problem is in defining the conditions of what I want to access ( ID > @Identifie is the part causing the problem). When I run the code, I get Must declare the scalar variable…
2
votes
3 answers

embedded sql in C

I've been attempting to write embedded SQL statements for DB2 that ultimately gets compiled in C. I couldn't find a tutorial or manual on the embedded SQL syntax for C for reference. One case I would like to do is to insert data into a table. I…
user38781
  • 21
  • 2
2
votes
1 answer

Convert float to decimal in Informix

I have a table with a column of type decimal. There is a ESQL/C structure that represents the table. It has a member of type decimal. I also have a normal C structure for equivalent for the same table. The type of the above mentioned field is a…
prabhu
  • 841
  • 1
  • 11
  • 26
1
2 3 4 5 6 7 8