Search Results

Search found 6988 results on 280 pages for 'if else statement'.

Page 140/280 | < Previous Page | 136 137 138 139 140 141 142 143 144 145 146 147  | Next Page >

  • function_exists php

    - by user527800
    Hi all I'm trying to write a function that could receive it's second arg a name of a function. In order to validate function's name (that will be used in an eval statement) I use function_exists such as: if(function_exists($type)){ $toEval= $type.'(\''.$file.'\');'; }else{ But if the arg sent is include or require (with 'once' variations) this code fails (function_exists returns false). How could this be fixed? Thanks, Alex

    Read the article

  • Created query is not supported by my DB

    - by stacker
    I created an application using seam-gen. The created operation to search the DB ends with and exception (syntax error). The query has a where clause like this: lower(barcode0_.barcode_ean) like lower((?||'%')) limit ? Does hibnerate or seam create the where clause which my DB can't understand? Or is there a workaround for SQL statement related issues in seam?

    Read the article

  • Query to get data from a main table

    - by Thu Thuy
    I have an Information table with 3 colums tableName/FieldName/Value and its data like this: TableName|FieldName | Value Films |DateSortie |NULL Films |Duree |NULL Films |CodeLangue |NULL Films |Documentaire |NULL Could you show me a SQL statement to put data into the Value Field, please! Note that I also have table Films and its fields like data in FieldName field of the Information table Thanks in advance TNT

    Read the article

  • How to log SQL output to text file on client from C#

    - by Rob Packwood
    I have a large auditing stored procedure that prints values and runs some SELECT statements. When running within SQL Management Studio we have the use select to display "Results to Text" so all of the SQL results and print statement display in one place. Now I need to have some C# code also call this auditing procedure at the end of the process and basically store all data that would be in the "Results to Text" window into a .txt file. How can this be done?

    Read the article

  • && operation in actionscript

    - by wcpro
    In the following code the line after the if statement gets run even when "BITMAP" is null. Why is this? public function get BitmapHeight () { if (_bitmapHeight == 0 && BITMAP != null) _bitmapHeight = BITMAP.bitmapData.height; return _bitmapHeight; }

    Read the article

  • Rails - Always have to check exists, and then value?

    - by Jason B
    I am checking to see if a value in a related table exists quite often in my view, in this case, expenses have approvals. If they have not been submitted, then there is no record of them in the approvals table. I am ending up with some really awkward code <% if !expense_item.expense_approval || expense_item.expense_approval.approval_status == 0 %> Is there a way to do an if statement on a value, without having to check if it exists first? Or some default way to set it nil?

    Read the article

  • Fastest way to add prefix to array keys?

    - by Kirzilla
    Hello, What is the fastes way to add string prefixes to array keys? was $array = array( '1' => 'val1', '2' => 'val2', ); needed $array = array( 'prefix1' => 'val1', 'prefix2' => 'val2', ); According to http://www.phpbench.com/ (see Modify Loop) I should use "for" statement, but probably there is more elegant way? Thank you.

    Read the article

  • DELETE and ACCESS

    - by Alex
    Where is the error in this statement? query = "DELETE TOP 10 FROM table WHERE field LIKE \"something*\"" I get an error on the query sytax. Thanks.

    Read the article

  • Handling macro redefinition without modifying .h files ... C / C++ language

    - by user310119
    Background: Let assume that I have two header files a.h and b.h. a.h contains: #define VAR 1 b.h contains: #define VAR 2 Note: The name of both of the macro is same. Let say I have some file myFile.c which includes both of the header files i.e. a.h and b.h. When I try to access VAR, I get a redefinition error of VAR. In order to resolve this problem, I inserted #ifndef VAR statement in both a.h and b.h files to prevent this error. a.h file becomes #ifndef VAR #define VAR 1 #endif b.h file becomes #ifndef VAR #define VAR 2 #endif Note: The header file can contain multiple macros, not just one macro. Problem: Let's assume that a.h and b.h files are obtained from third party library. These files don't contain #ifndef VAR statement. I am not allowed to change their header files. Can I resolve macro 'VAR' redefinition error in myFile.c or myFile.cpp file which uses VAR macro? I know I #undef VAR can be used to undefine a macro VAR. How can I selectively include VAR later in my program? i.e. on line 10 of myFile.c code I should be able to refer to VAR definition from a.h file, on line 15 of my code I should be able to refer to VAR from b.h file and on line 18 again I should be able to refer to VAR from a.h file. In short, am I able to do macro polymorphism ? Given a name of header file, it should refer to macro definition present in that file. I thought of using namespace trick to resolve an issue. Define first header file in namespace first and second header file in namespace second. I tried defining two namespaces. First namespace contains #include a.h and second namespace contains b.h. However, namespace trick does not work with macro. When I tried to access firstns::VAR, compiler reports an error message. Can you please suggest some way?

    Read the article

  • Display BLOB (image) through JSP

    - by jMarcel
    I have a code to show a chart o employees. The data (name, phone, photo etc) are stored in SQLServer and displayed through JSP. Showing the data is ok, except the image .jpg (stored in IMAGE=BLOB column). By the way, I've already got the image displayed (see code below), but I dont't know how to put it in the area defined in a .css (see code below, too), since the image got through the resultSet is loaded in the whole page in the browser. Does anyone knows how can I 'frame' the image ? <% Connection con = FactoryConnection_SQL_SERVER.getConnection("empCHART"); Statement stSuper = con.createStatement(); Statement stSetor = con.createStatement(); Blob image = null; byte[] imgData = null; ResultSet rsSuper = stSuper.executeQuery("SELECT * FROM funChart WHERE dept = 'myDept'"); if (rsSuper.next()) { image = rsSuper.getBlob(12); imgData = image.getBytes(1, (int) image.length()); response.setContentType("image/gif"); OutputStream o = response.getOutputStream(); //o.write(imgData); // even here we got the same as below. //o.flush(); //o.close(); --[...] <table style="margin: 0px; margin-top: 15px;"> <tr> <td id="photo"> <img title="<%=rsSuper.getString("empName").trim()%>" src="<%= o.wite(imageData); o.flush(); o.close(); %>" /> </td> </td> <td id="empData"> <h3><%=rsSuper.getString("empName")%></h3> <p><%=rsSuper.getString("Position")%></p> <p>Id:<br/><%=rsSuper.getString("id")%></p> <p>Phone:<br/><%=rsSuper.getString("Phone")%></p> <p>E-Mail:<br/><%=rsSuper.getString("Email")%></p> </td> </table> And here is the fragment supposed to frame the image: #photo { padding: 0px; vertical-align: middle; text-align: center; width: 170px; height: 220px; } Thanks in advance !

    Read the article

  • bulk insert from Java into Oracle

    - by Will Glass
    I need to insert many small rows rapidly into Oracle. (5 fields). With MySQL, I break the inserts into groups of 100, then use one insert statement for every group of 100 inserts. But with Oracle, user feedback is that the mass inserts (anywhere from 1000-30000) are too slow. Is there a similar trick I can use to speed up the programmatic inserts from Java into Oracle?

    Read the article

  • jQuery if and logic

    - by danit
    I have a simple jQuery toolbar, the basic functionality is: Hover: Background change to defined value & add .active class OnClick: Move the icon down 4px, and change background of the toolbar to that of the element What I would like to do move the icon down 4px when it has the class 'active' applied, however also remove the onclick event? Somehow I need an 'IF' statement in my jQuery for the Onclick event.

    Read the article

  • Clustered Index

    - by Charu
    Which type of index(clustered/non clustrered) should be used for Insert/Update/Delete statement in SQL Server. I know it creates an additional overhead but is it better in performance as comparison to non clustered index? Also which index should be use for Select statements in SQL Server?

    Read the article

  • Including huge string in our c++ programs ?

    - by Xinus
    I am trying to include huge string in my c++ programs, Its size is 20598617 characters , I am using #define to achieve it. I have a header file which contains this statement #define "<huge string containing 20598617 characterd>" When I try to compile the program I get error as fatal error C1060: compiler is out of heap space I tried following command line options with no success /Zm200 /Zm1000 /Zm2000 How can I make successful compilation of this program? Platform: Windows 7

    Read the article

< Previous Page | 136 137 138 139 140 141 142 143 144 145 146 147  | Next Page >