Why the operator: = is not working when it is in a string concatenated and assigned to a variable?

I met with an error ORA-00904: "V_DEPTNO": online: 14 (My PL/SQL code is below), while playing with the cursor of reference (for the end of the apprenticeship).
I debugged it and the problem was solved and it returns the desired output.  However, the solution of it is not sensible for me even if the output
has been posted/successfully recovered.    Here's a clearer description of the code:


On line 14, I have a variable called stmt and stmt value concatenated with the string "where deptno =: v_deptno' and then finally assigned to this stmt variable."

In this line, he returned ORA-00904 but it was fixed by using =: operator instead of the = operator.

 stmt:=stmt || 'where deptno=:v_deptno'; 

In sql pure when it is intended to add where clause for such purpose, the = comparison operator is used.
Example:

Select empno,ename,sal from emp where deptno=10;

But in my pl/sql code, =: operator was used.

Why is this? Can someone explain what it is? Even if I did my research, but I couldn't find the explanation yet.

All what I've understood so far, is that this may mean the following (I may be wrong):
1 - everything first, assign the value 10, of v_deptno, who was declared, to easily compare.
2. compare the value assigned with deptno.
On this basis, recover data.


Thus, he worked as a = + tour operator defined in another high programming language such as c#... etc.
Example:

int a = 0;

a =+ 1;    //  a was declared as an integer that has value 0
        // then  we tried to increment by 1 or add by one
         // so it would be  a=a+1;  
                //which is  a=0+1;

It works the same?

Here's my complete code pl/sql, just in case...

--ref cursor
declare 

type emp_refcur  is ref cursor;
emp_cv emp_refcur;
emprec emp%rowtype;
stmt varchar2(299):= 'select * from emp';
v_deptno number:=10;

begin

if v_deptno is null then
  open emp_cv for stmt;

else
  stmt:= stmt || ' where deptno=:v_deptno';
  open emp_cv for stmt using v_deptno;
end if;

loop
fetch emp_cv into emprec;
exit when emp_cv%notfound;
dbms_output.put_line(emprec.empno||chr(9)||emprec.ename||chr(9)||emprec.deptno);
end loop;
close emp_cv;
end;
/







I would you to explain and share with me something to read or give me some clues.

Thanks in advance!

In this line, he returned ORA-00904 but it was fixed by using =: operator instead of the = operator.

There is no "=:" operator.

The colon character ': ' is used to define a binding (placeholder) variable in the query string.

The value of this variable must be passed ("linked") after analysis and run step so that the query is executed correctly. That's what the USING clause in your code.

Thus, he worked as a = + tour operator defined in another high programming language such as c#... etc.

Example:

  1. int a = 0;
  2. a = + 1;    one has been declared as an integer that is set to 0
  3. then we tried to increment by 1 or add one
  4. so it would be a = a + 1;
  5. which is a = 0 + 1;

It works the same?

No, nothing to do with it.

Tags: Database

