コード例 #1
0
ファイル: Portal.cs プロジェクト: VincentRisi/jportal
 public void PostgreSQLSequence(string tableName, string fieldName, ref int value)
 {
     Cursor cursor = new Cursor(this);
     cursor.Format(string.Format("select nextval('{0}_{1}_seq')::int", tableName.ToLower(), fieldName.ToLower()), 0);
     cursor.Run();
     cursor.Read();
     value = cursor.GetInt(0);
 }
コード例 #2
0
ファイル: Portal.cs プロジェクト: VincentRisi/jportal
 public void SqliteSequence(string tableName, string fieldName, ref int value)
 {
     Cursor cursor = new Cursor(this);
     cursor.Format(string.Format("select seq from sqlite_sequence where name = '{0}'", tableName), 0);
     cursor.Run();
     cursor.Read();
     value = cursor.GetInt(0) + 1;
 }
コード例 #3
0
ファイル: Portal.cs プロジェクト: VincentRisi/jportal
 public void OracleSequence(string tableName, string fieldName, ref int value)
 {
     Cursor cursor = new Cursor(this);
     cursor.Format(string.Format("select {0}Seq.NextVal from dual)", tableName), 0);
     cursor.Run();
     cursor.Read();
     value = cursor.GetInt(0);
 }