MCPcopy Create free account
hub / github.com/apache/cloudberry / get_cursor

Function get_cursor

gpcontrib/orafce/dbms_sql.c:225–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225static CursorData *
226get_cursor(FunctionCallInfo fcinfo, bool should_be_assigned)
227{
228 CursorData *cursor;
229 int cid;
230
231 if (PG_ARGISNULL(0))
232 ereport(ERROR,
233 (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
234 errmsg("cursor id is NULL")));
235
236 cid = PG_GETARG_INT32(0);
237 if (cid < 0 || cid >= MAX_CURSORS)
238 ereport(ERROR,
239 (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
240 errmsg("value of cursor id is out of range")));
241
242 cursor = &cursors[cid];
243 if (!cursor->assigned && should_be_assigned)
244 ereport(ERROR,
245 (errcode(ERRCODE_UNDEFINED_CURSOR),
246 errmsg("cursor is not valid")));
247
248 return cursor;
249}
250
251/*
252 * CREATE FUNCTION dbms_sql.is_open(c int) RETURNS bool;

Callers 14

dbms_sql_is_openFunction · 0.85
dbms_sql_close_cursorFunction · 0.85
dbms_sql_debug_cursorFunction · 0.85
dbms_sql_parseFunction · 0.85
bind_variableFunction · 0.85
bind_arrayFunction · 0.85
dbms_sql_define_columnFunction · 0.85
dbms_sql_define_arrayFunction · 0.85
dbms_sql_executeFunction · 0.85
dbms_sql_fetch_rowsFunction · 0.85
dbms_sql_column_valueFunction · 0.85

Calls 2

errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected