Search Results

Search found 39491 results on 1580 pages for 'insert id'.

Page 48/1580 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • can't define id ( cold fusion )

    - by venom
    here is my cold fusion code: Example1: <cfquery name="GET_BRAND" datasource="#dsn1#"> SELECT PRODUCT_CATID FROM PRODUCT_CAT WHERE PRODUCT_CATID = PRODUCT_CATID </cfquery> #get_brand.product_catid# But it shows all the time number 1, i just can't understand why, and how do i make it work properly, this code should have defined the brand_id, but instead shows 1. The system is Workcube. Here is my example for getting from the static product's id, its dynamic price: Example 2: <cfset product_id = 630> <cfquery name="price_standart" datasource="#dsn3#"> SELECT PRICE_STANDART.PRICE PRICE FROM PRICE_STANDART WHERE PRICE_STANDART.PRODUCT_ID = <cfqueryparam value="#product_id#" cfsqltype="cf_sql_integer"> </cfquery> But this time i need to get from dynamic product's ID its dynamic brand id. This script works the same way as the Example 1: <cfquery name="GET_BRAND" datasource="#dsn1#"> SELECT BRAND_ID FROM PRODUCT_BRANDS WHERE BRAND_ID = BRAND_ID </cfquery> #get_brand.BRAND_ID#

    Read the article

  • Cannot get principal id on my Spock test

    - by Ant's
    I have a controller like this : @Secured(['ROLE_USER','IS_AUTHENTICATED_FULLY']) def userprofile(){ def user = User.get(springSecurityService.principal.id) params.id = user.id redirect (action : "show", params:params) } I want to test the controller above controller in spock, so I wrote a test code like this: def 'userProfile test'() { setup: mockDomain(User,[new User(username:"amtoasd",password:"blahblah")]) when: controller.userprofile() then: response.redirectUrl == "/user/show/1" } When I run my test, this test fails with this error message : java.lang.NullPointerException: Cannot get property 'principal' on null object at mnm.schedule.UserController.userprofile(UserController.groovy:33) And in case of Integration test: class UserSpec extends IntegrationSpec { def springSecurityService def 'userProfile test'() { setup: def userInstance = new User(username:"antoaravinth",password:"secrets").save() def userInstance2 = new User(username:"antoaravinthas",password:"secrets").save() def usercontroller = new UserController() usercontroller.springSecurityService = springSecurityService when: usercontroller.userprofile() then: response.redirectUrl == "/user/sho" } } I get the same error as well. What went wrong? Thanks in advance.

    Read the article

  • How do you get the ID of a control in ASP.NET

    - by James
    I am attempting to loop through an array of numbers, match them to the checkbox they they are associated with, and checkmark that box. My checkbox is set up like: <input type="checkbox" runat="server" id="someID" name="somename" value="1234" /> My code when the page loads currently looks like: foreach (string interest in interests_Var){ foreach (var c in Page.Controls) { } } interests_Var is my array containing different numbers. We'll assume one of them is 1234. While looping through the page controls, I want to compare the value of the control to my number. If it equals my number, I want to then apply the attribute checked="checked". I'm assuming I have to find the ID of the control I am using, then use that ID to add a new attribute. Or is there a way I can add the attribute using the c variable? I'm not dead set on this setup, so if you know a better way, I'm all ears. Thanks for any help and suggestions.

    Read the article

  • passing session id via url

    I'm trying to get my script to use url session id instead of cookies. The following page is not picking up the variable in the url as the session id. I must be missing something. First page http://www.website.com/start.php ini_set("session.use_cookies",0); ini_set("session.use_trans_sid",1); session_start(); $session_id = session_id(); header("location: target.php?session_id=". $session_id ); Following page - http://www.website.com/target.php?session_id=rj3ids98dhpa0mcf3jc89mq1t0 ini_set("session.use_cookies",0); ini_set("session.use_trans_sid",1); print_r($_SESSION); print(session_id()) Result is a different session id and the session is blank. Array ( [debug] = no ) pt1t38347bs6jc9ruv2ecpv7o2

    Read the article

  • Action method expected parameter named Id and nothing otherwise

    - by codingbiz
    The Error The parameters dictionary contains a null entry for parameter 'UserId' of non-nullable type 'System.Int64' for method 'System.Web.Mvc.ActionResult Predict(Int64)' in 'sportingbiz.Controllers.PredictionController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters This does not work. Throws the error mentioned above http://mysite/User/Profile/15 This works http://mysite/User/Profile/?UserID=15 The Controller Action public ActionResult Profile(long UserID) { } When I changed the parameter name to Id it works. I think it's because Id was specified in the route collection (Global.asax). Is it possible to tell MVC that UserId should map to Id without changing it in the Global.asax

    Read the article

  • Insert an element to std::set using constructor

    - by Dave17
    is it possible to insert a new element to std::set like in case of std::list for example: //insert one element named "string" to sublist of mylist std::list< std::list<string> > mylist; mylist.push_back(std::list<string>(1, "string")); Now, mylist has one element of type std::string in its sub-list of type std::list. How can you do the same in if std::set is the sub-set of std::list my list i.e std::list<std::set <string>> mylist; if you can't then why not?

    Read the article

  • INSERT SQL in Java

    - by Pierre
    Hello. I have a Java application and I want to use SQL database. I have a class for my connection : public class SQLConnection{ private static String url = "jdbc:postgresql://localhost:5432/table"; private static String user = "postgres"; private static String passwd = "toto"; private static Connection connect; public static Connection getInstance(){ if(connect == null){ try { connect = DriverManager.getConnection(url, user, passwd); } catch (SQLException e) { JOptionPane.showMessageDialog(null, e.getMessage(), "Connection Error", JOptionPane.ERROR_MESSAGE); } } return connect; } } And now, in another class I succeeded to print my values but when I attempt to insert a value nothing is happening ... Here's my code : try { Statement state = SQLConnection.getInstance().createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY); Statement state2 = SQLConnection.getInstance().createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE); state2.executeUpdate("INSERT INTO table(field1) VALUES (\"Value\")"); // Here's my problem ResultSet res = state.executeQuery("SELECT * FROM plateau");

    Read the article

  • sql server - bulk insert error

    - by user554134
    I am using bulk insert and getting below error: Note: The data in the load file is not beyong the configured column length Running Command: bulk insert load_data from 'C:\temp\dataload\load_file.txt' with (firstrow = 1, fieldterminator = '0x09', rowterminator = '\n',MAXERRORS = 0, ERRORFILE = 'C:\temp\dataload\load_file') Contents of load file: user_name file_path asset_owner city import_date admin C:\ admin toronto 04/12/2012 Error: Msg 4863, Level 16, State 1, Line 1 Bulk load data conversion error (truncation) for row 1, column 6 (validated). Msg 7399, Level 16, State 1, Line 1 The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error. Msg 7330, Level 16, State 2, Line 1 Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

    Read the article

  • Insert data into table effeciently, postgresql

    - by Rowan_Gaffney
    I am new to postgresql (and databases in general) and was hoping to get some pointers on improving the efficiency of the following statement. I am inserting data from one table to another, and do not want to insert duplicate values. I have a rid (unique identifier in each table) that are indexed and are Primary Keys. I am currently using the following statement: Insert INTO table1 SELECT * FROM table2 WHERE rid NOT IN (SELECT rid FROM table1). As of now the table one is 200,000 records, table2 is 20,000 records. Table1 is going to keep growing (probably to around 2,000,000) and table2 will stay around 20,000 records. As of now the statement takes about 15 minutes to run. I am concerned that as Table1 grows this is going to take way to long. Any suggestions?

    Read the article

  • SQL SELECT INSERTed data from Table

    - by Noam Smadja
    its in ASP Classic. MS-Access DB. i do: INSERT INTO Orders (userId) VALUES (123)" what i want to retrieve is orderNumber from that row. its an auto-increment number. so i did: SELECT orderNumber FROM Orders WHERE userId=123 but since it is on the same page, the SELECT returns: Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record. i've seen somewhere RETURNING orderNumber as variable but it was for oracle and i dont know how to implement it into my asp :( set addOrder = Server.CreateObject("ADODB.Command") addOrder.ActiveConnection = MM_KerenDB_STRING addOrder.CommandText = "INSERT INTO Orders (userId) VALUES ("&userId&")" addOrder.CommandType = 1 addOrder.CommandTimeout = 0 addOrder.Prepared = true addOrder.Execute() Dim getOrderNumber Set getOrderNumber = Server.CreateObject("ADODB.Recordset") getOrderNumber.ActiveConnection = MM_KerenDB_STRING getOrderNumber.Source = "SELECT orderNumber FROM Orders WHERE userId=" & userId getOrderNumber.CursorType = 0 getOrderNumber.CursorLocation = 2 getOrderNumber.LockType = 1 getOrderNumber.Open() session("orderNumber") = getOrderNumber.Fields.Item("orderNumber").value

    Read the article

  • postback __EVENTTARGET ID in Page.Request.Form has $ not _ in ASP.NET

    - by Industry86
    I am using the ToolkitScriptManager from the Ajax tool kit and I am having a problem finding my button's ID. My ID's on my controls come back with $ symbols instead of _ symbols, like the following: Grid$ctl06$insertButton This obviously causes problems when attempting to find the control from the Page.Request.Form keys. I cannot seem to find the determining factor that would cause this. Now, I know this is the name and in my source I see that the ID is with the _, so why is the Page.Request.Form showing up with the $ symbol instead? Anybody encounter this before?

    Read the article

  • Android/ORMLite Insert Row with ID

    - by Joe M
    I'm currently using ORMLite to work with a SQLite database on Android. As part of this I am downloading a bunch of data from a backend server and I'd like to have this data added to the SQLite database in the exact same format it is on the backend server (ie the IDs are the same, etc). So, my question to you is if I populate my database entry object (we'll call it Equipment), including Equipment's generatedId/primary key field via setId(), and I then run a DAO.create() with that Equipment entry will that ID be saved correctly? I tried it this way and it seems to me that this was not the case. If that is the case I will try again and look for other problems, but with the first few passes over the code I was not able to find one. So essentially, if I call DAO.create() on a database object with an ID set will that ID be sent to the database and if it is not, how can I insert a row with a primary key value already filled out? Thanks!

    Read the article

  • Error during data INSERT in php

    - by nectar
    here my code- $sql = "INSERT INTO tblpin ('pinId', 'ownerId', 'usedby', 'status') VALUES "; for($i=0; $i0) { $sql .= ", "; } $sql .= "('$pin[$i]', '$ownerid', 'Free', '1')"; } $sql .= ";"; echo $sql; mysql_query($sql); if(mysql_affected_rows() 0) { echo "done"; } else { echo "Fail"; } output: ** INSERT INTO tblpin ('pinId', 'ownerId', 'usedby', 'status') VALUES ('13837927', 'admin', 'Free', '1'), ('59576082', 'admin', 'Free', '1'); Fail why it is not inserting values when $sql query is right?

    Read the article

  • PHP MySQL Insert Data

    - by happyCoding25
    Hello, Im trying to insert data into a table in MySQL. I found/modified some code from w3Schools and still couldn't get it working. Heres what I have so far: <?php $rusername=$_POST['username']; $rname=$_POST['name']; $remail=$_POST['emailadr']; $rpassword=$_POST['pass']; $rconfirmpassword=$_POST['cpass']; if ($rpassword==$rconfirmpassword) { $con = mysql_connect("host","user","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mydbname ", $con); } mysql_query("INSERT INTO members (id, username, password) VALUES ('4', $rusername, $rpassword)"); ?> Did I mistype something? To my understanding "members" is the name of the table. If anyone knows whats wrong I appreciate the help. Thanks

    Read the article

  • SQL insert default value

    - by Stan
    Say if I have a table like CREATE TABLE [Message] ( [MessageIdx] [int] IDENTITY (1, 1) NOT NULL , [Message] [varchar] (1024) COLLATE Latin1_General_CI_AS NOT NULL , [ValidUntil] [datetime] NULL , CONSTRAINT [PK_Message] PRIMARY KEY CLUSTERED ( [MessageIdx] ) WITH FILLFACTOR = 90 ON [PRIMARY] ) ON [PRIMARY] GO I am trying to insert value without specify column names explicitly. Below statement causes error. How can I do that? Thanks. set identity_insert caconfig..fxmessage on; insert into message values (DEFAULT,'blah',DEFAULT); set identity_insert caconfig..fxmessage off;

    Read the article

  • can I change my open ID URL change?

    - by dhruvbird
    I wanted to know if I can change my open ID url from say: www.abc.com/username to www.pqr.com/username while the relying party still thinks I am the same user? or even say: www.abc.com/something/username to www.abc.com/somethingelse/username I intuitively think that this is not possible since if it were, then it is possible for anyone to spoof anyone else's identity. Also, does Open ID specify which fields the relying party should use to ensure secure determination of the user's identity? For example, I would expect it to club the URL provided with the username/email address sent back by the Open ID server.

    Read the article

  • Create "INSERT" statements from mySQL database in Java

    - by girdus
    Does anyone know of any good libraries or scripts out there which will allow me to point to any mySQL table and automatically get a list of all the INSERT statements for the data in the table? DdlUtils allows me to create an XML file from a database model but I would like to have it in INSERT statements format and preferably the ability to choose a couple of tables instead of dumping the entire database. Thanks. EDIT: I need it to be a Java API because I want to programatically call it from my Java method.

    Read the article

  • Turning user ID into name (seperate tables) in PHP

    - by mobile
    I am currently trying to display the username of people who i am following, the problem is that during the following process, only the ID of me and the person i'm following is stored. I've got it to the point where the ID's are displayed but i'd like to show the names hyperlinked. $p_id is the profile ID. Here's what I've got: $following = mysql_query("SELECT `follower`, `followed` FROM user_follow WHERE follower=$p_id"); I am following: <?php while($apple = mysql_fetch_array($following)){ echo '<a href="'.$apple['followed'].'">+'.$apple['followed'].'</a> '; }?> The usernames are in a different table "users" under the field "username" - I need them to match up with the ID's that are currently displayed, and be displayed. Any help appreciated, thanks guys

    Read the article

  • ID cannot be null (Auto Increment)

    - by THeK
    I'm using an INSERT ON DUPLICATE KEY statement for my website. It's for creating news items, so I figured I could use the same MySQL command for both creating and updating news items. However, when I use the following: INSERT INTO table (id,title,content) VALUES(NULL,"Test","Test"); Instead of creating a new auto increment value it throws an error. However, the command works on my main development server. But not on my laptop. Both versions of MySQL are the same, the only difference being MySQL was installed manually on my server, and with WAMP on my laptop. Are there any MySQL Variables that could be causing this?

    Read the article

  • Jquery li element id

    - by Gazler
    Hi, I am using a jquery contextmenu plugin for right click menus which I am trying to add to each li element of an unordered list with the ID mailbox. The code I have is: $("#mailbox > li").contextMenu('myMenu1', { bindings: { 'open': function(t) { alert('Trigger was '+t.id+'\nAction was Open'); } //CODE SNIPPED }); My assumption is that this should alert the id of the list element that the contextMenu was called from, however it is returning an empty string. Am I accessing/assigning these correctly? t is an object HTMLLIElement in the context above by the way. Cheers, Gazler.

    Read the article

  • How to insert into data base using multi threading programming [closed]

    - by user1196650
    I am having a method and that method needs to do the following thing: It has to insert records into a database. No insert is done for the same table again. All inserts are into different tables. I need a multi threading logic which inserts the details into db using different threads. I am using oracle db and driver configuration and remaining stuff are perfect. Please help me with an efficient answer. Can anyone could provide me with a skeleton logic of the program.

    Read the article

  • Encrypted ID in URLs

    - by Eric
    I am trying to hash or encrypt a record's ID for URL's such that people can't view various records simply by guessing different integer ID's. Essentially, my URL's would be something like this: /plans/0AUTxwoGkOYfiZGd2 instead of /plans/304. Would the best way to do this just be to use SHA-1 to hash the plan's id and store it in a hashed_id column for plans? Then, overwrite to_param and add a finder to find by hashed_id? How do you ensure that the characters generated are 0-9, a-z, or A-Z? Thanks!

    Read the article

  • PHP MYSQL Insert Data in Arabic Language

    - by h_a86
    I am trying to insert some Arabic Language data into MySQL using PHP and an HTML form. When I insert the data in to MYSQL table, the table field represents data as مرحبا العالم. But when I access the same data with PHP and show it in my webpage, it shows the correct data. I am using: http-equiv="Content-Type" content="text/html; charset=utf-8" meta tag in my web page to show Arabic data. My question is why my data looks like this: مرحبا العالم in MySQL table, and how should I correct it.

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >