on 08-15-2012 12:41 PM
Hi,
I need to read a database table (SQL Server database) using PI JDBC Adapter. Table field names contain space. For example: "Customer Name". If I create data type in ESR, PI doesn't allow to put space in between field names. I there any way to handle this? Can I use underscore in place of space? Will it work? Or any other solution for this?
Thanks,
Netrey
Hello!
Have you tried something like "SELECT 'customer name' AS cName FROM..." ? This should create an alias which you could use on the data type.
Otherwise, you could as well stick with a T-SQL procedure.
BR,
Lucas Santos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Netrey!
T-SQL is the Stored Procedure language used in the MS SQL databases. With this, you could from PI call the stored procedure and it would return the data after processing it on the database. You can check some code examples and usage on http://msdn.microsoft.com/en-us/library/ms187926.aspx .
However, have you tried using the "AS" SQL command as I've mentioned before? This should remove the necessity of declaring the data type with space, and should allow you use the alias name instead. Let me know if this works.
BR,
Lucas Santos
What Lucas referring is very similar to the terminology called SQL Alias. Please take help from DBA. You can use Alias for both column names as well table names. You might want to try without space as Alias for all the columns you create in ESR and see if that helps. Otherwise you need to go for stored procedure, if the database fields are not feasible to change.
Also if you use jdbc receiver then you can go for the statement6 structure on the request side and use alias sql as query. The response structure provide alias name and see if that helps.
You can see this link
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
if you use underscore it will not work, ask DB team to change field name,request them to avoid spaces.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.