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
1 answer

Query the state of 'COMPATIBILITY_MODE' ON / OFF from another session in ASE

As of Sybase ASE 15.0.3 one can set the so called COMPATIBILITY_MODE within a session to ON or OFF with the SQL or ESQL/C command: SQL SET COMPATIBILITY_MODE ON This can be configured too as server wide option, but this is not meant here. The…
guru
  • 147
  • 2
  • 13
1
vote
0 answers

How to migrate from INGRES to MS-SQLServer

we have serveral C (ANSI-C) processes on a intel-based solaris server which connect to an ingres db through embedded sql. Now we want to migrate the code to ms-sql server. I have already found OBDC drivers/libraries for solaris on the net,…
Guido
  • 11
  • 2
1
vote
0 answers

Heterogeneous data types in multiple dynamic values in a Pro *C query IN clause

This is related to the following discussion Multiple dynamic values in a Pro *C query IN clause My question is: What determines the value of L[..], is it the length of data defined in Oracle Table Description as Varchar(100) or size of the…
Dr. Debasish Jana
  • 6,980
  • 4
  • 30
  • 69
1
vote
2 answers

Oracle pro*c indicator variables vs NVL in query execution

oracle-pro-c has recommended using indicator variables as "NULL flags" attached to host variables. As per documentation, we can associate every host variable with an optional indicator variable (short type). For example: short indicator_var; EXEC…
Dr. Debasish Jana
  • 6,980
  • 4
  • 30
  • 69
1
vote
1 answer

Oracle Pro*C Bulk Merge of records in C/C++ using host arrays

Using Oracle Pro*C in C/C++, we can use host arrays for managing bulk inserts into the EMP table as per following example: struct { char ename[3][10]; int eno[3]; } emp_rec1; struct { int dno[3]; } emp_rec2; ...…
Dr. Debasish Jana
  • 6,980
  • 4
  • 30
  • 69
1
vote
1 answer

Error when trying to compile Pro*C programs in Linux

I am practicing with a Pro*C program and SQL and I have the following simple program: #include #include char user_id[20]="test/test" char emp_name[20]; main() { EXEC SQL CONNECT :userid; printf("Connected\n"); EXEC…
1
vote
1 answer

Can NULL indicators be used in the WHERE clause for COBOL embedded SQL?

I am working on a CICS screen where the users can query, add, update or delete data in a table. In one of my tables, the unique key is made of 5 fields, 2 of which can be NULL. In my cursor I'm having to use an AND (COLUMN_1 = :V??-REC.COLUMN-1 OR…
Thraydor
  • 140
  • 1
  • 12
1
vote
1 answer

Storing Oracle DB table's ROWID as a character array

I would like to retrieve ROWID of a table from Oracle DB and store in memory as a character array for later use. For example, I run the following query: SELECT ROWID, MARKS FROM MTB WHERE EID='123'; Then using Pro*C, I would like to store this…
Dr. Debasish Jana
  • 6,980
  • 4
  • 30
  • 69
1
vote
1 answer

TEXT Update versus TEXT insert on Informix Dynamic Server

I maintain a 3rd party Informix driver that's written with ESQL-style (Informix API) calls. I'm working on a bug where, for TEXT fields, INSERTs work fine and UPDATEs fail. Stepping through the code, what I've found is that we're checking our…
John Lockwood
  • 3,787
  • 29
  • 27
1
vote
1 answer

How to get rid of label used but not defined

I'm trying to print the rows of a table in embedded sql. I have this code where publication is the table and pubid is the attribute. I tried this: EXEC SQL DECLARE C1 CURSOR FOR SELECT pubid FROM publication; EXEC SQL OPEN C1; EXEC SQL…
Dave
  • 81
  • 6
1
vote
1 answer

Oracle Pro*C for insert with a sub select query causing ORA-01403: no data found

I am using C++ code with embedded Pro*C (Version: 11.2.0.3.0) for Oracle DB. I am running a bulk insert clause as below: insert int TBL1 (col1, col2) select a.col1, b.col2 from TBL2 a, TBL3 b where a.col1 = :v and a.col2 = b.col2 I run this query…
Dr. Debasish Jana
  • 6,980
  • 4
  • 30
  • 69
1
vote
3 answers

insert wrong order in postgresql (using pro c)

I wanted to insert data to psql from a text file with proc, after inserting data with my proc program ,the order of data in psql was different from the text file sometimes. there was no any sql error in the process, I found the problem when I…
ohohyeah
  • 13
  • 2
1
vote
1 answer

SQLSET data type in descriptor

How to insert SQLSET type in descriptor? First I prepare and declare cursor with bind variables: select * from account where aco_no in ( ? ) and ..; My goal is to replace '?' in open cursor with list of account ('123', '234'). Cursor for statement…
Kamil S
  • 11
  • 2
1
vote
0 answers

DB-Library and ESQL/C (for educational purposes)

Understanding old technologies often help us to better understand new ones, so this is a question to the gurus of database programming with many years of experience (since the very beginning of SQL Server, at least version 6.5). Recently I've…
Delgrosso
  • 11
  • 1
1
vote
2 answers

Blanks causing problem while fetching rows (Informix)

The always interesting issue of NULL Vs Blank is driving me bit crazy now. I have two ESQL/C structures that represent two tables. I'm fetching a row from one table in a cursor. Using the values of two fields from this fetch, I will retrieve a row…
prabhu
  • 919
  • 2
  • 12
  • 28