Home > database >  I am a beginner PB, how old are grammar have a problem? Please help me take a look at what place is
I am a beginner PB, how old are grammar have a problem? Please help me take a look at what place is

Time:09-20

//declare a local variable, respectively used to save the students information
String ls_id ls_name, ls_sex
The Date ld_birthday
//student id will be obtained from student id edit box
Ls_id=sle_1. Text
//from the student table conditions satisfying the student id to retrieve the information, and store the information to the corresponding variable
SELECT student student_name, student sex, student. Birthday

The Error C0031 Syntax Error

CodePudding user response:


String ls_name ls_sex, ls_birthday
SELECT student student_name, student sex, student. Birthday
Into: ls_name, : ls_sex, ls_birthday
From the table.

CodePudding user response:

If only from the student table number:
The select student_name, sex, birthday
Into: ls_name, ls_sex, : ls_birthday
The from student where student id=: ls_id;

CodePudding user response:

To help the top, two 1 above

CodePudding user response:

The select statement has a problem, that should be ~ 2 floor

CodePudding user response:

Looks like LZ must also strengthen learning embedded SQL,

CodePudding user response:

Pb has automatic function, there won't be using automatically generated function is wrong

CodePudding user response:

On the second floor, UP!!!!!!

CodePudding user response:

LZ want to find the book to see, basic problem,

CodePudding user response:

refer to the eighth floor feifei502 response:
LZ to find a book to see, basic problem,

SQL statements based

CodePudding user response:

SQL syntax is not complete,
On the second floor of the right...

CodePudding user response:

Don't learn PB

CodePudding user response:

The SQL statement is incomplete

CodePudding user response:

According to the second floor

CodePudding user response:

The SQL statement is incomplete

CodePudding user response:

The following statements select data in The Emp_LName and Emp_FName columns of a row in The Employee table and put The data into The SingleLineEdits sle_LName and sle_FName (The transaction object Emp_tran is 2) :

Int Emp_num

String Emp_lname, Emp_fname

Emp_num=Integer (sle_Emp_Num. Text)

SELECT the employee Emp_LName, employee. Emp_FName

INTO: Emp_lname, : Emp_fname

FROM the Employee

WHERE the Employee. Emp_nbr=: Emp_num

USING Emp_tran;

IF Emp_tran. SQLCode=100 THEN

MessageBox (" Employee Inquiry ", & amp;

"Employee Not Found")

ELSEIF Emp_tran. SQLCode & gt; 0 then

MessageBox (" Database Error ", & amp;

Emp_tran SQLErrText, the Exclamation!)

END the IF

Sle_Lname. Text=Emp_lname

Sle_Fname. Text=Emp_fname

CodePudding user response:

 Usage 

An error occurs if the SELECT statement returns more than one row.
The Error handling for It is good practice to test the success/failure code after executing a SELECT statement. You can test the SQLCode for a failure code.
When you use the INTO clause, the original concept does not verify been the data type of the retrieved column matches the data type of the host variable. It only checks for the existence of the columns and tables. You are responsible for checking that the data types match. Keep in mind that not all the database data types are the same as the original concept data types.

CodePudding user response:

Yes, need into: ll_name

CodePudding user response:

August 1, it is estimated that the building is now an ace.

CodePudding user response:

Slowly groping!

CodePudding user response:

On the second floor of the top

CodePudding user response:

There are some things to remember

CodePudding user response:

Look at a book club, need to learn too much

CodePudding user response:

You from a table or a student?

CodePudding user response:

Set the variable to use

CodePudding user response:

String ls_name ls_sex, ls_birthday
The SELECT student_name, sex, birthday
Into: ls_name, ls_sex, : ls_birthday
The from student where student ID ID=ls_id;
Student ID ID to your student ID ID table

CodePudding user response:

I think it is the SQL statement is incomplete

CodePudding user response:

The select col into: variables from table where 1=1;

CodePudding user response:

Select col1 into: var1 from tablename where col2=: var2.
So you see see

CodePudding user response:

On the second floor of

CodePudding user response:

What you write is what ah? All have no

CodePudding user response:

To be late

CodePudding user response:

SQL21 day self-study

CodePudding user response:

LZ want to find the book to see, basic problem,

CodePudding user response:

Binding XXXXXXXXXXX

CodePudding user response:

The select column into variables from table where conditions using connection

CodePudding user response:

There is something wrong with the SQL statement, positive solution on the second floornullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related