Search Results

Search found 17501 results on 701 pages for 'stored functions'.

Page 44/701 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • Is directly executing SQL bad app design?

    - by Michael Lowman
    I'm developing an iOS application that's a manager/viewer for another project. The idea is the app will be able to process the data stored in a database into a number of visualizations-- the overall effect being similar to cacti. I'm making the visualizations fully user-configurable: the user defines what she wants to see and adds restrictions. She might specify, for instance, to graph a metric over the last three weeks with user accounts that are currently active and aren't based in the United States. My problem is that the only design I can think of is more or less passing direct SQL from the iOS app to the backend server to be executed against the database. I know it's bad practice and everything should be written in terms of stored procedures. But how else do I maintain enough flexiblity to keep fully user-defined queries? While the application does compose the SQL, direct SQL is never visible or injectable by the user. That's all abstracted away in UIDateTimeChoosers, UIPickerViews, and the like.

    Read the article

  • Insert using stored procedure from nhibernate

    - by jcreddy
    Hi I am using the following code snippets to insert values using stored procedure. the code is executing successfully but no record is inserted in DB. Please suggest with simple example. **---- stored procedure--------** Create PROCEDURE [dbo].[SampleInsert] @id int, @name varchar(50) AS BEGIN insert into test (id, name) values (@id, @name); END **------.hbm file-------** <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <sql-query name="Procedure"> exec SampleInsert :Id,:Name </sql-query> </hibernate-mapping> **--------c# code to insert value using above sp------** ISessionFactory sessionFactory = new Configuration().Configure().BuildSessionFactory(); ISession session = sessionFactory.OpenSession(); IQuery query = session.GetNamedQuery("Procedure"); query.SetParameter("Id", "222"); query.SetParameter("Name", "testsp"); query.SetResultTransformer(new NHibernate.Transform.AliasToBeanConstructorResultTransformer(typeof(Procedure).GetConstructors()[0])); Regards Jcreddy

    Read the article

  • MySQL: How to consume/discard the result of a query?

    - by GetFree
    I have a stored procedure which executes an optimize table statement for every table in a DB. Those optimize table statements are prepared statements of course (they have to be built at runtime) and I need to call that procedure from PHP using ext/mysql API. Unfortunately, ext/mysql does't support doing such thing because optimize table returns a result set and in order to handle that, the new mysql protocol is required, which is supported by the "new" ext/mysqli API. Well... there are several things I dont have control over, so it's not in my posibilities to upgrade to ext/mysqli any time soon, nor can I implement the procedure as PHP code rather than sql code. So I thought if it would be possible somehow to consume/discard the result of optimize table inside the stored procedure so that ext/mysql doesn't complain about it. One thing to consider is that since the optimize table statements are prepared statements, you can't use a cursor over them.

    Read the article

  • Linkage of namespace functions

    - by user144182
    I have a couple of methods declared at the namespace level within a header for a class: // MyClass.h namespace network { int Method1(double d); int Method2(double d); class MyClass { //... } } then defined in //MyClass.cpp int Method1(double d) { ... } int Method2(double d) { ... } This project compiles cleanly and is a dependency for a ui project which uses MyClass. The functions were previously member functions of MyClass, but were moved to namespace since it was more appropriate. My problem is the ui project complains when it gets to the linker: 1network.lib(MyClass.obj) : error LNK2001: unresolved external symbol "int __cdecl network::Method1(double)" (?INT@ds@sim@@YAHN@Z) 1network.lib(MyClass.obj) : error LNK2001: unresolved external symbol "int __cdecl network::Method2(double)" (?CINT@ds@sim@@YAHN@Z) What am I doing wrong?

    Read the article

  • OBject access from different functions in VC++

    - by sijith
    Hi, I have 3 function in my class B. These three function have to access member function of other class A. I did this by creating object of class A in class B constructor and tried to access that object in functions of class B. But its showing error. How can i assess the same object in these three functions. Where i have to create object of class A B::B() { A a; } B:: function() { a.fun(); //fun belongs to class A } B:: function1() { a.fun1(); //fun1 belongs to class A } I am getting error, How can i implement the same where i can access object a in both function.

    Read the article

  • javascript: what are immediate functions used for [duplicate]

    - by tkoomzaaskz
    This question already has an answer here: Why using self executing function in JavaScript? [duplicate] 4 answers I've been programming in JS since some time, but I have never came upon a need of using immediate functions, for example: (function(){ console.log('hello, I am an immediate function'); }()) What would be the difference if I just wrote: console.log('hello, I am an immediate function'); ? I don't have any access to this function anyway (it is not assigned anywhere). I think (but I'm not sure) that I can implement everything without immediate functions - so why do people use it?

    Read the article

  • Is there any tool which can show the call tree for SQL stored procedures

    - by DBZ_A
    I have a huge SQL script which i need to analyse. It would be really helpful if i could find a tool which can generate a call tree; ie, to see which all procedures are called from a particular procedure. a perl based example is here, http://sqlblog.com/blogs/linchi_shea/archive/2009/10/23/find-the-complete-call-tree-for-a-stored-procedure.aspx but i need a tool to analyse the text file (.sql file), not the procedure stored in the database. due to some reasons i will not be able to create the whole set of procedures in the database and use the above mentioned tool. please respond if you have come across any ide/tool with this feature.

    Read the article

  • list all functions on CRAN

    - by baptiste
    Suppose I'm trying to run a script of unknown origin, and one of the functions is from a package that is not loaded by the script (an oversight, maybe it was loaded in the .Rprofile of the person who wrote it). How can I find in which package this function resides? There's some information compiled on CRAN, that doesn't require the user to download/install all R packages locally; however as far as I could tell it only gives access to the DESCRIPTION files. RSiteSearch, and its web equivalent, seem to access an online database of all CRAN packages, where presumably a list of all functions would be available. Is there some way of accessing this information? Thanks. Edit: I know sos::findFn, utils::RSiteSearch and search.r-project; what I would like is to get the raw data that these tools use.

    Read the article

  • Single C++/CLI method to wrap many type specific C functions

    - by T33C
    I am wrapping a C library using C++/CLI so that the C library can be used easily from C# in a C#'ish way. Some of the functions in this library are for putting a value into a container. There are no generics in C so there exists a function per type CLIB_SetBool(BOOL value), CLIB_SetInt(int value), CLIB_SetString(char* string) and so on. To make it easier to use from C#, I have created a single Set function which takes a System::Object. I have two related questions: With my method how would you use a switch statement on the type of System::Object to call the correct CLIB_Setxxxx function. [typeid is only for unmanaged code and I can't seem to use GetType.] Is there a better way to wrap these functions like using a Generic? [I started using template specialisation but then realised that C# doesn't see templates.] Thanks.

    Read the article

  • PHP: Classes to use functions from each other?

    - by Martti Laine
    Hello I've been into this problem for a while already, and have asked some questions about it here Stackoverflow. I've got some advice, but I just can't understand it. Could someone provide me an example of classes working smoothly together. I have 3 (maybe more) classes: mysql user alerts As I said, could someone provide an example, so these classes could use functions from each other class, e.g. user could use mysql's functions. I'm asking for an simple example, for learning-purposes. And please, no google-suggestions or links to other questions. I've tried to search this for a while already. No success, though. Martti Laine

    Read the article

  • SQL Server 2008 error message from stored procedure

    - by George2
    Hello everyone, I am using SQL Server 2008 Enterprise. When we met with such error message from stored procedure, Message 1205, Level 13, State 52, the process Pr_FooV2, Line 9 Services (Process ID 111) and another process is deadlock in the lock | communication buffer resources, and has been chosen as the deadlock victim. Rerun the transaction. I am wondering whether such messages are stored in log files? I searched log folder of my SQL Server 2008 installation root (in my environment, it is C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Log), but can not find such files. thanks in advance, George

    Read the article

  • const member functions can call const member functions only?

    - by Abhi
    Hi all. Do const member functions call only const member functions? class Transmitter{ const static string msg; mutable int size; public: void xmit() const{ size = compute(); cout<<msg; } private: int compute() const{return 5;} }; string const Transmitter::msg = "beep"; int main(){ Transmitter t; t.xmit(); return EXIT_SUCCESS; } If i dont make compute() a const, then the compiler complains. Is it because since a const member function is not allowed to modify members, it wont allow any calls to non-consts since it would mean that the const member function would be 'indirectly' modifying the data members?

    Read the article

  • Is it possible to inspect the contents of a Table Value Parameter via the debugger?

    - by Stephen Edmonds
    Does anyone know if it is possible to use the Visual Studio / SQL Server Management Studio debugger to inspect the contents of a Table Value Parameter passed to a stored procedure? To give a trivial example: CREATE TYPE [dbo].[ControllerId] AS TABLE( [id] [nvarchar](max) NOT NULL ) GO CREATE PROCEDURE [dbo].[test] @controllerData [dbo].[ControllerId] READONLY AS BEGIN SELECT COUNT(*) FROM @controllerData; END DECLARE @SampleData as [dbo].[ControllerId]; INSERT INTO @SampleData ([id]) VALUES ('test'), ('test2'); exec [dbo].[test] @SampleData; Using the above with a break point on the exec statement, I am able to step into the stored procedure without any trouble. The debugger shows that the @controllerData local has a value of '(table)' but I have not found any tool that would allow me to actual view the rows that make up that table.

    Read the article

  • "Inlining" (kind of) functions at runtime in C

    - by fortran
    Hi, I was thinking about a typical problem that is very JIT-able, but hard to approach with raw C. The scenario is setting up a series of function pointers that are going to be "composed" (as in maths function composition) once at runtime and then called lots and lots of times. Doing it the obvious way involves many virtual calls, that are expensive, and if there are enough nested functions to fill the CPU branch prediction table completely, then the performance with drop considerably. In a language like Lisp, I could probably process the code and substitute the "virtual" call by the actual contents of the functions and then call compile to have an optimized version, but that seems very hacky and error prone to do in C, and using C is a requirement for this problem ;-) So, do you know if there's a standard, portable and safe way to achieve this in C? Cheers

    Read the article

  • Unrecognized libraries and functions

    - by John Smith
    I am working in Eclipse 3.7.2 on Ubuntu 12.04 with C++. I have read about a few instances where libraries were not being recognized and the majority said to update the Paths and Symbols but that hasn't fixed my issue. I have 2 projects open in my workspace, one of which is already a completed project that has implemented functions and libraries with no errors from Eclipse. However, when I try to implement some of the same functions or include the same libraries in the 2nd project Eclipse can't resolve them. For example, #include <string> #include <stdio.h> strstr(p, "<Project>"); The include statement will be accepted and stdio.h will be found but the strstr function is not resolved even though it works fine in the other project. Any ideas as to why this might be happening? Thanks.

    Read the article

  • EF Stored Procedure Complex Type

    - by Web Dev
    I am using EF4. I am somewhat confused on on the Entity Framework Complex name. When I go to Functional Import of a Stored Procedure name and it ask me to type in the Complex name, is that supposed to be the name of of a class that can handle that output. For examle, say if my stored procedure returns FirstName, LastName. Is the Complex name supposed to be a class that can handle that output in this case PersonName? public class PersonName { public string FirstName {get; set;} public string LastName {get;set} }

    Read the article

  • Java Int Array - Number being stored are different from ones specified

    - by Danadir
    Hey there, I have encountered the most weird problem ever in Java. When I am doing this: int []s = new int [5]; s[0] = 026; s[1] = 0011; s[2] = 1001; s[3] = 0026; s[4] = 1101; the numbers being stored in the array, seen from debug mode are different i.e. the numbers stored are 22,9,1001,22,1101. Can you give me some hints what might be wrong with this? Thanks in advance

    Read the article

  • Difference between jQuery click, bind, live, delegate & trigger functions( with example)

    - by I Like PHP
    Hello All, I know there are a lot of questions similar to this, but I want to know clear difference between all of these jQuery functions together on this page with an example, so that it will be very helpful for me to understand the mechanism of all of these functions. I have also read the reference on jQuery main site, but there is no comparison between these: $().click(fn) $().bind('click',fn) $().live('click',fn) $().delegate('td','click',fn) $().trigger('click') // UPDATED Please do not refer any link if there is a part of question belong to that. Please describe how all four function exactly works in different manner, and which should be preferred in which situation. Note: If there are any other function with same functionality/mechanism , then please share. Thanks a lot. Update i have also seen $(trigger) function? is this works similar to above four function ?

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >