Line data Source code
1 : #include <stdio.h> 2 : 3 : EXEC SQL INCLUDE sqlca; 4 : exec sql include ../regression; 5 : 6 : EXEC SQL WHENEVER SQLERROR sqlprint; 7 : 8 : int 9 4 : main () 10 : { 11 : EXEC SQL BEGIN DECLARE SECTION; 12 : int foo; 13 : EXEC SQL END DECLARE SECTION; 14 : 15 4 : ECPGdebug (1, stderr); 16 : 17 4 : EXEC SQL CONNECT TO REGRESSDB1; 18 4 : EXEC SQL SET AUTOCOMMIT = ON; 19 4 : 20 4 : EXEC SQL SELECT foo INTO :foo FROM JSON_TABLE(jsonb '[{"foo":1}]', '$[*]' AS p0 21 : COLUMNS ( 22 : foo int 23 : )) jt (foo); 24 4 : printf("Found foo=%d\n", foo); 25 : 26 4 : EXEC SQL SELECT foo INTO :foo FROM JSON_TABLE(jsonb '[{"foo":"1"}]', '$[*]' AS p0 27 : COLUMNS ( 28 : NESTED '$' AS p1 COLUMNS ( 29 : NESTED PATH '$' AS p11 COLUMNS ( foo int ) 30 : ) 31 : )) jt (foo); 32 4 : printf("Found foo=%d\n", foo); 33 : 34 4 : EXEC SQL DISCONNECT; 35 4 : 36 4 : return 0; 37 : }