How to View Oracle Stored Procedure using SQLPlus?
check your casing, the name is typically stored in upper case SELECT * FROM all_source WHERE name=”DAILY_UPDATE” ORDER BY TYPE, LINE;
check your casing, the name is typically stored in upper case SELECT * FROM all_source WHERE name=”DAILY_UPDATE” ORDER BY TYPE, LINE;
Try adding this line to the beginning of your stored procedure: SET FMTONLY OFF You can remove this after you have finished importing.
To get more information about the cause of an “ODBC–call failed.” error we can loop through the DBEngine.Errors collection and see if there are other messages that might be a bit more descriptive. For example, with the code qdf.Connect = strConnectionString qdf.SQL = ” EXEC [dbo].[SAMPLE_TEST]” qdf.ReturnsRecords = True On Error GoTo oops Set rst … Read more
I believe there are three different cases that you have to worry about: strings (anything that requires quotes): ”” + replace(@string, ””, ”””) + ”” names (anything where quotes aren’t allowed): quotename(@string) things that cannot be quoted: this requires whitelisting Note: Everything in a string variable (char, varchar, nchar, nvarchar, etc.) that comes from user-controlled … Read more
This is documented here in the JDBC driver manual. In your case, you’d have to do this: try (SQLServerCallableStatement stmt = (SQLServerCallableStatement) con.prepareCall(“{call test(?)}”)) { SQLServerDataTable table = new SQLServerDataTable(); sourceDataTable.addColumnMetadata(“n”, java.sql.Types.INTEGER); sourceDataTable.addRow(9); sourceDataTable.addRow(12); sourceDataTable.addRow(27); sourceDataTable.addRow(37); stmt.setStructured(1, “dbo.integer_list_tbltype”, table); } I’ve also recently documented this in an article.
Pass parameter value like this – ‘AA,BB,CC’. Then, it is enough to use FIND_IN_SET function – SELECT product_id, product_price FROM product WHERE FIND_IN_SET(product_type, param);
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
I got it!…hehe protected DataTable RetrieveEmployeeSubInfo(string employeeNo) { SqlCommand cmd = new SqlCommand(); SqlDataAdapter da = new SqlDataAdapter(); DataTable dt = new DataTable(); try { cmd = new SqlCommand(“RETRIEVE_EMPLOYEE”, pl.ConnOpen()); cmd.Parameters.Add(new SqlParameter(“@EMPLOYEENO”, employeeNo)); cmd.CommandType = CommandType.StoredProcedure; da.SelectCommand = cmd; da.Fill(dt); dataGridView1.DataSource = dt; } catch (Exception x) { MessageBox.Show(x.GetBaseException().ToString(), “Error”, MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { … Read more
Something like create or replace procedure my_proc( p_rc OUT SYS_REFCURSOR ) as begin open p_rc for select 1 col1 from dual; end; / variable rc refcursor; exec my_proc( :rc ); print rc; will work in SQL*Plus or SQL Developer. I don’t have any experience with Embarcardero Rapid XE2 so I have no idea whether it … Read more
You can easily create procedures in phpMyAdmin. Go to your database. Click ‘Routines’ tab in header Click on ‘Add routine’ Then a popup window will be opened. In that write your procedure and click on “GO” For example like follows. That’s it. You can view your created procedures under ‘Routines’ tab itself.