Using variable with the same name as field name?

I have a complex proc where I have variables with the same name as field name used on a query. something like this:
SELECT a.id_table WHERE a.id_table = id_table
where the last id_table is a parameter sent to the proc:
declare procedure myproc(id_table int)
Is there any way or notation to declare the variable inside the query as a variable or I have to use a different name?

Well, variables are not the only thing you have to change if you want to switch to Oracle.
Although I don't think it is good practice (to use variable name same as column name), here is one example how you can achieve it using EXECUTE IMMEDIATE and bind variable
SQL> select deptno, count(1)
  2  from scott.emp
  3  group by deptno;
    DEPTNO   COUNT(1)
        30          6
        20          5
10 3
SQL> set serveroutput on
SQL> declare
  2  deptno varchar2(10);
  3  i number;
  4  begin
  5  deptno:=10;
  6  execute immediate
  7  'select count(1) from scott.emp where deptno=:deptno' into i using deptno;
  8  dbms_output.put_line('OUT ---> '||i);
  9  end;
10  /
OUT ---> 3
PL/SQL procedure successfully completed.
SQL> Message was edited by:
tekicora
Message was edited by:
tekicora

Similar Messages

  • I got a second iPad in the family.  Can we use it with the same Apple account and name?

    We got a second iPad in the family, cna we use it with the same Apple name and account?

    Yes you can, and it's then up to you whether to have the same the same or different content to the older one. When you sync to it your computer for the first time it may be best to give it a different name, just so that you can distinguish them.

  • How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?, How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?

    How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?, How do I create a graph with two different y-axis variables with the same x-axis (therefor having two curves)?

    Hi Libby,
    Select all three columns of data. All three must be 'regular' columns, not Header columns, and the X values must be in the leftmost column.
    Click the Charts button and choose the Scatter chart.
    The resulting chart will initially show only the first and second columns of data, and the selection will have been reduced to show this.
    Click the gear icon at the top left of the selection and choose Share X Values.
    You should see a result similar to this:
    Notes:
    The values on my sample table contain a random element, so they have changed from thhe first image to the second.
    The chart is as created by Numbers, with two edits:
    Data points have been connected with curves, using the Chart nspector.
    The curves were selected and their stroke increased to 2pts, using the stroke formating button in the format bar.
    Regards,
    Barry

  • I purchased songs from 2 different computers using itunes with the same apple id. I had 1 iPod I used for these but I just recently got an iPhone and I was wondering why it wasn't letting me put my purchased songs on my iPhone?

    I purchased songs from 2 different computers using itunes with the same apple id. I had 1 iPod I used for these but I just recently got an iPhone and I was wondering why it wasn't letting me put my purchased songs on my iPhone?

    You can transfer iTunes content from an iTunes library on a single computer only.
    Since these songs were purchased with the same iTunes account, you can download the song that is not in your iTunes library on the computer you will be syncing your iPhone with. Or you can download the song or songs direct on your iPhone.
    http://support.apple.com/kb/HT2519?viewlocale=en_US&locale=en_US

  • Trying to use Variables with the Unknown Computer collection to prompt Task Sequence for Domain, Join Account, Join Password, and Join Location.

    I want to use SCCM 2012 R2 and OSD, to boot a bare metal machine, install and OS, and bind it to Active Directory. The catch is that I want the deployment process in SCCM to prompt for the following pieces of information, and then use that information to
    bind the computer to Active Directory (W/O using MDT) instead of supply the data in the task sequence.
    Computer Name
    Domain
    Domain OU
    Domain Join Account
    I am approaching this in a similar fashion as stated in this blog.
    http://osdblog.com/2013/06/26/add-a-prompt-for-a-computer-name-in-your-sccm-deployment/
    I have added the following collection variables to the unknown computers collection:
    When I launch the task sequence, I am prompted as I would expect. I input the desired information, the deployment competes, but it does not bind to the domain.  Here is what my TS looks like. I intentally disabbled  the apply Network Settings step
    because it forces you to enter specific information if it enabled. I don't want to that, thus why I am trying to use the variables.
    My SMSTS log does not have a whole lot of meaningfull data, but I can post it if someone wants to see it. The only possible thing I could think of would be drivers, their are some driver errors in the log. However, if I turn on the Apply Networking setting
    process in the task sequence and turn off the variables, the machines bind fine. With that in mind, I would not think my problem would be driver related. Anyone out there have expertise in using a process like this, that could assist?
    --Tony

    Awesome! Thanks. One more thing, how should I supply the OSDJoinPassword variable? Should I just enter %OSDJoinPassword%
    for Password and Confirm Password? I can not tell if it will actually read it as a variable or try to use "%OSDJoinPassword%" for
    the actual password.
    --Tony

  • Just bought an ipad air and I have an ipad 2.  I would like to use both with the same computer.  Can someone tell me how to do this.  Do I have to set up a separate user.

    I just ordered an ipad air and I have an ipad 2. Can someone help me so I can use both ipads from the same computer.  The new one is for my husband and I am going to take the ipad 2.  Do I have to do something different since they will be using the same computer.  Any help you can give me would be appreciated.  Thanks in advance for your help.

    It's no problem. I hope this explanation simplifies the information in the Link Demo gave you. It's how I think most people do it...
    To avoid having to pay again for apps you have already purchased, use the same Apple ID (likely the current one) on both devices. You can adjust this in:
    Settings > iTunes & App Store.
    So that you can communicate with each other, use separate Apple IDs for iCloud, Messages, and FaceTime. Adjust those in:
    Settings > iCloud
    Settings > Messages
    Settings > FaceTime

  • How can I bandle Mac-mini Ipad and Iphone all with the same usser name and password

    I alway's have problem with my ID AND PASSWORD  also I want to bandle my mac-mini Ipad and Iphone with the same password and usser name how do I do tyhis?

    Hola amigo
    If you wish to use the same Apple ID for all your Apple devices then you need to set them up that way from the start. If you did not use the same Apple ID for them all then you would need to erase the iOS devices by returning them to the factory settings and starting over as if they were new.
    However, content is forever tied to the Apple ID that bought it. Apple does not transfer content from one Apple ID to another. Apple does not merge Apple IDs. You will never be able to download or update your content bought with one Apple ID with a different Apple ID. So you would need to decide if your are abandoning extra Apple IDs that you may have created and the content that you acquired with that Apple ID.

  • Refreshing the jeditorpane with the same file name(URGENT)

    Hi,
    I'm having trouble getting the JEditorPane to refresh the contents of an HTML file after updating it. Currently the original version of the file is shown and despite using setPage() with the same filename again, nothing happens, and the displayed file remains the same.
    I've tried removeAll(), validate() etc... but these have provided no results.
    Is there anyway i can clear the contents of the memory or something in order to fetch the updated file again?
    Any answers to this problem would be appreciated

    JEditorPane specifically doesn't allow loading of the same file/URL twice. It's one of the first checks it makes when you set the page.
    I think it'll work fine if you simply call setText("") on the editor pane to clear it down before calling setPage(..) with your file or URL. Even though the setText method doesn't load a file or anything it does create a new document which will not have the same URL as your original file so when you reload you file it will fail in the comparison and load it from scratch again.
    Hope this works for you,
    Drew

  • Multiple authentication sources with the same category

    Quote from portal help:
    "Multiple authentication sources can use the same category. However, because the prefix is prepended to the user and group names, you need to be certain that the domains involved do not have different users or groups with the same name. That is, if a LizaR user exists on one domain, and a LizaR user exists on another domain, they must be the same user because only one user will be created."
    Fine, let's say I am "certain that the domains involved do not have different users or groups with the same name".
    But there is other concern I have here. I want to know how portal will RECOGNIZE which authentication source to use?
    Let's say I have 2 auth sources AS1 and AS2 with the same category MyAuth. AS1 use WS1 to authenticate against LDAP1 and AS2 use WS2 to authenticate against LDAP2.
    Now, I have a user - Dmitry. I am trying to login into portal and I selected AS1 to do actual authentication. My question is how portal will CHOOSE which auth source to use because all portal knows about me is <MyAuth\Dmitry> that is came from portal login screen? Both auth sources match this pattern so seems like portal may choose any of them.
    Does it mean that portal will try to authenticate again AS1 and if this attempt failed then you AS2?
    I didn't find any explanation in portal documentation.
    Thank you.
    Edited by Bryazgin at 12/12/2007 10:42 AM

    Yes, it seems you are right. As soon as portal have found CORRECT user there is no issue anymore because user is bind to unique auth source that actually has been used to created this user.
    I think my main confusion come from the fact that having <Category> and <UserName> is not enough to UNIQUE identify user in portal as soon as <Category> can be the SAME for different auth sources.
    Let's have you have user created by AS1. According API this user created by this AS1 will have 4 different names, like sUniqueName, sAuthenticationName, sLoginName and sDisplayName. But portal is going to search user in portal database BASED on information that is available in login form - <Category> and <User Name>. At this point portal has no idea about sUniqueName and all this things.
    Now if there were 2 users in database that have been created by 2 different auth sources with the same <category> and <User Name> then I don't understand how portal will figured out which user to choose from. I guess <Category> value somehow MUST participate in sUniqueName value. <Category> has to be involve in process of finding user in database. In this scenario 2 users will be retrieved from database and what is important these 2 users are different, they have been created by different auth sources. Now question became which user is CORRECT one?
    Edited by Bryazgin at 12/12/2007 1:34 PM

  • Can I have 2 iPhones with the same number??

    Can I have 2 iPhones with the same number??
    I have a fairly new 5S iPhone. I would like to add a "iPhone 6" when available. Can I get it WITH THE SAME PHONE # ?

    Dual NAM is a different animal - that means having tow phone numbers on the same phone.  That's not allowed any longer, true.
    The OP is asking about having the same number on two devices - and Elector gave a solution.  Just move the SIM from phone to phone, depending on which one you want to use at any given time.  You cannot use the same number on two devices simultaneously.

  • Consolidation multiple STO PO to Create one Delivery with the same date

    Hi:
    Want to create one delivery notes from mutiple STO PO using VL10B.
    with the same delivery date.
    How to do it

    Basically the criteria to combine more than one STO into one single delivery
    is STO delivery date and receiving plant. If they are the same then one delivery
    is created and different delivery items are summed.
    Good reference available in SAP notes:
       386340 - Grouping purchase orders into one delivery using Vl10*
    There is more information in another existent thread:
      Combine STO into same DN

  • Custom fields with the same name in Project Online

    Today I discovered something interesting when creating custom fields in Project Online.
    I usually create a certain set of custom fields that are useful to have on both the project and the task level. An example of these is Reportable, which I use to determine which tasks to roll up into reports and also which projects overall to report on.
    So I created a project level custom field called Reportable. No problem.
    I then created a custom field on the task level called Reportable. And the computer said no!
    I then learned that although you could do this in Project Server 2013, you can't in Project Online. You can't have duplicate custom field names, even if they are of different types.
    This has led me to use a naming standard, such as Reportable Task and Reportable Project. But I really don't like that as codes are for computers, not us humans. So I hope this changes in the future, but for now you just need to think about how you approach
    the fields.
    Good luck!
    Ryan Darby
    National Manager PMO
    www.ipmo.com.au
    www.projectonline.com.au

    Hi Ryan,
    I would follow Ben on this..
    Just made a test on a Project 2013 instance on-premise and I cannot create a task ECF and a project ECF with the same name. The same test on a Online instance returns the same result: the ECF names must be unique whatever the entity is.
    Waiting for Ben's confirmation.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • How can I have two fields with the same name if it makes sense?

    Hello, folks :)
    I have a pretty hard time figuring out how I can have two text fields with the same binding name.
    The whole problem is that when I need two fields with the same binding name they are still differnent coz they have the same name but differnt indices.
    I should make a form filled at runtime by merging a pdf form file and an fdf file data file. And I have no choice to do it differently. And my form file needs some data like customerName, companyName twice in one form. But there's only one possible buinding name indexed zero.
    How can I create a field with absolutely the same name or is it just impossible due to possible name conflicts? And is there a workaround to this problem? I just need one piece of data repeated in different places.
    Thanks for your replies :)
    P.S. if u think that the problem is not clear enough let me know. I'll supply you with more details. But the general process can not be changed.
    One pdf should be mergred with an fdf with as the result of their merge a new filled and flattened form. I have no control over fdfs their are generated by Oracle and I can not fill the form using XML files coz this process should be integrated in a working application.

    I just thought about a really ugly workaround with a server-side script adding values to fdf files but it's a bit of work and tests and personally i think it's a bad idea :-(

  • Hiding Fields with the same name

    I have multiple fields across a form with the same name
    TxtName#1
    TxtName#2
    TxtName#3..... TxtName#24
    They are all share the same name because they should all have the same data.
    I want to be able to hide some of these fields, based on the number entered in another field TxtQty.
    for example if TxtQty=2 then
    TxtName#3-TxtName#24 will be hidden and only TxtName#1 and TxtName#2 will be visible.
    Can anyone please help?
    Thanks!

    The easiest way is to rename TxtName #1 and #2 to "TxtName2", and use the following custom Validate script for each:
    // Copy this field's value to the TxtName fields
    getField("TxtName").value = event.value;
    You can then hide all of the TxtName fields with:
    getField("TxtName").display = display.hidden;

  • I would like to use Formcentral form data to populate a pdf with the same fields.  Is that possible?

    I would like to use Formcentral form data to populate a pdf with the same fields.  Is that possible?

    Randy,
    We have an application that I would like to have in Formscentral.  That application is also in a larger PDF file that once filled in populates all the other forms below it (lease, credit check form, ect).  If the Application on Formscentral keep the same field names as the pdf can I pull the data from formscentral and sill populate the old application pdf so that all the forms below it will be also populated. 
    Greg

Maybe you are looking for

  • Error messages when I log on to Firefox.

    I get these same two error messages ( below) when I use my FIREFOX. What is the problem? How canI fix it? Thank you. ERORR MESSAGES: 1. --stanticate interface component! 2. Message TypeError_EMBARQ_INST_.DTFox is defined

  • Hwo to calculate first week for this year in variable

    The logic is taking today's date and subtracting 7 days.  It uses that date to determine the week which when run today is week one of 2010.but if this is for this year then  jan8 if i deduct 7 wit will comes as jan1 which will be as 1 st week. i have

  • TS3694 how do i resolve error 1015 please

    How do i resolve error code 1015 please

  • Catch SAPSQL_INVALID_FIELDNAME  error

    Hi, Is it possible to cacht SAPSQL_INVALID_FIELDNAME error ? When Im trying :     CATCH SYSTEM-EXCEPTIONS SAPSQL_INVALID_FIELDNAME = 1.     ENDCATCH. I got an error that there is no such exception :/ thx for help

  • Looking for Ribbon cabble for Seagate HD for my Zen Mi

    Hello, i'm looking for the following spare pieces : the ribbon cable between the seagate HD and my zen micro player. Does anyone have one I'm ready to buy it right now ! :-) Thanks in advance. Franck