KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > content > db > queries > sybase > TKDBContentAttributeGetOldContentId


1 package de.webman.content.db.queries.sybase;
2
3 import com.teamkonzept.db.*;
4 import java.sql.*;
5
6 public class TKDBContentAttributeGetOldContentId extends TKPrepQuery {
7
8     public final static boolean ISPREPARED =
9         true;
10     
11     public final static String JavaDoc[] PARAMORDER =
12         { "CONTENT_ID", "INSTANCE_ID" };
13     
14     public final static Object JavaDoc[][] PARAMTYPES = null;
15         
16     public final static boolean[] SETRELEVANTS =
17         { true };
18         
19     public final static String JavaDoc SQLSTRING =
20         
21         "DECLARE @CONT_ID_NEW INT " +
22         "DECLARE @INST_ID INT " +
23         
24         "SELECT @CONT_ID_NEW = ? " +
25         "SELECT @INST_ID = ? " +
26         
27         "SELECT MAX(C.CONTENT_ID) AS OLD_CONTENT_ID FROM CONTENT C, CONTENT_VERSION CV " +
28         "WHERE CV.INSTANCE_ID = @INST_ID AND C.CONTENT_ID = CV.CONTENT_ID AND C.CONTENT_ID < @CONT_ID_NEW ";
29         
30         
31             
32     public void initQuery(Connection con) {
33         super.initQuery(
34             con,
35             ISPREPARED,
36             PARAMORDER,
37             PARAMTYPES,
38             SETRELEVANTS,
39             SQLSTRING );
40     }
41 }
Popular Tags