Undefine variables in PL/SQL

Dear Friends,
Iam using a PL/SQL script to enroll new users. At runtime we have to enter user name. If same user name already there then
I need to display message and ask user to re-enter user name. The problem is When I go back it is not prompted for entry of user name. So it will become indefine loop.Please
give solution to this problem. sample Script
follows
declare
userno number;
begin
<<stage1>>
select count(*) into userno from dba_users where username= '&abc';
if userno = 1 then
goto stage1;
end if;
END;

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Bogdan Dincescu ([email protected]):
In sqlplus you have the "undef var_name" command that undefines the substitution variable var_name.<HR></BLOCKQUOTE>
null

Similar Messages

  • [DW 8.02 + PHP] how to use variables in advanced SQL queries

    Hi all,
    I can't find a way to use variables in an SQL query after
    updating
    dreamweaver 8.02.
    I always get error messages that says: 'missing variable
    type:myvariablename', undefined#myvariablename... and so on.
    What is the correct way to use variables?
    I usually set a variable in a PHP statement (example: <?
    $today=date('Y-m-d'); ?>)
    and then I compare this variable in the SQL query.
    What is the correct syntax for variable in DW 8.02 in
    advanced SQL
    queries?
    TIA
    tony

    sweetman wrote:
    > I'm editing a website created with DW 8.01 and MX
    Kollection.
    >
    > I updated DW to 8.02 and now I can't edit an existing
    SQL query.
    > I always get an error message 'Missing variable type'
    and I can't go
    > on.
    InterAKT released a new version of Kollection to cope with
    the 8.0.2
    changes. AFAIK, you should be able to download the updated
    version from
    your InterAKT account area.
    David Powers, Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Undefined variables

    I am new to PHP & MySQL and am having a little difficulty. I am using Dreamweaver CS5.5 for website building. I just recently completed a tutorial by David Powers titled "Setting up a PHP developement environment for Dreamweaver. I downloaded and installed the latest version of XAMPP and found that things have changed a little since he made the tutorial making some of the screen shots and directions obsolete, but I managed to make my way through it with success until I got to the end. Everything was working and I successfully made a connection to my database, but when I clicked on "Live View" in dreamweaver I got error messages instead of the expected list of information stored in the database. Those error messages:
    Notice: Undefined variable: database_connTest in C:\xampp\htdocs\php_test\comments.php on line 34Notice: Undefined variable: connTest in C:\xampp\htdocs\php_test\comments.php on line 34
    Warning: mysql_select_db() expects parameter 2 to be resource, null given in C:\xampp\htdocs\php_test\comments.php on line 34
    Notice: Undefined variable: connTest in C:\xampp\htdocs\php_test\comments.php on line 36
    Warning: mysql_query() expects parameter 2 to be resource, null given in C:\xampp\htdocs\php_test\comments.php on line 36
    Any Idea what is causing this and how to repair it. I desire to continue learning more about building a dinamic website but feel I need to discover and correct my mistakes before I go on. Is it possible that the sample file was created in a PHP or MySQL language that isn't recognized by the newest version of the XAMPP software package?
    Thanks so much for your help.

    Yea I'm just really confused because I tested the server by making the "Time" php page that David had in his tutorial and it worked great. But when I installed the sample files as he instructed I was able to open the comments PHP file in dreamweaver and view it in design view or code view, but when I try viewing it in Live view, or on a browser all I get is the error message I pasted to my first post. Here is the code for the SQL file (I inserted the line numbers in hopes they might help):
    1  -- phpMyAdmin SQL Dump
    2  -- version 3.2.4
    3  -- http://www.phpmyadmin.net
    4  --
    5  -- Host: localhost
    6  -- Generation Time: Feb 05, 2010 at 02:41 PM
    7  -- Server version: 5.1.41
    8  -- PHP Version: 5.3.1
    9
    10 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
    11
    12
    13 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
    14 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
    15 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
    16 /*!40101 SET NAMES utf8 */;
    17
    18 --
    19 -- Database: `php_test`
    20 --
    21
    22 -- --------------------------------------------------------
    23
    24 --
    25 -- Table structure for table `comments`
    26 --
    27
    28 DROP TABLE IF EXISTS `comments`;
    29 CREATE TABLE IF NOT EXISTS `comments` (
    30   `comment_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    31   `first_name` varchar(20) NOT NULL,
    32   `last_name` varchar(30) NOT NULL,
    33   `comment` text NOT NULL,
    34   PRIMARY KEY (`comment_id`)
    35 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
    36
    37 --
    38 -- Dumping data for table `comments`
    39 --
    40
    41 INSERT INTO `comments` (`comment_id`, `first_name`, `last_name`, `comment`) VALUES
    42 (1, 'Ben', 'Morin', 'I would like more seafood choices on the menu. Thanks.'),
    43 (2, 'Dieter', 'Dietrich', 'Is your London restaurant open on Saturdays?'),
    44 (3, 'Sachiko', 'Matsuda', 'Unbelievably excellent service received at your New Tokyo
    restaurant.'),
    45 (4, 'Letitia', 'Riley', 'Are there any plans to open a restaurant in Anchorage, Alaska?');
    46
    47 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
    48 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
    49 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
    50
    And this is the code for the Comments.php file (I added the Line #s for lines 34 - 39 in case the error message was refering to this code):
    <?php require_once('Connections/connTest.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    Line 34- mysql_select_db($database_connTest, $connTest);
    Line 35- $query_getComments = "SELECT first_name, last_name, `comment` FROM comments ORDER BY comment_id DESC";
    line 36- $getComments = mysql_query($query_getComments, $connTest) or die(mysql_error());
    Line 37- $row_getComments = mysql_fetch_assoc($getComments);
    Line 38- $totalRows_getComments = mysql_num_rows($getComments);
    Line 39- ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Cafe Townsend - Customer Comments</title>
    <link href="assets/styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <div id="header"><img src="assets/header.jpg" width="700" height="92" alt="Cafe Townsend" /></div>
      <h1 id="main_header">Cafe Townsend Intranet</h1>
      <div id="main">
        <h2>Customer comments</h2>
        <div id="comments">
          <?php do { ?>
            <p><?php echo $row_getComments['comment']; ?> &#8212; <?php echo $row_getComments['first_name']; ?> <?php echo $row_getComments['last_name']; ?></p>
            <?php } while ($row_getComments = mysql_fetch_assoc($getComments)); ?>
        </div>
      </div>
      <div id="footer"></div>
    </div>
    </body>
    </html>
    <?php
    mysql_free_result($getComments);
    ?>

  • Undefined Variable

    I have a beta version of a task management system that uploads new tasks to a SQL database using post and an HTTP service request. The same PHP page being posted to writes back an XML file that I use to get all of the information in a datagrid. All of the forms upload the all of the task info smoothly and the datagrid updates on the fly. My problem arises with a delete button inside the datagrid that that sends the ID of the selected item to my delete tasks PHP page through a function. I keep getting an error 1065 (undefined variable) when I click the delete button nested in a column of the datagrid. The code for my button is as follows
                                <mx:DataGridColumn headerText="clear task" editable="true">
                                    <mx:itemRenderer>
                                        <mx:Component>
                                            <mx:Button label="Delete" click="deleteInfo();" />
                                        </mx:Component>
                                    </mx:itemRenderer>  
                                </mx:DataGridColumn>
    The function in my CDATA reads
    function deleteInfo()
                      var number = dgtasks.selectedItem.number;
                      del_number = number;
                      deleteTask.send();
                      Alert.show(del_number);
    I have tried writing a number of different functions inside deleteInfo () just to see if it would even be called and I still get that error 1065. If anyone could help me out I would really appreciate. Thanks!

    Here is my entire file. The only thing negated are the URL's for the service requests. Thanks again!
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  xmlns="*" layout="vertical" creationComplete="send_data();">
    <mx:String id="del_number">-1</mx:String>
    <!--- This is our HTTPService, it will send requests and recieve the latest XML information from the server -->
        <mx:HTTPService id="userRequest" url="myurl" useProxy="false" method="POST" >
        <!--- These are the post variables here, -->
        <!--- <edit_task>{activeId}</edit_task> will send the value of {activeId} to PHP as $_POST['edit_task'] -->
            <mx:request xmlns="">
                <employee>{employee.text}</employee>
                <client>{client.text}</client>
                <title>{title.text}</title>
                <description>{description.text}</description>
                <issued>{issued.text}</issued>
                <due>{due.text}</due>
                <priority>{priority.text}</priority>
                <opened>{opened.text}</opened>
                <adding_value>1</adding_value>
            </mx:request>
        </mx:HTTPService>
        <mx:HTTPService id="updateValue" url="myurl" useProxy="false" method="POST" > 
        <!--- These are the post variables here, --> 
        <!--- <edit_task>{activeId}</edit_task> will send the value of {activeId} to PHP as $_POST['edit_task'] --> 
            <mx:request xmlns=""> 
                <completed>{activeComplete}</completed> 
                <opened>{activeOpened}</opened> 
                <edit_task>{activeId}</edit_task> 
            </mx:request> 
        </mx:HTTPService> 
        <!--This is our HTTPService for removing a task from the table--> 
            <mx:HTTPService id="deleteTask" url="myurl" useProxy="false" method="POST" > 
            <mx:request xmlns=""> 
                <number>{del_number}</number> 
            </mx:request> 
        </mx:HTTPService> 
        <!--- These next 3 lines make String variables that i store the last ID clicked and the 'complete' and 'opened' status of that ID --> 
        <mx:String id="activeId">-1</mx:String> 
        <mx:String id="activeComplete">-1</mx:String> 
        <mx:String id="activeOpened">-1</mx:String> 
                    <mx:Panel width="100%" height="100%" title="Essence Task Manager"> 
                        <mx:DataGrid 
                            id="dgtasks" 
                            dataProvider="{userRequest.lastResult.tasks.task}" width="100%" height="50%" 
                            doubleClickEnabled="true" 
                            itemDoubleClick="alert_descript(event)" 
                            itemClick="clickItem(event);"> 
                            <mx:columns> 
                                <mx:DataGridColumn headerText="Task Number" dataField="number" editable="false"/> 
                                <mx:DataGridColumn headerText="Employee" dataField="employee" editable="false"/> 
                                <mx:DataGridColumn headerText="Client" dataField="client" editable="false"/> 
                                <mx:DataGridColumn headerText="title" dataField="title" editable="false"/> 
                                <mx:DataGridColumn headerText="description" dataField="description" editable="false"/> 
                                <mx:DataGridColumn headerText="issued" dataField="issued" editable="false"/> 
                                <mx:DataGridColumn headerText="due" dataField="due" editable="false"/> 
                                <mx:DataGridColumn headerText="priority" dataField="priority" editable="false"/> 
                                <mx:DataGridColumn headerText="Acknoweledged" dataField="opened" editable="true" rendererIsEditor="true"> 
                                    <mx:itemRenderer> 
                                        <mx:Component> 
                                            <mx:CheckBox selected="{data.opened}" click="data.opened=!data.opened"/> 
                                        </mx:Component> 
                                    </mx:itemRenderer>     
                                </mx:DataGridColumn> 
                                <mx:DataGridColumn headerText="Completed" dataField="completed" editable="true" width="100" rendererIsEditor="true"> 
                                        <mx:itemRenderer> 
                                    <mx:Component> 
                                        <mx:CheckBox selected="{data.completed}" click="data.completed=!data.completed"/> 
                                    </mx:Component> 
                                </mx:itemRenderer> 
                            </mx:DataGridColumn> 
                                <mx:DataGridColumn headerText="clear task" editable="true"> 
                                    <mx:itemRenderer> 
                                        <mx:Component> 
                                            <mx:Button label="Delete" click="deleteInfo();" /> 
                                        </mx:Component> 
                                    </mx:itemRenderer>     
                                </mx:DataGridColumn> 
                            </mx:columns> 
                            </mx:DataGrid> 
                            <mx:Panel title="Add Task" layout="horizontal" width="100%"> 
                                <mx:Form> 
                                    <mx:FormItem label="employee"> 
                                      <mx:TextInput id="employee"/> 
                                    </mx:FormItem>     
                                    <mx:FormItem label="client"> 
                                      <mx:TextInput id="client"/> 
                                    </mx:FormItem>   
                                    <mx:FormItem label="title"> 
                                      <mx:TextInput id="title"/> 
                                    </mx:FormItem> 
                                    <mx:FormItem label="description"> 
                                      <mx:TextInput id="description"/> 
                                    </mx:FormItem> 
                                        <mx:FormItem label="issued"> 
                                      <mx:TextInput id="issued"/> 
                                    </mx:FormItem>   
                                        <mx:FormItem label="due"> 
                                      <mx:TextInput id="due"/> 
                                    </mx:FormItem>   
                                   <mx:FormItem label="priority"> 
                                      <mx:TextInput id="priority"/> 
                                    </mx:FormItem>   
                                    <mx:FormItem label="opened"> 
                                      <mx:TextInput id="opened"/> 
                                    </mx:FormItem>    
                                    <mx:FormItem label="completed"> 
                                      <mx:TextInput id="completed"/> 
                                    </mx:FormItem>   
                                    <mx:FormItem> 
                                  <mx:Button label="Submit" click="send_data()"/> 
                                </mx:FormItem> 
                              </mx:Form> 
                                <mx:TabNavigator width="100%" height="100%"> 
                                <mx:VBox label="description"> 
                                        <mx:Panel title="Task Description" layout="vertical" width="100%" height="100%"> 
                                        <mx:FormItem> 
                                            <mx:Label  text="{dgtasks.selectedItem.description}"/> 
                                        </mx:FormItem> 
                                        </mx:Panel> 
                                    </mx:VBox> 
                                <mx:VBox label="comments"> 
                                <mx:DataGrid width="100%"> 
                                    <mx:columns> 
                                        <mx:DataGridColumn headerText="posted by"/> 
                                        <mx:DataGridColumn headerText="comment"/> 
                                    </mx:columns> 
                                </mx:DataGrid> 
                                </mx:VBox> 
                                </mx:TabNavigator> 
                            </mx:Panel> 
                       </mx:Panel> 
    <mx:Script> 
            <![CDATA[ 
                import mx.events.ListEvent; 
                import flash.events.Event; 
                import mx.controls.Alert; 
                private function send_data() 
                    userRequest.send(); 
                   function alert_descript(event:ListEvent) 
                    var showdescription:String = event.itemRenderer.data.description; 
                    Alert.show(showdescription); 
                function deleteInfo()
                      var number = dgtasks.selectedItem.number; 
                      del_number = number; 
                      deleteTask.send(); 
                      Alert.show(del_number); 
            ]]> 
        </mx:Script> 
        <!--This script is used to import the click event and than passes the variables back out to the mx--> 
        <mx:Script> 
            <![CDATA[ 
                //this is the clickItem function that is called above in the onClick function... 
                function clickItem(event:ListEvent) 
                    var id = event.itemRenderer.data.number; 
                    var comp = event.itemRenderer.data.completed; 
                    var opened = event.itemRenderer.data.opened; 
                    activeId = id; 
                    activeComplete = comp; 
                    activeOpened = opened; 
                    //send_data(); 
                    updateValue.send(); 
            ]]> 
        </mx:Script> 
    </mx:Application>

  • PHP returning "undefined" variable to flash

    Hello Everyone, I am working on a touch screen POS login interface that takes in a four digit user pin and searches a database. It uses Flash, PHP and MYSQL. I need PHP to return the user name and access level. The AS3 code below is what I have so far, but it doesn't work correctly.
    "IntLogin" is the 4 digit pin that is sent to PHP when the user touches login on the GUI.
    function onLoginClick(e:MouseEvent):void
              keyLogin.gotoAndStop("KeyDn");
              var loader:URLLoader = new URLLoader();
              var request:URLRequest = new URLRequest("Login.php");
              var variables:URLVariables = new URLVariables();
              loader.dataFormat = URLLoaderDataFormat.VARIABLES;
              request.method = URLRequestMethod.POST;
              variables.login = intLogin;
              request.data = variables;
              trace(request.data = variables);
              loader.addEventListener(Event.COMPLETE, onComplete);
              loader.load(request);
               function onComplete(event:Event):void{
                        var loader:URLLoader = URLLoader(event.target);
                        var variables:URLVariables = new URLVariables(loader.data);
                        txtUser.text = variables.username;
    Next is the PHP code which works great in the browser when I implictly give $select a value, returning "username=Walker&access=1"
    However, when I run the program from Flash it returns an undefined variable and the end of the PHP file.
    <?php # Login.php
    require_once ('mysqli_connect.php');
    //Connect to the db
    if (!empty($_POST['login'])){
              $select = $_POST['login'];
              $sql = "SELECT Last_Name AS name, Access_Level AS level FROM Users WHERE User_ID = '$select'";
              $q = mysqli_query($dbc, $sql);
              if($q){
                        $row = mysqli_fetch_array($q, MYSQLI_ASSOC);
                        $name = $row['name'];
                        $access = $row['level'];
                        echo "username=$name";
      echo "&access=access";
    ?>
    I have have tried debugging the both the PHP and the AS code, but I am stuck. When I trace in AS3 I get the following:
    1445
    login=1445
    undefined
    $access";
    ?>
    Please if you anyone can help with this it would be greatly appreciated. I am on a strict timeline and I don't know what to do here.
    Thanks:)
    Jusmark

    You have to send it as a flash var
    Take a look at the code on my php webpage:
    http://www.spectacularstuff.com/php-test/inprogress/scrfix/home.php
    That is how I sent it to flash. Now, we want to receive it in
    flash. You need the following actionscript in AS3.
    // Display FlashVar onto webpage to ensure we are
    // receiving it
    var tf:TextField = new TextField();
    tf.autoSize = TextFieldAutoSize.LEFT;
    tf.border = false;
    tf.x = 50;
    tf.y = 10;
    addChild(tf);
    // Detect the FlashVar from the webpage
    try {
    var keyStr:String;
    var valueStr:String;
    var paramObj:Object =
    LoaderInfo(this.root.loaderInfo).parameters;
    for (keyStr in paramObj) {
    valueStr = String(paramObj[keyStr]);
    if (keyStr.indexOf(".") != -1){
    keyStr = keyStr.substring(0, keyStr.indexOf(".")); //now
    it's "home"
    // tf.appendText(keyStr);
    } catch (error:Error) {
    // tf.appendText(error);

  • Can we assign value to a variable in PL/SQL Loop

    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????
    Thanks & Regards,
    Hari Babu
    Edited by: 1004977 on Jun 5, 2013 2:40 AM

    Hi,
    1004977 wrote:
    Hi
    Can we assign value to a variable in PL/SQL Loops?
    DECLARE
    V_Num NUMBER;
    BEGIN
    LOOP
    V_Num := 10;
    DBMS_OUTPUT.put_line(V_num);
    V_Num := V_Num - 1;
    EXIT WHEN V_Num = 0;
    END LOOP;
    END;
    In the above program, Can we assign V_num with a value 10????????Yes; the example you posted does that.
    When the loop starts, the value 10 is assigned to v_num. You should see that value displayed by the put_line statement.
    After that, v_num is set to 10 - 1 = 9.
    Next, the EXIT condition is evaluated. At this point, v_num is 9, not 0, so the loop runs again. V_num is set to 10 again, and the loop continues forever (or, in some versions, until the dbms_output buffer is filled and an error occurs.)

  • How to use presentaion variable in the SQL statement

    Is there any special syntax to use a presentation variable in the SQL Statement?
    I am setting a presentation variable (Fscl_Qtr_Var)in the dashboard prompt.
    If i set the filter as ADD->VARIABLE->PRESENTATION, it shows the statement as 'Contract Request Fiscal Quarter is equal to / is in @{Fscl_Qtr_Var} '.
    And this works fine but when i convert this to SQL, it returns
    "Contract Request Date"."Contract Request Fiscal Quarter" = 'Fscl_Qtr_Var'
    And this does not work.It is not being set to the value in the prompt.
    I need to combine this condition with other conditions in the SQL Statement. Any help is appreciated. Thanks

    Try this: '@{Fscl_Qtr_Var}'

  • Error when inserting into table - Undefined Variable

    DB = Oracle 10.2.0.1
    WEBSERV = Apache 2.0.55
    LANG = PHP5
    I have created (or more accurately, copied) a php script to insert data into one of my database tables when I press submit. The code is as follows (my connect string works fine and its included in the dbutils.php file):
    <?php
    if($submit == "submit"){
    include "dbutils.php";
      $query = "insert into users values (seq_user_usr_id.NEXTVAL, '$usr_name')";
      $cursor = OCIParse ($db_conn, $query);
      if ($cursor == false){
        echo OCIError($cursor)."<BR>";
        exit;
      $result = OCIExecute ($cursor);
      if ($result == false){
        echo OCIError($cursor)."<BR>";
        exit;
      OCICommit ($db_conn);
      OCILogoff ($db_conn);
    else{
       echo '
        <html><body>
        <form method="post" action="index.php">
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td>Please enter a username:</td>
        <td><input type="text" name="usr_name"></input><br></td>
    </tr>
    <tr>
        <td><input type="submit" name="button" value="Submit"></input></td>
    </tr>
    </table>
        </form>
        </body></html>
    ?></p>I am getting the following error regarding an undefined variable:
    [Fri Jan 20 13:11:22 2006] [error] [client 127.0.0.1] PHP Notice: Undefined variable: submit in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\mywebsite\\test.php on line 3
    Where would I declare this variable? It is just a check to see if the submit button is pressed as far as I can see. Any help would be greatfully appreciated.
    W8

    I have changed the code to this:
    <?php
    if($submit == "submit"){
    include "dbutils.php";
    $usr_name = $_POST['usr_name'];
    $query = "insert into users (column1, column2) values (seq_user_usr_id.NEXTVAL, '$usr_name')";
    $cursor = OCIParse ($db_conn, $query);
    if ($cursor == false){
    echo OCIError($cursor)."
    exit;
    $result = OCIExecute ($cursor);
    if ($result == false){
    echo OCIError($cursor)."
    exit;
    OCICommit ($db_conn);
    OCILogoff ($db_conn);
    else{
    $submit = $_POST['submit'];
    echo '
    <html><body>
    <form method="post" action="index.php">
    <table width="400" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>Please enter a username:</td>
    <td><input type="text" name="usr_name"></input>
    </td>
    </tr>
    <tr>
    <td><input type="submit" name="submit" value="submit"></input></td>
    </tr>
    </table>
    </form>
    </body></html>
    ?>And now I am getting the following error:
    [Mon Jan 23 13:45:32 2006] [error] [client 127.0.0.1] PHP Notice:  Undefined index:  submit in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\mywebsite\\test2.php on line 24Does anyone have any ideas?
    I am struggling to find an example to work from to get this working. If anyone can point me to any literature that will explain the code so that I can work this out for myself that would also be a great help.

  • Presentation Variable in the SQL default section in the dashboard prompt

    Hi Gurus,
    I have two prompts and two go buttons. First Go button is used to populate pv_category1 presentation variable.
    category_column --> pv_category1--> 1st Prompt
    Product_Column --> pv_product2 --> 2nd Prompt
    I want to set the default for the 2nd Prompt depending on the 1st Prompt ( Category) chosen by the user.
    In the SQL default --> i have typed in the below Query.
    *Select TableName.Product_Column from Subject_Area where category_column = '@{pv_category1}'*
    The Problem is that i dont get any default value for 2nd Prompt after choosing the First prompt and hitting the GO Button.
    If i hardcode the value in @{pv_category1} ...
    for eg
    Select TableName.Product_Column from Subject_Area where category_column = 'Incidents' i get the corresponding value as default.
    But i want this 2nd prompt (product) to dyamically default depending on the 1st prompt (category) chosen by the user.
    I am using OBIEE 10.1.3.4 and i have googled a lot on this topic...
    can we not use Presentation variable in the SQL default section of the Dashboard Prompt?
    Any help in this regard would be highly appreciated.
    Thanks
    Ashish

    Thanks for the Quick Reply.
    But the functionality that i want to achieve is the default value in the 2nd column (out of many values for 2nd column) based on the 1st column chosen by the USER. for eg we have two columns in our database ie category and Product.. Data goes like this
    category ProductName
    Incidents --- A
    Incidents --- B
    Incidents --- C
    Changes --- D
    Changes --- E
    Projects --- M
    Projects --- N
    Projects --- O
    Projects --- P
    If the User chooses Incidents in the first prompt then the default in the 2nd prompt should be B ( out of A,B,C Values available in the 2nd prompt)....
    Checking the constraint checkbox doesnt solve the default problem...
    Thanks
    Ashish

  • Problem returning variables from dynamic SQL/PLSQL

    Hi, I have a problem I am trying to solve using a very short piece of dynamic SQL or PLSQL but I am having problems getting the variable values out of the dynamic block.
    I have 16 counters whose names are made up of three variable parts - 'scheme', 'contributory category' and 'employment category'
    The 'scheme' can be either 'no1', 'no2', 'off', 'cg' or 'amc'
    The 'contributory category' can be either 'cont' or 'noncont'
    The 'employment category' can be either 'ft' or 'pt'
    (There are only 16 because only 16 combinations are possible)
    For example the total counter name could be 'v_cg_noncont_ft_count'
    I have created a variable by concatenating the various elements called v_incr_count_name which holds the name of the counter I want to increment.
    I am running this whole thing within an anonymous PLSQL block so I cannot use global variables meaning that my variables are not visible within a dynamic PLSQL block.
    I believe this means that either I need to bind the variables within a PLSQL block or use a SELECT FROM INTO SQL block.
    I have tried a few solutions with no luck such as the following PLSQL:
    v_incr_count := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'BEGIN :a := :a + 1; END;';
    EXECUTE IMMEDIATE sql_stmt USING v_incr_count_name;
    Unfortunately I am getting the 'IN bind variable bound to an OUT position' error which I believe is because it is trying to return a value into v_incr_count_name which has been defined by default as an IN variable. The problem is that I need to store the returned value into the variable whose name is stored in v_incr_count_name.
    Another solution I tried is:
    v_incr_count_name := 'v_'||v_scheme||'_'||v_cont_cat||'_'||v_emp_cat||'_count';
    sql_stmt := 'SELECT '||v_incr_count_name||' + 1 FROM DUAL';
    EXECUTE IMMEDIATE sql_stmt INTO v_return;
    This solution gives me an 'Invalid colum error'
    Any help would be greatly appreciated
    Cheers, Dan

    Repost:
    Problem with variables in dynamic SQL/PLSQL

  • How to define variables in toad sql script editor - newbie

    I have just pull out the script of a Function and want to run it on toad SQL editor.
    I am little bit confused how to define the VARIABLEs here in toad SQL editor to run my script.
    SELECT
    NVL(SUM(debit), 0) - NVL(SUM(credit), 0)
    INTO l_accountBalance
    FROM
    GLP_VoucherMaster vm
    INNER JOIN GLP_VoucherDetail vd ON vm.GLP_VoucherMaster_ID = vd.GLP_VoucherMaster_ID
    INNER JOIN GLP_ChartOFAccounts coa ON vd.GLP_ChartOfAccounts_ID = coa.GLP_ChartOfAccounts_ID
    WHERE
    vm.isActive = 'Y' AND vd.isActive = 'Y'
    -- *** how to define variables in toad sql script editor ***
    AND vm.voucherDate < p_cDate
    AND coa.AccountCode LIKE p_accountCode || '%';
    Thanks
    w\

    Just prefix with a colon (:)
    SELECT   NVL (SUM (Debit), 0) - NVL (SUM (Credit), 0)
      INTO   L_accountbalance
      FROM           Glp_vouchermaster Vm
                 INNER JOIN
                     Glp_voucherdetail Vd
                 ON Vm.Glp_vouchermaster_id = Vd.Glp_vouchermaster_id
             INNER JOIN
                 Glp_chartofaccounts Coa
             ON Vd.Glp_chartofaccounts_id = Coa.Glp_chartofaccounts_id
    WHERE       Vm.Isactive = 'Y'
             AND Vd.Isactive = 'Y'
             AND Vm.Voucherdate < :P_cdate
             AND Coa.Accountcode LIKE :P_accountcode || '%';
    /:p

  • Using a number variable in an SQL statement

    Hi,
    I am trying to use a variable in an sql statement and I have run into problems when the variable is a number. The following line of code works if the variable is a string but not if it is a number.
    "SELECT TOP 1 UUT_STATUS FROM UNIT_UUT_RESULT WHERE UnitID =  '" + Locals.LocalUnitID + "' ORDER BY START_DATE_TIME DESC"
    Is there a difference in the use of the single and double quotes and the + sign for number variables?
    Thanks
    Stuart
    Solved!
    Go to Solution.

    Hi Stuart,
    I am assuming that the UnitID is stored as a numeric in the database? If so, the proper SQL syntax for comparing with numerics should not use a single quote (or any quotes for that matter). The quotes are used only for strings.
    So you would want to use:
    "SELECT TOP 1 UUT_STATUS FROM UNIT_UUT_RESULT WHERE UnitID =  " + Locals.LocalUnitID + " ORDER BY START_DATE_TIME DESC"
    This is really more of an SQL question universal to all languages, not just TestStand.
    Here is an excellent resource that you can consult:
    http://www.w3schools.com/sql/sql_where.asp
    Jervin Justin
    NI TestStand Product Manager

  • How to pass a variable for a SQL query in OLEDB source?

    Hi All,
    I am new to SSIS and working on it past few days. Can anyone please help me getting through a scenario where I need to pass a variable in the SQL statement in OLEDB source connection. Please find below for the details.
    eg:
    1) I have a SQL table with the columns SerialNumber, Name, IsValid, FileName with multiple rows.
    2) I have the file Name in a variable called Variable1.
    3) I want to read the data from my SQL table filtering based on the FileName (Variable1) within a data flow task and pull that data to the destination table.
    Question: In the data flow task, added source and destination DB connection with a script component in between to perform my validations. When trying to retrieve the data from source using the variable (i.e. SQL Query with variable), I am not able to add
    the query as the SQL statement box is disabled. How to filter the data based on the variable in the source DB ?
    Any help/suggestions would be of great help.
    Thanks,
    Sri

    Just to add with Vaibhav comment .
    SQL Command  : SQL query either with SQL variable or any condition  or simple Sql statement
    Like ;
    Select * from dimcustomer
    SQL Command using Varible :
    Sometimes we design our dynamic query in variable and directly use that variable name in oledb source.
    If you Sql query needs a condition based on SSIS variable .
    you can find a Example here :
    http://www.toadworld.com/platforms/sql-server/b/weblog/archive/2013/01/17/ssis-replace-dynamic-sql-with-variables.aspx
    http://www.select-sql.com/mssql/how-to-use-a-variable-inside-sql-in-ssis-data-flow-tasks.html
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • Using bind variables in Oracle SQL developer

    Hi all,
    i am using Oracle SQL developer. i want to use the bind variable in my sql.
    variable myid number :=1;
    select * from mds_3618_request where id = :myid;
    but i am getting the below error.
    Error starting at line 2 in command:
    select * from mds_3618_request where id = :myid
    Error report:
    SQL Error: Missing IN or OUT parameter at index:: 1
    Does Oracle SQL developer support bind variables in the SQL statements?
    thanks in Advance
    Vali Shaik

    You are probable going to get a quicker answer on this forum : SQL Developer
    -- Andy

  • All of a sudden getting Undefined variable: attvalue in Squirrelmail

    I'm running squirrelmail 1.4.17, and it's been running fine for about 2 months now. This week all of a sudden, I'm getting the following error when trying to read e-mails:
    Notice: Undefined variable: attvalue in /usr/share/squirrelmail/functions/mime.php on line 1407
    The attvalue variable has to do with stripping out dangerous characters from e-mails. My concern is that my system has been compromised and that someone has disabled this value in order to hack into my server.
    The only non standard plugin I've installed into Squirrelmail is a filter that enables me to have an out of office message, it also helps me to move junk mail automatically. It too has been running fine for about a month.
    If anyone can offer any advice, I'd greatly appreciate it. Like I said, everything was fine until just a couple of days ago. No updates took place, everything else seems fine on the surface.
    Thanks
    Mike

    I did forget to mention one thing. At the same time this started happening, I also had a problem that I had experienced before upgrading to the latest Squirrelmail, and that is that in the sending mail processing, specifically in the file deliver.class.php (line 614), I was getting a Notice: Undefined variable: default_charset in /usr/share/squirrelmail/class/deliver/Deliver.class.php on line 614.
    I brute force fixed this problem by hard coding the default_charset variable in that function. I know that's not an ideal solution, but it at least fixed the problem from the users point of view.
    Again, this wasn't happening until just recently, and I can't figure out what on the server changed to trigger these problems.

Maybe you are looking for