statement

SQL insert statement

I want to do the following: I have a table called Name which has an ID field. I have another blank table called Transcript I want to take the ID#s from Name and insert them into Transcript where they do not exist. Secondly I want to create 10 records with a different COURSE# value in the Transcript table. Therefore for each Name.ID ...

C# conditional statement

I want to switch the value for isFollowing. If it's true I want isFollowing = false and the opposite too. Instead of 'if' statement i am using ? : isFollowing == true ? isFollowing = false : isFollowing = true; But this isn't working. it gives "Only assignment, call, increment, decrement, and new object expressions can be us...

jquery string to function convert

is this possible? <div id="anything">I will change</div> <div id="id" jq="$('#anything').css({background: 'red'})"></div> var x = '$('#id').attr('jq')'; jQuery.call(x); Basically i would like use an attribute jq on any tag to act like a onclick would on html that calls the javascript statements. btw jQuery.call() is for demonstratio...

using update statement in toplink in multithreaded environment

hi, i am using toplink, but i am getting some problem while updating the values. this is my code snippet ExpressionBuilder builder = new ExpressionBuilder(); Expression expr = builder.get("addressId").equal("2"); Address address1 = (Address)uow.readObject(Address.class, expr); address1.setPincode(address1.getPincode() + 1); uow.register...

Python (2.6) , List Comprehension: why is this a syntax error ?

Why is print(x) here not valid (SyntaxError) in the following list-comprehension? my_list=[1,2,3] [print(my_item) for my_item in my_list] To contrast - the following doesn't give a syntax error: def my_func(x): print(x) [my_func(my_item) for my_item in my_list] ...

Python: making your own statements

Is there a way to define new statements like def, with, for,.. of my own in python. Of course, I don't mean to override the existing statements.. Only create some of my own. If so, how do I do it? Can you point me to good docs on the subject? ...

Full statement from ISO 8583

I would like to know if it is possible to do a full statement (between a date range) through ISO 8583, I have seen ATMs which do full statements and was wondering what method they used. I know balance inquiry and mini statements are possible on a POS devise over 8583. If it is possible does anyone have an information on the structure o...

trying to read sql statement c#

string queryStr = "select max(patient_history_date_bio) " + "as med_date, medication_name from biological where " + "(patient_id = " + patientID.patient_id + ") " + "group by medication_name;"; using (var conn = new SqlConnection(connStr)) using (var cmd = new SqlCommand(queryStr, conn)) { conn.Open(); using (SqlD...

How to get method name from VariableDeclarationStatement

hi, i have a variable of type VariableDeclarationStatement. I want to get the name of the method from this variable . How can i do that?Help ...

PHP: Search in more tables at once?

Hello. How do i make a mysql query for more tables to check at once? i mean, something like: $sql = mysql_query("SELECT username FROM table1, table2, table3 WHERE username = '$username'"); $numer = mysql_num_rows($sql); echo "You have ".$number; can you do like this? What i want to do is to show a user all his posts from the whole s...

echo out from the UNION sql?

<?php $sql = mysql_query(" SELECT navn FROM member_film WHERE username = '$pusername' UNION SELECT meetup FROM member_meetups WHERE byusername = '$pusername' UNION SELECT title FROM member_tutorials WHERE username = '$pusername'"); $rowit = mysql_fetch_array($sql); $number = mysql_num_rows($sql); ?> <? echo $number; ?> <? echo $rowit["n...

unreachable statement

I have loop designed to validate the user input on a question, it was working fine until I added this; if (userInput.charAt(0) > NUMCOLS && userInput.charAt(0) < 0); { System.out.println("Error, " + userInput + " is an invalid move."); continue; } before this if (userInput.charA...

Oracle SQL: How to use more than 1000 items inside an IN clause

I have an SQL statement where I would like to get data of 1200 ep_codes by making use of IN clause. When I include more than 1000 ep_codes inside IN clause, Oracle says I'm not allowed to do that. To overcome this, I tried to change the SQL code as follows: SELECT period, ... FROM my_view WHERE period = '200912' ... AND...

Sqlite + Java: table not updating

I'm using a Java wrapper for SQLite called SQLiteJDBC - this may have some bearing on any answers... I have a table which I've displayed in a GUI, within that UI I have a button for the fields for an individual row of that table. When I save my changes I do this... Statement stmt = connection.createStatement(); stmt.execute("update 'ta...

SQL Is it possible to setup a column that will contain a value dependent on another column?

I have a table (A) that lists all bundles created off a machine in a day. It lists the date created and the weight of the bundle. I have an ID column, a date column, and a weight column. I also have a table (B) that holds the details related to that machine for the day. In that table (B), I want a column that lists a sum of weights from ...

Why differs floating-point precision in C# when separated by parantheses and when separated by statements?

I am aware of how floating point precision works in the regular cases, but I stumbled on an odd situation in my C# code. Why aren't result1 and result2 the exact same floating point value here? const float A; // Arbitrary value const float B; // Arbitrary value float result1 = (A*B)*dt; float result2 = (A*B); result2 *= dt; F...

How to combine specific column values in an SQL statement

There are two variables in our database called OB and B2B_OB. There are EP codes and each EP may have one of the following 4 combinations: EP OB B2B_OB --- -- ------ 3 X 7 X 11 14 X X What I want to do is to combine the X's in the fetched list so that I can have A or B value for a single EP. My conditions are: IF...

Sql query to get this result..

Consider i have a user table and I have three columns mobilePhone,homePhone and workPhone... I have to select homePhone for every user as first pref if there is no value    I'll go for mobilePhone and    if there is no value for it       I ll go for workPhone.... Any suggestion how it can be done in mysql.. ...

How to get this done in mysql?

Consider i have a registartion table and there is field prefLocationId and it contains value like this 1,2,3,2,1,4 and so many.... And i have a table prefLocation which looks like this Id LocationName 1 Chennai 2 Mumbai 3 Kolkatta 4 Delhi and i want to select record of users and show values like Chennai,Mumbai,Kolkatta,Mumbai,Che...

SQl count() help with a select statement

HI im using this code SELECT MACH_NO, COUNT(MACH_NO) AS TOTAL_REPORTS FROM MAINTENANCE_LOG GROUP BY MACH_NO; to retrieve some data which gives MACH_NO TOTAL_REPORTS 1 4 5 2 8 1 7 1 now how can i retrieve only where total reports is bigger than three? I TRIED WHE...