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
1
vote
3 answers

Is using Natural Join or Implicit column names not a good practice when writing SQL in a programming language?

When we use Natural Join, we are joining the tables when both table have the same column names. But what if we write it in PHP and then the DBA add some more fields to both tables, then the Natural Join can break? The same goes for Insert, if we do…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
1
vote
1 answer

Anyone have experience developing with ESQL/C for INFORMIX-SQL?

Does anyone have experience developing with ESQL/C for INFORMIX-SQL, as in calling C funcs within "Perform" screen generator and "ACE" report writer? I have ISQL without ESQL/C. I experimented compiling a perform screen, where in the instructions…
Joe R.
  • 2,032
  • 4
  • 36
  • 72
1
vote
1 answer

"FOR UPDATE" clause is throwing error in esql program

We are developing a migrate program. There are nearly 80 million records are there in DB. The code is as follows: static int mymigration(struct progargs *args) { exec sql begin declare section; const char *selectQuery; const char…
Liju Mathew
  • 871
  • 1
  • 18
  • 31
1
vote
2 answers

Proper way of declaring cursor for huge number of updates

I need some suggestions as to whether my idea is ok or not. I have a situation where: I need to do updates to every row of a table. There is some logic involved in the updation. The logic is very simple, but it needs to be done for every row. There…
prabhu
  • 919
  • 2
  • 12
  • 28
1
vote
1 answer

Multiple dynamic values in a Pro *C query IN clause

I want to read a flat file to fetch a dynamic list of values (number of values is not fixed) & then I want to use this list of values in the IN clause of an select query in Pro *C. What is the best way to achieve this using Pro *C? I came across a…
Alok Save
  • 202,538
  • 53
  • 430
  • 533
1
vote
0 answers

ORA-24811:While writing into a LOB, less data was provided than indicated

When ever I run my Pro*C code which insert a large buffer to table using CLOB. ORA-24811:While writing into a LOB, less data was provided than indicated. code is below OCIClobLocator *lob; ... EXEC SQL insert into TAB (MSG,STATUS ,ERROR_DESC…
1
vote
1 answer

Creating temp table with PID in ESQL/C

I am using ESQL/C code to provide backend support for a UI, connecting to an Informix database. I am creating temp table inside my code. But, I guess that if multiple users use this UI at the same time then temp table might already exist in the…
Kundan Kumar
  • 1,974
  • 7
  • 32
  • 54
1
vote
1 answer

How to syncrhonize on-site in-memory/no-sql datasources with central database in real-time

I have an interesting architecture problem. My scenario is this: I need to centralize data that's currently stored within on-site SQL Server 2005 databases sitting within 60 storefronts, soon to be doubled to 120 storefronts. There's a main SQL…
Chris Harris
  • 1,329
  • 4
  • 17
  • 28
1
vote
0 answers

How to get the error occurring while executing an embedded SQL command in a C program?

I am fetching a few records from a table in an Oracle database. My program is able to fetch a few records but later it stops abruptly without showing any error. Please check the code below void fetch_data() { char tran_dt[16]; trace("fetch_data():…
MK Singh
  • 706
  • 1
  • 13
  • 36
1
vote
1 answer

Informix ESQL/C — How to initialize fields?

How can I write a routine in ESQL/C which will initialize to 0 (zero) all numeric fields (smallint, decimal, etc) and to a space the other fields in a table?
famedoro
  • 1,223
  • 2
  • 17
  • 41
1
vote
2 answers

How to configure cmake to compile informix *.ec files?

I'm just found cmake and I want to use it to create make files for a little project that uses the esql compiler.
Aragorn
  • 843
  • 12
  • 25
0
votes
1 answer

SQL application error

here is a code in embedded SQL(in c) EXEC SQL BEGIN DECLARE SECTION char *id = NULL; EXEC SQL END DECLARE SECTION . . //here id is assigned value, printf("%s",id) gives an int i parsed into string . EXEC SQL SELECT * FROM table T WHERE T.id =…
Vishal
  • 989
  • 2
  • 11
  • 19
0
votes
1 answer

If condition in Embedded Sql

Here is a part code form my embedded SQL program EXEC SQL IF EXISTS(SELECT * FROM table_name WHERE bool_condition) BEGIN ... END; It gives the error An unexpected token "IF EXISTS(SELECT * FROM table_name " was found following…
Vishal
  • 989
  • 2
  • 11
  • 19
0
votes
1 answer

Unexpected output of embedded SQL program

I'm trying to implement an absolute basic toy example using ECPG to run an embedded SQL query in C. This is my code: int main() { EXEC SQL WHENEVER NOT FOUND DO BREAK; EXEC SQL BEGIN DECLARE SECTION; char v_country_iso2[2], v_name[32]; …
Christian
  • 3,239
  • 5
  • 38
  • 79
0
votes
0 answers

Deleting a row in Oracle with ESQL/C

I'm trying to write a program with C and ESQL. One of the things I want to do is delete old row from one of my table (by comparing with SYSDATE) each time the program is run. So my SQL code looks like this: DELETE FROM Trip WHERE dateT < (SYSDATE -…
flatzo
  • 133
  • 1
  • 9