Bad connection variable? I'm doing a host variable.

Okay, so I said a global variable:

VARIABLE g_total NUMBER

and I want to use this variable to store the results of a stored procedure (I reduced my code to focus on the problem area):

CREATE OR REPLACE PROCEDURE my_procedure
(p_price IN m_movies.price%TYPE
p_quantity IN m_cart.quantity%TYPE)
IS
BEGIN
: g_total: = p_price * p_quantity;
DBMS_OUTPUT. Put_line ("the order total is: ' |: g_total");
END;
/


After all this, I get an error "bad bind variable g_total ' for the two lines I use it inside the procedure. What the heck is a variable binding? I use a host variable. (I think). If this has nothing to do with the fact that I can only give a very generic NUMBER data type to the host variable? Help, please!

It's not the way it will work. You cannot create choice with lie (as you saw).
You had rather code like this:

SQL> VARIABLE g_total NUMBER

SQL> create or replace procedure my_procedure (p_price      in     number,
                                          p_quantity   in     integer,
                                          g_total         out number)
is
begin
   g_total := p_price * p_quantity;
end my_procedure;
/
Procedure created.

SQL> exec my_procedure(50,3, :g_total)
PL/SQL procedure successfully completed.

SQL> print g_total

   g_total
----------
       150

Tags: Database

