MSSQL Stored procedures

I have made stored procedures for an app, and i would like to
know how to prevent all the system SPs from showing up in the
Stored procedure tree. I think i need to create a schema for the
db?
Using CS3 on VIsta U and MSSQL 2005 Express

MikeL7 wrote:
> I have made stored procedures for an app, and i would
like to know how to
> prevent all the system SPs from showing up in the Stored
procedure tree. I
> think i need to create a schema for the db?
> Using CS3 on VIsta U and MSSQL 2005 Express
>
It sounds like your using an SQL login that has rights to see
all the
system SPs.
When I create web applications I always create an SQL user
for the web
pages, one which only has GRANT rights to the stored
procedures the
website needs. I also have an admin SQL user for the website
admin
pages, this user will have more rights and will be able to do
deletes or
inserts on particular tables.
Never ever ever use SA in your webpages to connect to your
SQL server,
if your site gets compromised via SQL injection then they
will have
complete control over it. Trust me on this one, its happened
to me, and
I had to learn the hard way by formatting the server and
reinstalling
everything, and setting up everything again. My boss was not
impressed
with me!
Steve

Similar Messages

  • How to call MSSQL stored procedure from oracle database

    MSSQL and Oracle databases are linked thru ODBC link using Oracle HSODBC.
    I can query MSSQL table or view from Oracle Database using standard notation for acessing remote objects schema.object@dblink_name...
    Can anybody give me syntax for calling MSSQL stored procedure thru ODBC database link?
    I tried syntax exec schema.stored_procedure@dblink_name but it doesn't work...i'm getting schema.stored_procedure must be declared error...
    Tnx,in advance!
    Dejan Botica

    Oracle database 10gR2.
    MSSQL2000 database.
    For example query:
    select * from dbo.Tbl_Test@kron@dw_jamnica; works fine...
    ...while for example exec dbo.Test@kron@dw_jamnica;
    reports error:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'DBO.TEST@KRON@DW_JAMNICA' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Table Tbl_Test and procedure Test exists in MSSQL instance.
    Regards,
    Dejan

  • MSSQL Stored procedure : only one command executed

    For a MSSQL Stored Procedure, We have used this
    Solution1:
    Just put SET NOCOUNT OFF in the end of the stored procedure. After that run the stored procedure in the Desktop Intelligence report.
    Or
    If the above doesnu2019t works then please try the following solution.
    Solution2:
    You have to add the given parameter in .sbo file -> save the file and run the stored Procedure.
    This file should be located under <drive>\Business Objects\BusinessObjects Enterprise 11.5\dataAccess\RDBMS\connectionServer\odbc\odbc.sbo
    <Defaults>
    <Parameter Name="Force SQLExecute">Always</Parameter>
    but it still does not work
    What others?

    Hello
    thank you for your answer but indicated procedure to test does not work too
    the message is the same : u201CNo column and no data to fetchu201D
    I return with more details :
    to create a new report DesKi, I use this stored procedure
    CREATE PROCEDURE dbo.test1 @matricule integer
    AS
    BEGIN
    SET NOCOUNT OFF
    delete from Temp_matr_boucle
    execute absences_matricules_per_matr @matricule /* it is ok */
    select MATRICULE ,NOM ,PRENOM ,CDDEP, NBR_PERIODE, NBR_JOURS , UNITE ,
           DATE_MIN,  DATE_MAX ,TYPE_ABSENCE, MATRICULE_CAR, NBR_JOURS_SERVICES
    from Temp_matr_boucle as result  /* not execute */
    return
    END
    Launched directly from the database it work verry well.
    Launched in Deski rapport, we get the same message
    u201CNo column and no data to fatchu201D
    The exec command works because the table "Temp_matr_boucle" is filled but is no longer running the select commande.
    You have advisor to use one a two solutions (see replay from DWinkel)
    1) SET NOCOUNT OFF
    or
    2) add the parameter:
    <Defaults>
    <Parameter Name="Force SQLExecute">Always</Parameter> in odbc.sbo file
    Note that we use the OLEDB driver and not the odbc
    We all tried both but the result is the same
    thank you for your help
    regards
    Mariana

  • How to convert MSSQL stored procedure to PostgreSQL

    Hi,
    Anyone can help me...?
    How to convert MSSQL stored procedure to PostgreSQL function?
    Is there any tool available to convert T-SQL from MSSQL to PostgreSQL?
    Thanks in advance

    Hello
    Here, I write one sample stored procedure of SQL Server which I need to convert into PostgreSQL. Please help me in this with PostgreSQL.
    Thanks in advance.
    Below is sample SQL Server stored procedure: require to convert into PostgreSQL stored procedure
    CREATE PROCEDURE [dbo].[usp_GetData_ByTableName]
    @TableName NVARCHAR(MAX)
    ,@IncludeKeepAlive BIT
    ,@RowsAffected BIGINT=0 OUTPUT
    ) AS
    BEGIN
    SET NOCOUNT ON
    DECLARE @SQL VARCHAR(MAX)
    Select data base on parameter.
    SET @SQL =
    SELECT *FROM '+@TableName+'
    WHERE 1=1
    +
    CASE WHEN (@IncludeKeepAlive = 0)
    THEN
    AND [MessageTransactionID] <> 152
    ELSE
    END
    EXECUTE SP_EXECUTESQL @SQL
    RETURN 0

  • MSSQL stored procedures to Oracle migration

    I am working on a migration from MSSQL2K to Oracle 10g. I have used the Oracle Migration Workbench to do the initial conversion, and I am having to do a ton of by hand conversion. There are some stored procedures that the OMWB did not bring over at all, however.
    Does anybody know of a utility that can take a single MSSQL stored procedure and convert it to a Oracle PL/SQL procedure or function? I am somewhat tired of doing entire procedures by hand. It is very tedious.
    wally

    Wally, there is a process to this kind of migration. In a lot of instances the OMWB will not map some of your stored procedures and hence, at the end of the migration you will see them as missing. Go back to the Source model view and using the log window, filter so you just see the errrors. Comment out the offending statements and right click on the object to parse it again. If it is correct it will appear in the Oracle Model. Once it has appeared there it will be generated into your Oracle database. However, you may still need to verifiy that you have got equivilence by testing the procedure.

  • Sending data to mssql stored procedure that accepts variable of text  data

    Hi all
    i have a stored procedure in mssql 2000 whole input parameter is of type text
    how can i send data of type string from java class while calling storedprocedure using callable statement
    if ui use setString() function it gives an exception that data will be trunctated
    com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.
         at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
         at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.sendExecute(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecute(Unknown Source)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(Unknown Source)
         at com.clearcube.util.DMLLayer.processClientRequest(DMLLayer.java:49)
         at com.clearcube.discovery.PushDiscoveryHandler.init(PushDiscoveryHandler.java:90)
         at com.clearcube.discovery.PushDiscoveryController$1.run(PushDiscoveryController.java:113)
         at java.util.TimerThread.mainLoop(Unknown Source)
         at java.util.TimerThread.run(Unknown Source)
    c
    if any one have solution to this problem plz reply me

    my stored procedure accepts input of type text
    i use text type becouse nvarchar is not enough to
    place data.
    and i want to send data that is greater than the
    length of varcharUnder setString in the API:
    "The driver converts this to an SQL VARCHAR or LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHAR values) when it sends it to the database."
    I am not sure what you should use then? Maybe setCharacterStream?

  • MSSQL Stored Procedure has duplicate OUT parameter

    Hi All;
    I am using the WLS MSSQL jdbc driver (mssqlserver4v70rel510sp8) for wls
    5.1 sp 12. The following code generates a duplicate OUT parameter.
    Parameters 4 and 5 are duplicated. I went over the stored procedure in
    ISQL, and the problem is not occurring there. Has anyone seen this sort of
    problem? I noticed this problem does not occur when I have the "?=" in
    front.
    stmt = con.prepareCall("{ ?= call webactivate..ValidatePromoCode(?, ?,
    stmt.registerOutParameter(1, java.sql.Types.INTEGER);
    stmt.setString(2, marketingCode);
    stmt.setString(3, activationData.getRawServiceNumber());
    stmt.registerOutParameter(4, java.sql.Types.VARCHAR);
    stmt.registerOutParameter(5, java.sql.Types.INTEGER);
    stmt.registerOutParameter(6, java.sql.Types.INTEGER);
    stmt.execute();
    Log.putDebug("#1="+stmt.getString(1));
    Log.putDebug("#4="+stmt.getString(4));
    Log.putDebug("#5="+stmt.getString(5));
    Log.putDebug("#6="+stmt.getString(6));
    Paul Rowe

    Thanks Joseph. I was hoping you would get back to me on this. You are the
    king of this newsgroup. Here's what I got, which indicates some type of
    problem on my end:
    Update count = 1
    Update count = 1
    Update count = 1
    Update count = 1
    Update count = 1
    Output status: 4
    Output param 1: 4
    Output param 2: marketingCode activationData.getRawServiceNumber()
    Output param 3: 2
    "Joseph Weinstein" <[email protected]> wrote in message
    news:[email protected]...
    Paul Rowe wrote:
    Hi All;
    I am using the WLS MSSQL jdbc driver (mssqlserver4v70rel510sp8) for
    wls
    5.1 sp 12. The following code generates a duplicate OUT parameter.
    Parameters 4 and 5 are duplicated. I went over the stored procedure in
    ISQL, and the problem is not occurring there. Has anyone seen this sortof
    problem? I noticed this problem does not occur when I have the "?=" in
    front.Hi Paul. Please run this sample program below with the driver you have,and
    let me know the output. it works with the latest driver I have. I get:
    C:\joe\70bugs>java foo
    Update count = 1
    Output status: 4
    Output param 1: marketingCode activationData.getRawServiceNumber()
    Output param 2: 2
    Output param 3: 3
    The code:
    import java.sql.*;
    import java.util.*;
    class foo {
    public static void main(String[] args) throws Exception
    Properties props = new Properties();
    props.put("user", "sa");
    props.put("password", "");
    props.put("server", "natoma");
    try {
    Driver myDriver = (Driver)
    Class.forName("weblogic.jdbc.mssqlserver4.Driver").newInstance();
    Connection con = myDriver.connect("jdbc:weblogic:mssqlserver4",props);
    >
    String proc = "create proc foojoe @bar varchar(60), @qwevarchar(60), "
    + " @asd varchar(60) output, @zxc int output, @ert intoutput "
    + " as select @asd = @bar + @qwe select @zxc = 2 select@ert = 3 "
    + " return 4";
    Statement s = con.createStatement();
    try { s.executeUpdate("drop proc foojoe"); } catch (Exceptionignore){}
    s.executeUpdate(proc);
    CallableStatement stmt = con.prepareCall("{ ?= callfoojoe(?,?,?,?,?) }");
    stmt.registerOutParameter(1, java.sql.Types.INTEGER);
    stmt.setString(2, "marketingCode");
    stmt.setString(3, " activationData.getRawServiceNumber()");
    stmt.registerOutParameter(4, java.sql.Types.VARCHAR);
    stmt.registerOutParameter(5, java.sql.Types.INTEGER);
    stmt.registerOutParameter(6, java.sql.Types.INTEGER);
    stmt.execute();
    while (true) // how to handle any callable statement...
    ResultSet rs = stmt.getResultSet();
    int updateCount = stmt.getUpdateCount();
    // If there are no more results or counts, we're done.
    if (rs == null && updateCount == -1)
    break;
    // Check to see if there is a ResultSet
    if (rs != null) {
    while (rs.next()) {
    System.out.println("Get first resultset col by id:" +rs.getString(1));
    rs.close();
    } // Otherwise, there will be an update count
    else {
    System.out.println("Update count = " + updateCount);
    stmt.getMoreResults();
    // Best to retrieve status and output parameters
    // after all result sets and update counts have been retrieved.
    System.out.println( "Output status: " + stmt.getInt(1));
    System.out.println( "Output param 1: " + stmt.getString(4));
    System.out.println( "Output param 2: " + stmt.getString(5));
    System.out.println( "Output param 3: " + stmt.getString(6));
    catch(Exception e) { e.printStackTrace(); }

  • JDBC Sender MSSQL Stored Procedure - Multiple Select Statements

    Hello all,
    I will proceed to tell you my problem, for which solution I request your kind advice:
    Im working in a project for a retailer, which consists in sending the information from erp and sql server to pos thru XI interfaces.
    One of the interfaces is about sending items from sql server to a file so the pos can load it into the system. For doing so I have devloped an stored procedure which function is to return several select statements as many stores the retailer might have, so they can have a different file per store along with its corresponding items in it. 
    The thing is that XI just gets the first select statement and creates the corresponding file, but it seems to ignore the remaining responses as I'm neither getting any file nor an error afterwards.
    So, my question is: is XI capable of handling multiple select responses from an Stored Procedure in graphical mapping??? Or am I just wasting my time trying?
    Thanks in advice for your help.
    Regards.

    Hello Ramkumar,
    After 5 days trying, I finally made it work out applying your advice. Below the short explanation of what I did:
    My Source structure is: Main Node->Row->Records (Material Number, StoreNum, Price, Status)
    My Target structure is: Main Node->File Node->Record Node->Records ( Material Number, Price, Status)
    The key was to make all the occurrences happen against StoreNum node. So, based on what you adviced these two where the key mappings:
    1) The Mapping that will create a new file for each different store that comes in the query (In my case, query was already sort by store using an sql "order by" function, if not you can also use xi node function "sort" as Ramkumar suggested)
    StoreNum->RemoveContext->SplitbyValue (Value Changed)->Collapse Contexts->File Node
    2) The Mapping that will create each record in its corresponding store file:
    StoreNum->RemoveContext->SplitbyValue (Value Changed)->Record Node
    And Voilá !!! It worked.
    Thanks very much Ramkumar.
    Regards.

  • Please help convert MSSQL Stored Procedure to Oracle PL/SQL

    Hi there to all,
    this be my first post to these forums. I have already posted this question on a microsoft msdn forum, until someone advised that I ask my question here - dunno why I didnt think of that! ?:|
    Im working with an Oracle 10g Database from an ASP.NET 2.0 application, and want to know if it Oracle supports OPENXML (rhetorical question I fear!). The reason I ask is because I want to create an Oracle Stored Procedure that will accept an XML string as an input parameter, prepare it, select from it, and then insert it into an Oracle table.
    I have done this successfully in SQL server using the following as an example:
    CREATE PROCEDURE [dbo].[Employee_INSERT]
    bq. @INSERTRECORD XML
    AS
    BEGIN
    bq. DECLARE @XDOC INT; \\ EXEC sp_xml_preparedocument @XDOC OUTPUT, @INSERTRECORD; \\ INSERT INTO [dbo].[REC_Employees] (
    bq. bq. [EMPTITLE], \\ [EMPFNAME], \\ [EMPLNAME], \\ [EMPDEPTID], \\ [EMPBEGINDATE], \\ [EMPACTIVE], \\ [EMPDATEADDED]
    bq. )
    bq. SELECT
    bq. bq. [EMPTITLE] = Title, \\ [EMPFNAME] = Firstname, \\ [EMPLNAME] = LastName, \\ [EMPDEPTID] = DepartmentID, \\ [EMPBEGINDATE] = StartDate, \\ [EMPACTIVE] = IsActive, \\ [EMPDATEADDED] = GETUTCDATE()
    bq. FROM
    bq. bq. OPENXML(@XDOC, '/EMPREC/Table', 2) \\ WITH (
    bq. bq. Title VARCHAR(10), \\ FirstName VARCHAR(50), \\ LastName VARCHAR(50), \\ DepartmentID INT, \\ StartDate DATETIME, \\ IsActive BIT
    bq. bq. );
    bq. EXEC sp_xml_removedocument @XDOC;
    END
    I would sincerely appreciate any help in this regard!
    PS - Please excuse the formatting!
    Much Thanks!
    regards
    shalan

    Assuming your table is named DESTINATION
    Name                                      Null?    Type
    TITLE                                              VARCHAR2(10)
    FIRSTNAME                                          VARCHAR2(50)
    LASTNAME                                           VARCHAR2(50)
    DEPARTMENT                                         NUMBER
    STARTDATE                                          DATE
    ISACTIVE                                           NUMBERYou can use a procedure like:
    create or replace
    procedure test (p_xml in xmltype)
    is
    begin
      insert into destination
      select title
           , firstname
           , lastname
           , department
           , to_date (startdate, 'yyyy-dd-mm hh24:mi:ss') startdate
           , isactive
        from (xmltable ('/EMPREC/Table' passing p_xml
                       columns title varchar2(5) path 'Title'
                             , firstname varchar2(10) path 'FirstName'
                             , lastname varchar2(10) path 'LastName'
                             , department number path 'Department'
                             , startdate varchar2(20) path 'StartDate'
                             , isactive number path 'IsActive'
                      ) temp
    end test;to create records in the table
    Removed a unnecessary SELECT FROM DUAL...
    Edited by: Alex Nuijten on Jan 19, 2009 2:24 PM

  • How to create an External Content Type with SQL Stored Procedures Parameters and query it in a SharePoint App

    Hi,
    I'm new to SharePoint 2013 I want to be able to query a MSSQL database from a SharePoint App I have tried to create an External Content Type (ECT) which is produced from a MSSQL stored Procedure, this procedure has several parameters which are needed to
    filter the data correctly.  From here I want to produce an external list which I can then query from a c# SharePoint app.  If I leave the filters in the ECT null then the list is of course empty or if enter a default values the results are limited
    for the app to query so are no good.
    I want to dynamically pass values to the ECT when querying from the app, is this not possible.  Should I just be returning everything in an external list and then letting the query in the app filter the data, this seems inefficient?
    Is this the best way to do this or should I be doing this differently?
    Please can someone point me in the right direction.
    Thanks

    Hi Pandra801,
    When you create a the external content type, please try to add a filter based on your select statement.
    http://arsalkhatri.wordpress.com/2012/01/07/external-list-with-bcs-search-filters-finders/
    Or, try to create a stored procedure based on your select statement, then create ECT using the SQL stored procedure.
    A step by step guide in designing BCS entities by using a SQL stored procedure
    http://blogs.msdn.com/b/sharepointdev/archive/2011/02/10/173-a-step-by-step-guide-in-designing-bcs-entities-by-using-a-sql-stored-procedure.aspx
    I hope this helps.
    Thanks,
    Wendy
    Wendy Li
    TechNet Community Support

  • Help in stored procedure

    i have a stored procedure in MSSQL which needs to be migrated to oracle 10g,i have got problem related to migration.
    My mssql stored procedure is like as follows:
    create procedure sample(
    var1 varchar(20),
    var2 varchar(20) )
    as
    declare @V_TBL table(col1 varchar(20), col2 varchar(20))
    begin
    insert into @V_TBL(col1,col2)
    select col1,col2 from table1 where col1=@var1 and col2=@var2
    some more logic
    end
    now in oracle how do i create this variable table or some other way is there to solve this?

    > i have got problem related to migration.
    Yep.. and this is to be expected. Why? Because Oracle is different than SQL-Server. And it is because of these differences that the market buys Oracle. Not because Oracle is the same as SQL-Server, but because it is difference.
    The first thing you need to accept that migration is not going to be easy and painless - because of these differences.
    What works and works well in SQL-Server, can spell a performance disaster in Oracle. And vice versa.
    Why are temp tables typically used in SQL-Server and Sybase and Ingres and others? Because these databases have a different concurrency and isolation model than Oracle.
    In these products, Writers can block Readers and Readers can block Writers.
    In Oracle, a Reader will never block a Writer. A Writer will never block a Reader. One Writer will only ever block another Writer when vying for the same row. (and on a very rare occasion, when vying for the same data block that lacks sufficient transaction slots)
    Simple example. I open a cursor [SELECT * FROM emp]. I fetch 10 rows of a 100 rows. You start a transaction. You issue a [DELETE FROM emp] and commit. The EMP table is now empty. I fetch the next set of 10 rows using my cursor. What do I see?
    I see the next 10 rows as the EMP table looked like at the time I opened my cursor. I still see all 100 rows. Because that was The Truth at the time I opened my cursor. Oracle guarantees me a consistent read. No dirty reads.
    So the "tricks" you pulled in SQL-Server to work around the reader and writer blocking issue (a failure of SQL-Server ito providing read consistency), is not applicable in Oracle. And the reasons and methods for using temp tables in SQL-Server is not valid in Oracle.
    So when migrating SQL-Server stored proc code to Oracle.. it is a migration. Which means refactoring design and code. Do not expect to be able to simply port the design or code.

  • Stored Procedure returning just one row

    Hi! I've a problem with a MSSQL Stored Procedure. This procedure works perfectlly if I execute it directly on MSSQL Query Analyzer. But the problem is in Java, when I call it, the resultset has just one row, and it must have 59, so I don't know what is going on. My procedure is a bit big, but please, help me :)
    This is the procedure code
    CREATE PROCEDURE desc_doctos
    @pt_gaveta varchar(250),
    @pl_idexp varchar(250),
    @pl_idcar numeric,
    @identa int
    AS
    DECLARE @id_carpeta_hija int
    DECLARE @nombre_hija varchar(500)
    DECLARE @fh_creacion datetime
    DECLARE @numero_carpetas int
    DECLARE @numero_documentos int
    DECLARE @cv_aplicacion_des varchar(100)
    DECLARE @id_gabinete_des int
    DECLARE @identa_modificado varchar(10)
    DECLARE @liga varchar(250)
    DECLARE @hora varchar(50)
    DECLARE @fecha varchar(50)
    DECLARE imx_descendencia CURSOR LOCAL FOR
    SELECT IOC.ID_CARPETA_HIJA, IOC.NOMBRE_HIJA,IC.FH_CREACION,
    convert(varchar(2),datepart(dd,IC.FH_CREACION))+'/'+convert(varchar(2),datepart(mm,IC.FH_CREACION))+'/'+convert(varchar(4),datepart(yyyy,IC.FH_CREACION)),
    convert(varchar(2),datepart(hh,IC.FH_CREACION))+':'+convert(varchar(2),datepart(mi,IC.FH_CREACION))+':'+convert(varchar(2),datepart(ss,IC.FH_CREACION)),
    IC.NUMERO_CARPETAS,IC.NUMERO_DOCUMENTOS,
    ICP.CV_APLICACION_DES,ICP.ID_GABINETE_DES
    FROM IMX_ORG_CARPETA IOC, IMX_CARPETA IC, IMX_CARPETAPUENTE ICP
    WHERE
    IOC.TITULO_APLICACION=@pt_gaveta
    AND IOC.ID_GABINETE= @pl_idexp
    AND IOC.TITULO_APLICACION = IC.TITULO_APLICACION
    AND IOC.ID_GABINETE = IC.ID_GABINETE
    AND IOC.ID_CARPETA_HIJA = IC.ID_CARPETA
    AND IOC.TITULO_APLICACION *= ICP.TITULO_APLICACION                
    AND IOC.ID_GABINETE *= ICP.ID_GABINETE
    AND IOC.ID_CARPETA_HIJA *= ICP.ID_CARPETA
    AND ID_CARPETA_PADRE= @pl_idcar;
    OPEN imx_descendencia
         FETCH NEXT FROM imx_descendencia INTO @id_carpeta_hija,@nombre_hija,@fh_creacion,@fecha,@hora,
              @numero_carpetas,@numero_documentos,@cv_aplicacion_des,@id_gabinete_des
         WHILE @@FETCH_STATUS = 0
         BEGIN
              SELECT @identa_modificado = @identa+1          
              IF (@id_gabinete_des IS NOT NULL)
              BEGIN
                   SET @liga = '../jsp/imxvisor.jsp?gaveta='+@cv_aplicacion_des+'&idExp='+convert(varchar(10),@id_gabinete_des)+'&cierre=si'     
                   BEGIN TRAN
                        --INSERT INTO IMX_ARBOL_TEMPORAL VALUES(@nombre_hija,@liga,@identa,0,'_blank','1',1,1)          
                        SELECT @nombre_hija,@liga,@identa,0,'_blank'
                        EXEC lista_doctos @pt_gaveta,@pl_idexp,@id_carpeta_hija,@identa_modificado
                   COMMIT TRAN
              END
              ELSE
              BEGIN
                   SET @liga = '../jsp/datosarbol.jsp?opcion=0&idcarpeta='+convert(varchar(10),@id_carpeta_hija)+'&carpetas='+convert(varchar(10),@numero_carpetas)
                   SET @liga = @liga + '&documentos='+convert(varchar(10),@numero_documentos)+'&hora='+@hora
                   SET @liga = @liga + '&fecha='+@fecha+'&idExp='+@pl_idexp+'&gaveta='+@pt_gaveta
                   BEGIN TRAN
                        --INSERT INTO IMX_ARBOL_TEMPORAL VALUES(@nombre_hija,@liga,@identa,0,'DATOS','1',1,1)
                        SELECT @nombre_hija,@liga,@identa,0,'DATOS'
                        EXEC lista_doctos @pt_gaveta,@pl_idexp,@id_carpeta_hija,@identa_modificado
                   COMMIT TRAN
              END
              EXEC desc_doctos @pt_gaveta,@pl_idexp,@id_carpeta_hija,@identa_modificado
              FETCH NEXT FROM imx_descendencia INTO @id_carpeta_hija,@nombre_hija,@fh_creacion,@fecha,@hora,
                   @numero_carpetas,@numero_documentos,@cv_aplicacion_des,@id_gabinete_des
         END
    CLOSE imx_descendencia
    DEALLOCATE imx_descendencia
    and this is my java code
    import java.sql.*;
    public class pruebasSQL{
         public static void main(String[] args){
              try{
                   Class.forName("com.inet.tds.TdsDriver").newInstance();     
                   Connection connection;
                   connection = DriverManager.getConnection("jdbc:inetdae7:localhost","user","pass");
                   connection.setCatalog( "DataBase");
                   CallableStatement statement = connection.prepareCall("{call desc_doctos ('NVA_EST',1002,0,1)}");
                   ResultSet rs = statement.executeQuery();
                   rs.last();
                   System.out.println(rs.getRow());
                   rs.close();
                   connection.close();
              catch(Exception e){
                   System.out.println(e);
    Hope u can help me =)
    Raul Medina
    [email protected]

    Hi! I managed to resolve this problem. This is what I did, hope somebody finds it usefull
    //connection, declarations, etc...
    PreparedStatement ps = connection.prepareStatement("exec desc_doctos 'NVA_EST',1002,0,1");
                   ResultSet rs = ps.executeQuery();
                   rs.next();
                   System.out.println(rs.getString(1));
                   while(ps.getMoreResults()){
                        rs = ps.getResultSet();
                        rs.next();
    +" "+rs.getString(2)+" "+rs.getString(3)+" "+rs.getString(4)+" "+rs.getString(5));
                        System.out.println(rs.getString(1));
    ------------

  • Stored Procedure w/ binary data parameter problems in Visual Basic

    Howdy all.
    I am having a problem calling stored procedures with a BLOB parameter. I have tried changing the paramater other data types to see if it would work, but with no success. I am calling the stored procedure from Visual Basic using ADO. I am using the Oracle ODBC Driver, Release 9.2.0.4.0. I have tried changing the setup of the ODBC a good bit because that has fixed several problems for me in the past; however, it did not fix my current problem.
    Here is what I am trying to do. I have a function like the folowing:
    <BEGIN --------------------------------------->
    CREATE OR REPLACE FUNCTION PAGEFORMATSINSERT(
    p_ObjectFormatCode_ID      IN RAW DEFAULT NULL,
    p_PA_ID      IN RAW DEFAULT NULL,
    p_Name      IN VARCHAR2 DEFAULT NULL,
    p_FormatData      IN BLOB DEFAULT NULL,
    p_PF_ID      IN OUT RAW )
    RETURN INTEGER
    AS
    BEGIN
    INSERT INTO PAGEFORMATS (PF_ID, ObjectFormatCode_ID, PA_ID, Name, FormatData) /* <---- this FormatData column is a BLOB column */
    VALUES     (p_PF_ID, p_ObjectFormatCode_ID, p_PA_ID, p_Name, p_FormatData)
    END PAGEFORMATSINSERT;
    <END ----------------------------------------->
    The FormatData parameter has a data type of BLOB. In my Visual Basic, I have my ADODB.Command object. I am setting the CommandText of the Command object to "{? = call PageFormatsInsert(?, ?, ?, ?, ?)}". In order to set the parameter value for the BLOB data type, I am calling the AppendChunk function of the Command object - passing it a Byte array.
    I am getting the folling error:
         ERROR: -2147467259 [Oracle][ODBC][Ora]ORA-06550: line 1, column 13:
         PLS-00306: wrong number or types of arguments in call to 'PAGEFORMATSINSERT'
         ORA-06550: line 1, column 7:
         PL/SQL: Statement ignored
    If I change the FormatData parameter to a LONG RAW parameter, I get the following error:
         ERROR: -2147467259 [Oracle][ODBC][Ora]ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error
         ORA-06512: at line 1
    I am at a loss as to how to get binary data into by Oracle database. I need to do it using stored procedures. How can I set up my stored procedure or table to do what I want it to do? Should I change my table definition? Are there some settings in the ODBC connection I can tweak? How can I get the stored procedure to accept my call from VB ADO?
    Any help would be appreciated.
    wally

    Thanks for the idea, but I don't get how I am supposed to get my binary data to the stored procedure using the stream. I have a binary array that I want to pass to a stored procedure. I want to be able to use the same Visual Basic front end with out MSSQL database as with our Oracle database.
    I am using the ADODB Connection and Command and RecordSet objects. Currenlty our front end calls the ADODB.Command(ParamNumber).AppendChunk function passing it the binary array. Somehow, the SQL Server driver does the magic in order for the MSSQL stored procedure to work correctly. I need to know how to do one of the following:
    1. Get the Oracle driver to do the same magic.
    2. Set up the Oracle stored procedure so I don't have to change the VB front end.
    3. Change the VB front end so that it works with both MSSQL and Oracle.
    wally

  • How to create stored procedure directely in RPD

    Hi Gurus,
    I am trying to create stored procedure directly in physical table in rpd level in OBIEE.for this one i have gone through below website.
    http://obiee101.blogspot.com/2011/01/obiee-using-mssql-stored-procedure-as.html
    in that blog they mentioned to write some query which is...........
    EXEC [DATABASE_NAME].[SCHEMA_NAME].[PROCEDURE_NAME]
    in above query i am not getting what is DATABASE_NAME,SCHEMA_NAME,PROCEDURE_NAME
    can any one elobrate this one

    Hi nath,
    Firstly are you using MYSQL or Oracle as the database,if its oracle database then follow this
    http://obiee101.blogspot.com/2008/01/obiee-using-oracle-stored-procedure-to.html
    http://oraclebizint.wordpress.com/2008/02/20/oracle-bi-ee-101332-executing-stored-proceduresfunctions-before-reports-before-report-triggers-and-global-temporary-tables/
    EXEC [DATABASE_NAME].[SCHEMA_NAME].[PROCEDURE_NAME][DATABASE_NAME] --> is the database name your creating your procedure
    [SCHEMA_NAME]-->is the user with which your creating
    [PROCEDURE_NAME] --> the name given to procedure
    You dont know how to get those run this SQL in TOAD and see select sys_context('userenv','db_name'), sys_context('userenv','session_user') from dual
    (OR) open you connection pool properties window in RPD,you will get the DB name and the user name as the schema name
    hope answered your question.
    CHeers,
    KK

  • Using stored procedures that take parameters

    I'm trying to invoke (MSSQL) stored procedures from Visual Composer. I've got the tool to see the procedures, but when the data service definition is created, there are no inputs, even though the procedures take parameters. When I run the Test Data Service wizard and press execute, I get an error saying a parameter wasn't provided. The input area on the left of the wizard window shows no input parameters and if I click the add button, I get nothing.
    Am I doing something wrong?
    Thanks.

    Hi
    I think you should check the stored procedure. If the stored procedure defines the input parameters correctly or not.
    Regards
    Inder

Maybe you are looking for

  • SMS text message header does not display sender information

    When I receive a text message the only header information that displays is the date and time.  The senders information does not display.  The lines are not even there.  There is no way to reply to a text message or tell who the sender is.  This probl

  • BPM 11.1.1.6 error creating process instance

    Hello! I am deploying BPM processes using JDeveloper 11.1.1.5 and SOA Server 11.1.1.6 and I am getting the following error: [2012-12-04T19:11:47.209+01:00] [WLS_SOA1] [NOTIFICATION] [] [oracle.integration.platform.blocks.tenant] [tid: [ACTIVE].Execut

  • Convert application error to system error

    Iam facing an issue in BPM, Iam triyng to access to a webservice using synchronous send step, and I ahve an exception branch to catch the syetm error and fault message. Eventhough I specified fault messages, application error was not properly recogni

  • Nvidia / Nouveau Failing [SOLVED]

    Using a dual-VGA nVidia Corporation NV17GL [Qaudro NVS] (rev a3) card. Followed the instructions in the beginner's guide to install Nouveau drivers, but when I 'startx' I get: http://gmjones.org/tv/IMAG0138.jpg The log reads: http://gmjones.org/tv/Xo

  • HT2736 Why can I not send or access gifting iTunes ??

    Why can I not send or access gifting iTunes ??