cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Table : table or view does not exist

Former Member
0 Kudos

Hello,

I'm running a Netweaver 7.0 portal and have developed a custom Web Dynpro application. It works great. To support more features I added a custom table to the portal database schema (SAP<sid>DB). However, when I try to access the table from within code I get the following SQL message: table or view does not exist. I can access all the SAP portal tables just fine - just not the new one I created. I've asked DBAs to verify permissions; they've looked but can't figure out what the problem is.

Here's the code:


InitialContext dbInitContext = new InitialContext();
Properties sysProperties = System.getProperties();
String sysname = sysProperties.getProperty("SAPSYSTEMNAME");
String dbName = "jdbc/" + "SAP" + sysname + "DB";
DataSource dataSource = (DataSource) dbInitContext.lookup(dbName);
Connection conn = dataSource.getConnection();
String tableName = wdContext.currentContextElement().getTableName();
String SelectStmt = "Select * from" .concat(" " + tableName);
// Prepare the SQL statements
PreparedStatement stmt = conn.prepareStatement(SelectStmt);
// Execute the Query
ResultSet resultSet = stmt.executeQuery();

Any ideas where we've gone astray or what we might check? Any idea what permissions we need to set?

Thanks,

John

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The solution to this problem was to create a Data Dictionary project with the table structure and deploy it to the portal.