Can a stored procedure/function return a table?

As for now, this is not possible. Here is the documentation on what may be used in the FROM clause: table_references: table_reference [, table_reference] … table_reference: table_factor | join_table table_factor: tbl_name [[AS] alias] [index_hint)] | table_subquery [AS] alias | ( table_references ) | { OJ table_reference LEFT OUTER JOIN table_reference ON conditional_expr } join_table: table_reference … Read more

How to kill all active and inactive oracle sessions for user

The KILL SESSION command doesn’t actually kill the session. It merely asks the session to kill itself. In some situations, like waiting for a reply from a remote database or rolling back transactions, the session will not kill itself immediately and will wait for the current operation to complete. In these cases the session will … Read more

Calling Oracle stored procedure from C#?

Please visit this ODP site set up by oracle for Microsoft OracleClient Developers: http://www.oracle.com/technetwork/topics/dotnet/index-085703.html Also below is a sample code that can get you started to call a stored procedure from C# to Oracle. PKG_COLLECTION.CSP_COLLECTION_HDR_SELECT is the stored procedure built on Oracle accepting parameters PUNIT, POFFICE, PRECEIPT_NBR and returning the result in T_CURSOR. using Oracle.DataAccess; … Read more

Retrieve data from stored procedure which has multiple result sets

To retrieve multiple result sets using a DataReader with NextResult you can do this String myConStr =”User ID=”user”;password=”pass”;Initial Catalog=pubs;Data Source=Server”; SqlConnection myConnection = new SqlConnection(myConStr); SqlCommand myCommand = new SqlCommand(); SqlDataReader myReader; myCommand.CommandType = CommandType.StoredProcedure; myCommand.Connection = myConnection; myCommand.CommandText = “MyProc”; try { myConnection.Open(); myReader = myCommand.ExecuteReader(); while (myReader.Read()) { // write logic to process … Read more

Bulk insert using stored procedure

There’s nothing wrong with your stored procedure code – the point is: the BULK INSERT command cannot accept a file name as a variable. This does work: BULK INSERT ZIPCodes FROM ‘e:\5-digit Commercial.csv’ WITH but this never works – within a stored proc or not: DECLARE @filename VARCHAR(255) SET @filename=”e:\5-digit Commercial.csv” BULK INSERT ZIPCodes FROM … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)