How can i put the value of a variable in an SQL statement?

Hi,
Can someone please tell me how i can use a variable as part of an sql statement.
So instead of "SELECT * FROM tablename WHERE username='john'"
I can put in "SELECT * FROM tablename WHERE username.text"

What would happen if someone entered "(delete *
from tablename)" into the username field?The SELECT would fail and the DELETE
would never run.
Or am I missing something?Ok, that wasn't valid SQL, so lets change it into valid SQL. What would this do
"SELECT * FROM tablename WHERE username=" + user
where user is "blah;DROP TABLE tablename;"
The SQL would become
SELECT * FROM tablename WHERE username=blah;DROP TABLE tablename;
And that would select, and then drop the table
Kaj
Message was edited by:
kajbj

Similar Messages

  • How can i put the values of the position of a pixel in an array ?

    Hello. I wanted to know if someone can help me with my problem. In fact i have to make an image treatment. For this i put my immage in an array and i work in this array thanks to two For loops. I wanted to know which pixel is white and which one is grey so i made a software and this works very well but know i would like to put the value of X and Y of each white pixel. unfortunately i don t know how to use Labview very well. So i tought about a system based on a conditional loop who put the value of X and Y in two 1D arrays. But i am not able to achieve it. This is what i tried but i don t know how to achieve it. If you guy or girls have solutions to my problem or an other way to do it go on ^^.
    Thanks every one.
    Attachments:
    Untitled.png ‏15 KB

    I am sure you can adapt one of the two solutions shown here.
    LabVIEW Champion . Do more with less code and in less time .

  • How Can I get the value of a variable name stored in another variable?

    I have a scenario wherein i get a record as %rowtype as input parameter into my function and i generate a dynamic sql to check the validity of a particular value in one of the columns of the input parameter record.
    I have a variable that stores the column name of input parameter record whose value is to be validated.
    The dynamic SQL looks like this:
    'Select empno from emp where empname = input_rec.'||v_colname
    While using Execute Immediate I get the error - Invalid Identifiier -'input_rec'.'ename'
    On Googling I found that the input parameter is out of the scope of the SQL that's being executed in the Execute Immediate.
    Is there any way I can get the value of ('input_rec.'||v_colname) so that I can pass it into the Execute Immediate with 'Using' clause?

    karthyk wrote:
    I have a scenario wherein i get a record as %rowtype as input parameter into my function and i generate a dynamic sql to check the validity of a particular value in one of the columns of the input parameter record.
    I have a variable that stores the column name of input parameter record whose value is to be validated.
    The dynamic SQL looks like this:
    'Select empno from emp where empname = input_rec.'||v_colname
    While using Execute Immediate I get the error - Invalid Identifiier -'input_rec'.'ename'
    On Googling I found that the input parameter is out of the scope of the SQL that's being executed in the Execute Immediate.
    Is there any way I can get the value of ('input_rec.'||v_colname) so that I can pass it into the Execute Immediate with 'Using' clause?compose the SELECT in a single VARCHAR2 variable before passing variable to EXECUTE IMMEDIATE

  • How can I save the value of a variable in a database?

    Do I need to save the number of times that I click in the animation to know how many times it has been seen
    I go to the databases msql through php, javascript, ajax and jquery, but I  don't know how to save the variable that contes the clicks from adobe edge animate
    I appreciate your help about how I can go to the database from adobe edge animate, Thank you very much.
    Luis Felipe Garcia
    [email protected]

    Can you clarify something? You want to know how many times someone has clicked a particular animation. Are you wanting to store the click as soon as they click it? So for example:
    User sees animation.
    They click to continue and go to some other page.
    You want to know how many times they've done that.
    Is that what you mean?

  • How can I get the value of "Warehose" column in a form

    How can I get the value of "Warehouse" column in the form below (I mean what table that contain this value):
    Production Supervisor >> Batches >> (Button) Material Details >> (Button) Line Allocations
    Well, for more clearly! My problem is I must have the Unit Cost of Items, so I've got it in the cm_cmpt_dtl (table), but if I want to, I must create a relation that require 2 filed, they're Item_ID and Whse_Code.
    There's no problem with Item_ID, but Whse_Code seem to be the Mission Impossible (hix, I hate that film!!!!)
    I wonder if It was right to post this topic here. But anyway I just post my question here, hope I could get some help.

    wow, many, many, many.... and many thanks!
    Just add a tiny modify to check out the Batch_type
    doc_id = (select batch_id from gme_batch_header where batch_no='&batch_number' and batch_type = 0)
    Because the batch_no can be duplicated as we also create Batch and Filrm Planned Order.
    Many thanks for your support!
    P/S: Sorry for my terrible English :P

  • How can we put the report which is generated by the program into spool??

    How can we put the report which is generated by the program into spool??
    I had generated a file in Unix which had the report but now the requirement has changed.
    Regards,
    Shashank.

    Hi Shashank,
    If the program is executed in the background and it has the write statement then the spool will automatically generated.
    Reward points if useful.
    Regards,
    Atish

  • How can I pass the value to another frame?

    Hi all,
    The following is part of my coding of a frame. Once i click on the jButton2, the selected value will be stored into a variable named NAME and the value will be displayed by a label in same frame. At the same time, a new frame named TESTING3 will be set to visible.
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
    // TODO add your handling code here:
        String name = (String)jList1.getSelectedValue();
        jLabel1.setText(name);       //display the value in a label in same frame
        new testing3().setVisible(true);     //a new frame set to visible
    }      Question: How can I pass the value to TESTING3 frame and display it on that frame?
    Thanks,
    ning.

    just make an archive that save that variable and them get them from de clase were you save it
    public class sav {
    String n;
    public sav {
    n="";
    public void addn(String x){
    n=x;
    public String shown(){
    return n;
    and them save it from the frame
    sav sun = new sav();
    sav.addn(f);
    them call it from the other frame
    sav sin = new sav();
    String s = sin.shown();
    label.setText(s);
    and i think thats you want to do if its not please explain me better
    bye

  • How can i pass the value one from to another form?

    hi all
    how can i pass the value one from to another form  with out use it when ever i want to needed this value that ican useit?
    like i have two fields U_test1 and U_test2  table name @AUSR
    that i have  four form  A! , A2,A3,A4    please tell me in details....?

    Hi,
    U can assign the values to some variables and access then in ur required forms.
    Vasu Natari.

  • How can I sum the values in a given column on sheet 1 i.e. A1:A50 based on the adjacent columns specific value i.e. B1:B50 = "Living Room" on sheet 2

    How can I sum the values in a given column on sheet 1 i.e. A1:A50 based on the adjacent columns specific value i.e. B1:B50 = “Dinning Room” on sheet 2
    For Example:
    SHEET 1
    A
    B
    $50
    Dinning Room
    $800
    Dinning Room
    $300
    Kitchen
    $1,000
    Master Bedroom
    $100
    Dinning Room
    SHEET 2
    Display the total SUM amount of each Project based on Sheet 1
    Project Name
    Total Cost
    Dinning Room
    $950
    Kitchen
    $300

    Would be a good idea to open iWork Formulas and Functions User Guide and search for the description of the function named SUMIF
    The Guide is available for every user thru the Help menu.
    Yvan KOENIG (VALLAURIS, France) jeudi 19 mai 2011 17:32:42
    Please :
    Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How can I receive the value of a selected item in the backing bean

    I have a table in a jspx file.
    When I go to the detail page I want to do something with the value of the currentrow.
    I want do a calculaction of the value of ClbId.
    How can I receive the value of the selected ClbId in my backing bean
    <af:table value="#{bindings.Searchteamlist.collectionModel}"
    var="row" rows="#{bindings.Searchteamlist.rangeSize}"
    first="#{bindings.Searchteamlist.rangeStart}"
    emptyText="#{bindings.Searchteamlist.viewable ? 'No rows yet.' : 'Access Denied.'}"
    selectionState="#{bindings.Searchteamlist.collectionModel.selectedRow}"
    selectionListener="#{bindings.Searchteamlist.collectionModel.makeCurrent}"
    rendered="#{backing_FirstFlag_Club_Club.searchFirstTimeClub_Club_AdresAndereClubs == false}">
    <af:column sortProperty="Matricule" sortable="true"
    headerText="#{bindings.Searchteamlist.labels.Matricule}">
    <af:outputText value="#{row.Matricule}"/>
    </af:column>
    <af:column sortProperty="ClbId" sortable="true"
    headerText="#{bindings.Searchteamlist.labels.ClbId}">
    <af:outputText value="#{row.ClbId}">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.Searchteamlist.formats.ClbId}"/>
    </af:outputText>
    </af:column>
    <af:column sortProperty="Nom" sortable="true"
    headerText="#{bindings.Searchteamlist.labels.Nom}">
    <af:outputText value="#{row.Nom}"/>
    </af:column>
    <f:facet name="selection">
    <af:tableSelectOne text="Select and">
    <af:commandButton text="Submit"
    action="club_AdresAndereClubsDetail">
    <af:setActionListener from="#{row}"
    to="#{processScope.row}"/>
    </af:commandButton>
    </af:tableSelectOne>
    </f:facet>
    </af:table>

    hi tde
    Using an Expression Language helper class like this one from Steve Muench ...
    http://radio.weblogs.com/0118231/stories/2006/12/18/sourceForMyFavoriteElHelperClass.html
    ... you could write something like this in your backing bean:
    Integer vClbId = (Integer)EL.get("#{row.ClbId}");(Make sure to cast it to the correct type.)
    success
    Jan Vervecken

  • How can I put the report generated by a program into a File?

    Hi all,
       How can I put the report generated by a program into a File?It can be in TXT format or excel format which ever is possible.
    I need to export this file to memory,How can I do that??
    Regards,
    Shashank.

    Hello Shashank,
    Please ignore my previous answer... Ofcourse it works...
    There are several ways to do this...
    two of them are
    1. List -> Save -> File and press enter..
        it will ask for the format, then path where to save it. Just give the path.
    2. Using function module 'GUI_DOWNLOAD'.
    I'm giving the example bellow which explains the usage of both GUI_UPLOAD and GUI_DOWNLOAD.
    To do this... you need to have folder with name 'TEST' and a .txt file in it with name 'test'. And contents of it are :
    TEST1             ,BOT 
    TEST2             ,BOT 
    TEST3             ,BUT 
    with spaces.
    REPORT zssr_bdc .
    DATA: BEGIN OF g_t_itab OCCURS 0,
            matnr LIKE mara-matnr,
            maktx LIKE makt-maktx,
          END OF g_t_itab.
    DATA: g_t_bdcdata TYPE TABLE OF bdcdata.
    DATA: path TYPE string,
          path1 type string.
    path = 'C:\Documents and Settings\ssr3kor\Desktop\TEST\test.txt'.
    path1 = 'C:\Documents and Settings\ssr3kor\Desktop\TEST\test1.txt'.
    *contents of test.txt    *
    *TEST1             ,BOT  *
    *TEST2             ,BOT  *
    *TEST3             ,BUT  *
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename = path
      TABLES
        data_tab                      = g_t_itab.
    LOOP AT g_t_itab.
      WRITE:/1(18) g_t_itab-matnr, 20(40) g_t_itab-maktx.
    ENDLOOP.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
       filename = path1
       filetype                      = 'ASC'
      TABLES
        data_tab                      = g_t_itab.
    Now you will get one .txt file with name 'TEST1.TXT' in the TEST folder.
    <b>REWARD POINTS IF IT IS HELPFUL</b>
    Regards
    Sasidhar Reddy Matli

  • How can we get the value of the key field in a custom data model using governance API?

    Dear Team,
    How can we get the value of the key field in a custom data model, to be used for manipulation of the change request fields using governance API?
    Any kind of help would be sincerely appreciated.
    Thanks & Regards,
    Tushar.

    Hi Michael,
    Thanks for direction. Let me give more context on this as I'm interested to get more details..One of the issue was to read cross entity field values on UI based on user action and set other entity field behaviour...It is similar to what is being posted here.
    For ex: Reading MTART from Basic Data UIBB in MM MDG UI and set the field properties in some other custom entities say ZZETEST. This cannot be done using UI BADI as it only supports single entity at a time and not cross entity. So alternatively we found a solution where we can enhance existing PLMB feederclass cl_mdg_bs_mat_feeder_form by reading the model and the entity as needed as it it proved that it supports cross entity UI field behaviours and so business requirements.
    This is a workaround for now.
    So the question is How do we achive it using governance API for cross entity field behiaviours.?or what is the right way doing this.
    Can we do that using governance API and its' methods?
    In the Governance API doc you provided below has referring to below external model as part of gevernance API.
    The active or inactive data (before or during the derivation or the check) can be read
    with the external data model interface IF_USMD_MODEL_EXT with the method READ_CHAR_VALUE and
    the corresponding READ_MODE parameter. To avoid unnecessary flushes (derivations), the NO_FLUSH
    parameter should b
    e set to ‘X’.
    Thanks
    Praveen

  • Hi, how can i break the value for a row and column once i have converted the image to the array?????​??

    Hi, I would like to know how can i break the value for a row and column once i have converted the image to the array. I wanted to make some modification on the element of the array at a certain position. how can i do that?
    At the moment (as per attachhment), the value of the new row and column will be inserted by the user. But now, I want to do some coding that will automatically insert the new value of the row and the column ( I will use the formula node for the programming). But the question now, I don't know how to split the row and the column. Is it the value of i in the 'for loop'? I've  tried to link the 'i' to the input of the 'replace subset array icon' , but i'm unable to do it as i got some error.
    Please help me!
    For your information, I'm using LABView 7.0.

    Hi,
    Thanks for your reply.Sorry for the confusion.
    I manage to change the array element by changing the row and column value. But, what i want is to allow the program to change the array element at a specified row and column value, where the new value is generated automatically by the program.
    Atatched is the diagram. I've detailed out the program . you may refer to the comments in the formula node. There are 2 arrays going into the loop. If a >3, then the program will switch to b, where if b =0, then the program will check on the value of the next element which is in the same row with b but in the next column. But if b =45, another set of checking will be done at a dufferent value of row and column.
    I hope that I have made the problem clear. Sorry if it is still confusing.
    Hope you can help me. Thank you!!!!
    Attachments:
    arrayrowncolumn2.JPG ‏64 KB

  • How can I obtain the value of a database column in a JSP variable ?

    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

    Try something like
    String cnt = c1.getRowSet().getCurrentRow().getAttribute("Cont").toString();
    -A
    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

  • How can i get the value stored in the session object using its sessionid

    how can i get the value stored in the session object using its sessionid by running stand alone java application

    myforum wrote:
    how can i get the value stored in the session object using its sessionid by running stand alone java applicationThis does not seem to make sense! You need at least to give a lot more detail of what you are doing.

Maybe you are looking for

  • First iPod... and I have no idea how to use it! Help, please!

    Alright, so today I went out and bought a new 80G iPod Classic. So when I get it home, I try to upload some of my music. (About 5G) However, I'm on a PC, and all of my music is in Windows Media Player. But when I open up iTunes, it converts some of m

  • Sndpeek. real-time audio visualization

    Homepage: http://soundlab.cs.princeton.edu/software/sndpeek/ Screens: http://soundlab.cs.princeton.edu/images/sndpeek.jpg http://soundlab.cs.princeton.edu/images/sndpeek6.jpg http://soundlab.cs.princeton.edu/images/sndpeek2.jpg http://soundlab.cs.pri

  • Oracle Collaboration Coexistence Gateway and Exchange 2010

    Hi, in the Beehive 2.0 Integration Guide is said that the Collaboration Coexistence Gateway is compatible with MS Exchange 2003 and 2007. Are there any plans to make in compatible to Exchange 2010 or is it even already compatible? Thanks for your hel

  • PB Invoking OEM / DBCA

    Hello, I just completed the installation of most of the configuration tools with the runInstaller for Oracle 9i Database on Red Hat Linux Enterprise 3 (WS). When finished the OEM (Oracle Enterprise Manager) started-up. I tried to create a new databas

  • Counterfeit Adobe Photoshop CS6?

    Almost at the end of the install process for Photoshop CS6 it says it is a counterfeit file and is corrupt and that I should report piracy. That seems odd because I downloaded it from the Adobe site under "my recent products". Needless to say it stop