Similar Questions

  • Why the tableStyle script not working, when the other two are

    Hi, please can you help and thank you in advance. I'm puzzled. As you can see, I am new to scripting - a glance through the 15 pages on the forum showed me how the news - and I want a workflow in which I put the styles and then use in this case, "appliedTableStyle" to connect to the appropriate table.
    My question is why this style of table script not work and appear in the palette? (when the two scripts below paragraphs and cells are) I tried the doc.tableStyles.add and the doc.tableStyle.add. Please show me where I'm wrong, or a better alternative. Thank you.
    docTest = app.documents.add)
    table_styles (docTest)
    cell_styles (docTest)
    para_styles (docTest)
    function table_styles (doc)
    {
    with (doc)
    {
    //try {doc.tableStyles.add
    try {doc.tableStyle.add
    ({
    name: "tableGLOBAL."
    bodyRegionCellStyle: doc.cellStyles.item ('cellGLOBAL'),
    headerRegionSameAsBodyRegion: true,
    bodyRowCount: 10.
    headerRowCount: 1.
    })
    }
    catch {} (_)
    }
    }
    function cell_styles (doc)
    {
    with (doc)
    {
    try {doc.cellStyles.add
    ({
    name: "cellGLOBAL."
    appliedParagraphStyle: doc.paragraphStyles.item ('paraBodyGLOBAL'),
    topInset: 0,
    leftInset: 0,
    bottomInset: 0,
    rightInset: 0,
    verticalJustification: VerticalJustification.CENTER_ALIGN,
    firstBaselineOffset: FirstBaseline.LEADING_OFFSET,.
      })
    }
      catch (_){}
    }
    }
    function para_styles (doc)
    {
    with (doc)
    {
    try {doc.paragraphStyles.add
    ({
    name: "paraBodyGLOBAL."
    appliedFont: "Arial,"
    firstLineIndent: 0,
    justification: Justification.LEFT_JUSTIFIED,.
    pointSize: "6 pt."
    main: '8 '.
    })
    }
    catch {} (_)
    }
    }

    Your trial... construction of capture hides the real error - during the development of a script, you can not use.

    When I removed it, ID has reported only with the message quite without value

    "Error string: this attribute is not defined for the table styles.

    Source: ts = doc.tableStyles.add({")

    without saying what attribute... Try one by one, I found this particular result: you cannot initialize 'headerRegionSameAsBodyRegion '... Probably because you cannot initialize without a header first, and you don't "do" again because you always initialize the entire style.

    But this workaround works:

    ts = doc.tableStyles.add({
     name: 'tableGLOBAL'
     , bodyRegionCellStyle: doc.cellStyles.item( 'cellGLOBAL' )
     , headerRowCount: 1
     , bodyRowCount: 10
    });
    ts.headerRegionSameAsBodyRegion = true;
    
  • Why the hyperlinks do not work when Firefox loads a new web page?

    Today, no reason apparent, and for the first time in the years of using Firefox, I find that when a new page loads I can't select any of the hyperlinks on the page. What happens on 90% or more pages I have access. If I navigate to another application (for example, by using Alt + Tab) and return to Firefox, the hyperlinks will work. But if I select one of them and a new page will load, I'm unable to click on hypertext links back.

    This is manifested by the cursor remaining as an arrow and do not suddenly change hands hyperlinks sharp when you move. It also seems to affect the ability to use the GUI buttons and the minimize/restore/maximize/close buttons in the upper left corner of the title bar. Ribbon menu items, oddly enough, seem to work as usual, except that if I open, say, tools/options, I have to leave Fireox and vice versa, before being able to use the Options window that opens. It also prevents me from selecting other tabs. And I still have problems using the Forum of Support Mozilla's form to post this question.

    I tried Firefox running in safe mode and reinstall the software, all to no effect

    is nothing in particular happened

    You have this problem when running in Firefox SafeMode?
    http://support.Mozilla.com/en-us/KB/safe+mode
    Do not choose anything at the moment, just use 'continue in safe mode.

    If this is not the case, see this:
    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+theme...

  • Satellite Pro 105-S9722 - why the touchpad does not work when it is the cover up?

    whenever I hit the touchpad icon to light up the touchpad, it won't work, only when it is off...

    Hello

    I m afraid. I put t understand what you want to make :(
    You want to enable the touchpad or what? Thanks for posting more details

    You can enable and disable the touchpad with FN + F9 key
    If you want to change some settings for the touchpad, so I would recommend getting into the mouse option in the control panel.
    That could be the touchpad properties.
    In the properties, you should be able to find the needed touchpad settings.

  • Why the timing information not disappear when I switch off sync in my office?

    I'm at the office, in my work and I disconnect from my account synchronization to work and I want to connect to my personal account, but I can't because the timing with the first account information have not gone and wil be merged with personal information.

    Sync is not intended to be used in this way. Data that is synchronized is not a temporary view, the data is copied in Firefox on the device: the data do not disappear when you disconnect fron one account synchronization or close Firefox.

    You have to work and personal accounts of Sync thru having two distinct profiles.
    https://support.Mozilla.org/en-us/KB/profiles-where-Firefox-stores-user-data
    https://support.Mozilla.org/en-us/KB/Profile-Manager-create-and-remove-Firefox-profiles

    If you are interested in two distinct profiles, let know us and we can guide you when you set up desktop shortcuts for each profile opening.

  • Get the error the Service does not work when you try to update

    Original title: Dell Inspiron 1545 model

    My Labtop wife; the automatic update is enabled; but will NOT be updated. When I try to update; There are NO error codes. After trying to update. The computer

    addresses by specifying THE SERVICE IS DO NOT running. You must restart; also the F8 key does not work.

    Hello

    1. What is the error message right on the service does not work?

    2. were there any changes (hardware or software) to the computer before the show?

    Perform the steps in the link and check.

    The problems with the installation of updates (Windows Vista)

    Hope this information helps.

  • Why the effects do not work on still images.

    Why some effects do not work on still images?

    As the active camera or earthquake?

    It seems to me that to have an earthquake or the busy camera, a series of images will have to be moved by the software.  In other words, you need a video clip with separate images.  A still is an image.

    You might be able to get around that.  Place your image in a dedicated project, a video share/export.  There will be many executives you need.  Report a project like the video rather than as a still.  Then you should be able to apply your chosen effects.

    I did not had time to try it, but I think it should work.

    Bill

  • V11.0.12 XI and IE11 Acrobat. Hyperlink inside the PDF does not work when the PDF file is opened with any browser.

    V11.0.12 XI and IE11 Acrobat. Hyperlink inside PDF is a blue rectangle and links to another PDF. When PDF is opened in Acrobat, the link works. When opened in any browser (IE, Firefox, Chrome) the link does not work. How can I get the link to work in browsers?

    I think it is a bug. I uninstalled Acrobat and reinstalled Acrobat v11.0.0. I tried the link and it works properly. Then, I installed each both updated and tested the hyperlink. Update 1-10, that the link works. However, when the 11.0.11 update is installed, the "Go to a page in another document" hyperlink stops working in browsers. V11.0.12 installation does not solve the problem. If I uninstall Acrobat and install v11.0.0 with updated v11.0.10, everything works fine.

  • Buttons containing the URLS do not work when published.

    I am using Captivate 3 and other buttons that include links to the external URL do not work when you publish a project as a swf.

    When the buttons are clicked on in the browser, that nothing is happening, the URLS appear to have been lost. Other buttons in the project who sail to the other slides to continue working, only the external URL buttons have stopped.

    Could someone help me with this please?

    Thank you

    Rob

    Hello

    This could be the Flash Player silently block the call.

    Click here and follow what is offered

    See you soon... Rick

    Useful and practical links

  • The behaviors do not work when there is a previous div fixed on the same page?

    I have a still image at the beginning of the page.

    After that, I have a div with images in which I applied the swap image behavior, but the behavior does not work.

    If I change the positioning of my image, therefore, if this image is in the absolute position, by report o what either (unless it is fixed), the following divs show the swap image behavior.

    What is going on?

    I found it; is a z-index issue.

    Giving the div fixed negative z-index (-10), the behavior of the rest of the divs is working well.

    It just fit my original drawing at all, but it is not serious. There's a solution.

    Thank you all for your kind replies.

  • Why my scripts does not work when scheduled in the calendar?

    Hello

    I created scripts to start and stop onedrive using the "Tell" command

    When I plan their schedule they fail to run.  They were created as programs and work if I launch them manually.

    Is there something that I am missing?  Or is there a better way?

    PS: Scripts are the OneDrive to run after hours to prevent it completely hogging my bandwidth to broadband.

    If there is a better way to control the use of bandwidth for OneDrive I would be grateful.

    See you soon

    Memn

    A workflow schedule alarm will not work unless it is attached to a local calendar ("on my Mac"), instead of a network such as iCloud calendar.

  • Why my scars do not work when I have the correct graphics, everything is gray

    Hey everyone I'm new to after effects and it does not work all is grey on I can not start a new project

    If the menus are dimmed so you probably started the rendering engine and not the soft:

    A Mac Finder:

    On a Windows engine, the extension will be exe.

  • The mouse does not work when coming out of sleep mode

    I move the mouse to the computer of the mode "Eve".  Our journal 3 on tiles appear.  My husband,. admin Acct and finally my user account.  Admin account and my acct have the same privileges.  In any case... The mouse will not move the cursor at all once the computer wakes up from sleep mode.  My husband tile is highlighted and so I either hit tab again so he can highlight other options that I can hit enter too and I hope that the mouse starts to move the cursor.  It won't let me spend the good user.  If I type his password on his account, sometimes it works and other times it won't.  So I tabulate between change username and password reset and cancel until he started working.  Very frustrating!  I changed the batteries in the wireless mouse and it would work for a day or two and then same problem.  I also tried to return to an earlier point when the computer worked as it should.  Again... problem would return.  I have tried installing and re - install the intermittent operation of device (mouse) and then the next day would not.  Finally uninstalled this mouse and bought a new Logitech wireless mouse.  He began to do the same.  Help, please!

    Hello

    (1) work well before?

    (2) don't you make changes to the computer until the problem occurred?

    I suggest you to try the steps below and check if it helps.

    Method 1: Make sure to enable the option to allow this device to wake the computer for the mouse and keyboard and check if this can help, follow the steps provided below.

    1. click on Start.

    2. now type devmgmt.msc in the search for files and programs.

    3. on the screen of the Device Manager, right click on the mouse and other pointing devices.

    4. Select Properties.

    5. now you must click on the power management tab.

    6. now check box allow this device to wake the computer.

    Method 2 : You can also try to create a new power plan and check if it helps, here is the link:
    http://Windows.Microsoft.com/en-us/Windows-Vista/change-create-or-delete-a-power-plan-scheme

    Hope this information is useful.

  • Why the mouse does not disappear when captions are turned off?

    Hello!

    My owner like apparently not captions when I record my demonstrations, so I have disabled this option when I capture from my demo. However, I discovered that my mouse movement does not capture when the subtitles are disabled, which means that I have to activate the mouse for each slide. It's more annoying than catastrophic, but no one knows why this is happening and how can I prevent? I checked that "capture the mouse" is selected in the recording preferences. I even turned off and back on, nothing works. Is this a bug or user error? (I'm leaning towards option B).

    Thank you!

    Krista

    Hello

    I am at a total loss to explain why it happens. Have not really noticed myself.

    However, I might be able to ease the pain a little.

    I'm not sure it will work, but it can. After you save, select all of the slides in Storyboard mode or in the film. Then activate the mouse for each of them at a time. This part should work. I'm not sure, what if the movements of the mouse will be selected on registration. It may end up when the mouse is there, but you need to reset the coordinates for each slide. Ick!

    In this case, you could take a different point of view.

    Export captions as a Word document. Change the Word document and delete all the text in the legend. Then import them into empty on all of the legends. Then mount a legend and configure it as a transparent. The apply to all allows you to configure all the other legends in this way. It would still be there, but would be invisible. Can be less painful that way.

    Be sure to report the problem of mouse as a bug! The link is in my sig line.

    See you soon... Rick

    Useful and practical links

  • My helmet is bright red, and the speakers does not work, when I try to adjust the volume when there is no headset/speakers in, there is a sign of the cross as the symbol of the volume where the places are supposed to be, macbook pro retina display

    My helmet is for some time, as the eye of the terminator, glowing and speakers have not worked since. I need to plug headphones or external speakers. Whenever I try to adjust the volume when it shows just a cross symbol under the sign of the volume, where small squares usually are (see below)

    Is there a way to fix this? Some other similar forums tell me to try to manually move a switch in the audio jack, but I can't seem to find such a change and the thing that seems most like a light switch, does not move.

    Can someone please help?

    Thank you

    Your audio output is stuck in optical mode, this is the red light.

    The solution is to try to insert and remove the plug a dozen times or more in the hopes of convincing making fall out of optical mode and in electric mode.

Maybe you are looking for