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
2 answers

Binding Variables in PL/SQL

I read this script that assigns of a data column info into 2 binding variables. something like this: EXEC SQL SELECT var1 into :v.v1:v2 from table Shouldn't there be a comma in there? Or is this like assigning var1 into v.v1 and also into v2 with…
DG85
  • 11
  • 2
0
votes
1 answer

ORA-3113 after updating CLOB

I am trying to get acquainted to using LOBs in Oracle (coming from RdB which should be migrated). I now face a problem when I try to make an update on an existing entry with a CLOB column named AN.BEMERKUNG: Code extract: OCIClobLocator *clob ; long…
0
votes
1 answer

Does simple-minded implementation of optional criteria in SQL risk serious inefficiency?

This is a non-urgent question about Oracle (~11g) query optimisation. It is not urgent because the query is currently performing well within requirements, but I should like to know if it is advisable to optimise my query anyway. The query joins a…
PJTraill
  • 1,353
  • 12
  • 30
0
votes
1 answer

Multiply two host variables in embedded SQL for PostgreSQL

I have problem multiplying two host variables in embedded SQL for PostgreSQL. The SQL-query is big but I have cut out the part that doesn't work. Declaration: EXEC SQL BEGIN DECLARE SECTION; int var1; int var2; EXEC SQL END DECLARE…
user1766169
  • 1,932
  • 3
  • 22
  • 44
0
votes
0 answers

How to over come from deadlock in embedded SQL through C# in SQL Server 2014?

I am facing deadlock problem on Dispatching.PackageTrace table when below Embedded SQL is invoked through C# programming language in MS SQL Server 2014. Below is the table design in Database: CREATE TABLE…
Raj
  • 313
  • 2
  • 9
0
votes
0 answers

Embedded SQL in C connection issue

The Postgresql role is the owner of the db 'university' and it's been configured like, alter user canoe password 'mypassword'; The piece of embedded SQL code in C just makes a connection to DB. printf("SQLSTATE=[%s]\n", SQLSTATE); EXEC SQL…
canoe
  • 1,273
  • 13
  • 29
0
votes
1 answer

Pro*C Oracle -- looping through sql fetch

I'm beginning with Pro*C and have a program that reads in records and prints out grouped by an identifying value (guests). In order to get all the information printed, I used a break from the for loop to control what goes where. It compiles but…
stackuser
  • 869
  • 16
  • 34
0
votes
2 answers

Oracle Pro*C -- using a cursor in nested loop

I'm teaching myself Pro*C and have a program that goes (supposedly) through records in a database with a cursor, and it compiles and runs. The problem is that I'm getting whatever junk was in memory when the variables print (those read in using the…
stackuser
  • 869
  • 16
  • 34
0
votes
0 answers

ECPG: sizeof() in EXEC SQL DECLARE SECTION

I have Sybase ASE CPRE Embedded SQL С code: void MyFunc( MyClass*unit_address ) { EXEC SQL BEGIN DECLARE SECTION; CS_BINARY var1[sizeof(MyClass)]; EXEC SQL END DECLARE SECTION; } Try to migrate to PostgreSQL ECPG Embedded SQL…
ggJa
  • 19
  • 3
0
votes
1 answer

Decode() function query in Oracle

Can we use a select query in embedded sql (Pro*C) as the first argument in a Decode() function.
Sachin
  • 20,805
  • 32
  • 86
  • 99
0
votes
1 answer

DB2 embedded SQL in C use same host variable for both input and output allowed?

Is it safe to use same host variable for both input and output in an embedded SQL query ? I'm using C and DB2 static embedded SQL. Example: EXEC SQL SELECT someCol INTO :someHostVar FROM SomeTable WHERE :someHostVar =…
XiaoChuan Yu
  • 3,951
  • 1
  • 32
  • 44
0
votes
0 answers

ESQL Return New ID After Insert

I am trying to retrieve the new ID generated after a SQL insert using ESQL. I'm having problems figuring out the proper syntax or how to use the two UUID functions and could use a little assistance.
user2402831
  • 693
  • 10
  • 22
0
votes
1 answer

Program with embedded sql gives compilation error

#include #include #include #include "/opt/PostgreSQL/9.1/include/libpq-fe.h" int main() { PGconn *conn; int buf_ptr=0; int i; { fprintf(stderr,"connection to database failed:%s",PQerrorMessage(conn)); …
zishan
  • 584
  • 1
  • 6
  • 12
0
votes
1 answer

Combining the functionality of Embedded SQL and libpq

I have written a program in C that periodically polls variables in a PostgreSQL database into host variables and listens for notifications from the database. I am wondering if there is a solution that would either let me 1. LISTEN for a notification…
Elaine B
  • 213
  • 1
  • 3
  • 14
0
votes
1 answer

Using host variables in a PL/pgSQL trigger functions

I am trying to figure out how to write a trigger function in PL/pgSQL that can select values into host variables in an Embedded SQL/C program. I am new to SQL, so I apologize if my terminology is a bit off. Basically, on a change to the table, I…
Elaine B
  • 213
  • 1
  • 3
  • 14