Dim Adapter
HI all
I would like to know if Dim Adapter version 9.3.1 can work with planning version
9.3.1.1
Thanks
Renan
Hi John,
Thanks for ur prompt reply.
I installed DIM Informatica 8.1.1, for that i installed Planning adapter as "Hyperion Data Integration Management Adapter for Planning Release 9.3.1.1 Informatica PowerCenter 8.1.1 Microsoft Windows x86 Installer".
Hyperion Data Integration Management Release 9.3.1 Microsoft Windows x86 Installer - V11259-01 - I think, this adapter is used for Informatica 7.1.5. not for informatica 8.1.1
Correct me, if i am wrong john
Thanks & Regards,
PC
Similar Messages
-
Has anyone successfully used the PowerCenter DIM Adapter for Enterprise for data/metadata extraction? Any assistance would be appreciated.
Hi,
You might get more responses from the HFM and Enterprise forum :- Financial Consolidation
Cheers
John
http://john-goodwin.blogspot.com/ -
Hi,
Can some please Validate that whether Oracle is Supporting Dim adapter for Essbase or not.
Can someone give me link or somethig as a Proof.
Also can we see data in Dim Adapters or not..
A List of Pros and Cons will be Welcomed.
Cheers
AnubhavDIM itself as an Oracle product had its last release in 11.1.1 (see the 'Statement of Direction' linked in this Proactive Support blog entry: https://blogs.oracle.com/proactivesupportEPM/entry/statements_of_direction_for_epm).
However, the Essbase adapter continues to ship (or at least, it is still in the 11.1.2.3 documentation). But I don't think the adapter itself has been updated since 11.1.1.
Since DIM the integration tool itself is now out of Premier support, I can't see why you would want to use it unless you are a dedicated Informatica shop (DIM is just Informatica under an OEM agreement). ODI is the Oracle replacement.
If Oracle really are still shipping the adapter, I am confused as to whether or not Oracle would still support a problem with the adapter if used with a non-DIM product (i.e. Informatica). And if I really needed an answer to that, I would talk to Oracle support directly.
I worked at an Informatica shop a couple of years ago and they were keen to use the adapters, but we went with 'native' techniques like DATAEXPORT plus ODI for things like Planning metadata management. My recollection is that using DIM didn't abstract away from Essbase very far (still had to create load rules, for example) but abstracted away just enough to place annoying limitations on what you could do if you know Essbase well. For example, the data load wouldn't permit a slice load to ASO (if I recall correctly) which would be a show-stopper in some applications. -
Hyperion DIM adapter 11.1.1 for Essbase doesn't work
Hi all,
I have installed Informatica 8.6.1 and Hyperion DIM adapter for Essbase 11.1.1.1.
I have followed all the installation procedure correctly like registering with the registry and registering the plug in with the Informatica repository and setting up the class path variables.
Still I am unable to see the option 'Import from Hyperion Essbase' in the Informatica source and target designer.
Am I missing any steps or any other suggestions? Thanks...Hi,
where can i download Informatica 8.6?
Please help. Thanks in advance.
Regards,
Imtiaz. -
Hi All,
I installed the below DIM Adapters
Informatica Application
V11452-01 Part 1 of 2 - Hyperion Data Integration Management Release 9.3.1.1 Informatica PowerCenter 8.1.1 Microsoft Windows x86 Installer (Part 1 of 2)
V11452-01 Part 2 of 2 - Hyperion Data Integration Management Release 9.3.1.1 Informatica PowerCenter 8.1.1 Microsoft Windows x86 Installer (Part 2 of 2)
Planning Adapter for Informatica
V11450-01 - Hyperion Data Integration Management Adapter for Planning Release 9.3.1.1 Informatica PowerCenter 8.1.1 Microsoft Windows x86 Installer
After installing the DIM Application and adapter, i did't get Application connection browse as "*Hyperion Planning Connection*". I cant able to select the planning adapter in informatica.
Please guide me in this situtation, its very urgent requirement for me.
Thanks & Regards,
PCHi John,
Thanks for ur prompt reply.
I installed DIM Informatica 8.1.1, for that i installed Planning adapter as "Hyperion Data Integration Management Adapter for Planning Release 9.3.1.1 Informatica PowerCenter 8.1.1 Microsoft Windows x86 Installer".
Hyperion Data Integration Management Release 9.3.1 Microsoft Windows x86 Installer - V11259-01 - I think, this adapter is used for Informatica 7.1.5. not for informatica 8.1.1
Correct me, if i am wrong john
Thanks & Regards,
PC -
DIM Error when starting Informatica - Failed to load DLL: HASClient.dll
Hi all,
I have Informatica 8.1.1 SP3 installed and I have installed Hyperion DIM adapter for Essbase 11.1.1.
I have followed all the steps given in the installation guide to install the adapters.
But when I open Informatica I am getting the error - Failed to load DLL: HASClient.dll for plug in HASCONNECTOR.
Beacuse of that I am not getting the option to 'Import from Essbase' in Informatica.
Can anyone give any idea what I may have done wrong and how can I make it working.
Thanks..You need to run through the instructions again. This sounds like an issue with the environment variables not being set correctly.
Look in the [DIM Install PDF|http://download.oracle.com/docs/cd/E17236_01/epm.1112/dim_11111_install.pdf] -
Illegal Operation when attempting to define a DIM Source/Target for Essbase
We have installed the Hyperion DIM adapter and got past errors finding HASClient.dll when starting Designer.
In Workflow we have defined a data source for Essbase. When attempting to define a new source from 'Hyperion Essbase'. The application pops up an error dialogue stating that HASClient.dll has performed an illegal operation.
Have double checked the environment variables and they look OK. Anyone any idea what might have gone wrong? We already have Hyperion Planning adapters running fine, it's just the Essbase adapters giving problems.We solved the problem by reviewing and correcting some environment variables that had been wrongly adjusted on previous product installs.
We stripped back the environment variables and then built new ones in line with the [DIM 11.1.1.2 Installation Instructions|http://download.oracle.com/docs/cd/E17236_01/epm.1112/dim_11111_install.pdf] -
Loading Performance Scorecard measure with DIM
Hi,
I'm having a bit of a problem loading measure into Hyperion Performance Scorecard 9.3.1 with DIM adapter. I have managed to load the measures and set some of the properties, however there seems to be a problem setting the High / Low result (HigherIsBetter port) and Result frequency. Tried passing in T and F for HigherIsBetter and 0 to 8 for ResultFrequency but nothing happened. Has anybody had this problem before? I have applied the 9.3.0.1.1 patch to the DIM 9.3.0.1 adapter.
Regards,
GerdAfter compression, the requested IDs will delete but where the deleted request IDs goes? Is there any chance to get them back?
After the compression request id replace by 0. You can't find anymore.
what about if I want to load delta on already compressed cube? how compression impact on cube after delta?
This is normal behavior. we can load delta data to compressed cube. no issues with it.
Compression won't impact on delta.
compression - just moves data from F fact table E fact table. Your loaded delta records(uncompressed) will be at F fact table.
Compression always do on old request not on the latest requests.
Aggregates on cube will improve query performance, apart from query response time how do you know query performance increased?
first you can check your how much time taking without aggregates note down it.
later create aggregates and check query performance time.
You can check query statistics at RSRT --> use cache or aggregates, execute+debug.
About DSO requirement:
As my guess we never get such requirement to load 10 objects from one source and remaining 4 objects from another source to fill 14 objects of cube.
You can load, but thru one dso you will get 10 objects data and 4 objects data will be blank.
2dso also same it will fill 4 objects data and 10 objects will be blank.
routines - we can't about this. its purely depend on your requirement.
BI Content - if you want one data flow, you need objects, based on your data source or cube you will get/find required info objects by using bi content.
Thanks -
"Failed to open the connection" problem related to multiple tables in the report?
Post Author: Gadow
CA Forum: Data Connectivity and SQL
System specifics:
Web environment using ASP.Net 2.0 (from Visual Studio 2005 Professional)
Crystal Reports 2008, v. 12.0.0.549, Full
We have set up the following method for displaying reports via our website:
User is sent to a report-specific page. The user is given some filtering options specific to the report that will be viewed. When the user has specified the data filters, the user clicks a button.
The page wraps up the report parameters -- selection query, formula values, report location, the name to be displayed, etc. -- into a class which gets put into the Session object.
The page redirects to DisplayReport.aspx. ALL reports redirect to this page.
DisplayReport.aspx retrieves the report parameters from Session. A ReportDocument object is created and loaded, then set with the data from the parameters class.
A ConnectionInfo object is created and set with the relevant log on credentials. All of the reports draw from the same database, so the connection information is hard-coded as the same for all reports. The page then iterates through all of the tables in the Database.Tables collection of the ReportDocument and calls ApplyLogOnInfo to each table using the ConnectionInfo object.
The page is rendered and the user gets the filtered report.
We currently have seven reports. Five reports work fine and display the correctly filtered data with no error messages. Two reports generate a Failed to open the connection error and do not display. I have verified that the queries being sent to DisplayReport.aspx are valid, and as I said the connection information itself is hard-coded in the one page that displays the reports and this is identical to all reports.
The five reports that do work all have a single data table, either an actual database table or a single view. The two reports that do not work all have multiple tables. As far as I can tell, this is the only difference between the sets; all seven reports are based on the same DSN and I have verified the database on all of the reports. All of the reports were written using Crystal Reports 8, and all of the reports display fine in a Windows app I wrote some years ago using Crystal Reports 8. Again, the only difference between those reports that do work and those that do not is the number of tables used in the report: one table or view in the reports that display, more than one table (tables only, none use views) in the reports that do not display.
As for the code I am using, below are the relevant methods. The function MakeConnectionInfo simply parses out the components of a standard SQL connection string into a ConnectionInfo object. DisplayedReport is the ID of the CrystalReportViewer on the page.Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs)
Dim o As Object = Session("ReportParams")
Dim ReportURL As String = ""
'Verify that there is a ReportParameters object
If o Is Nothing OrElse o.GetType IsNot GetType(ReportParameters) Then 'Redirect to the error page
Response.Redirect("/errors/MissingReport.aspx")
End If
ReportParams = CType(o, ReportParameters)
'Verify that the report exists
ReportURL = "/Reports/ReportFiles/" + ReportParams.ReportName
ReportPath = Server.MapPath(ReportURL)
If Not File.Exists(ReportPath) Then
Response.Redirect("/errors/MissingReport.aspx?Report=" + ReportParams.ReportTitle)
End If
InitializeReport()
End Sub
Protected Sub InitializeReport()
Dim RD As New ReportDocument
Dim CI As ConnectionInfo = MakeConnectionInfo(DB_Bonus)
Dim RPF As CrystalDecisions.Shared.ParameterField = Nothing
RD.Load(ReportPath)
If ReportParams.SelectString <> "" Then
Dim Adapt As New SqlDataAdapter(ReportParams.SelectString, DB_Bonus)
Dim DS As New Data.DataSet
Adapt.Fill(DS)
RD.SetDataSource(DS.Tables(0))
End If
For Each kvp As KeyValuePair(Of String, String) In ReportParams.Formulas
Dim FFD As FormulaFieldDefinition = Nothing
Try
FFD = RD.DataDefinition.FormulaFields(kvp.Key)
Catch ex As Exception
'Do nothing
End Try
If FFD IsNot Nothing Then
Select Case FFD.ValueType
Case FieldValueType.DateField, FieldValueType.DateTimeField
If IsDate(kvp.Value) Then
FFD.Text = String.Format("Date()", Convert.ToDateTime(kvp.Value).ToString("yyyy, MM, dd"))
Else
FFD.Text = "Date(1960, 01, 01)"
End If
Case FieldValueType.StringField
FFD.Text = String.Format("""""", kvp.Value)
Case Else
'For now, treat these as if they were strings. If things blow up here,
'we will need to add the appropriate formatting for the field type.
FFD.Text = String.Format("""""", kvp.Value)
End Select
End If
Next
For Each T As CrystalDecisions.CrystalReports.Engine.Table In RD.Database.Tables
Dim TLI As TableLogOnInfo = T.LogOnInfo
TLI.ConnectionInfo = CI
T.ApplyLogOnInfo(TLI)
Next
DisplayedReport.ReportSource = RD
End Sub
Does this approach not work with reports containing multiple tables, or is there something I'm missing? Any meaningful suggestions would be much appreciated.Dear Dixit,
Please refer to the Crystal report landing page to get the details
information about the support for crystal report issues.
Please use the following thread to post your questions related to
crystal report.
SAP Business One and Crystal Reports
Regards,
Rakesh Pati
SAP Business One Forum Team. -
Attempting to Save data from an access database file into a local variable for use.
Hello! i'm trying to develop a small text based game in Visual Basic 2013 and I've recently decided i need to use a more sophisticated data storage system then dozens of .txt files and stream-readers. i'm using Microsoft access and i completed my database
last night. it stores the stat and skill values of the player-character and the non-player characters. the problem is i cannot bring the data into visual basic in a usable way. using ado.net i can bring a single record into the system as a detail view and
then read the data in from the labels but i'd far prefer to have it done purely through code. the book i purchased only covers data grid views and detail view and I've spent several hours searching for a solution online.
for clarification. i need to read each value in a record into a variable so i can calculate the stats for the games combat system.So, you want to select from MS Access?
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Ryan\Desktop\Coding\Microsoft Access\Northwind_2012.mdb"
Dim selectCommand As String
Dim connection As New OleDbConnection(connectionString)
selectCommand = "Select * From MyExcelTable ORDER BY ID"
Me.dataAdapter = New OleDbDataAdapter(selectCommand, connection)
With DataGridView1
.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.ColumnHeader
End With
Dim commandBuilder As New OleDbCommandBuilder(Me.dataAdapter)
Dim table As New DataTable()
table.Locale = System.Globalization.CultureInfo.InvariantCulture
Me.dataAdapter.Fill(table)
Me.bindingSource1.DataSource = table
Dim data As New DataSet()
data.Locale = System.Globalization.CultureInfo.InvariantCulture
DataGridView1.DataSource = Me.bindingSource1
Me.DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Aqua
Me.DataGridView1.AutoResizeColumns( _
DataGridViewAutoSizeColumnsMode.AllCells)
End Sub
Then from DataGridView to a text file, right.
Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim dt As DataTable = New DataTable
Dim DBAdapter As OleDbDataAdapter = New OleDbDataAdapter
Dim connection As OleDbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\Excel\\Desktop\\Coding\\Microsoft Access\\Nor"& _
"thwind.mdb;Jet OLEDB:System Database=system.mdw")
Dim query As String = "SELECT * FROM Orders;"
connection.Open
Dim command As OleDbCommand = New OleDbCommand(query, connection)
Dim adapter As OleDbDataAdapter = New OleDbDataAdapter(command)
adapter.Fill(dt)
Dim writer As StreamWriter = New StreamWriter("C:\\Users\\Excel\\Desktop\\FromAccess.txt")
For Each Row As DataRow In dt.Rows
For Each values As Object In Row.ItemArray
writer.Write(values)
Next
Next
writer.Close
End Sub
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it. -
How to match a fingerprint template from database ?
i now can save a fingerprint template from database using this code..
Dim fingerprintData As MemoryStream = New MemoryStream
Template.Serialize(fingerprintData)
fingerprintData.Position = 0
Dim br As BinaryReader = New BinaryReader(fingerprintData)
Dim bytes() As Byte = br.ReadBytes(CType(fingerprintData.Length, Int32))
Dim cmd As SqlCommand = New SqlCommand("INSERT INTO fininger_table VALUES(@FIRSTNAME, @LASTNAME, @FINGERPRINT)", conn)
cmd.Parameters.Add("FIRSTNAME", SqlDbType.VarChar).Value = CaptureForm.tboxFname.Text
cmd.Parameters.Add("LASTNAME", SqlDbType.VarChar).Value = CaptureForm.tboxLname.Text
cmd.Parameters.Add("FINGERPRINT", SqlDbType.Image).Value = bytes
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
and i fetch the data when the form is load..
conn.Open()
Dim cmd As New SqlCommand("SELECT * FROM Fininger_table", conn)
Dim rdr As SqlDataReader = cmd.ExecuteReader()
Dim MemStream As IO.MemoryStream
Dim fpBytes As Byte()
While rdr.Read()
fpBytes = rdr("FINGERPRINT")
MemStream = New IO.MemoryStream(fpBytes)
Dim template As New DPFP.Template(MemStream)
OnTemplate(template)
' template.DeSerialize(MemStream)
End While
rdr.Close()
conn.Close()
and now i'm stuck..i dont know how to match the fingerprint from the database to verify the user..
plz help me out..tnx in advance
btw im using a DIGITAL PERSONA FINGERPRINT READER..with the OTW SDKHello My dear Brother
I am zaid Ahmad khan would like to help you and this is the working code please see this and you will have the solution
Imports System.Data.SqlClient
Imports DPFP
Public Class Form1
Private WithEvents verifyControl As DPFP.Gui.Verification.VerificationControl
Private matcher As DPFP.Verification.Verification
Private matchResult As DPFP.Verification.Verification.Result
Private allReaderSerial As String = "00000000-0000-0000-0000-000000000000"
Public template As DPFP.Template
Private userTemplateColumn As String = "Template"
Private userIDColumn As String = "ID"
Dim bytes As Byte()
Private Sub CreateDPControl(ByRef control As DPFP.Gui.Verification.VerificationControl)
Try
control = New DPFP.Gui.Verification.VerificationControl()
control.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink
control.Name = "verifyControl"
control.Location = New System.Drawing.Point(0, 0)
control.ReaderSerialNumber = "00000000-0000-0000-0000-000000000000"
control.Visible = True
control.Enabled = True
control.BringToFront()
Me.Controls.Add(control)
Catch ex As Exception
MessageBox.Show("exception")
End Try
End Sub
Private Function ConnectString() As String
Dim connectionString As String
connectionString = "Server=localhost;database=bs;User ID=sa;Password=123"
Return connectionString
End Function
Private Sub VerifyBiometric_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
matcher = New Verification.Verification()
matchResult = New Verification.Verification.Result
CreateDPControl(verifyControl)
End Sub
Private Sub verifyControl_OnComplete(ByVal Control As Object, ByVal FeatureSet As DPFP.FeatureSet, ByRef EventHandlerStatus As DPFP.Gui.EventHandlerStatus) Handles verifyControl.OnComplete
Dim dataSet As DataSet = New DataSet()
Dim adapter As SqlDataAdapter = New SqlDataAdapter()
Dim sqlCommand As SqlCommand = New SqlCommand()
Dim ctr = 0
Try
Dim max As Integer = 0
Dim cn As New SqlConnection(ConnectString())
cn.Open()
sqlCommand.CommandText = "Select templateBytes7 from userthumbs where id='1029'"
sqlCommand.CommandType = CommandType.Text
sqlCommand.Connection = cn
Dim lrd As SqlDataReader = sqlCommand.ExecuteReader()
Dim usr
While lrd.Read()
usr = lrd("templateBytes7")
End While
bytes = Nothing
bytes = usr
template = New DPFP.Template()
template.DeSerialize(usr)
'Perform match
matcher.Verify(FeatureSet, template, matchResult)
If matchResult.Verified Then
EventHandlerStatus = Gui.EventHandlerStatus.Success
MsgBox("Verified!")
Me.Hide()
MessageBox.Show("Done")
Else
EventHandlerStatus = Gui.EventHandlerStatus.Failure
MsgBox("Please Try Again!")
End If
Finally
End Try
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class -
Crystal reports, Push method using a stored Procedure
Could someone 'PLEASE' help! I am trying to create and populate a Crystal Report via a stored procedure in a vb.net asp.net web site.. I have created a dataset1.xsd and I have dragged my Stored_Proc onto the dataset. I then use the 'DataBase Expert' and select ADO.net Datasets and select my storedProcedure from dataset1 as my selected dataset. After that I just drag the fields onto my report. Then via ado.net shown below I populate the dataset. I can loop through the dataset and it does get populated correctly from the stored_proc. yet when the report pops up in a web browser the fields are empty. I have found that this method works fine if I drag an actual table from my database onto my dataset, but I need to populate the dataset via joins and a parameter.
Could someone please tell me what I'm missing!
***********Code Sample**************
Dim conStr As String = System.Configuration.ConfigurationManager.AppSettings("adoConnString")
Dim sqlConnection As New SqlConnection(conStr)
Dim Command As SqlCommand = New SqlCommand()
Command.Connection = sqlConnection
Command.CommandText = "usp_GetInquiryByID"
Command.CommandType = CommandType.StoredProcedure
Dim Parameter As SqlParameter = New SqlParameter("@intInqID", 108)
Parameter.Direction = ParameterDirection.Input
Parameter.DbType = DbType.Int16
Command.Parameters.Add(Parameter)
Dim Adapter As SqlDataAdapter = New SqlDataAdapter(Command)
Dim ds As New DataSet1
Adapter.Fill(ds, "Inquirys")
CrystalReportSource1.ReportDocument.SetDataSource(ds)
CrystalReportSource1.DataBind()
Duckkiller53Hello Scott,
It'll be difficult to migrate CR 10 reports to SQL Server 2005, since it's not a supported combination:
[http://resources.businessobjects.com/support/communitycs/TechnicalPapers/cr10_supported_platforms.pdf|http://resources.businessobjects.com/support/communitycs/TechnicalPapers/cr10_supported_platforms.pdf]
Also, CR 10 will be going out of support at the end of the year, so the supported platform list will not be expanded.
It's not a recommended combination for production use.
Sincerely,
Ted Ueda -
Can someone help me with the following problem.
I use CR2008 in a web environment ASP 2008.
When I request a report in PDF format with bookmarks.
I see in the first bookmark the report name with something between maybe a session id.
report_name{AE261482-41A9-BD6F-A97BE291F83}.rpt
What is the solution to get only the reportname.
ThanksLudek,
I send you some code from my application this is with a msaccess database we get the same connect to a oracle database.
If you like I will send you the website you can try it by yourself.
But don't how to upload it.
Code:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strReportFilePath As String
Dim strFileName As String
Dim cmd As OleDbCommand
Dim ds As DataSet
Dim adapter As OleDbDataAdapter
Dim destoptions As DiskFileDestinationOptions
Dim repdoc As ReportDocument
Dim cn As New OleDbConnection
' Vullen Dataset voor gebruik van Crystal Reports
Try
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\data\testcr\testcr.mdb; User Id=admin; Password="
cmd = New OleDbCommand
With cmd
' voeg SQL string toe
.CommandText = "select * from tst_hours"
' open connectie
.Connection = cn
.Connection.Open()
End With
' bepaal de plaats van het report
strReportFilePath = Server.MapPath("Reports
TestRap.rpt")
strFileName = "tst_hours"
adapter = New OleDbDataAdapter(cmd)
ds = New DataSet()
adapter.Fill(ds, strFileName)
destoptions = New DiskFileDestinationOptions
repdoc = New ReportDocument
repdoc.Load(strReportFilePath)
repdoc.SetDataSource(ds)
strFileName = strFileName & "_" & User.Identity.Name.ToString() & ".pdf"
' instellen options en response
repdoc.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile
repdoc.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
repdoc.ExportOptions.DestinationOptions = destoptions
repdoc.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, True, "TestReport")
Catch ex As Exception
' bij foutmelding listboxen disabled en foutmelding tonen
Finally
' altijd de connectie met de database sluiten
cn.Close()
End Try
End Sub
The result is a sessionid on the first bookmark.
Rene -
Never implemented exception handling in Stored Procedures
I have lots of stand alone stored procedures callled from .NET 20 programs that follow the following pattern. They runn against Oracle 10.2 on Win2003. The only deviiation is a couple where I insert to temptables. I specify a parameter for messages but don't know the best way to implement for Oracle as well as any tips on ODP.NET/oracle interactions error handling.
1. Is it recommended to implement exception handling in With Clauses?
2. If there is an exception in one cursor's SQL, how do I still execute the second?
3. Is it best in some circumstances to pass a null back to client and check for null in program?
From .NET programs I have run into a couple of problems.
4. TNS packet failure.
Anyways any suggestions or experiences are welcome.
CREATE OR REPLACE PROCEDURE GET_SALES_DATA
, p_businessdate in date
, p_message out varchar2
, p_rcSales out sys_refcursor
, p_rInventory out sys_refcursor
) is
open p_rcSales for
with somedata as (select ...)
, someMoreData as (selct ...)
-- Main select
Select * from somedata sd inner join somemoredata smd on smd.key = sd.key;
open p_rcInventory for
with somedata as (select ...)
, someMoreData as (selct ...)
-- Main select
Select * from somedata sd inner join somemoredata smd on smd.key = sd.key;
-- CODE NOT IMPLEMENTED
-- exception
-- when TOO_MANY_ROWS then select 'Error handling for future implementations' into p_message from dual ;
-- when NO_DATA_FOUND then select 'Error handling for future implementations. No data' into p_message from dual;
-- when others then raise_application_error(-20011,'Unknown Exception in GET_SALES_DATA Function');
-- WHEN invalid_business_date then select 'Invalid: Business date is in the current work week.' into p_message from dual ;
END GET_SALES_DATA;Pseudocode'ish because Module level variables and properties have not been defined here for brevity.
Public Class WebPage1
PAge_Load
GetData
End Class Data Access Layer
Public Class DAL
Public Sub GetOracleData()
Dim conn As OracleConnection
Try
conn = New OracleConnection
Catch ex As Exception
Throw ex
End Try
Dim cmd As New OracleCommand
With cmd
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("MyConnectionString").ToString
cmd.CommandText = DATABASE.GetSalesData
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = conn
End With
cmd.Connection = conn
Dim oparam As OracleParameter
oparam = cmd.Parameters.Add("p_businessdate", OracleDbType.Date)
oparam.Value = BusinessDate.ToString("dd-MMM-yy")
oparam = cmd.Parameters.Add("p_message", OracleDbType.Varchar2, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rc_inven_csv", OracleDbType.RefCursor, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rcSales", OracleDbType.RefCursor, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rcInventory", OracleDbType.RefCursor, ParameterDirection.Output)
Dim Adapter As New OracleDataAdapter(cmd)
Try
Adapter.TableMappings.Add("Table", Sales)
Adapter.TableMappings.Add("Table1", Inventory)
Adapter.Fill(dsOracleData)
Catch ex As OracleException
HandleError("Exception Retrieving Oracle Data", ex, MethodInfo.GetCurrentMethod.Name, True)
Finally
If conn.State = ConnectionState.Open Then
conn.Close()
End If
End Try
dbMessages = cmd.Parameters("p_message").ToString
End If
arrStatusMessages.Add("Retrieved Oracle Data Successfully")
End Sub
' Original Implementation ; No longer used
Public function GetOracleData
Dim conn As New OracleConnection
conn.ConnectionString = dbconn.Connectionstring
Dim cmd As New OracleCommand
With cmd
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("MyConnectionString").ToString
cmd.CommandText = DATABASE.GetSalesData
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = conn
End With
cmd.Connection = conn
Dim oparam As OracleParameter
oparam = cmd.Parameters.Add("p_businessdate", OracleDbType.Date)
oparam.Value = BusinessDate.ToString("dd-MMM-yy")
oparam = cmd.Parameters.Add("p_message", OracleDbType.Varchar2, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rcSales", OracleDbType.RefCursor, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rcInventory", OracleDbType.RefCursor, ParameterDirection.Output)
Dim Adapter As New OracleDataAdapter(cmd)
Try
Adapter.TableMappings.Add("Table", Sales)
Adapter.TableMappings.Add("Table1", Inventory)
Adapter.Fill(dsOracleData)
dim dt as datatable = dsoracledata.tables("sales")
If IsDataNull(dt) Then
_errorType = DBErrorType.NullData
End If
If isDataEmpty(dt) Then
_errorType = DBErrorType.EmptyData
End If
_hasError = False
Catch oraEx As OracleException
_ExceptionText = oraEx.Message.ToString
_errorType = DBErrorType.OracleException
#If DEBUG Then
Throw oraEx
#End If
Catch zeroEx As DivideByZeroException
_ExceptionText = zeroEx.Message.ToString
_errorType = DBErrorType.DivideByZeroException
#If DEBUG Then
Throw zeroEx
#End If
Catch oflowEx As OverflowException
_ExceptionText = oflowEx.Message.ToString
_errorType = DBErrorType.OverflowException
#If DEBUG Then
Throw oflowEx
#End If
Catch argEx As InsufficientMemoryException
_ExceptionText = argEx.Message.ToString
_errorType = DBErrorType.InsufficientMemoryException
#If DEBUG Then
Throw argEx
#End If
Catch nomemEx As OutOfMemoryException
_ExceptionText = nomemEx.Message.ToString
_errorType = DBErrorType.OutOfMemoryException
#If DEBUG Then
Throw nomemEx
#End If
Catch Ex As Exception
_ExceptionText = Ex.Message.ToString
_errorType = DBErrorType.GenericException
#If DEBUG Then
Throw Ex
#End If
Finally
If conn.State = ConnectionState.Open Then
conn.Close()
End If
End Try
End class Error Class
Public Class Errors
Public Sub ExitClass()
Return
End Sub
' 'blnWriteNow says when Error is critical and no further processing needs to be done by class, then write to event logs or text files and call exit class
' to return control back to webpage. This is my first time trying this way.
Public Sub HandleError(ByVal friendlyMsg As String, ByVal objEx As Exception, ByVal methodInfo As String, Optional ByVal blnWriteNow As Boolean = False)
If Not blnWriteNow Then Exit Sub
Dim strMessages As String
strMessages = arrStatusMessages
'Send error email
If blnSendEmails Then
SendMail("[email protected], strMessages. applicationname, " has thrown error. ")
End If
'Throw error for debugging
If blnThrowErrors Then
Throw New Exception(strMessages & vbCrLf & objEx.Message)
End If
' Write to event log and if not available (shared hosting environment), write to text log
If blnWriteNow Then
If blnWriteToEvtLog Then
If blnCanWriteToEvtLog Then 'Program has write permission to log
WriteToEventLog(strMessages, _appname, EventLogEntryType.Error, appname)
Else
If Not Directory.Exists( appPath & "\log") Then
Try
Directory.CreateDirectory( appPath & "\log")
Catch ex As Exception
arrStatusMessages.Add("Cant't write to event log or create a directory")
End Try
End If
End If
End If
End If
End Sub
End ClassI have lots of stand alone stored procedures callled from .NET 20 programs that follow the following pattern. They runn against Oracle 10.2 on Win2003. The only deviiation is a couple where I insert to temptables. I specify a parameter for messages but don't know the best way to implement for Oracle as well as any tips on ODP.NET/oracle interactions error handling.
1. Is it recommended to implement exception handling in With Clauses?
2. If there is an exception in one cursor's SQL, how do I still execute the second?
3. Is it best in some circumstances to pass a null back to client and check for null in program?
From .NET programs I have run into a couple of problems.
4. TNS packet failure.
Anyways any suggestions or experiences are welcome.
CREATE OR REPLACE PROCEDURE GET_SALES_DATA
, p_businessdate in date
, p_message out varchar2
, p_rcSales out sys_refcursor
, p_rInventory out sys_refcursor
) is
open p_rcSales for
with somedata as (select ...)
, someMoreData as (selct ...)
-- Main select
Select * from somedata sd inner join somemoredata smd on smd.key = sd.key;
open p_rcInventory for
with somedata as (select ...)
, someMoreData as (selct ...)
-- Main select
Select * from somedata sd inner join somemoredata smd on smd.key = sd.key;
-- CODE NOT IMPLEMENTED
-- exception
-- when TOO_MANY_ROWS then select 'Error handling for future implementations' into p_message from dual ;
-- when NO_DATA_FOUND then select 'Error handling for future implementations. No data' into p_message from dual;
-- when others then raise_application_error(-20011,'Unknown Exception in GET_SALES_DATA Function');
-- WHEN invalid_business_date then select 'Invalid: Business date is in the current work week.' into p_message from dual ;
END GET_SALES_DATA;Pseudocode'ish because Module level variables and properties have not been defined here for brevity.
Public Class WebPage1
PAge_Load
GetData
End Class Data Access Layer
Public Class DAL
Public Sub GetOracleData()
Dim conn As OracleConnection
Try
conn = New OracleConnection
Catch ex As Exception
Throw ex
End Try
Dim cmd As New OracleCommand
With cmd
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("MyConnectionString").ToString
cmd.CommandText = DATABASE.GetSalesData
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = conn
End With
cmd.Connection = conn
Dim oparam As OracleParameter
oparam = cmd.Parameters.Add("p_businessdate", OracleDbType.Date)
oparam.Value = BusinessDate.ToString("dd-MMM-yy")
oparam = cmd.Parameters.Add("p_message", OracleDbType.Varchar2, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rc_inven_csv", OracleDbType.RefCursor, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rcSales", OracleDbType.RefCursor, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rcInventory", OracleDbType.RefCursor, ParameterDirection.Output)
Dim Adapter As New OracleDataAdapter(cmd)
Try
Adapter.TableMappings.Add("Table", Sales)
Adapter.TableMappings.Add("Table1", Inventory)
Adapter.Fill(dsOracleData)
Catch ex As OracleException
HandleError("Exception Retrieving Oracle Data", ex, MethodInfo.GetCurrentMethod.Name, True)
Finally
If conn.State = ConnectionState.Open Then
conn.Close()
End If
End Try
dbMessages = cmd.Parameters("p_message").ToString
End If
arrStatusMessages.Add("Retrieved Oracle Data Successfully")
End Sub
' Original Implementation ; No longer used
Public function GetOracleData
Dim conn As New OracleConnection
conn.ConnectionString = dbconn.Connectionstring
Dim cmd As New OracleCommand
With cmd
conn.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("MyConnectionString").ToString
cmd.CommandText = DATABASE.GetSalesData
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = conn
End With
cmd.Connection = conn
Dim oparam As OracleParameter
oparam = cmd.Parameters.Add("p_businessdate", OracleDbType.Date)
oparam.Value = BusinessDate.ToString("dd-MMM-yy")
oparam = cmd.Parameters.Add("p_message", OracleDbType.Varchar2, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rcSales", OracleDbType.RefCursor, ParameterDirection.Output)
oparam = cmd.Parameters.Add("p_rcInventory", OracleDbType.RefCursor, ParameterDirection.Output)
Dim Adapter As New OracleDataAdapter(cmd)
Try
Adapter.TableMappings.Add("Table", Sales)
Adapter.TableMappings.Add("Table1", Inventory)
Adapter.Fill(dsOracleData)
dim dt as datatable = dsoracledata.tables("sales")
If IsDataNull(dt) Then
_errorType = DBErrorType.NullData
End If
If isDataEmpty(dt) Then
_errorType = DBErrorType.EmptyData
End If
_hasError = False
Catch oraEx As OracleException
_ExceptionText = oraEx.Message.ToString
_errorType = DBErrorType.OracleException
#If DEBUG Then
Throw oraEx
#End If
Catch zeroEx As DivideByZeroException
_ExceptionText = zeroEx.Message.ToString
_errorType = DBErrorType.DivideByZeroException
#If DEBUG Then
Throw zeroEx
#End If
Catch oflowEx As OverflowException
_ExceptionText = oflowEx.Message.ToString
_errorType = DBErrorType.OverflowException
#If DEBUG Then
Throw oflowEx
#End If
Catch argEx As InsufficientMemoryException
_ExceptionText = argEx.Message.ToString
_errorType = DBErrorType.InsufficientMemoryException
#If DEBUG Then
Throw argEx
#End If
Catch nomemEx As OutOfMemoryException
_ExceptionText = nomemEx.Message.ToString
_errorType = DBErrorType.OutOfMemoryException
#If DEBUG Then
Throw nomemEx
#End If
Catch Ex As Exception
_ExceptionText = Ex.Message.ToString
_errorType = DBErrorType.GenericException
#If DEBUG Then
Throw Ex
#End If
Finally
If conn.State = ConnectionState.Open Then
conn.Close()
End If
End Try
End class Error Class
Public Class Errors
Public Sub ExitClass()
Return
End Sub
' 'blnWriteNow says when Error is critical and no further processing needs to be done by class, then write to event logs or text files and call exit class
' to return control back to webpage. This is my first time trying this way.
Public Sub HandleError(ByVal friendlyMsg As String, ByVal objEx As Exception, ByVal methodInfo As String, Optional ByVal blnWriteNow As Boolean = False)
If Not blnWriteNow Then Exit Sub
Dim strMessages As String
strMessages = arrStatusMessages
'Send error email
If blnSendEmails Then
SendMail("[email protected], strMessages. applicationname, " has thrown error. ")
End If
'Throw error for debugging
If blnThrowErrors Then
Throw New Exception(strMessages & vbCrLf & objEx.Message)
End If
' Write to event log and if not available (shared hosting environment), write to text log
If blnWriteNow Then
If blnWriteToEvtLog Then
If blnCanWriteToEvtLog Then 'Program has write permission to log
WriteToEventLog(strMessages, _appname, EventLogEntryType.Error, appname)
Else
If Not Directory.Exists( appPath & "\log") Then
Try
Directory.CreateDirectory( appPath & "\log")
Catch ex As Exception
arrStatusMessages.Add("Cant't write to event log or create a directory")
End Try
End If
End If
End If
End If
End Sub
End Class -
ODP OracleCommandBuilder. Updating a table including DATE columns.
Hi
I have a problem with the OracleCommandBuilder not creating the correct update commands when I have DATE type columns in the table.
I have created a test table (called DATETEST) with three columns:
STRINGCOLUMN VARCHAR2 10
DATECOLUMN DATE
NUMBERCOLUMN NUMBER
The STRINGCOLUMN is the primary key.
Then I created a typed dataset that looks like this:
STRINGCOLUMN string
DATECOLUMN string
NUMBERCOLUMN long
This is the XML schema for the typed dataset:
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="DateDS" targetNamespace="http://tempuri.org/DateDS.xsd" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns="http://tempuri.org/DateDS.xsd" xmlns:mstns="http://tempuri.org/DateDS.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="DateDS" msdata:IsDataSet="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="DATETEST">
<xs:complexType>
<xs:sequence>
<xs:element name="DATECOLUMN" type="xs:string" minOccurs="0" />
<xs:element name="STRINGCOLUMN" type="xs:string" minOccurs="0" />
<xs:element name="NUMBERCOLUMN" type="xs:long" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
And this is the test code:
Dim connection As Oracle.DataAccess.Client.OracleConnection
Dim adapter As New Oracle.DataAccess.Client.OracleDataAdapter()
Dim dbCommand As New Oracle.DataAccess.Client.OracleCommand()
Dim sqlstring As String
Dim data As New DateDS() 'Typed dataset
Const ConnectionString As String = "User Id=............."
Try
'Connect to database
connection = New OracleConnection(ConnectionString)
connection.Open()
'Get data from table DATETEST
dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN) AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
dbCommand.Connection = connection
adapter.SelectCommand = dbCommand
adapter.Fill(data, "DATETEST")
'Make changes to dataset
data.DATETEST(0).DATECOLUMN = Now()
data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
'Update database
sqlstring = "SELECT * FROM DATETEST"
adapter.SelectCommand = New OracleCommand(sqlstring, connection)
Dim custCB As New Oracle.DataAccess.Client.OracleCommandBuilder()
custCB.DataAdapter = adapter
adapter.Update(data, "DATETEST")
'Disconnect
connection.Close()
connection.Dispose()
Catch exc As Exception
MessageBox.Show(exc.Message)
End Try
Getting the data from the database is not a problem.
The dataset contains the correct information.
But updating the database is impossible.
I get errors like:
ORA-01861: literal does not match format string
And if I don't specify a DATE format in the TO_CHAR statement I get this error:
Concurrency violation: the UpdateCommand affected 0 records.
I think I've tried everything.
I've used the OracleGlobalization class, with the SetSessionInfo method.
I've tried all different types of date conversions to make sure that
the date format on the database is the same as in the dataset.
I've tried to change the NLS parameters on the DB server and in the registry on the client.
I've tried to change the DATECOLUMN type in the typed dataset from string to Oracle.DataAccess.Types.OracleDate
But it still doesn't work.
The default date format on the DB 9i server is AMERICAN,(DD-MON-RR).
A strange thing is that when I instead of using the ODP classes use
the System.Data.OracleClient and its OracleCommandBuilder
the code works perfectly without any errors.
This is the test code that works:
Dim connection As System.Data.OracleClient.OracleConnection
Dim adapter As New System.Data.OracleClient.OracleDataAdapter()
Dim dbCommand As New System.Data.OracleClient.OracleCommand()
Dim data As New DateDS()
Dim sqlstring As String
Const ConnectionString As String = "User Id=......."
Try
'Connect to database
connection = New System.Data.OracleClient.OracleConnection(ConnectionString)
connection.Open()
'Get data from table DATETEST
dbCommand.CommandText = "SELECT STRINGCOLUMN, TO_CHAR(DATECOLUMN,'YYYY-MM-DD HH24:MI:SS') AS DATECOLUMN, NUMBERCOLUMN FROM DATETEST"
dbCommand.Connection = connection
adapter.SelectCommand = dbCommand
adapter.Fill(data, "DATETEST")
'Make changes to dataset
data.DATETEST(0).DATECOLUMN = Now()
data.DATETEST(0).NUMBERCOLUMN = data.DATETEST(0).NUMBERCOLUMN + 1
'Update database
sqlstring = "SELECT * FROM DATETEST"
adapter.SelectCommand = New System.Data.OracleClient.OracleCommand(sqlstring, connection)
Dim custCB As New System.Data.OracleClient.OracleCommandBuilder()
custCB.DataAdapter = adapter
adapter.Update(data, "DATETEST")
'Disconnect
connection.Close()
connection.Dispose()
Catch exc As Exception
MessageBox.Show(exc.Message)
End Try
My experience until this came up is that the ODP provider is better on everything
than the microsoft Oracle provider so I don't want to switch unless I have to.
Could someone that have used the ODP OracleCommandBuilder for updating a table including DATE columns with a typed dataset please give me some tips on how to make this work?
I would be the happiest man on earth if someone had a solution :-)
ErikDon't convert the dates to strings. Ever.
The command builder uses the metadata returned from the select command to build the insert/update commands. Using to_char in the query tells ODP that that is a varchar2 column. If you omit the to_char the commandBuilder will know to bind a date parameter in that spot.
Also in your typed dataset you should change the type from a string to a date.
David
Maybe you are looking for
-
Hi, I have a column in my database called buy_or_share. I have the type set at ENUM ('buy', 'share') and default as: buy. I am building a search page for users to search whether they want to buy or share (in the form of a radio group) and then a sear
-
Why two different URLS lead to same thread?
My action engine nugget here http://forums.ni.com/ni/board/message?board.id=170&message.id=240328#M240328 showed up at the botom of the LV page as one ot the most Kudoed and when I hit that link it takes me to here http://forums.ni.com/ni/board/mess
-
Camera Calibration "Fors script in PS Cs
I have done a calibration using the Gretagmacbeth Color chart,for each of my Olympus cameras E300 and E20 which are supported by ACR 2.4 in PS CS using the Fors ACR calibration script. The profiles have not been updated since that version and show as
-
Hi All: I have created two optional/ready for input variables - one is for cost center values and the other is for nodes of the cost center hierarchy. I want to make sure that the user populates one of the two variables. For this reason, I cannot m
-
What (if any) Online Backup Services Can Handle 1 TB of Storage?
Hi - I have a 750GB OWC external hard drive that I like a lot, but is getting full (I store a lot of videos for work, as well as everything on my MacBook). I'd like to back it all up, and thought it might be smarter to use an online service this time