Search Results

Search found 9396 results on 376 pages for 'stored procedures'.

Page 23/376 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Regression tests for T-SQL stored procedures

    - by Achim
    Hi, I would like to regression test t-sql stored procedures. My idea is to specify for each SP multiple input parameter sets. The SP should be executed with these parameters, results should be written to disc. Next time the new results should be compared with results stored before. Does anybody know a good tool for something like that? Should not be that hard to implement, but in practice you will need functionality like "ignore that column" or something like that. And I would assume that such a tool should already exist!? cheers, Achim

    Read the article

  • stored procedures, error #1312, CLIENT_MULTI_RESULTS flag

    - by aadersh patel
    i am writing stored procedures in MySQL that return values; CREATE PROCEDURE getCustomerById (id int) BEGIN SELECT * FROM customer WHERE customer.id = id; END; and i get the error that the results cannot be shown in the given context. after some googling, i think that i need to set the flag "CLIENT_MULTI_RESULTS" - i am connecting the database from JDBC using a java app, but cant find where to set it! any suggestions?

    Read the article

  • Can netezza database handle procedures?

    - by san6086
    Hi I am having Netezza Database. I am querying the tables through DB visualiser. Since my table creation involves complex, I am interested to use procedures but I am unable to write it in DBvisualiser. I am confused whether the problem is with the tool that I use or in Netezza? Please advice

    Read the article

  • T-SQL Dynamic SQL and Temp Tables

    - by George
    It looks like #temptables created using dynamic SQL via the EXECUTE string method have a different scope and can't be referenced by "fixed" SQLs in the same stored procedure. However, I can reference a temp table created by a dynamic SQL statement in a subsequence dynamic SQL but it seems that a stored procedure does not return a query result to a calling client unless the SQL is fixed. A simple 2 table scenario: I have 2 tables. Let's call them Orders and Items. Order has a Primary key of OrderId and Items has a Primary Key of ItemId. Items.OrderId is the foreign key to identify the parent Order. An Order can have 1 to n Items. I want to be able to provide a very flexible "query builder" type interface to the user to allow the user to select what Items he want to see. The filter criteria can be based on fields from the Items table and/or from the parent Order table. If an Item meets the filter condition including and condition on the parent Order if one exists, the Item should be return in the query as well as the parent Order. Usually, I suppose, most people would construct a join between the Item table and the parent Order tables. I would like to perform 2 separate queries instead. One to return all of the qualifying Items and the other to return all of the distinct parent Orders. The reason is two fold and you may or may not agree. The first reason is that I need to query all of the columns in the parent Order table and if I did a single query to join the Orders table to the Items table, I would be repoeating the Order information multiple times. Since there are typically a large number of items per Order, I'd like to avoid this because it would result in much more data being transfered to a fat client. Instead, as mentioned, I would like to return the two tables individually in a dataset and use the two tables within to populate a custom Order and child Items client objects. (I don't know enough about LINQ or Entity Framework yet. I build my objects by hand). The second reason I would like to return two tables instead of one is because I already have another procedure that returns all of the Items for a given OrderId along with the parent Order and I would like to use the same 2-table approach so that I could reuse the client code to populate my custom Order and Client objects from the 2 datatables returned. What I was hoping to do was this: Construct a dynamic SQL string on the Client which joins the orders table to the Items table and filters appropriate on each table as specified by the custom filter created on the Winform fat-client app. The SQL build on the client would have looked something like this: TempSQL = " INSERT INTO #ItemsToQuery OrderId, ItemsId FROM Orders, Items WHERE Orders.OrderID = Items.OrderId AND /* Some unpredictable Order filters go here */ AND /* Some unpredictable Items filters go here */ " Then, I would call a stored procedure, CREATE PROCEDURE GetItemsAndOrders(@tempSql as text) Execute (@tempSQL) --to create the #ItemsToQuery table SELECT * FROM Items WHERE Items.ItemId IN (SELECT ItemId FROM #ItemsToQuery) SELECT * FROM Orders WHERE Orders.OrderId IN (SELECT DISTINCT OrderId FROM #ItemsToQuery) The problem with this approach is that #ItemsToQuery table, since it was created by dynamic SQL, is inaccessible from the following 2 static SQLs and if I change the static SQLs to dynamic, no results are passed back to the fat client. 3 around come to mind but I'm look for a better one: 1) The first SQL could be performed by executing the dynamically constructed SQL from the client. The results could then be passed as a table to a modified version of the above stored procedure. I am familiar with passing table data as XML. If I did this, the stored proc could then insert the data into a temporary table using a static SQL that, because it was created by dynamic SQL, could then be queried without issue. (I could also investigate into passing the new Table type param instead of XML.) However, I would like to avoid passing up potentially large lists to a stored procedure. 2) I could perform all the queries from the client. The first would be something like this: SELECT Items.* FROM Orders, Items WHERE Order.OrderId = Items.OrderId AND (dynamic filter) SELECT Orders.* FROM Orders, Items WHERE Order.OrderId = Items.OrderId AND (dynamic filter) This still provides me with the ability to reuse my client sided object-population code because the Orders and Items continue to be returned in two different tables. I have a feeling to, that I might have some options using a Table data type within my stored proc, but that is also new to me and I would appreciate a little bit of spoon feeding on that one. If you even scanned this far in what I wrote, I am surprised, but if so, I woul dappreciate any of your thoughts on how to accomplish this best.

    Read the article

  • Stored Procedure Permissions Problem

    - by JimR
    I have migrated a set of SQL 2000 databases to SQL 2008. Most is working well, however I have some stored procedures that scheduled and run by SQL Server Agent jobs that are giving me troubles. Many of the scheduled stored procedures work, but the stored procs that access a database other than the default databases are failing with the following message: Executed as user: XYZ\YadaYada. The server principal: "XYZ\YadaYada" is not able to access the database "MyOtherDatabaseOnSameServer" under the current security context. [SQL STATE 08004](Error 619) The step failed. Obviously, I changed the names to protect the guilty. The account is a user in all of the relavent databases and is a memeber of db_owner, db_datareader, and db_datawriter. When I run these same procedures from a query window in SMS using the same accounts (I have tried many) they work fine. What am I missing?

    Read the article

  • How to find out where or if MYSQL5 logs are stored on a machine WHM/Cpanel

    - by moi
    I have a WHM/Cpanel re-seller hosting account on a virtual private server (Linux). I have root access to the machine via SSH I am trying to locate a file that contains information that will help me to determine which users have accessed what db and from which hosts. I would imagine this kind of data is stored in a log file somewhere. The MySQL page says: The general query log - Established client connections and statements received from clients See: http://dev.mysql.com/doc/refman/5.0/en/server-logs.html It also says: By default, all log files are created in the mysqld data directory. So, I am am NOT asking where are the general query log logs stored, (cos I expect I will get answers saying "it depends") Please help me work out: "How can go about finding out where MySQL general query log logs are stored on a linux machine" Couple of things i've already tried: I looked at /etc/my.cnf it was a tiny file that only contained the following info: [mysqld] skip-bdb skip-innodb set-variable = max_connections=500 safe-show-database ~ ~ I have looked in: /var/lib/mysql/ But I could not see any log-like file names in that directory. Any clues on this would be most welcome.

    Read the article

  • How do I list all non-system stored procedures?

    - by bubbassauro
    I want to create a query to list of all user defined stored procedures, excluding the ones that are system stored procedures, considering that: Checking the name like "sp_" doesn't work because there are user stored procedures that start with "sp_". Checking the property is_ms_shipped doesn't work because there are system stored procedures that have that flag = 0, for example: sp_alterdiagram (it is not MSShipped but appears under System Stored Procedures in SQL Server Management Studio). There must be a property, or a flag somewhere since you can see the "System Stored Procedures" in a separate folder in SQL 2005. Does anyone know? Edit: A combination of the suggestions below worked for me: select * from sys.objects O LEFT OUTER JOIN sys.extended_properties E ON O.object_id = E.major_id WHERE O.name IS NOT NULL AND ISNULL(O.is_ms_shipped, 0) = 0 AND ISNULL(E.name, '') <> 'microsoft_database_tools_support' AND O.type_desc = 'SQL_STORED_PROCEDURE' ORDER BY O.name

    Read the article

  • How to suggest using an ORM instead of stored procedures?

    - by Wayne M
    I work at a company that only uses stored procedures for all data access, which makes it very annoying to keep our local databases in sync as every commit we have to run new procs. I have used some basic ORMs in the past and I find the experience much better and cleaner. I'd like to suggest to the development manager and rest of the team that we look into using an ORM Of some kind for future development (the rest of the team are only familiar with stored procedures and have never used anything else). The current architecture is .NET 3.5 written like .NET 1.1, with "god classes" that use a strange implementation of ActiveRecord and return untyped DataSets which are looped over in code-behind files - the classes work something like this: class Foo { public bool LoadFoo() { bool blnResult = false; if (this.FooID == 0) { throw new Exception("FooID must be set before calling this method."); } DataSet ds = // ... call to Sproc if (ds.Tables[0].Rows.Count > 0) { foo.FooName = ds.Tables[0].Rows[0]["FooName"].ToString(); // other properties set blnResult = true; } return blnResult; } } // Consumer Foo foo = new Foo(); foo.FooID = 1234; foo.LoadFoo(); // do stuff with foo... There is pretty much no application of any design patterns. There are no tests whatsoever (nobody else knows how to write unit tests, and testing is done through manually loading up the website and poking around). Looking through our database we have: 199 tables, 13 views, a whopping 926 stored procedures and 93 functions. About 30 or so tables are used for batch jobs or external things, the remainder are used in our core application. Is it even worth pursuing a different approach in this scenario? I'm talking about moving forward only since we aren't allowed to refactor the existing code since "it works" so we cannot change the existing classes to use an ORM, but I don't know how often we add brand new modules instead of adding to/fixing current modules so I'm not sure if an ORM is the right approach (too much invested in stored procedures and DataSets). If it is the right choice, how should I present the case for using one? Off the top of my head the only benefits I can think of is having cleaner code (although it might not be, since the current architecture isn't built with ORMs in mind so we would basically be jury-rigging ORMs on to future modules but the old ones would still be using the DataSets) and less hassle to have to remember what procedure scripts have been run and which need to be run, etc. but that's it, and I don't know how compelling an argument that would be. Maintainability is another concern but one that nobody except me seems to be concerned about.

    Read the article

  • Howto UML: sub methods / calls / operations / procedures

    - by hsmit
    How would you guys model this in UML (in a sequence diagram)? .. car1.drive(); .. ... in Car class: .. drive(){ this.startEngine(); } startEngine(){ this.getKey(); this.insertKey(); } .. a small begin: objx car1 ---- ---- | | | drive() | |-------->| startEngine() | |------------. | | | | |<-----------. | | But where comes the getKey() method? Must this be communicated via another sequence diagram? Or is there a way to include sub procedures?

    Read the article

  • Debugging stored procedures, without using SSMS 2008 Debugger, or the Visual Studio debugger (output

    - by Albert
    I have a SQL Server 2005 database with some Stored Procedures (SP) that I would like to debug...essentially I would just like to check variable values at certain points throughout the SP execution. I have SSMS 2008, but when I try to use the debugger, I get an error that it can't debug SQL Server 2005 databases. And I can't use the Visual Studio debugger (by stepping into the SP via Server Explorer) because Remote Debugging is blocked by our firewall, and I'm rightfully not allowed to touch the firewall. So my question is how can I check variable values at certain points in the SP execution? Is there some way to output those values somewhere, perhaps along with some text?

    Read the article

  • How to convert a MSSQL database (including procedures, functions and triggers) to a firebird databas

    - by user193655
    I am considering migrating to Firebird. To have a "quick start" approach I downloaded the trial of a conversion tool (DBConvert) and tried it. I just picked up a random tool, this tool doesn't convert procedures, functions and triggers (I don't think it is a limit of the trial since there is not an explicit reference to sp, sf and triggers in the link above). Anyway by trying that tool I had the message: "The DB cannot be converted succesfully because some FK names are too long." This is because in some tables I have FK whose description is 32 chars. Is this a real firebird limit or it is possible to overcome it somehow (of course renaming the FK is an extreme option because it is extra work)? Anyway how to convert a MS SQL DB fully to FIREBIRD? Is there a valid tool? Did someone succed in a conversion of non trivial databases?

    Read the article

  • When should we use Views, Temporary Tables and Direct Queries ? What are the Performance issues in a

    - by Shantanu Gupta
    I want to know the performance of using Views, Temp Tables and Direct Queries Usage in a Stored Procedure. I have a table that gets created every time when a trigger gets fired. I know this trigger will be fired very rare and only once at the time of setup. Now I have to use that created table from triggers at many places for fetching data and I confirms it that no one make any changes in that table. i.e ReadOnly Table. I have to use this tables data along with multiple tables to join and fetch result for further queries say select * from triggertable By Using temp table select ... into #tx from triggertable join t2 join t3 and so on select a,b, c from #tx --do something select d,e,f from #tx ---do somethign --and so on --around 6-7 queries in a row in a stored procedure. By Using Views create view viewname ( select ... from triggertable join t2 join t3 and so on ) select a,b, c from viewname --do something select d,e,f from viewname ---do somethign --and so on --around 6-7 queries in a row in a stored procedure. This View can be used in other places as well. So I will be creating at database rather than at sp By Using Direct Query select a,b, c from select ... into #tx from triggertable join t2 join t3 join ... --do something select a,b, c from select ... into #tx from triggertable join t2 join t3 join ... --do something . . --and so on --around 6-7 queries in a row in a stored procedure. Now I can create a view/temporary table/ directly query usage in all upcoming queries. What would be the best to use in this case.

    Read the article

  • What should I use to increase performance. View/Query/Temporary Table

    - by Shantanu Gupta
    I want to know the performance of using Views, Temp Tables and Direct Queries Usage in a Stored Procedure. I have a table that gets created every time when a trigger gets fired. I know this trigger will be fired very rare and only once at the time of setup. Now I have to use that created table from triggers at many places for fetching data and I confirms it that no one make any changes in that table. i.e ReadOnly Table. I have to use this tables data along with multiple tables to join and fetch result for further queries say select * from triggertable By Using temp table select ... into #tx from triggertable join t2 join t3 and so on select a,b, c from #tx --do something select d,e,f from #tx ---do somethign --and so on --around 6-7 queries in a row in a stored procedure. By Using Views create view viewname ( select ... from triggertable join t2 join t3 and so on ) select a,b, c from viewname --do something select d,e,f from viewname ---do somethign --and so on --around 6-7 queries in a row in a stored procedure. This View can be used in other places as well. So I will be creating at database rather than at sp By Using Direct Query select a,b, c from select ... into #tx from triggertable join t2 join t3 join ... --do something select a,b, c from select ... into #tx from triggertable join t2 join t3 join ... --do something . . --and so on --around 6-7 queries in a row in a stored procedure. Now I can create a view/temporary table/ directly query usage in all upcoming queries. What would be the best to use in this case.

    Read the article

  • Refactoring PL/SQL triggers - extract procedures

    - by Juraj
    Hello, we have application where database contains large parts of business logic in triggers, with a update subsequently firing triggers on several other tables. I want to refactor the mess and wanted to start by extracting procedures from triggers, but can't find any reliable tool to do this. Using "Extract procedure" in both SQL Developer and Toad failed to properly handle :new and :old trigger variables. If you had similar problem with triggers, did you find a way around it? EDIT: Ideally, only columns that are referenced by extracted code would be sent as in/out parameters, like: Example of original code to be extracted from trigger: ..... if :new.col1 = some_var then :new.col1 := :old.col1 end if ..... would become : procedure proc(in old_col1 varchar2, in out new_col1 varchar2, some_var varchar2) is begin if new_col1 = some_var then new_col1 := old_col1 end if; end; ...... proc(:old.col1,:new.col1, some_var);

    Read the article

  • Brackets around Stored Procedure in ADODB Command Text

    - by KennerL90
    Help me understand why this is happening! I use the ADODB.Command object. The Command Text is set to the Stored Procedure Name. Sometimes, if I DON'T add brackets around the stored procedure name, I get a Syntax Error or Access Violation error. Sometimes, if I DO add brackets around the stored procedure name, I get a Syntax Error or Access Violation error.

    Read the article

  • MySQL Stored Procedure Parameters are NULL

    - by emmilely
    I am stumped, and was hoping someone here would have a quick and easy answer. I did a fresh install of MySQL 5.5 and am trying to pass parameters into a stored procedure. The parameter values aren't being read by the stored procedure. MySQL doesn't throw an error and processes the code with null parameters. Here is the code: DELIMITER $$ CREATE DEFINER=`root`@`%` PROCEDURE `testing`(IN parameter INTEGER) BEGIN UPDATE table_name SET valueToChange = 'Test' WHERE mainID = @parameter; END And here is the query I'm using to call it: USE database_name; CALL testing(72); Can anyone help?

    Read the article

  • adress-chunk: separate data stored in one collumn - into three (street, postal-code, town)

    - by zero
    hello dear community. Hello dear friends form all over the planet first of all - this is a great great forum. I like this place to share the ideas. It is so great to see such a supportive place - featuring the knowledge exchange! today i have the following thing to discuss: i want to separate the following data that are stored in one column of a calc-spreadsheet: See the following data: You see that there are the following categories:_ steet, postal-code, town All the data are stored in only one Colum; Well to be honest: i want to separate them into three colums steet, postal-code, town see the data: what can i do? note - you see that there are commas inbetween the enties: and besides this we see that we have a postal-code with four digits: that is a good thing. Perhaps we can use this as a marker that helps us to separate the data?! Perhaps See a data-sample! Here you can see some exceptions: eg. the town that has two words combinde with a "-" ... or somethims without any signs and characters... see the following... as an example: Max-Bader-Platz 1, 5620 Schwarzach im Pongau Pestalozzistraße 4, 9990 Nussdorf-Debant Schulstraße 4, 5162 Obertrum am See But i guess that this means no problem... What do you think about this? I am very very interested to get your opinion! i look forward to hear from you! regards see a snipped of the dataset - that is stored in one column -[b]Goal: [/b]i want to separate the datas into three collumns... : Schulweg 6, 9871 Seeboden Khevenhüllerstraße 45, 4861 Schörfling Franz Xaver Rennstr.18, 6460 Imst Schulstraße 4, 5162 Obertrum am See Schulweg 6, 7432 Oberschützen Pestalozzistraße 4, 9990 Nussdorf-Debant Niederndorf bei Kufstein 53c, 6342 Niederndorf bei Kufstein Hauptschulstraße 18, 2183 Neusiedl an der Zaya Seeweg 14, 5202 Neumarkt am Wallersee Europaplatz 1, 8820 Neumarkt in Steiermark Schulstraße 7, 4212 Neumarkt im Mühlkreis Schulstraße 20, 4720 Neumarkt im Hausruckkreis Bahnhofstr. 10, 4872 Neukirchen an der Vöckla Schulstraße 5b, 4780 Schärding Reitbergstraße 2, 4311 Schwertberg Europaplatz 1, 2320 Schwechat Am Schulberg 5, 3931 Schweiggers Waidach 8, 6130 Schwaz Waidach 8, 6130 Schwaz Max-Bader-Platz 1, 5620 Schwarzach im Pongau Markt 29, 2662 Schwarzau im Gebirge Hofsteigstraße 68, 6858 Schwarzach Gmundner Straße 7, 4690 Schwanenstadt Mühlfeldstraße 1, 4690 Schwanenstadt Mainsdorferstraße 18, 8541 Schwanberg Jakob Stemer-Weg 3, 6780 Schruns Obere Umfahrungsstraße 16, 2432 Schwadorf bei Wien Battloggstraße 54, 6780 Schruns Schloss-Straße 19, 5020 Salzburg Schillerplatz 2, 8280 Fürstenfeld Erzherzog-Johann-Str. 400, 8970 Schladming Schulgasse 261, 8811 Scheifling i look forward to hear from you!! regards

    Read the article

  • ASP.NET MVC Stored Procedure

    - by Pinu
    I am using a ms sql stored procedure to get a set of records , when i am adding this stored procedure to my LinqToSql class and using it my repository it shows like it is returning a int value but it should be returning a set of rows. Is there some thing wrong with my stored procedure or some thing else???

    Read the article

  • How are thumbnails stored on Mac OS X?

    - by Alberto Moriconi
    I have noticed that thumbnails on Mac OS X don't seem to be generated every time I open a folder, but to be somehow "cached" instead. I wasn't able, however, to find a folder where they clearly look to be stored. I thought then they could be saved as some kind of metadata; i found, however, that when deleting a file (e.g. from the Desktop) and saving immediately after a file by the same name, the preview for the previous file is showed for ~ a second. Are they stored separately from data? How and when are they invalidated (e.g. only when a file by the same name appears in the same directory)?

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >