Search Results

Search found 1620 results on 65 pages for 'proc'.

Page 4/65 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Execute sybase stored proc from hibernate

    - by Padmanabh
    I am having issues with executing a simple sybase stored proc from hibernate. The procedure takes some input and returns one record. I tried with the following tag in hibernate mappings file and java code. <hibernate-mapping> <sql-query name="sybaseproc" callable="true"> <return class="Myentity"> <return-property name="next" column="next"/> </return> { ? = call nextnum(?,?) } </sql-query> </hibernate-mapping> java code is as follows Query q = session.getNamedQuery("sybaseproc"); q.setString(0,"test"); q.setInteger(1,new Integer(10)); Myentity entity = (Myentity) q.uniqueResult(); When I run my test. I get a error saying "Errors in Named Query sybaseproc" and the test does not run. Any help is appreciated. Thanks Padmanabh

    Read the article

  • Database Programming in C#, returning output from Stored Proc

    - by jpavlov
    I am working at gaining an understanding at how to interface stored procedures with applications. My example is simple, but it doesn't display my columns and rows in the command prompt, instead it display System.Data.SqlClient.SqlDataReader. How do I display the rows from my stored procudure? ----Stored Proc-- ALTER PROCEDURE dbo.SelectID AS SELECT * FROM tb_User; ----- Below is the code: using System; using System.Data.SqlClient; using System.IO; namespace ExecuteStoredProc { class Program { static void Main(string[] args) { SqlConnection cnnUserMan; SqlCommand cmmUser; //SqlDataReader drdUser; //Instantiate and open the connection cnnUserMan = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=c:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA\\UserDB.mdf; Integrated Security=True;Connect Timeout=30;User Instance=True"); cnnUserMan.Open(); //Instantiate and initialize command cmmUser = new SqlCommand("SelectID", cnnUserMan); cmmUser.CommandType = System.Data.CommandType.StoredProcedure; //drdUser = cmmUser.ExecuteReader(); Console.WriteLine(cmmUser.ExecuteReader()); Console.ReadLine(); } } } Thanks.

    Read the article

  • Why has wireless disappeared after my 12.10 upgrade?

    - by Shay Guy
    I just upgraded to 12.10 on my Lenovo B570 laptop. NetworkManager isn't displaying a submenu for wireless connections at all, even though I downloaded the update through the wireless connection. This displeases me. Stuff I've tried includes: $ sudo modprobe wl FATAL: Module wl not found. $ sudo lspci -nn | grep "BCM" 02:00.0 Network controller [0280]: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller [14e4:4727] (rev 01) $ rfkill list all 0: ideapad_wlan: Wireless LAN Soft blocked: no Hard blocked: no ETA: linux-headers-generic is already the newest version, and what I get when reinstalling bcmwl-kernel-source includes the following, near the end. DKMS: install completed. ERROR: Module b43 does not exist in /proc/modules ERROR: Module b43legacy does not exist in /proc/modules ERROR: Module ssb does not exist in /proc/modules ERROR: Module bcm43xx does not exist in /proc/modules ERROR: Module brcm80211 does not exist in /proc/modules ERROR: Module brcmfmac does not exist in /proc/modules ERROR: Module brcmsmac does not exist in /proc/modules ERROR: Module bcma does not exist in /proc/modules FATAL: Module wl not found.

    Read the article

  • Named query not known error trying to call a stored proc using Fluent NHibernate

    - by Hamman359
    I'm working on setting up NHibernate for a project and I have a few queries that, due to their complexity, we will be leaving as stored procedures. I'd like to be able to use NHibernate to call the sprocs, but have run into an error I can't figure out. Since I'm using Fluent NHibernate I'm using mixed mode mapping as recommended here. However, when I run the app I get a "Named query not known: AccountsGetSingle" exception and I can't figure out why. I think I might have a problem with my HBM mapping since I'm not very familiar with using them but I'm not sure. My NHibernate configuration code is: private ISessionFactory CreateSessionFactory() { return Fluently.Configure() .Database(MsSqlConfiguration.MsSql2005 .ConnectionString((conn => conn.FromConnectionStringWithKey("CIDB"))) .ShowSql()) .Mappings(m => { m.HbmMappings.AddFromAssemblyOf<Account>(); m.FluentMappings.AddFromAssemblyOf<Account>(); }) .BuildSessionFactory(); } My hbm.xml file is: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <sql-query name="AccountsGetSingle"> <return alias="Account" class="Core, Account"></return> exec AccountsGetSingle </sql-query> </hibernate-mapping> And the code where I am calling the sproc looks like this: public Account Get() { return _conversation.Session .GetNamedQuery("AccountsGetSingle") .UniqueResult<Account>(); } Any thoughts or ideas would be appreciated. Thanks.

    Read the article

  • Problem with Keyboard hook proc

    - by Steve
    The background: My form has a TWebBrowser. I want to close the form with ESC but the TWebBrowser eats the keystrokes - so I decided to go with a keyboard hook. The problem is that the Form can be open in multiple instances at the same time. No matter what I do, in some situations, if there are two instances open of my form, closing one of them closes the other as well. I've attached some sample code. Any ideas on what causes the issue? var EmailDetailsForm: TEmailDetailsForm; KeyboardHook: HHook; implementation function KeyboardHookProc(Code: Integer; wParam, lParam: LongInt): LongInt; stdcall; var hWnd: THandle; I: Integer; F: TForm; begin if Code < 0 then Result := CallNextHookEx(KeyboardHook, Code, wParam, lParam) else begin case wParam of VK_ESCAPE: if (lParam and $80000000) <> $00000000 then begin hWnd := GetForegroundWindow; for I := 0 to Screen.FormCount - 1 do begin F := Screen.Forms[I]; if F.Handle = hWnd then if F is TEmailDetailsForm then begin PostMessage(hWnd, WM_CLOSE, 0, 0); Result := HC_SKIP; break; end; end; //for end; //if else Result := CallNextHookEx(KeyboardHook, Code, wParam, lParam); end; //case end; //if end; function TEmailDetailsForm.CheckInstance: Boolean; var I, J: Integer; F: TForm; begin Result := false; J := 0; for I := 0 to Screen.FormCount - 1 do begin F := Screen.Forms[I]; if F is TEmailDetailsForm then begin J := J + 1; if J = 2 then begin Result := true; break; end; end; end; end; procedure TEmailDetailsForm.FormCreate(Sender: TObject); begin if not CheckInstance then KeyboardHook := SetWindowsHookEx(WH_KEYBOARD, @KeyboardHookProc, 0, GetCurrentThreadId()); end; procedure TEmailDetailsForm.FormDestroy(Sender: TObject); begin if not CheckInstance then UnHookWindowsHookEx(KeyboardHook); end;

    Read the article

  • why does python.subprocess hang after proc.communicate()?

    - by ccfenix
    I've got an interactive program called my_own_exe. First, it prints out alive, then you input S\n and then it prints out alive again. Finally you input L\n. It does some processing and exits. However, when I call it from the following python script, the program seemed to hang after printing out the first 'alive'. Can anyone here tell me why this is happening? Thanks proc2 = subprocess.Popen("my_own_exe", shell=True , stdin=subprocess.PIPE, stdout=subprocess.PIPE) print proc2.communicate()[0] time.sleep(2); print "alive" # 'hang' after print this line proc2.communicate('S\n')[0] print "alive" print proc2.communicate()[0] time.sleep(6)

    Read the article

  • How do I get a single value from a stored proc using Nettiers

    - by Micah
    I have a really simple stored procedure that looks like this: CREATE PROCEDURE _Visitor_GetVisitorIDByVisitorGUID ( @VisitorGUID AS UNIQUEIDENTIFIER ) AS DECLARE @VisitorID AS bigint SELECT @VisitorID = VisitorID FROM dbo.Visitor WHERE VisitorGUID = @VisitorGUID --Here's what I've tried RETURN @VisitorID 'Returns an IDataReader SELECT @VisitorID 'Returns an IDataReader --I've also set it up wuth a single output --parameter, but that means I need to pass --the long in by ref and that's hideous to me I'm trying to get nettiers to generate a method with this signature: public long VisitorService.GetVisitorIDByVisitorGUID(GUID visitorGUID); Basically I want Nettiers to call ExecuteScalar instead of ExecuteReader. What am I doing wrong?

    Read the article

  • How do I get a scalar value from a stored proc using Nettiers

    - by Micah
    I have a really simple stored procedure that looks like this: CREATE PROCEDURE _Visitor_GetVisitorIDByVisitorGUID ( @VisitorGUID AS UNIQUEIDENTIFIER ) AS DECLARE @VisitorID AS bigint SELECT @VisitorID = VisitorID FROM dbo.Visitor WHERE VisitorGUID = @VisitorGUID --Here's what I've tried RETURN @VisitorID 'Returns an IDataReader SELECT @VisitorID 'Returns an IDataReader --I've also set it up with a single output --parameter, but that means I need to pass --the long in by ref and that's hideous to me I'm trying to get nettiers to generate a method with this signature: public long VisitorService.GetVisitorIDByVisitorGUID(GUID visitorGUID); Basically I want Nettiers to call ExecuteScalar instead of ExecuteReader. What am I doing wrong?

    Read the article

  • SQL Query to get Count within a Stored Proc

    - by sia
    So i need to figure out how i can get a record count value and use that count as a new value to insert into a table. Ex: In My Stored Procedure @Count int What im looking for @Count to equal "select top (1) _fieldName from _someTable order by _fieldName Desc" Finally insert into _newTable (_fieldName) values (@Count) End I dont have to use a variable, just trying to demonstrate what im really trying to do. My SQL knowledge is pretty limited so no laughing, or smirking! ;)

    Read the article

  • How to set Laptop Brightness in Gnome and /proc on Thinkpad W510?

    - by hakre
    I can set the brightness of my laptop screen already via /proc. I can read and change the value. Now I've set the value to 33 and then I went into gnome power management and enabled the option that it should reduce the backlight brightness being on battery. That works, the screen gets darker. If I now read out the current setting from /proc it still says it's 33. So I assume that there is another node in /proc to be used to control the brightness. The node I use so far is: /proc/acpi/video/VID/LCD0/brightness I'm using the nouveau driver. With the nvida driver the brightness can not be controlled.

    Read the article

  • SQL Server job (stored proc) trace

    - by Jit
    Hi Friends, I need your suggestion on tracing the issue. We are running data load jobs at early morning and loading the data from Excel file into SQL Server 2005 db. When job runs on production server, many times it takes 2 to 3 hours to complete the tasks. We could drill down to one job step which is taking 99% of the total time to finish. While running the job step (stored procs) on staging environment (with the same production database restored) takes 9 to 10 minutes, the same takes hours on production server when it run at early morning as part of job. The production server always stuck up at the very job step. I would like to run trace on the very job step (around 10 stored procs run for each user in while loop within the job step) and collect the info to figure out the issue. What are the ways available in SQL Server 2005 to achieve the same? I want to run the trace only for these SPs and not for certain period time period on production server, as trace give lots of information and it becomes very difficult for me (as not being DBA) to analyze that much of trace information and figure out the issue. So I want to collect info about specific SPs only. Let me know what you suggest. Appreciate your time and help. Thanks.

    Read the article

  • Determine caller within stored proc or trigger

    - by Mike Clark
    I am working with an insert trigger within a Sybase database. I know I can access the @@nestlevel to determine whether I am being called directly or as a result of another trigger or procedure. Is there any way to determine, when the nesting level is deeper than 1, who performed the action causing the trigger to fire? For example, was the table inserted to directly, was it inserted into by another trigger and if so, which one.

    Read the article

  • SQL Server 2008 Stored Proc suddenly returns -1

    - by aaginor
    I use the following stored procedure from my SQL Server 2008 database to return a value to my C#-Program ALTER PROCEDURE [dbo].[getArticleBelongsToCatsCount] @id int AS BEGIN SET NOCOUNT ON; DECLARE @result int; set @result = (SELECT COUNT(*) FROM art_in_cat WHERE child_id = @id); return @result; END I use a SQLCommand-Object to call this Stored Procedure public int ExecuteNonQuery() { try { return _command.ExecuteNonQuery(); } catch (Exception e) { Logger.instance.ErrorRoutine(e, "Text: " + _command.CommandText); return -1; } } Till recently, everything works fine. All of a sudden, the stored procedure returned -1. At first, I suspected, that the ExecuteNonQuery-Command would have caused and Exception, but when stepping through the function, it shows that no Exception is thrown and the return value comes directly from return _command.ExecuteNonQuery(); I checked following parameters and they were as expected: - Connection object was set to the correct database with correct access values - the parameter for the SP was there and contained the right type, direction and value Then I checked the SP via SQLManager, I used the same value for the parameter like the one for which my C# brings -1 as result (btw. I checked some more parameter values in my C' program and they ALL returned -1) but in the manager, the SP returns the correct value. It looks like the call from my C# prog is somehow bugged, but as I don't get any error (it's just the -1 from the SP), I have no idea, where to look for a solution.

    Read the article

  • Conditional Update stored proc is firing a trigger always

    - by schar
    I have a stored procedure that says update table1 set value1 = 1 where value1 = 0 and date < getdate() I have a trigger that goes like CREATE TRIGGER NAME ON TABLENAME FOR UPDATE ... if UPDATE(value1) BEGIN --Some code to figure out that this trigger has been called -- the value is always null END Any idea why this trigger is called even when the stored procedure does not update any values?

    Read the article

  • has_many conditions or proc on foreign key

    - by ere
    I have a has_many association between two models using a date as both the foreign and primary key for each model. It works perfectly one way but not the other. Works has_one :quiz_log, :primary_key => :start_at, :foreign_key => :start_at Doesn't work has_many :event_logs, :primary_key => :start_at, :foreign_key => :start_at The reason being (i think) because the start_at on QuizLog is a date and the start_at on EventLog is a datetime. So it returns nil trying to match the exact datetime on a simple date. How can I cast the foreign_key start_at on the second statement to convert it first from datetime to simply date so it will match the second model?

    Read the article

  • Knowing the type of the stored proc when invoking from C#

    - by dotnetdev
    I am making a windows service to be able to run operations on a sql server database (insert, edit, etc) and invoke Stored Procs. However, is there a way for me to know the type of the SP? When invoking from C#, I need to knof if it is returning 1 value, or more, or none (so I can use executereader, scalar, etc)? Thanks

    Read the article

  • Pass a pointer to a proc as an argument

    - by user146780
    I want to pass a pointer to a procedure in c++. I tried passing this LRESULT(*)(HWND, UINT, WPARAM, LPARAM) prc but it didn't work. How is this done? Thanks HWND OGLFRAME::create(HWND parent, LRESULT(*)(HWND, UINT, WPARAM, LPARAM) prc) { if(framehWnd != NULL) { return framehWnd; ZeroMemory(&rwc,sizeof(rwc)); } } By "it didn't work" I mean it's a syntax error.

    Read the article

  • Call stored proc using xml output from a table

    - by user263097
    Under a tight deadline and I know I can figure this out eventually but I don't have much time to do it on my own. I have a table that has columns for customer id and account number among many other additional columns. There could be many accounts for a single customer (Many rows with the same customer id but different account number). For each customer in the table I need to call a stored procedure and pass data from my table as xml in the following format. Notice that the xml is for all of the customers accounts. <Accounts> <Account> <AccountNumber>12345</AccountNumber> <AccountStatus>Open</AccountStatus> </Account> <Account> <AccountNumber>54321</AccountNumber> <AccountStatus>Closed</AccountStatus> </Account> </Accounts> So I guess I need help with 2 things. First, how to get the data in this xml format. I assuming I'll use some variation of FOR XML. The other thing is how do I group by customer id and then call a sproc for each customer id?

    Read the article

  • XML Document straight to Stored Proc Mapping in NHibernate

    - by ZekeTheGeek
    Hello. I'm building a mechanism to take XML data from a queue and call stored procs to save the data from the XML document directly to the database. This seems like something that NHibernate could address, but of course most of the information I find discusses going from objects to database instead of another data format (XML, in this case). Is there a way to use NHibernate in this fashion or am I barking up the wrong tree? Thanks.

    Read the article

  • oracle's pro*C compiler and gnu C (__builtin_va_list, __attribute__, etc)

    - by Charles Ma
    I'm compiling a database library with pro*C which converts the .ppc library file to a .c file that gcc can use. However, I'm getting a lot of errors in pro*C like the following PCC-S-02201, Encountered the symbol "__ attribute__ " when expecting one of the following ... , Encountered the symbol "__builtin_va_list" when expecting one of the following The missing symbols are from a chain of standard includes like stdio.h and stdlib.h. How do I get around this issue? The library I'm compiling came from an old solaris system that we're now upgrading (to a new solaris 10 system) and the header files don't seem to use these symbols. e.g. the newer .h files has typedef __builtin_va_list va_list while the old .h files has typedef void* va_list There are a lot of things like this so I'm reluctant to go and fix all of them manually with a typedef

    Read the article

  • pro*C in oracle XE

    - by srandpersonia
    I downloaded the free express edition of oracle, Oracle XE. I couldn't find the pro*c compiler in this edition. I read somewhere that oracle 9i client has pro*C, So I presumed that oracle client for 10g XE should have it too and downloaded it. But to my disappointment, I can't find it there too. :(. Is there a way to download the older oracle 9i and use it connect to 10g XE without any compatibility problems?. Or is it possible to download the pro*C compiler alone?. I don't want to download the standard editions as they are too large(2 GB). Thanks.

    Read the article

  • Best way to use PL/SQL Pacakge Cursors from Pro*C

    - by Greg Reynolds
    I have a cursor defined in PL/SQL, and I am wondering what the best way to use it from Pro*C is. Normally for a cursor defined in Pro*C you would do: EXEC SQL DECLARE curs CURSOR FOR SELECT 1 FROM DUAL; EXEC SQL OPEN curs; EXEC SQL FETCH curs INTO :foo; EXEC SQL CLOSE cusr; I was hoping that the same (or similar) syntax would work for a packaged cursor. For example, I have a package MyPack, with a declaration type MyType is record (X integer); cursor MyCurs(x in integer) return MyType; Now I have in my Pro*C code a rather unsatisfying piece of embedded PL/SQL that opens the cursor, does the fetching etc., as I couldn't get the first style of syntax to work. Using the example EXEC SQL EXECUTE DECLARE XTable is table of MyPack.MyType; BEGIN OPEN MyPack.MyCurs(:param); FETCH MyPack.MyCurs INTO XTable; CLOSE MyPack.MyCurs; END; END-EXEC; Does anyone know if there is a more "Pure" Pro*C approach?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >