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:

112 questions
0
votes
1 answer

Using Host Array in Open Cursor in Embedded SQL

I have this embedded SQL code: EXEC SQL OPEN MY_CURSOR USING :a1 END-EXEC Where a1 is Array with 20 items, but I don't know in forward how many Host Variables I will need. It can be from 1 to 20. If I use it in this way, and actually I am using…
Pavel Matras
  • 329
  • 1
  • 5
  • 13
0
votes
1 answer

mysql.h compile, but not its functions

I am trying to see how to embed sql code in a C program, but I have an issue I am not able to understand when I compile this code : #include #include #include MYSQL *mysql; MYSQL_RES *results; MYSQL_ROW…
Antoine
  • 71
  • 1
  • 5
0
votes
0 answers

How to call an esql/c program from Java directly

I am having a requirement to check the feasibility of being able to call ESQL/C programs directly from java. These ESQL applications are deployed in Linux and can be spawned multiple instances. Currently they are being called from .NET via Camel…
djyo02
  • 27
  • 1
  • 11
0
votes
1 answer

Precompile embedded sql in c on ubuntu linux db2 does not work

I asked before but it looks like its not me, its the system.. My db2 installation completed with "minor errors" so maybe that is it. I can't make out the error code explanations. The content of the folder: prog1.sqc sh.sh I gave DBADM authority to…
Nikica
  • 21
  • 5
0
votes
0 answers

Header files not recognized in PROC compiler 12.2 even with SYSHDRS in mkmf of HP-U

I am using the Pro*C 12.2 precompiler. I have a .c file which is using free(), but string.h is not included in the .c, .h or .pc files. The Makefile has SYSHDRS= /usr/include other files, but not string.h. The executable after compilation is working…
0
votes
2 answers

How to solve or start solving DB2 problem?

When I try to pre-compile my DB2 Cobol application that contains embedded SQL statements, I get this error in my SYSTERM file: ********************************* TOP OF DATA ********************************** DSNH527I W DSNHOPTS THE PRECOMPILER…
chustar
  • 12,225
  • 24
  • 81
  • 119
0
votes
4 answers

Embedded SQL in RPGLE performance in Update

When updating date/time fields in a file using embedded SQL in an RPGLE program I can use either CURRENT_DATE/CURRENT_TIME or store the current date/time value into a host variable. And use this host for assignign. Now I wonder which way is the…
Radinator
  • 1,048
  • 18
  • 58
0
votes
1 answer

SQL Server stored procedure in embedded SQL with host variables

In MicroFocus Cobol I am creating a stored procedure with using host variables. SQL code is this: CREATE PROCEDURE dbo.LLPSY_PK1_BPS_PROC_INDEX AS BEGIN IF EXISTS (SELECT * FROM sysobjects WHERE id =…
Pavel Matras
  • 329
  • 1
  • 5
  • 13
0
votes
1 answer

UPDATING an IMAGE column in Sybase with PREPARED statement fails

This is with ASE 15.7 and ESQL/C. Updating a row in a CURSOR with a prepared statement: EXEC SQL BEGIN DECLARE SECTION; CS_IMAGE image[512]; EXEC SQL END DECLARE SECTION; strcpy(image, "foo"); EXEC SQL PREPARE updt FROM "UPDATE image_test SET…
guru
  • 147
  • 2
  • 13
0
votes
2 answers

Getting record set from SQL on Ibm i

So, I am trying to modernize the code on my IBM i, and I am thinking about subfiles and printfiles. Excluding native I/O opperations, I can think of three ways to get my data to populate using embedded SQL. Cursor Fetch method MultiOccurance data…
Jeff
  • 329
  • 3
  • 13
0
votes
1 answer

Ingres fetching select into SQLDA

I am trying to use Embedded SQL in C to fetch rows from an Ingres database and return the results into the SQLDA structure. I will be selecting ints, longs and strings. So far my program fetches the strings fine, but I have issues with the ints…
Zooloo10
  • 45
  • 1
  • 8
0
votes
0 answers

What is "SystemDBConnection"

I've to fix a problem in an old ANSI C program witch make use of Microsoft Embedded Precompiler (nsqlprep). I come across the following line of code: EXEC SQL CONNECT TO :DBName AS SystemDBConnection USER :DBLogin; In the source it isn't defined,…
Flynn
  • 1
0
votes
1 answer

Can I use an SQL DECLARE section at global scope in Pro*C?

I am trying to port a ~2000 line Pro*C program to C++ (Pro*C++). It is full of global variables being used as host variables in SQL queries: char var1; char var2; int execute_query() { // some code EXEC SQL SELECT ... INTO :var1 EXEC…
Hassaan
  • 253
  • 4
  • 13
0
votes
1 answer

is precompilation necessary when switching DB2LUW node?

Embedded SQL application for DB2LUW is developed in following steps: db2 prep db2 bind Assume we have 2 DB2LUW nodes and DDL are identical for both nodes. When switching DB2LUW node, is precompilation for new node necessary? Or is it possible to…
A.Onita
  • 3
  • 1
0
votes
3 answers

How do you make an RPGLE program write SQL warnings and errors to the job log?

It seems like I remember writing an RPG program that used embedded SQL that wrote a message to the interactive user job log whenever a SQL warning or error occurred. I did not have to explicitly write it; it logged it by default. The program i am…
Mike
  • 1,274
  • 10
  • 24