Error Reading Variable

May 4, 2006

I keep receiving errors while using variables to pass values to different part of my package. For example ...

Error: 2006-05-04 10:31:59.84
Code: 0xC00470EA
Source: EdwPostProcess
Description: Reading the variable "User::GvPathRoot" failed with error code 0xC0010009.
End Error

The way my variables are constructed is :

First the global variables (Gv*) are set by the parent package;
Then local variables (Lv*) are set using the EvaluateAsExpression property and giving it an expression that takes the Gv* variable and concatenate a string to it.

At execution time, while the expressions are resolved, I get the above error while it was resolved correctly in a previous task.

I tried different method including duplicating my variables but without success. I'm running out of ideas

Gilles

View 4 Replies


ADVERTISEMENT

Incorrect Sql Statement - Not Reading Variable

Dec 5, 2006

In the funtcion below I am selecting a value from the page -  Request.QueryString("ProjectID") and this is being pulled through correctly - if I debug then ProjectID = Request.QueryString ("ProjectID") does equal the correct value.
However this value is not then working in the following line:
strSQL = "SELECT [ProjectID] FROM [Projects] WHERE [ProjectID] = [ProjectID]"
This statement is not reading any value for ProjectID and so is selecting all from the table.....
How do I write this statement to pick up the variable above?????
Thanks in advance for your help!
Clare 
 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim ds As New Data.DataSet
Dim da As Data.SqlClient.SqlDataAdapter
Dim strSQL As String
Dim ProjectID As Int32
ProjectID = Request.QueryString("ProjectID")
strSQL = "SELECT [ProjectID] FROM [Projects] WHERE [ProjectID] = [ProjectID]"
Dim connString As String = "Data Source=xxx;Initial Catalog=xxx;User ID=xxx;Password=xxx"
da = New Data.SqlClient.SqlDataAdapter(strSQL, connString)
da.Fill(ds)
ds.Tables(0).Columns.Add("imgFile")
 
For Each tempRow As Data.DataRow In ds.Tables(0).Rows
tempRow.Item("imgFile") = ("imgGrab2.aspx?id=" & tempRow.Item("ProjectID"))
Next
ImgGrid3.DataSource = ds
ImgGrid3.DataBind()
 
End Sub

View 12 Replies View Related

Reading And Writing Same Variable To A Script

Apr 27, 2006

It looks like its not possible to both read and write the same variable from a script using the conventional Me.Variables.<variable> syntax.