Similar Questions

  • INSTEAD, error PLS-00049: bad connection variable

    I try to use a PLACE for me to enter data in a table of bridge. Thanks in advance

    I get the following error:

    Error on line 4: PLS 00049: bad connection variable ' NEW. MEMBER_ID'

    2 INSTEAD OF THE INSERT OR UPDATE OR DELETE
    3 ON VI_Member_Talent_VW making REFERENCE AGAIN AS NINE OLD and OLD
    4. FOR EACH LINE
    5. START TO
    6. IF THE INSERTION

    Here is the code:



    CREATE OR REPLACE TRIGGER VI_INSERT_UPDATE_MT
    INSTEAD OF INSERT OR UPDATE OR DELETE
    ON VI_Member_Talent_VW REFERENCING NEW AS NEW as OLD OLD
    FOR EACH LINE
    BEGIN
    IF THE INSERTION
    THEN
    INSERT INTO VI_Member_Talent (Member_ID, Talent_ID) VALUES (: NEW.) Member_ID,: NEW. Talent_ID);
    END IF;
    IF THE UPDATE
    THEN
    UPDATE VI_Member_Talent SET Member_ID =: NEW. Member_ID, Talent_ID =: NEW. Talent_ID
    WHERE ROWID =: OLD.ID;
    END IF;
    IF THE REMOVAL
    THEN
    DELETE FROM VI_Member_Talent WHERE ROWID =: OLD.ID;
    END IF;
    END;

    Edited by: user13003575 may 2, 2010 08:53

    user13003575 wrote:
    It's the view

    CREATE OR REPLACE FORCE VIEW  "VI_MEMBER_TALENT_VW" ("ID", "Member_ID", "Talent_ID") AS
    SELECT rowid id, Member_ID, Talent_ID
    FROM VI_Member_Talent
    /
    

    and there is the problem.

    The view was created with quotes around column names, so that they are case-sensitive. You need to either modify your trigger double quote column names, or rebuild the view without the quotes. Personally, I'd go with changing the display.

    John

  • Bad connection variable

    Hi friend

    I don't want to use a trigger to update a value of varchar2:

    create or replace trigger WORK_STITCH_NAME_TRIG
    after insert or update on ASS_WORK_STITCH
    for each line
    declare
    NAME VARCHAR2 (100);
    Start
    If the insertion
    Select ENAME in the NAME of UAMRIS. WORDER where OID =: new. OID;
    Update UAMRIS. WORDER
    Set ENAME =(:new.NAME)
    where OID =: new. OID;
    end if;
    end;
    /

    but it gives me error like ': New.Name' variable of bad connection.

    Can someone help me with this please!

    Thank you

    Zitouni

    : OLD /: NEW applies only to the trigger of the columns of the table. Your relaxation is on table WORK_STITCH and the NAME is variable PL/SQL. Simply remove: NEW:

    create or replace trigger WORK_STITCH_NAME_TRIG
    after insert or update on ***_WORK_STITCH
    for each row
    declare
    NAME VARCHAR2(100);
    begin
    if inserting then
    select ENAME into NAME from UAMRIS.WORDER where OID=:new.OID;
    update UAMRIS.WORDER
    set ENAME=NAME
    where OID=:new.OID;
    end if;
    end ;
    /
    

    SY.

  • PLS-00049: bad bind variable in the database trigger

    Hi all

    If the POSTAL code table has no matching records, the trigger must create a new record for the given value of the zipper before you add a new record to the STUDENT table

    SQL > CREATE TABLE student

    (

    zip VARCHAR2 (5).

    student_id NUMBER,

    created_by VARCHAR2 (10),

    CREATED_DATE DATE,

    Modified_By VARCHAR2 (10),

    MODIFIED_DATE DATE

    );

    SQL > CREATE TABLE zip code

    (

    zip VARCHAR2 (5).

    zip_ID NUMBER,

    created_by VARCHAR2 (10),

    CREATED_DATE DATE,

    Modified_By VARCHAR2 (10),

    MODIFIED_DATE DATE

    );

    SQL > CREATE VIEW student_v

    AS

    SELECT *.

    OF the student;

    Created view.

    SQL > CREATE OR replace TRIGGER student_ins

    instead of INSERT ON student_v

    FOR EACH LINE

    DECLARE

    v_zip VARCHAR2 (5);

    BEGIN

    BEGIN

    SELECT zip

    IN v_zip

    ZIP CODE

    WHERE zip =: NEW.zip;

    EXCEPTION

    WHEN no_data_found THEN

    INSERT INTO postal code

    (zip,

    zip_ID,

    created_by,

    CREATED_DATE,

    Modified_By,

    MODIFIED_DATE)

    VALUES (: NEW.zip,)

    : NEW.zip_id-> not commented

    USER,

    SYSDATE,

    USER,

    SYSDATE);

    END;

    INSERT INTO student

    (zip,

    student_id,

    created_by,

    CREATED_DATE,

    Modified_By,

    MODIFIED_DATE)

    VALUES (: NEW.zip,)

    : NEW.student_id,.

    USER,

    SYSDATE,

    USER,

    SYSDATE);

    end;

    Decline: Trigger created with compilation errors.

    SQL > show error

    Errors for STUDENT_INS TRIGGER:

    LINE/COL ERROR

    -------- -------------------------------------------

    19/21 PLS-00049: bad connection variable ' NEW. ZIP_ID'

    SQL > ed

    CREATE or replace TRIGGER student_ins

    instead of INSERT ON student_v

    FOR EACH LINE

    DECLARE

    v_zip VARCHAR2 (5);

    BEGIN

    BEGIN

    SELECT zip

    IN v_zip

    ZIP CODE

    WHERE zip =: NEW.zip;

    EXCEPTION

    WHEN no_data_found THEN

    INSERT INTO postal code

    (zip,

    zip_ID,

    created_by,

    CREATED_DATE,

    Modified_By,

    MODIFIED_DATE)

    VALUES (: NEW.zip,)

    -: NEW.zip_id, -> replace commented with NULL

    NULL,

    USER,

    SYSDATE,

    USER,

    SYSDATE);

    END;

    INSERT INTO student

    (zip,

    student_id,

    created_by,

    CREATED_DATE,

    Modified_By,

    MODIFIED_DATE)

    VALUES (: NEW.zip,)

    : NEW.student_id,.

    USER,

    SYSDATE,

    USER,

    SYSDATE);

    end;

    SQL > /.

    SQL > insert into student_v (zip) values('111');

    1 line of creation.

    SQL > select * from student_v

    2.

    ZIP STUDENT_ID CREATED_BY CREATED_D MODIFIED_B MODIFIED_

    ----- ---------- ---------- --------- ---------- ---------

    111 APPS APPS APRIL 3, 14 3 APRIL 14

    SQL > select * from student

    2.

    ZIP STUDENT_ID CREATED_BY CREATED_D MODIFIED_B MODIFIED_

    ----- ---------- ---------- --------- ---------- ---------

    111 APPS APPS APRIL 3, 14 3 APRIL 14

    SQL > select * from zip code

    2.

    ZIP ZIP_ID CREATED_D MODIFIED_B MODIFIED_ CREATED_BY

    ----- ---------- ---------- --------- ---------- ---------

    111 APPS APPS APRIL 3, 14 3 APRIL 14

    You wrote trigger on the table of the student. So in the trigger, only the columns of this table must be offered for example: NEW.zip.

    Since zip_id is not part of this table, the: NEW.zip_id must always generate the error.

    insert into student_v (zip) values('111');

    In the above statement, you can only provide the value for the column zip but not zip_id. Therefore, the: NEW.zip_id is not available in the trigger. Must extract this value in the sequence after it is created.

    for example

    create the test of the order;

    INSERT INTO postal code

    (zip,

    zip_ID,

    created_by,

    CREATED_DATE,

    Modified_By,

    MODIFIED_DATE)

    VALUES (: NEW.zip,)

    test.nextval,

    NULL,

    USER,

    SYSDATE,

    USER,

    SYSDATE);

  • View object: how to get the value of a 'connection variable' by using expression groovy?

    Hi all

    I have a view object, and I set a variable binding for the VO. Then, I want to set the default value of an attribute of the VO to the variable binding.
    I try to set the Type of object to the Expression attribute value and the value in the name of the connection variable. But it does not work.

    My question is how to use a bind variable in groovy script?

    Thanks in advance and sorry for my bad English.
    Samson Fu

    Hi Samson,.

    Try this:
    viewObject.getNamedWhereClauseParam ("Your_Bind_Variable_Name")

    Note: Keep the viewObject is, don't replace with your name viewobject

    Jean Lou

  • How to find on which device connected to my system does not work?

    I have XP Professional.  Cannot start Windows Driver Foundation-User Mode Driver Framework(Manages user-mode driver host processes.)  In the window 'services.msc' and try to start Windows Driver Foundation, I get the message: "error 31 - failed to start service. A device attached to the system does not work. "Question: how to find on which device connected to my system does not work?

    1. click on start and then click Run.
    2 type devmgmt.msc in the run box and press ENTER. This will open your device manager.
    3. in the Device Manager window, click view, and then click Show hidden devices
    4. develop options in your device manager and see if there are any device with a yellow exclamation point or something that is rare. If you find one, you can uninstall and reinstall the driver for this device, as long as you have the installation for device drivers files.

    I hope that helps!

  • My works wireless, but my connection to the LAN does not work?

    I have a Toshiba L305-S5917 laptop and my connection to the LAN does not at all, when I plug my CAT 5 cable into the slot not strikes is the lights. IM able to use my wireless works fine. All this happened when my laptop crashed due to a virus. I reloaded all windows from XP to Windows 7 and also bought Numbus disk driver and recovery for my model laptop and still no connection to the LAN... pls help.

    Hello

    Sorry I'm not quite clear about the situation.

    You posted on the Vista Forum; you have loaded Win XP and you running Windows 7?

    If the computer is currently running on Windows 7, newspaper to the support site for Toshiba laptop, download Windows 7 drivers for the wireless network card and install them.

    In general.

    Check the Device Manager for the entry of valid card of the wire.

    http://www.ezlan.NET/Win7/net_dm.jpg

    If there is no valid entry, remove any entry from fake and re - install the drivers for the wireless card.

    ----------------------------------

    Try installing the latest drivers from the card manufacturer support page.

    Download the drivers and extract them to a folder of your choice.

    In Device Manager, right-click on the adapter.

    Click Update drivers and choose her browse my computer for drivers.

    Choose let me a list of choices, click on disk and point to the folder with the drivers.
    -------------------------------------

    Check network connections to make sure that you have a Local Area Connection icon/entry, and that the properties of the icon (right-click on the icon) are correctly configured with the TCP/IPv4 protocol in the properties of network connections.

    http://www.ezlan.NET/Win7/net_connection_tcp.jpg

    Connect you to the menu of the router from a work computer and make sure DHCP is on, and it is configured to assign IPs which can cover the number of computers that are connected (a bit more will be even better).

    Turn off the computer and the router, reset the router and the computer.

    Right-click on the wireless network connection card, select status, details and see if she got an IP address and the rest of the settings.

    On the State of intellectual property.

    TCP/IP and its variables usually look like this.

    Right-click on the wireless network connection card, select status, details and see if she got an IP address and the rest of the settings.

    Typical TCP/IP status looks like this.

    http://www.ezlan.NET/Win7/status-NIC.jpg

    Description is the data of the card making.

    Physical address
    is the MAC of the card number.

    The xx must be a number between 0 and 255 (all xx even number).

    YY should be between 0 and 255

    ZZ should be between 0 and 255 (zz all the same number.)

    The date of the lease must be valid at the present time.

    * Note 1.
    IP that starts with 169.xxx.xxx.xxx isn't valid functional IP.

    * Note 2 There could be an IPv6 entries too. However, they are not functional for Internet or LAN traffic. They are necessary for Win 7 homegroup special configuration.

    ------------------------

    Also, make sure that the software firewall on each computer allows free local traffic. If you use 3rd party Firewall on, Vista/XP Firewall Native should be disabled, and the active firewall has adjusted to your network numbers IP on what is sometimes called the Zone of confidence (see part 3 firewall instructions

    General example, http://www.ezlan.net/faq.html#trusted

    Please note that some 3rd party software firewall continue to block aspects of the Local traffic even it they are off (off) . If possible, configure the firewall correctly or completely uninstall to allow a clean flow of local network traffic. If the 3rd party software is uninstalled, or disables, make sure Windows native firewall is active .

    Jack - Microsoft MVP, Windows networking. WWW.EZLAN.NET

  • bad connect to Sql * more via command and cannot log on to the designer (need for connection string)

    I installed Oracle Developer with success, but having bad connect to Sql more than command line, also unable to connect via the developer tools, I get a TNS: Connect timeout occurred. This happens also for the "Plus" Sql for Windows.

    Oracle Forms connect error.png


    However, I can connect via the Sql Plus command window when it is executed from "Start-> all programs", but not when I first run the command window:

    sqlplus error.PNG


    I have a good Oracle 11 g install on Windows 7 and a good developer Sql install so I can connect to databases, but something does not work when you try to connect through these tools. Although Sql Plus works when called from 'Start-> all programs'

    sqlplus scott/tiger - don't use SQL * Net, you can connect like this even with the listener is stopped.

    Developer SQL can ONLY connect using SQL * Net & can be blocked by the firewall

    to connect using sqlplus & SQL * Net, you need to invoke it as below

    sqlplus scott/tiger@orcl

  • want to 5540: can I leave my printer connected 24-7? Does go in mode "sleep"? I print every day!

    Can I leave my printer connected 24-7?  Does go to sleep mode?  I do not see every day or week necessarily!

    According to the manual (HP Envy 5540 all in a manual series) on page 22, it goes into powersave mode after 5 minutes of inactivity. You can change this time in the control panel if you wish.

    After 2 hours of inactivity, the printer will automatically turn off, and you have to press the power button to restart. This auto off function is not active if the printer has wireless or WiFi Direct features turned on. Or if she has a fax, Ethernet, or USB connection. This info can be found on page 23 of the manual linked to the previous paragraph.

    -dave

  • Tecra Z50-A-14 t - bad connection WiFi signal

    In short.

    Absolutely the same problem with my new Tecra.
    Stable connection by cable.

    Bad connection same 3 5 meters from the router. If the distance is longer, or I use the laptop in another room sometimes it s no link at all.
    The card is Intel (R) Dual Band Wireless AC-3160 and that article how I found the link above.

    All electronic in the work of the House with no problem, but this piece of garbage to Wi - Fi only the same has even after 3 visits in the repair shop. And that s for new out of the box laptop.

    I really disappointed me.

    + The message was edited: link has been removed - forum rules +.

    Hmm. have you noticed the same problem of weak signal using the laptop to the power of the battery as well as connected to the adapter?

    My signal low similar knowledge questions may seem due BOF WiFi enabled power saving settings. This setting can be found in the current power plant? Advanced settings

    On the other hand, it might be possible that there is something wrong with the WiFi antenna cable. Maybe it is not properly connected to the mini PCI module

    In the case of changing the settings would not help you and if your already updated the Wlan to the latest version available, I think that the Toshiba certified maintainer should check the antenna.

  • My Canon pixma MG6320 must be connected to my computer does a 'download' a new driver?

    My Canon pixma MG6320 must be connected to my computer does a 'download' a new driver?

    Hi set231,

    When you install a new driver, it is recommended that the PIXMA MG6320 is not connected to the computer.  Please sign in when prompted during installation.

  • I can't connect to the internet via my host after uninstalled antivirus software and restart

    I can't connect to the internet via my host after uninstalled antivirus software and restart it.

    I use windows xp on my host computer and all computers in my client. After that I uninstalled the free trial NIS version and restart my host, I lost the internet connection. Tried to restore with the restoration of the system, but when I restarted it, it said the system restore could not be made. I changed it then with my laptop and I can connect to the internet as the host.

    Hello

    This can happen if the uninstall process fails and leaves behind a Symantec registry value. See the following Symantec article.

    Unable to connect to the Internet after uninstalling Norton AntiVirus.

    http://Service1.Symantec.com/support/NAV.nsf/8d071816eedd7cac88256c0e005a96e5/751c3298ab99cf7188256d34006702e2?OpenDocument

    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    How to back up and restore the registry in Windows?

    322756 (http://support.microsoft.com/kb/322756/ )

  • Cannot connect because windows 7 does not recognizse my profile

    Original title: Mr. Wall

    Cannot connect because windows 7 does not recognizse my profile

    Hello

    References to Vista also apply to Windows 7.

    You can try to fix it with Safe Mode - repeatedly press F8 as you bootup. Safe Mode ADMINISTRATOR account has no password by default (unless someone has changed the password so it should be available).

    Some programs such as the Google Updater (if you added the toolbar Google, Chrome or Google Earth) has been known to cause this problem.

    Error message when you log a computer Windows Vista-based or Windows 7 by using a temporary profile: "the user profile Service has no logon. Unable to load the user profile.
    http://support.Microsoft.com/kb/947215

    Difficulty "the user profile Service has no logon. User profile cannot be loaded. "Error in Windows 7
    http://www.SevenForums.com/tutorials/186131-user-profile-service-failed-logon-user-profile-cannot-loaded.html

    How to fix error "your user profile was not loaded correctly! You have logged on with a temporary profile. "in Vista & Windows 7.
    http://www.Vistax64.com/tutorials/135858-user-profile-error-logged-temporary-profile.html

    BE VERY CAREFUL IF YOU USE THIS ONE:

    DO NOT USE THE ACCOUNT HIDDEN ON A DAILY BASIS! If it corrupts you are TOAST.

    How to enable or disable the built-in Windows 7 Administrator account
    http://www.SevenForums.com/tutorials/507-built-administrator-account-enable-disable.html

    Use the hidden administrator account to lower your user account APPLY / OK and then lift it to ADMIN. This allows clear of corruption. Do the same for other accounts if necessary after following the above message.

    You can use the hidden - administrator account to make another account as an ADMINISTRATOR with the same password (or two with the same password) to use a test or fix the other.

    You can run the Admin account hidden from the prompt by if necessary.

    How Boot for Windows 7 System Recovery Options or use a Windows 7 boot disk.
    http://www.SevenForums.com/tutorials/668-system-recovery-options.html

    What are the system recovery options in Windows 7?
    http://Windows.Microsoft.com/en-us/Windows7/what-are-the-system-recovery-options-in-Windows-7

    How to create a Windows 7 system repair disc
    http://www.SevenForums.com/tutorials/2083-system-repair-disc-create.html

    If you cannot access your old account, you can still use an Admin to migrate to another (remember to always leave an Admin who is not used except for testing and difficulty account).

    Difficulty of a corrupted user profile
    http://Windows.Microsoft.com/en-us/Windows7/fix-a-corrupted-user-profile

    I hope this helps.
    --------------------------------------------------------------------------------------------
    Rob Brown - Microsoft MVP<- profile="" -="" windows="" experience :="" bicycle="" -="" mark="" twain="" said="" it="">

  • PLS-00049: bad bind variable 'NEW.col1' (col1 exists in the table)

    I use Oracle 12 c. And a bad bind variable error in this statement.

    create or replace

    check_tax_number relaxation

    INSERT BEFORE THE "C ##MYUSER". "customer" FOR EACH ROW

    BEGIN

    '0' IF new.taxpayer <>THEN

    : new.taxnumber: = "123456789";  -error here...

    END IF;

    END;

    I don't know which exists taxnumber customer in the table column.

    Here's desc 'C ##MYUSER '. "" customer ".

    Name of Type Null

    --------------------------- -------- -------------

    taxpayer NOT NULL NUMBER (1)

    taxnumber NOT NULL NVARCHAR2 (10)

    Other passes...

    Thanks for help.

    Based on the declaration of the customer table you posted columns are created in lowercase. Therefore, you must use the names of column between quotation marks:

    create or replace

    check_tax_number relaxation

    INSERT BEFORE THE "C ##MYUSER". "customer" FOR EACH ROW

    BEGIN

    IF : new. " taxpayer""" <> '0' THEN

    : new. " " "taxnumber""": = "123456789";  -error here...

    END IF;

    END;

    SY.

  • With the trial of 30 can days of dreamweaver I connect my site to my Web host? And I am able to see my site online?

    I have download the 30-tial for Dreamweaver. Then I connected my html site to my host via SFTP. But I can't see my site online. I wanted to know if I need the full version.

    Chances are you just uploaded in the wrong place on your server, or have something not set properly in your FTP settings.

    The 30 day trial is the full complete program just limited to 30 days of use of installation time.

Maybe you are looking for

  • What should I do to play games between w/xp and w/vista

    When we open windows messenger, we can connect ok, but when we try to play a game, something like activex isn't installed.what and how to fix it so we can interact with the games?

  • Windows freezing

    I have a problem with my computer freezing. It happens during normal use as surfing on the internet (IE Explorer or Firefox) or using applications such as MS Word. Screen freezes and don't answer not to all orders, even when I press CTRL-ALT-DEL. Som

  • all im ringtone problems

    I have a new Xperia Z2, but now I am facing a problem of tone, that I can't put a ringtone mp3 stored in my phone (I can't change it), when I choose a new MP3, it shows me "unknown file". "."And the same question for notifications...

  • Chromebook 14: Insufficient superior key

    The top key 'k' on my new Chromebook 14 began to fall. The left side of the key will appear while I type. Sometimes. Press gently on the left-hand side of the key reassigns, until I type and press 'k' on the right side, where he appears again. Is thi

  • M17x R4 Compatible graphics card

    I have an Alienware with serial numberADMIN NOTE: maintain the label removed by privacy policy >, Core i7-3630QM, 8 GB of RAM and Windows 7 64 bit, but my 660 M graphics card has failed. I checked the Alienware forum but couldn't find what are the co