DatabaseProcApplicationCreatedLinks
sybsystemprocssp_jdbc_fkeys  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** parameters: @pktable_name - table name for primary key
4     **             @pktable_owner - (schema) a schema name pattern; "" retrieves 
5     **		those without a schema
6     **             @pktable_qualifier - (catalog name) a catalog name; "" retrieves
7     **              those without a catalog; null means drop catalog name from the
8     **                  selection criteria 
9     **             @fktable_name - table name for foreign key
10    **             @fktable_owner - (schema) a schema name pattern; "" retrieves 
11    **		those  without a schema
12    **             @fktable_qualifier - (catalog name) a catalog name; "" retrieves
13    **              those without a catalog; null means drop catalog name from the
14    **              selection criteria 
15    **
16    ** note: there is one raiserror message: 18040
17    **
18    ** messages for 'sp_jdbc_fkeys'               18039, 18040
19    **
20    ** 17461, 'Object does not exist in this database.'
21    ** 18040, 'Catalog procedure %1! can not be run in a transaction.', sp_jdbc_fkeys
22    ** 18043 ' Primary key table name or foreign key table name or both must be
23    ** given'
24    ** 18044, '%1! table qualifier must be name of current database.' [Primary
25    ** key | Foreign key]
26    **
27    */
28    
29    CREATE OR REPLACE PROCEDURE sp_jdbc_fkeys
30        @pktable_name varchar(300) = null,
31        @pktable_owner varchar(32) = null,
32        @pktable_qualifier varchar(32) = null,
33        @fktable_name varchar(300) = null,
34        @fktable_owner varchar(32) = null,
35        @fktable_qualifier varchar(32) = null
36    AS
37        /* Don't delete the following line. It is the checkpoint for sed */
38        /* Server dependent stored procedure add here ad ADDPOINT_FKEYS */
39        declare @ftabid int, @ptabid int, @constrid int, @keycnt int, @primkey int
40        declare @fokey1 int, @fokey2 int, @fokey3 int, @fokey4 int, @fokey5 int
41        declare @fokey6 int, @fokey7 int, @fokey8 int, @fokey9 int, @fokey10 int
42        declare @fokey11 int, @fokey12 int, @fokey13 int, @fokey14 int, @fokey15 int
43        declare @refkey1 int, @refkey2 int, @refkey3 int, @refkey4 int, @refkey5 int
44        declare @refkey6 int, @refkey7 int, @refkey8 int, @refkey9 int, @refkey10 int
45        declare @refkey11 int, @refkey12 int, @refkey13 int, @refkey14 int
46        declare @refkey15 int, @refkey16 int, @fokey16 int, @status int, @i int
47        declare @msg varchar(255)
48        declare @msg2 varchar(50)
49        declare @export int, @import int
50        declare @notDeferrable int
51        declare @startedInTransaction bit
52    
53        if (@@trancount = 0)
54        begin
55            set chained off
56        end
57    
58        /* check if we're in a transaction before we execute any selects */
59        if (@@trancount > 0)
60            select @startedInTransaction = 1
61        else
62            select @startedInTransaction = 0
63    
64        /* this will make sure that all rows are sent even if
65        ** the client "set rowcount" is differect
66        */
67    
68        set rowcount 0
69    
70    
71        select @notDeferrable = 7
72        select @import = 0
73        select @export = 0
74    
75        /* if table_owner is null, include all in search */
76        if (@fktable_owner is null) select @fktable_owner = '%'
77        if (@pktable_owner is null) select @pktable_owner = '%'
78    
79        set nocount on
80    
81        set transaction isolation level 1
82    
83        if (@startedInTransaction = 1)
84            save transaction jdbc_keep_temptables_from_tx
85    
86        if (@pktable_name is null) and (@fktable_name is null)
87        begin
88            /* If neither primary key nor foreign key table names given */
89            /*
90            ** 18043 'Primary key table name or foreign key table name
91            ** or both must be given'
92            */
93            exec sp_getmessage 18043, @msg output
94            raiserror 18043 @msg
95            return (1)
96        end
97        else
98        begin
99            if (substring(@pktable_name, 1, 1) = '#') or
100               (substring(@fktable_name, 1, 1) = '#')
101           begin
102               /* We won't allow temptables here
103               ** 
104               ** Error 177: cannot create a temporary object (with
105               ** '#' as the first character name.
106               */
107               exec sp_getmessage 17676, @msg out
108               raiserror 17676 @msg
109               return (1)
110           end
111       end
112       if @fktable_qualifier is not null
113       begin
114           if db_name() != @fktable_qualifier
115           begin
116               exec sp_getmessage 18039, @msg out
117               raiserror 18039 @msg
118               return (1)
119           end
120       end
121       else
122       begin
123           /*
124           ** Now make sure that foreign table qualifier is pointing to the
125           ** current database in case it is not specified.
126           */
127           select @fktable_qualifier = db_name()
128       end
129   
130       if @pktable_qualifier is not null
131       begin
132           if db_name() != @pktable_qualifier
133           begin
134               exec sp_getmessage 18039, @msg output
135               raiserror 18039 @msg
136               return (1)
137           end
138       end
139       else
140       begin
141           /*
142           ** Now make sure that primary table qualifier is pointing to the
143           ** current database in case it is not specified.
144           */
145           select @pktable_qualifier = db_name()
146       end
147   
148       create table #jpid(pid int, uid int, name varchar(32))
149       create table #jfid(fid int, uid int, name varchar(32))
150   
151       if @pktable_name is not null
152       begin
153           select @export = 1
154           if ((select count(*) from sysobjects
155                       where name = @pktable_name
156                           and user_name(uid) like @pktable_owner ESCAPE '\'
157                           and type in ('S', 'U')) = 0)
158           begin
159               exec sp_getmessage 17674, @msg output
160               raiserror 17674 @msg
161               return (1)
162           end
163   
164           insert into #jpid
165           select id, uid, name
166           from sysobjects
167           where name = @pktable_name
168               and user_name(uid) like @pktable_owner ESCAPE '\'
169               and type in ('S', 'U')
170       end
171       else
172       begin
173           insert into #jpid
174           select id, uid, name
175           from sysobjects
176           where type in ('S', 'U')
177               and user_name(uid) like @pktable_owner ESCAPE '\'
178       end
179   
180       if @fktable_name is not null
181       begin
182           select @import = 1
183           if ((select count(*)
184                       from sysobjects
185                       where name = @fktable_name
186                           and type in ('S', 'U')
187                           and user_name(uid) like @fktable_owner ESCAPE '\') = 0)
188           begin
189               exec sp_getmessage 17674, @msg output
190               raiserror 17674 @msg
191               return (1)
192           end
193           insert into #jfid
194           select id, uid, name
195           from sysobjects
196           where name = @fktable_name
197               and type in ('S', 'U')
198               and user_name(uid) like @fktable_owner ESCAPE '\'
199       end
200       else
201       begin
202           insert into #jfid
203           select id, uid, name
204           from sysobjects where
205               type in ('S', 'U')
206               and user_name(uid) like @fktable_owner ESCAPE '\'
207       end
208   
209       create table #jfkey_res(
210           PKTABLE_CAT varchar(32) null,
211           PKTABLE_SCHEM varchar(32) null,
212           PKTABLE_NAME varchar(257) null,
213           PKCOLUMN_NAME varchar(257) null,
214           FKTABLE_CAT varchar(32) null,
215           FKTABLE_SCHEM varchar(32) null,
216           FKTABLE_NAME varchar(257) null,
217           FKCOLUMN_NAME varchar(257) null,
218           KEY_SEQ smallint,
219           UPDATE_RULE smallint,
220           DELETE_RULE smallint,
221           FK_NAME varchar(257),
222           PK_NAME varchar(257) null)
223       create table #jpkeys(seq int, keys varchar(32) null)
224       create table #jfkeys(seq int, keys varchar(32) null)
225   
226       /*
227       ** Since there are possibly multiple rows in sysreferences
228       ** that describe foreign and primary key relationships among
229       ** two tables, so we declare a cursor on the selection from
230       ** sysreferences and process the output at row by row basis.
231       */
232   
233       declare jcurs_sysreferences cursor
234       for
235       select tableid, reftabid, constrid, keycnt,
236           fokey1, fokey2, fokey3, fokey4, fokey5, fokey6, fokey7, fokey8,
237           fokey9, fokey10, fokey11, fokey12, fokey13, fokey14, fokey15,
238           fokey16, refkey1, refkey2, refkey3, refkey4, refkey5,
239           refkey6, refkey7, refkey8, refkey9, refkey10, refkey11,
240           refkey12, refkey13, refkey14, refkey15, refkey16
241       from sysreferences
242       where tableid in (
243               select fid from #jfid)
244           and reftabid in (
245               select pid from #jpid)
246           and frgndbname is NULL and pmrydbname is NULL
247       for read only
248   
249       open jcurs_sysreferences
250   
251       fetch jcurs_sysreferences into @ftabid, @ptabid, @constrid, @keycnt,
252           @fokey1, @fokey2, @fokey3, @fokey4, @fokey5, @fokey6, @fokey7, @fokey8,
253           @fokey9, @fokey10, @fokey11, @fokey12, @fokey13, @fokey14, @fokey15,
254           @fokey16, @refkey1, @refkey2, @refkey3, @refkey4, @refkey5, @refkey6,
255           @refkey7, @refkey8, @refkey9, @refkey10, @refkey11, @refkey12,
256           @refkey13, @refkey14, @refkey15, @refkey16
257   
258       while (@@sqlstatus = 0)
259       begin
260           /*
261           ** For each row of sysreferences which describes a foreign-
262           ** primary key relationship, do the following.
263           */
264   
265           /*
266           ** First store the column names that belong to primary keys
267           ** in table #pkeys for later retrieval.
268           */
269   
270           delete #jpkeys
271           insert #jpkeys values (1, col_name(@ptabid, @refkey1))
272           insert #jpkeys values (2, col_name(@ptabid, @refkey2))
273           insert #jpkeys values (3, col_name(@ptabid, @refkey3))
274           insert #jpkeys values (4, col_name(@ptabid, @refkey4))
275           insert #jpkeys values (5, col_name(@ptabid, @refkey5))
276           insert #jpkeys values (6, col_name(@ptabid, @refkey6))
277           insert #jpkeys values (7, col_name(@ptabid, @refkey7))
278           insert #jpkeys values (8, col_name(@ptabid, @refkey8))
279           insert #jpkeys values (9, col_name(@ptabid, @refkey9))
280           insert #jpkeys values (10, col_name(@ptabid, @refkey10))
281           insert #jpkeys values (11, col_name(@ptabid, @refkey11))
282           insert #jpkeys values (12, col_name(@ptabid, @refkey12))
283           insert #jpkeys values (13, col_name(@ptabid, @refkey13))
284           insert #jpkeys values (14, col_name(@ptabid, @refkey14))
285           insert #jpkeys values (15, col_name(@ptabid, @refkey15))
286           insert #jpkeys values (16, col_name(@ptabid, @refkey16))
287   
288           /*
289           ** Second store the column names that belong to foreign keys
290           ** in table #jfkeys for later retrieval.
291           */
292   
293           delete #jfkeys
294           insert #jfkeys values (1, col_name(@ftabid, @fokey1))
295           insert #jfkeys values (2, col_name(@ftabid, @fokey2))
296           insert #jfkeys values (3, col_name(@ftabid, @fokey3))
297           insert #jfkeys values (4, col_name(@ftabid, @fokey4))
298           insert #jfkeys values (5, col_name(@ftabid, @fokey5))
299           insert #jfkeys values (6, col_name(@ftabid, @fokey6))
300           insert #jfkeys values (7, col_name(@ftabid, @fokey7))
301           insert #jfkeys values (8, col_name(@ftabid, @fokey8))
302           insert #jfkeys values (9, col_name(@ftabid, @fokey9))
303           insert #jfkeys values (10, col_name(@ftabid, @fokey10))
304           insert #jfkeys values (11, col_name(@ftabid, @fokey11))
305           insert #jfkeys values (12, col_name(@ftabid, @fokey12))
306           insert #jfkeys values (13, col_name(@ftabid, @fokey13))
307           insert #jfkeys values (14, col_name(@ftabid, @fokey14))
308           insert #jfkeys values (15, col_name(@ftabid, @fokey15))
309           insert #jfkeys values (16, col_name(@ftabid, @fokey16))
310   
311           /*
312           ** For each column of the current foreign-primary key relation,
313           ** create a row into result table: #jfkey_res.
314           */
315   
316           select @i = 1
317           while (@i <= @keycnt)
318           begin
319               insert into #jfkey_res
320               select @pktable_qualifier,
321                       (select user_name(uid) from #jpid where
322                           pid = @ptabid),
323                   object_name(@ptabid),
324                       (select keys from #jpkeys where seq = @i),
325                   @fktable_qualifier,
326                       (select user_name(uid) from #jfid where
327                           fid = @ftabid),
328                   object_name(@ftabid),
329                       (select keys from #jfkeys where seq = @i),
330                   @i, 1, 1,
331                   /*Foreign key name*/
332                   object_name(@constrid),
333                       /* Primary key name */
334                       (select name from sysindexes where id = @ftabid
335                           and status > 2048 and status < 32768)
336               select @i = @i + 1
337           end
338   
339           /*
340           ** Go to the next foreign-primary key relationship if any.
341           */
342   
343           fetch jcurs_sysreferences into @ftabid, @ptabid, @constrid,
344               @keycnt, @fokey1, @fokey2, @fokey3, @fokey4, @fokey5, @fokey6,
345               @fokey7, @fokey8, @fokey9, @fokey10, @fokey11, @fokey12,
346               @fokey13, @fokey14, @fokey15, @fokey16, @refkey1, @refkey2,
347               @refkey3, @refkey4, @refkey5, @refkey6, @refkey7, @refkey8,
348               @refkey9, @refkey10, @refkey11, @refkey12, @refkey13, @refkey14,
349               @refkey15, @refkey16
350       end
351   
352       close jcurs_sysreferences
353       deallocate cursor jcurs_sysreferences
354   
355       /*
356       ** Everything is now in the result table #jfkey_res, so go ahead
357       ** and select from the table now.
358       */
359       if (@export = 1) and (@import = 0)
360       begin
361           select PKTABLE_CAT,
362               PKTABLE_SCHEM,
363               PKTABLE_NAME,
364               PKCOLUMN_NAME,
365               FKTABLE_CAT,
366               FKTABLE_SCHEM,
367               FKTABLE_NAME,
368               FKCOLUMN_NAME,
369               KEY_SEQ,
370               UPDATE_RULE,
371               DELETE_RULE,
372               FK_NAME,
373               PK_NAME,
374               @notDeferrable as DEFERRABILITY
375           from #jfkey_res
376           where PKTABLE_SCHEM like @pktable_owner ESCAPE '\'
377           order by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, KEY_SEQ
378       end
379   
380       if (@export = 0) and (@import = 1)
381       begin
382           select PKTABLE_CAT,
383               PKTABLE_SCHEM,
384               PKTABLE_NAME,
385               PKCOLUMN_NAME,
386               FKTABLE_CAT,
387               FKTABLE_SCHEM,
388               FKTABLE_NAME,
389               FKCOLUMN_NAME,
390               KEY_SEQ,
391               UPDATE_RULE,
392               DELETE_RULE,
393               FK_NAME,
394               PK_NAME,
395               @notDeferrable as DEFERRABILITY
396           from #jfkey_res
397           where FKTABLE_SCHEM like @fktable_owner ESCAPE '\'
398           order by PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, KEY_SEQ
399       end
400   
401       if (@export = 1) and (@import = 1)
402       begin
403           select PKTABLE_CAT,
404               PKTABLE_SCHEM,
405               PKTABLE_NAME,
406               PKCOLUMN_NAME,
407               FKTABLE_CAT,
408               FKTABLE_SCHEM,
409               FKTABLE_NAME,
410               FKCOLUMN_NAME,
411               KEY_SEQ,
412               UPDATE_RULE,
413               DELETE_RULE,
414               FK_NAME,
415               PK_NAME,
416               @notDeferrable as DEFERRABILITY
417           from #jfkey_res
418           where PKTABLE_SCHEM like @pktable_owner ESCAPE '\'
419               and FKTABLE_SCHEM like @fktable_owner ESCAPE '\'
420           order by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, KEY_SEQ
421       end
422   
423       if (@startedInTransaction = 1)
424           rollback transaction jdbc_keep_temptables_from_tx
425   
426   
427   


exec sp_procxmode 'sp_jdbc_fkeys', 'AnyMode'
go

Grant Execute on sp_jdbc_fkeys to public
go
RESULT SETS
sp_jdbc_fkeys_rset_001
sp_jdbc_fkeys_rset_003
sp_jdbc_fkeys_rset_002

DEFECTS
 MTYP 4 Assignment type mismatch name: varchar(32) = longsysname(255) 165
 MTYP 4 Assignment type mismatch name: varchar(32) = longsysname(255) 174
 MTYP 4 Assignment type mismatch name: varchar(32) = longsysname(255) 194
 MTYP 4 Assignment type mismatch name: varchar(32) = longsysname(255) 203
 MTYP 4 Assignment type mismatch KEY_SEQ: smallint = int 330
 QCSC 4 Costly 'select count()', use 'exists()' 154
 QCSC 4 Costly 'select count()', use 'exists()' 183
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {uid}
176
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysobjects.ncsysobjects unique
(name, uid)
Intersection: {uid}
205
 QPUI 4 Join or Sarg with Un-Rooted Partial Index Use SARG Candidate index: sysreferences.csysreferences clustered
(tableid, frgndbname)
Intersection: {frgndbname}
246
 QTYP 4 Comparison type mismatch Comparison type mismatch: smallint vs int 335
 TNOU 4 Table with no unique index sybsystemprocs..sysreferences sybsystemprocs..sysreferences
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 165
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 174
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 194
 MAW1 3 Warning message on %name% sybsystemprocs..sysobjects.id: Warning message on sysobjects 203
 MAW1 3 Warning message on %name% sybsystemprocs..sysindexes.id: Warning message on sysindexes 334
 MGTP 3 Grant to public sybsystemprocs..sp_jdbc_fkeys  
 MGTP 3 Grant to public sybsystemprocs..sysindexes  
 MGTP 3 Grant to public sybsystemprocs..sysobjects  
 MGTP 3 Grant to public sybsystemprocs..sysreferences  
 MNER 3 No Error Check should check return value of exec 93
 MNER 3 No Error Check should check return value of exec 107
 MNER 3 No Error Check should check return value of exec 116
 MNER 3 No Error Check should check return value of exec 134
 MNER 3 No Error Check should check return value of exec 159
 MNER 3 No Error Check should check @@error after insert 164
 MNER 3 No Error Check should check @@error after insert 173
 MNER 3 No Error Check should check return value of exec 189
 MNER 3 No Error Check should check @@error after insert 193
 MNER 3 No Error Check should check @@error after insert 202
 MNER 3 No Error Check should check @@error after delete 270
 MNER 3 No Error Check should check @@error after insert 271
 MNER 3 No Error Check should check @@error after insert 272
 MNER 3 No Error Check should check @@error after insert 273
 MNER 3 No Error Check should check @@error after insert 274
 MNER 3 No Error Check should check @@error after insert 275
 MNER 3 No Error Check should check @@error after insert 276
 MNER 3 No Error Check should check @@error after insert 277
 MNER 3 No Error Check should check @@error after insert 278
 MNER 3 No Error Check should check @@error after insert 279
 MNER 3 No Error Check should check @@error after insert 280
 MNER 3 No Error Check should check @@error after insert 281
 MNER 3 No Error Check should check @@error after insert 282
 MNER 3 No Error Check should check @@error after insert 283
 MNER 3 No Error Check should check @@error after insert 284
 MNER 3 No Error Check should check @@error after insert 285
 MNER 3 No Error Check should check @@error after insert 286
 MNER 3 No Error Check should check @@error after delete 293
 MNER 3 No Error Check should check @@error after insert 294
 MNER 3 No Error Check should check @@error after insert 295
 MNER 3 No Error Check should check @@error after insert 296
 MNER 3 No Error Check should check @@error after insert 297
 MNER 3 No Error Check should check @@error after insert 298
 MNER 3 No Error Check should check @@error after insert 299
 MNER 3 No Error Check should check @@error after insert 300
 MNER 3 No Error Check should check @@error after insert 301
 MNER 3 No Error Check should check @@error after insert 302
 MNER 3 No Error Check should check @@error after insert 303
 MNER 3 No Error Check should check @@error after insert 304
 MNER 3 No Error Check should check @@error after insert 305
 MNER 3 No Error Check should check @@error after insert 306
 MNER 3 No Error Check should check @@error after insert 307
 MNER 3 No Error Check should check @@error after insert 308
 MNER 3 No Error Check should check @@error after insert 309
 MNER 3 No Error Check should check @@error after insert 319
 MUCO 3 Useless Code Useless Brackets 53
 MUCO 3 Useless Code Useless Brackets 59
 MUCO 3 Useless Code Useless Brackets 76
 MUCO 3 Useless Code Useless Brackets 77
 MUCO 3 Useless Code Useless Brackets 83
 MUCO 3 Useless Code Useless Brackets 95
 MUCO 3 Useless Code Useless Brackets 109
 MUCO 3 Useless Code Useless Brackets 118
 MUCO 3 Useless Code Useless Brackets 136
 MUCO 3 Useless Code Useless Brackets 154
 MUCO 3 Useless Code Useless Brackets 161
 MUCO 3 Useless Code Useless Brackets 183
 MUCO 3 Useless Code Useless Brackets 191
 MUCO 3 Useless Code Useless Brackets 258
 MUCO 3 Useless Code Useless Brackets 317
 MUCO 3 Useless Code Useless Brackets 423
 MUIN 3 Column created using implicit nullability 148
 MUIN 3 Column created using implicit nullability 149
 MUIN 3 Column created using implicit nullability 209
 MUIN 3 Column created using implicit nullability 223
 MUIN 3 Column created using implicit nullability 224
 QCRS 3 Conditional Result Set 361
 QCRS 3 Conditional Result Set 382
 QCRS 3 Conditional Result Set 403
 QISO 3 Set isolation level 81
 QJWT 3 Join or Sarg Without Index on temp table 242
 QJWT 3 Join or Sarg Without Index on temp table 244
 QPRI 3 Join or Sarg with Rooted Partial Index Use SARG Candidate index: sysindexes.csysindexes unique clustered
(id, indid)
Intersection: {id}
334
 VUNU 3 Variable is not used @primkey 39
 VUNU 3 Variable is not used @status 46
 VUNU 3 Variable is not used @msg2 48
 CRDO 2 Read Only Cursor Marker (has for read only clause) 235
 MRST 2 Result Set Marker 361
 MRST 2 Result Set Marker 382
 MRST 2 Result Set Marker 403
 MSUB 2 Subquery Marker 154
 MSUB 2 Subquery Marker 183
 MSUB 2 Subquery Marker 321
 MSUB 2 Subquery Marker 324
 MSUB 2 Subquery Marker 326
 MSUB 2 Subquery Marker 329
 MSUB 2 Subquery Marker 334
 MTR1 2 Metrics: Comments Ratio Comments: 20% 29
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 29 = 34dec - 7exi + 2 29
 MTR3 2 Metrics: Query Complexity Complexity: 243 29

DEPENDENCIES
PROCS AND TABLES USED
read_writes table tempdb..#jfkey_res (1) 
writes table sybsystemprocs..sp_jdbc_fkeys_rset_003 
reads table sybsystemprocs..sysobjects  
read_writes table tempdb..#jpkeys (1) 
read_writes table tempdb..#jfkeys (1) 
read_writes table tempdb..#jfid (1) 
reads table sybsystemprocs..sysreferences  
writes table sybsystemprocs..sp_jdbc_fkeys_rset_002 
calls proc sybsystemprocs..sp_getmessage  
   reads table sybsystemprocs..sysusermessages  
   reads table master..syslanguages (1)  
   reads table master..sysmessages (1)  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  
writes table sybsystemprocs..sp_jdbc_fkeys_rset_001 
reads table sybsystemprocs..sysindexes  
read_writes table tempdb..#jpid (1) 

CALLERS
called by proc sybsystemprocs..sp_jdbc_importkey  
called by proc sybsystemprocs..sp_jdbc_exportkey  
called by proc sybsystemprocs..sp_jdbc_getcrossreferences