I can only assign a variable as Readonly or ReadWrite and not both. If I assign it ReadOnly I can only access it in the PreExecute subroutine. If I assign it ReadWrite I can only access it in the PostExecute subroutine (in fact doesn't this just make it WriteOnly in fact?). So I can only either read in or read out a variable using this syntax, noth both. Is this right?

So the read and write a variable to a script, the VariableDispenser approach is the only option to use. Is this right? and is it documented somewhere that this is how to use variables in scripts. Thanks.

View 13 Replies View Related

Reading A Variable In A Script Taks Used As Source

Aug 28, 2006

Hi,

I'm using a script task as source and I need to read a global variable.

I tried stuff I found on the internet, but they all use Dts.VariableDispenser.LockForRead(varName)

This gives an errero on 'Dts.' saying it can not resolve it.

View 2 Replies View Related

Reading An OUTPUT Parameter From A Stored Procedure Into A Variable

Oct 2, 2007

Hello,
I am struggling with this, having read many msdn articles and posts I am non the wiser. I have a sproc with an output parameter @regemail. I can call the sproc OK from my code as below, via a tableadapter. And the sproc works as desired from management studio express. I want to get the result returned in the OUTPUT parameter (NOT the Return Value) and place it in a variable. Can anyone advise how I can do this? J.
THE CODE I USE TO CALL THE SPROC
Dim tableAdapter As New DataSet1TableAdapters.RegistrationTableAdaptertableAdapter.SPVerifyUser(strRegGuid, String.Empty)
 THE STORED PROCEDURECREATE Proc [prs_VerifyUser
 @regid uniqueidentifier,@regemail nvarchar(250) OUTPUT
ASBEGIN
IF EXISTS(SELECT RegEmail from dbo.Registration WHERE RegID = @regid)
BEGIN
SELECT @regemail = RegEmail FROM Registration WHERE RegID = @regid
Return 1
END
Return 2
END

View 4 Replies View Related

Reading The Error Messages

May 22, 2006

when a statement fails and it tell me for example

Server: Msg 137, Level 15, State 2, Procedure spinsertnew, Line 266
Must declare the variable '@'.

How can I find which line it is using query manager?

View 13 Replies View Related

Error Reading DataSource ...

May 5, 2008

While pulling data from a progress 10.1B Database, we get the following error (datasource). How do we go about redirectign the erroneous row into a flat file / database so that we can isolate the issue?
[DTS.Pipeline] Error: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "DataReader Source" (1) returned error code 0xC02090F5. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.

View 3 Replies View Related

Debug Error - Object Variable Or With Block Variable Not Set -

Feb 15, 2006

I keep getting this debug error, see my code below, I have gone thru it time and time agian and do not see where the problem is.  I have checked and have no  NULL values that I'm trying to write back.
~~~~~~~~~~~
Error:
System.NullReferenceException was unhandled by user code  Message="Object variable or With block variable not set."  Source="Microsoft.VisualBasic"
~~~~~~~~~~~~
My Code
Dim DBConn As SqlConnection
Dim DBAdd As New SqlCommand
Dim strConnect As String = ConfigurationManager.ConnectionStrings("ProtoCostConnectionString").ConnectionString
DBConn = New SqlConnection(strConnect)
DBAdd.CommandText = "INSERT INTO D12_MIS (" _
& "CSJ, EST_DATE, RECORD_LOCK_FLAG, EST_CREATE_BY_NAME, EST_REVIEW_BY_NAME, m2_1, m2_2_date, m2_3_date, m2_4_date, m2_5, m3_1a, m3_1b, m3_2a, m3_2b, m3_3a, m3_3b" _
& ") values (" _
& "'" & Replace(vbCSJ.Text, "'", "''") _
& "', " _
& "'" & Replace(tmp1Date, "'", "''") _
& "', " _
& "'" & Replace(tmpRecordLock, "'", "''") _
& "', " _
& "'" & Replace(CheckedCreator, "'", "''") _
& "', " _
& "'" & Replace(CheckedReviewer, "'", "''") _
& "', " _
& "'" & Replace(vb2_1, "'", "''") _
& "', " _
& "'" & Replace(tmp2Date, "'", "''") _
& "', " _
& "'" & Replace(tmp3Date, "'", "''") _
& "', " _
& "'" & Replace(tmp4Date, "'", "''") _
& "', " _
& "'" & Replace(vb2_5, "'", "''") _
& "', " _
& "'" & Replace(vb3_1a, "'", "''") _
& "', " _
& "'" & Replace(vb3_1b, "'", "''") _
& "', " _
& "'" & Replace(vb3_2a, "'", "''") _
& "', " _
& "'" & Replace(vb3_2b, "'", "''") _
& "', " _
& "'" & Replace(vb3_3a, "'", "''") _
& "', " _
& "'" & Replace(vb3_3b, "'", "''") _
& "')"
DBAdd.Connection = DBConn
DBAdd.Connection.Open()
DBAdd.ExecuteNonQuery()
DBAdd.Connection.Close()

View 2 Replies View Related

Reading Query From .sql File Error

Feb 4, 2005

I have a report that is based on a query that is read from a .sql file and is executed in the stored procedure. I found this code on the internet. When I run the SP in Query Analyser it tells me that "2 rows have been affected". I don't know why I don't get the data. Any help??

Stored procedure:

CREATE PROCEDURE TimeTracker_Report_ClientNumbers2

AS
DECLARE @SQLQuery as NVARCHAR(4000)
BEGIN
CREATE TABLE #tmpQuery (Query NVARCHAR(4000))
BULK INSERT #tmpQuery FROM '\servernameQueriesReport_ClientNumbers.sql'
SELECT @SQLQuery = Query FROM #TMPQUERY
EXECUTE sp_executesql @SQLQuery
END
GO

and Report_ClientNumbers.sql contains the following query:

SELECT Name, ClientNumber FROM Companies WHERE Not ClientNumber IS NULL ORDER BY ClientNumber

View 1 Replies View Related

Error In Reading Float Data

Mar 20, 2006

I am using SQL Server 2000, VS 2003
I have Education table in which there is a field CGPA having float data type (null allowed) I retreive the data from SQL server using stroed proc and store it in SqlDataReader dr while reading if CGPA contains 0 then it raises an error that "Specified cast is not valid" other wise it does not raise any error.
while (dr.Read()){ Education e = new Education(); e.EducationId = dr.GetInt32(0);  e.Country = dr.GetInt32(1); e.InstitutionName = dr.GetString(2); e.Grade = dr.GetString(3); e.CGPA = dr.GetFloat(4); // ERROR HERE  e.Percentage = dr.GetFloat(5); e.PassingYear = dr.GetString(6);}
where as in Education CGPA is also the float property can any one tell me how to read 0 value of float from SQL server
 

View 3 Replies View Related

I/O Error Reading BCP Format File

Jul 20, 2000

I added a field to an exisiting table (CHAR 30), and I added to field to the BCP Format File.
The BCP worked fine before the new field, and still works fine when I exclude the new field
from the format file, but with the new field I receive the following error:

SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]I/O error while reading BCP format file

(2 row(s) affected)

Here is a copy of my format file:
7.0
11
1 SQLCHAR 0 6 "" 1 Empl_ser_no
2 SQLCHAR 0 2 "" 2 Empl_stat_cd
3 SQLCHAR 0 1 "" 3 Guest_type_fl
4 SQLCHAR 0 30 "" 4 Job_tl
5 SQLCHAR 0 14 "" 5 Pager_no
6 SQLCHAR 0 1 "" 6 Security_Clear_fl
7 SQLCHAR 0 9 "" 7 SSN
8 SQLCHAR 0 30 "" 8 Emer_cont_nm
9 SQLCHAR 0 14 "" 9 Emer_cont_no
10 SQLCHAR 0 1 "" 10 Citizen_fl
11 SQLCHAR 0 30 "
" 11 Job_Res

The input file is just a fixed positonal text file, and I have checkid it 100 times- it is fine.

Any sugestions from any BCP gurus out there? THANKS

View 1 Replies View Related

[mssql] I/O Error While Reading BCP Format File

Feb 29, 2000

Hi All,

I had a problem today where BCP would not read the format file I created giving the following error:

I/O error while reading BCP format file.

I searched the archives here at swynk.com and found a thread titled exactly the same as the one I am now creating. There were numerous responses to this thread but none of them seemed to solve the problem for me (short of the one that suggested using BCP to create the format file, which I didn't want to do).

I used BCP to create a format file for me (which looked identical to the format file that I created) and it worked fine. With my suspicions aroused, I used a binary file viewer to look at the contents of each file and highlight the differences. Apart from the usual variations in whitespace I noticed that the my file did not have any carriage returnline feed at the end of the last row definition.

My format file ended at the end of the last row definition line. It did not have any carriage returns and line feeds. I matched the one generated by BCP and added the following "

" to the end of the file, tested my format file and it worked perfectly.

The moral of the story is, make sure when you create a format file, you have an empty line at the end of the file (ie: after your last "Server Column Name", make sure you have "

" sans quotes).

Hope this saves someone a few hours :-)

Cheers,
Dan.

View 1 Replies View Related

Error Reading Password-protected FM In SQL Server

Jul 28, 2006

I'm trying to pull certain Filemaker 5 tables into SQL Server 2000 inan automated import job using a file DSN. Everything resides locallyon a Windows XP machine. My process works fine on a test FM file withno password, but with the real FM files, all password protected, itfails with this error:******Error Source: Microsoft OLE DB Provider for ODBC DriversError Description: Unspecified error[FileMaker][ODBC FileMaker Pro driver]An error has occurred whiletrying to gather a list of available tables.[FileMaker][ODBC FileMaker Pro driver][FileMaker Pro]Connect failed.Context: Error calling GetRowSet to get DBSCHEMA_TABLES schema info.Your provider does not support all the schema rowsets required by DTS.******This happens whether or not I supply a password to the SQL Server job.It has been nagging me for days and I can't find any documentation onit. Has anyone else encountered this?Thanks very much.Scott

View 1 Replies View Related

Error Reading Certain Numeric Values With VFPOLEDB Driver

Aug 29, 2006

It appears that the VFPOLEDB driver tries to convert numeric types in VFP to decimal types in .NET. In this case, it's a Numeric 9,3 in VFP and it's trying to put it into a decimal 8,3 in .NET.

I know that VFP has this funny quirk where if you don't use all of the decimal places after the decimal point, it allows you to use extras in front of the decimal point. In our case, the number is 104895.83 and yes, VFP is happy storing this in a Numeric 9,3 column.

When trying to read this in .NET, you get this message:

System.InvalidOperationException

The provider could not determine the decimal value. blah, blah, blah...

The question then is - is there a work-around? I can find no way to force .NET to use greater precision. About all I can come up with is to catch the exception and return a nice error message asking the user to make the column larger in VFP.

Here's the .NET code, thanks in advance

Mike



string sqlString = "SELECT * FROM " + Path.GetFileName(dbfFullPath);

OleDbConnection oleConn = new OleDbConnection("Provider=VFPOLEDB.1;Data Source=" +

folderName + ";Collating Sequence=MACHINE;");

OleDbCommand oleCmd = new OleDbCommand(sqlString, oleConn);

OleDbDataReader oleReader;

try

{

oleConn.Open();

oleReader = oleCmd.ExecuteReader();

View 3 Replies View Related

Error When Reading The Label Field From Report Parameters

Aug 16, 2007

Hi there,

I am trying to fill a Textbox with the Label-Field from the Report Parameters. The Multi-Value-Option is checked and it is possible to select multi-values from the time hierarchy [Time].[Year - Half Year - Quarter - Month].

For example you can choose:
"Calendar 2007" ([Time].[Year - Half Year - Quarter - Month].[Year].&[2007-01-01T00:00:00])
"Quarter 4, 2006" ([Time].[Year - Half Year - Quarter - Month].[Quarter].&[2006-10-01T00:00:00])
and "April 2006" ([Time].[Year - Half Year - Quarter - Month].[Month].&[2006-04-01T00:00:00])

Now I want to fill a Textbox with the chosen parameter values by putting following expression as value of the textbox:

Parameters!TimeYearHalfYearQuarterMonthDate.Label ... with "TimeYearHalfYearQuarterMonthDate" as the name of the DataSet.

That gives an Error.

Can you please help me out?

Best regards
Claudio

View 6 Replies View Related

The Data Extension Returned An Error During Reading The Field.

Mar 6, 2006

Can anyone tell me what the heck this is trying to tell me. I have 3 datasets I'm working with so there are errors for each here:

[rsMissingFieldInDataSet] The data set €˜Revenue_By_Client€™ contains a definition for the Field €˜Branch€™. This field is missing from the returned result set from the data source.

[rsErrorReadingDataSetField] The data set €˜Revenue_By_Client€™ contains a definition for the Field €˜Branch€™. The data extension returned an error during reading the field.

[rsMissingFieldInDataSet] The data set €˜Main_Dataset_AZ€™ contains a definition for the Field €˜PostedAmount_InHouse€™. This field is missing from the returned result set from the data source.

[rsErrorReadingDataSetField] The data set €˜Main_Dataset_AZ€™ contains a definition for the Field €˜PostedAmount_InHouse€™. The data extension returned an error during reading the field.

Preview complete -- 0 errors, 4 warnings

View 7 Replies View Related

DB Engine :: Error Occurred While Reading Input Stream From Network?

Aug 2, 2012

I am facing this error in SQL server error logs on my activepassive Cluster set around 10-20 times per day.

Edition : SQLserver2008R2 Enterprise edition
SQL SP: SP1
Windows : 2008R2 Enterprise windows

2012-07-30 04:44:15.560 A fatal error occurred while reading the input stream from the network. The session will be terminated (input error: 10054, output error: 0).

View 12 Replies View Related

DbComms Error Occurred While Reading Input. Context Read Packet Header. Unexpected End Of Stream...

Dec 4, 2007

I'm getting the following error from a few hosts that are querying a db in SQL Server 2005. The error has occurred while executing various queries that we would expect to return various sized result sets (from a couple rows to a couple million rows). Many hosts have never experienced the error but it is occurring fairly frequently on a couple.

using Windows Server 2003 on both the jdbc client and the DB host.

using jdbc driver from sqljdbc_1.1

netstat doesnt increment the TCP connection reset count after this error occurs.

using standard sql server authentication.

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





com.microsoft.sqlserver.jdbc.SQLServerException: A DBComms.error occurred while reading input. Context:Read packet header, Unexpected end of stream, readBytes:-1. Negative read result PktNumber:0. ReadThisPacket:0. PktDataSize:4,096.



com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
com.microsoft.sqlserver.jdbc.DBComms.readError(Unknown Source)
com.microsoft.sqlserver.jdbc.DBComms.receive(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerStatement$StatementExecutionRequest.executeStatement(Unknown Source)
com.microsoft.sqlserver.jdbc.CancelableRequest.execute(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerConnection.executeRequest(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQuery(Unknown Source)
com.nmwco.server.LoggingReporting.UiQueryPerformer.generateStringStringPair(UiQueryPerformer.java:211)
com.nmwco.server.LoggingReporting.SharedVisualizer.createClientsUi(SharedVisualizer.java:767)
com.nmwco.server.LoggingReporting.SharedVisualizer.createClientsUi(SharedVisualizer.java:737)
com.nmwco.server.report.Reports.ApplicationNetworkUtilization.configure(ApplicationNetworkUtilization.java:44)
com.nmwco.server.report.ReportVisualizerFactory.execute(ReportVisualizerFactory.java:459)
com.nmwco.server.report.report.processRequest(report.java:207)
com.nmwco.server.report.report.doGet(report.java:217)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
com.nmwco.server.jsp.reporting_config._jspService(reporting_config.java:132)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
com.nmwco.server.misc.EncodingFilter.doFilter(EncodingFilter.java:33)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
java.lang.Thread.run(Thread.java:619)

View 3 Replies View Related

[Execute SQL Task] Error: An Error Occurred While Assigning A Value To Variable

Jun 20, 2007

hello
I have a problem with Sql task
when sql task tried to assing a value to my variable I have this error ""La valeur n'est pas comprise dans la plage attendue."
I'm using ODBC connexion for a csv file

someone can help me ?

thanks

View 4 Replies View Related

[Execute SQL Task] Error: An Error Occurred While Assigning A Value To Variable...

Nov 8, 2006

hi chaps

i m getting the following ERROR:

[Execute SQL Task] Error: An error occurred while assigning a value to variable "JDETimezone": "Unable to find column Timezone in the result set.".



i know what the problem is i.e. no row is returned then what is the problem

here you are.... i want to it work... strange... ok i explain...

actully i have some processign to do with variable JDETimezone even no row is returned.... can u tell me the alternative to do the follwing task...

I want to retrieve a record from some table and do some processing and if no row is present or returned then i want to do seperate processing.... can ne one help me out ?



regards,

Anas

View 4 Replies View Related

Variable Error

Mar 29, 2006

I'm trying to set up a simple package that can be run after other packages to move packagelog files to another folder(I'm doing this because it doesn't look like we can overwrite a package log file and I really don't want to have to manually keep these in check). Anyway, I've got a source variable and a destination variable. I'm using an expression to build these values in the File System Task. When I run the package I get this error :

Error: 0xC0014054 at CopyPackageLog: Failed to lock variable "C:TempMyPackageLog.xml" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created."

It looks like the variables are getting loaded with the correct path names. Any suggestions?

MarkA

View 2 Replies View Related

Variable Error

May 13, 2008

Hi,

I am getting a strange error when trying to set a variable from a Execute SQL task. The error I get is below:


[Execute SQL Task] Error: An error occurred while assigning a value to variable "MpxBeginOrderNbr": "The type of the value being assigned to variable "User::MpxBeginOrderNbr" differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object. ".

The variable MpxBeginOrderNbr is DataType Int32

The sql statement I am executing is:

SELECT
MIN(OrderNbr) AS MpxBeginOrderNbr
FROM
dbo.vCrmOrderHeader
WHERE
OrderDate > DATEADD(MONTH, -?, GETDATE())


OrderNbr in the View vCrmOrderHeader is datatype BIGINT.
I have tried changing the MpxBeginOrderNbr variable to Int64 but I get the same error message.
In my test data the result set returns the number 1 which is the first order.
Is this a bug in SSIS or am I missing something?

View 3 Replies View Related

Table Variable Error

Jun 12, 2002

I'm creating a table variable, then executing it in an EXEC statement, like this:

DECLARE @temp_table TABLE (
column1 INT,
column2 INT
)
SET @strInsert = 'INSERT INTO @temp_table (column1,column2) VALUES ('+@intValue1+','+@intValue2+')'
EXEC (@strInsert)

I get a message during the EXEC statement that I must declare @temp_table. When I do this using an actual temporary table (i.e. #temp_table) instead, it works fine. Is there a way around this so I can use the variable instead of the table?

View 1 Replies View Related

Error With Assigning Variable A Value

Dec 6, 2006

i am trying on this but hit error

Declare @var int
Set @var = select max(value) from xxx

anyone can help me?

View 2 Replies View Related

UNDEFINED VARIABLE ERROR

Apr 11, 2006

I have the following form

<head>
<title>Mapleside Farms</title>
<link rel="stylesheet" href="mapleside.css" type="text/css" />
</head>


<form name = "account" action="account.php" method = "post">

Enter information

<input type=text name="lastname">
<br>
<input type=text name="firstname">
<br>
<input type=text name="address">
<br>
<input type=text name="city">
<br>
<input type=text name="state">
<br>
<input type=text name="zipcode">
<br>
<input type=text name="email">
<br>
<input type=text name="username">
<br>
<input type=text name="password">
<br>
</form>


And the following php page
<?php

$Customer_Lname=$_POST['lastname'];
$Customer_Fname=$_POST['firstname'];
$Customer_address=$_POST['address'];
$Customer_city=$_POST['city'];
$Customer_state=$_POST['state'];
$Customer_zipcode=$_POST['zipcode'];
$Customer_email=$_POST['email'];
$Customer_username=$_POST['username'];
$Customer_password=$_POST['password'];


// open connection to database
$db = mysql_connect("localhost", "root", "");
if (!$db)
{
print "unable to connect!";
exit;
}

//select database to use
$db= mysql_select_db ("mapleside");
if (!$db)
{
print "could not select database";
exit;
}

// create SQL query string
$query = "INSERT INTO customer (Customer_Lname, Customer_Fname, Customer_address, Customer_city, Customer_state, Customer_zipcode, Customer_email, Customer_username, Customer_password) VALUES ($Customer_Lname, $Customer_Fname, $Customer_address, $Customer_city, $Customer_state, $Customer_zipcode, $Customer_email, $Customer_username , $Customer_password)";
$result = mysql_query($query);

mysql_query($query) or die
('Error, insert query failed');
echo('Data inserted successfully' );

//close connection
mysql_close();


?>

However, when I run my form and php pages, I get undefined variable errors. Can anyone lead me in the right direction????

View 2 Replies View Related

Error 137: Must Declare Variable ...

Dec 10, 2007

Hello,

I have the following SP, which gives out a "Error 137: Must declare variable @tmp_return_tbl" error.

This is the important part of the code:
.
.
.
-- DECLARE TABLE VARIABLE
DECLARE @tmp_return_tbl TABLE (tID int, Text_Title nvarchar(30), Text_Body nvarchar(100))

-- fill out table variable USING A SELECT FROM ANOTHER TABLE VARIABLE
-- NO PROBLEM HERE
INSERT INTO @tmp_return_tbl
SELECT TOP 1 * FROM @tmp_tbl
ORDER BY NEWID()

-- TRYING TO UPDATE A TABLE
UPDATE xTable
SET xTable.fieldY = xTable.fieldY + 1
WHERE xTable.tID = @tmp_return_tbl.tID --THIS PRODUCES THE ERROR
.
.
.

I know I cannot use a table variable in a JOIN without using an Alias, or use it directly in dynamic SQL (different scope) - but is this the problem here? What am I doing wrong?

Your help is much appreciated.

View 3 Replies View Related

Declare Variable Error

Jan 14, 2008

Can anyone tell me why I keep getting this error? I am declaring the variable, but it's not recognizing it? What am I missing?

------error---------------
Server: Msg 137, Level 15, State 2, Procedure sp_CopyData, Line 85
Must declare the variable '@DatabaseFrom'.

-----sp----

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


create Procedure dbo.sp_CopyData
(@ClientAbbrev nchar(4) )
AS
DECLARE @DatabaseFrom varchar(100)

Set @DatabaseFrom = @ClientAbbrev + '.dbo.tsn_ClaimStatus'

--------------------------------------------------------------
delete from sherrisplayground.dbo.tsn_ClaimStatus
where csclientcode = @ClientAbbrev


---Insert Data from Original table into copied table---------
Insert into [AO3AO3].sherrisplayground.dbo.tsn_ClaimStatus (
CsClientCode,
ClaimStatusID,
Pat,
Claim,
[ID],
Code,
[Date],
ActionID,
Comment2,
Comment3,
Comment4,
[Followup Date],
Checkamt,
UserName)
select
@ClientAbbrev,
ClaimStatusID,
Pat,
Claim,
[ID],
Code,
[Date],
ActionID,
Comment2,
Comment3,
Comment4,
[Followup Date],
Checkamt,
UserName
from @DatabaseFrom


return


GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

View 2 Replies View Related

Conversion Error In A Variable

Jan 31, 2008


Hi, I'm trying to do the following in a variable. I keep getting the error expression cannot be evaluated.


select "BDE" + case when len(datepart(month, getdate())) = 1
then +"0"+(DT_WSTR,2) MONTH( GETDATE() ) +"0"+(DT_WSTR,2) datepart("dd",getdate())
else (DT_WSTR,2) MONTH( GETDATE() ) +(DT_WSTR,2) datepart("dd",getdate()) end

when I just run len(datepart("mm", getdate())) , I get the operand needs to be explicity cast with a cast operator.


Any suggestions? How do I get it to recoginize len(datepart("mm", getdate())) ?

View 5 Replies View Related

Variable Error In Package

Jun 12, 2007

I have a package with variable "A" defined at the package level, type "string".



I subsequently reference variable "A" in a script task, as a ReadWrite variable. In the script, I simply assign the value of another string variable to variable "A".



However, when I run the package, I *intermittently* receive the error below. Not every time though, sometimes it runs fine without the error. What's going on here?



Thanks



Error msg:



The type of the value being assigned to variable differs from the current variable type. Variables may not change type during execution. Variable types are strict, except for variables of type Object.



Code:



Public Sub Main()

Dim newestFile As String

.....................

.....................

Dts.Variables("A").Value = newestFile

Dts.TaskResult = Dts.Results.Success

End Sub

View 6 Replies View Related

Error Message: Must Declare Variable @ID

May 3, 2007

I’m having trouble with a datalist. The default view is the Item Template which has an Edit button. When I click the Edit button, I run the following code (for the EditCommand of the Datalist):
 
DataList1.EditItemIndex = e.Item.ItemIndex
DataBind()
 
It errors out with the message “Must declare variable @ID�.
 
I’ve used this process on other pages without problem.
 
The primary key for the recordsource that populates this datalist is a field named “AutoID�. There is another field named ID that ties these records to a master table. The list of rows returned in the datalist is based off the ID field matching a value in a dropdown list on the page (outside of the datalist). So my SQLdatasource has a parameter to match the ID field to @ID. For some reason, it's not finding it and I cannot determine why. I haven't had this issue on other pages.
 
Here’s my markup of the SQLDataSource and the Datalist/Edit Template:
 
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:SMARTConnectionString %>"
    DeleteCommand="DELETE FROM [tblSalesSupport] WHERE [NBID] = @NBID"
    InsertCommand="INSERT INTO [tblSalesSupport] ([ID], [NBNC], [NBEC], [Description], [Estimate], [CompanyID], [CompanyName], [ProjectNumber]) VALUES (@ID, @NBNC, @NBEC, @Description, @Estimate, @CompanyID, @CompanyName, @ProjectNumber)"
    SelectCommand="SELECT * FROM [tblSalesSupport] WHERE ([ID] = @ID)"
    UpdateCommand="UPDATE [tblSalesSupport] SET [ID] = @ID, [NBNC] = @NBNC, [NBEC] = @NBEC, [Description] = @Description, [Estimate] = @Estimate, [CompanyID] = @CompanyID, [CompanyName] = @CompanyName, [ProjectNumber] = @ProjectNumber WHERE [NBID] = @NBID">
        <DeleteParameters>
            <asp:Parameter Name="NBID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="NBNC" Type="Boolean" />
            <asp:Parameter Name="NBEC" Type="Boolean" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Estimate" Type="Decimal" />
            <asp:Parameter Name="CompanyID" Type="Int32" />
            <asp:Parameter Name="CompanyName" Type="String" />
            <asp:Parameter Name="ProjectNumber" Type="String" />
            <asp:Parameter Name="NBID" Type="Int32" />
        </UpdateParameters>
        <SelectParameters>
           <asp:ControlParameter ControlID="ddlFind" Name="ID" PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="NBNC" Type="Boolean" />
            <asp:Parameter Name="NBEC" Type="Boolean" />
            <asp:Parameter Name="Description" Type="String" />
            <asp:Parameter Name="Estimate" Type="Decimal" />
            <asp:Parameter Name="CompanyID" Type="Int32" />
            <asp:Parameter Name="CompanyName" Type="String" />
            <asp:Parameter Name="ProjectNumber" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>
   
       <asp:DataList CssClass="MainFormDisplay" ID="DataList1" runat="server" DataKeyField="NBID" DataSourceID="SqlDataSource1" width="100%">
        <HeaderTemplate>….</HeaderTemplate>
        <ItemTemplate>….</ItemTemplate>
        <EditItemTemplate>
            <table border="0"  style="width: 100%">
                <tr class="MainFormDisplay"  valign="top">
                    <td colspan="8">
                        <asp:TextBox ID="txtNBID" runat="server" Text='<%# Eval("NBID") %>' Visible="true"></asp:TextBox>
                        <asp:TextBox ID="txtID" runat="server" Text='<%# Bind("ID") %>' Visible="True"></asp:TextBox></td>
                </tr>
                <tr class="MainFormDisplay">
                    <td valign="top" style="width: 100px"><asp:Checkbox ID="chkNBNC" runat="server" Checked='<%# Bind("NBNC") %>' /></td>
                    <td style="width: 100"><asp:CheckBox ID="chkNBEC" runat="server" Checked='<%# Bind("NBEC") %>' Width="100px" /></td>
                    <td style="width: 100px"><asp:TextBox ID="txtCompanyName" runat="server" Text='<%# Bind("CompanyName")%>' Width="100px"></asp:TextBox></td>
                    <td style="width: 100px"><asp:TextBox ID="txtProjectNumber" runat="server" Text='<%# Bind("ProjectNumber") %>' Width="100px"></asp:TextBox></td>
                    <td style="width: 100px"><asp:TextBox ID="txtDescription" runat="server" Text='<%# Bind("Description") %>' Width="100px"></asp:TextBox></td>
                    <td style="width: 100px"><asp:TextBox ID="txtEstimate" runat="server" Text='<%# Bind("Estimate","{0:N2}") %>' Width="100px"></asp:TextBox></td>
                    <td style="width: 55px"><asp:CheckBox ID="ckDeleteFlag" runat="server" /></td>
                    <td style="width: 100px"><asp:Button ID="ItemSaveButton" runat="server" CommandName="Update" Text="Save" />
                    <asp:Button ID="ItemCancelButton" runat="server" CommandName="Cancel" Text="Cancel" /></td>
                </tr>               
            </table>
            &nbsp;
        </EditItemTemplate>
    </asp:DataList><br />

View 2 Replies View Related

Must Declare The Scalar Variable Error

Jan 19, 2008

Hi All,

I'm totaly new to administrating databases.

All I want to do is run the sql server script located at http://www.data-miners.com/sql_companion.htm#downloads.

This creates some tables and uploads a series of text files into them.

When I run the script through SQL Server Express 2005 I get the error Must declare the scalar variable "@DATADIR". I suspect it's something with me putting in the wrong path.

The text files that the script needs to load into the table are located on the K drive, and I have changed the path in

declare @DATADIR varchar(128)
set @DATADIR='C:gordonookdatafinal extfiles'


to


declare @DATADIR varchar(128)
set @DATADIR='k: extfiles'

I suspect this is the wrong syntax that's why it's not working but I might be totally wrong.

The text file and the server are both saved on the k drive.

Regards,

Seaweed

View 3 Replies View Related

Internal SQL Server Error When Using Variable

Jul 20, 2005

In the code below I get an Internal SQL Server error in QueryAnalyzer. Ultimately I want to get thos code working in a function.DECLARE @WeekNumber tinyintDECLARE @Comp decimal(18,2)DECLARE @PeriodFromDate datetimeDECLARE @PeriodToDate datetimeSET @WeekNumber = 27SET @PeriodFromDate = (SELECT MIN(StartDate) AS StartDate FROMCalendar WHERE WeekNumber = @WeekNumber)SET @PeriodToDate = (SELECT MAX(EndDate) AS StartDate FROM CalendarWHERE WeekNumber = @WeekNumber)SET @Comp = (SELECT SUM(ActualGrossComp)FROM dbo.fnc_ProgramLineUp_1_2()WHERE Delay > 0AND ClearanceCode <> 3AND TeleCastDate BETWEEN @PeriodFromDate AND PeriodToDate)But this code runs fine:DECLARE @WeekNumber tinyintDECLARE @Comp decimal(18,2)DECLARE @PeriodFromDate datetimeDECLARE @PeriodToDate datetimeSET @WeekNumber = 27SET @PeriodFromDate = (SELECT MIN(StartDate) AS StartDate FROMCalendar WHERE WeekNumber = @WeekNumber)SET @PeriodToDate = (SELECT MAX(EndDate) AS StartDate FROM CalendarWHERE WeekNumber = @WeekNumber)SELECT SUM(ActualGrossComp)FROM dbo.fnc_ProgramLineUp_1_2()WHERE Delay > 0AND ClearanceCode <> 3AND TeleCastDate BETWEEN @PeriodFromDate AND PeriodToDateThe only difference is that here I'm not setting @Comp to the returnvalue of the SELECT. This code also runs fine when I sum othercolumns. Any ideas?

View 2 Replies View Related

Email Error Message Via Variable

Jan 2, 2008

I am trying to capture an error message and email to myself whenever the script has an error. I have an email task event handler on OnError and use the variable errormsg as my email body. I have the errormsg variable with a package wide scope defined as string with a value of @[System::ErrorDescription]. Is there anything elso I need to do to make this work?

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved