[nsbasic-ce] Re: SQL SELECT WHERE

2009-05-26 Thread EMERSON VIER
I know abou error mensage, but I need the solution for this, my column is Age 
and I need seach value for this when I make this

Set records=db.Execute(SELECT * FROM People_DB WHERE Age = '19' )

Work very well but I need sustitute the '19' to on variable.

Thx for all

EMERSON VIER



--- In nsbasic...@yahoogroups.com, Harold Wood  Meyuni Gani hwoody2w...@... 
wrote:

 You are encloseing value1 within quotes, so what gets passed to the sql 
 engine is the name value1 which is interpeted as the name of a column.  What 
 you need to have is select * from tablename where columnname = + value1 
 This way the engine gets passed the query along with the value in value1.
 
 Harold Wood  Meyuni Gani
 
 -Original Message-
 From: EMERSON VIER emersonv...@...
 Sent: Monday, May 25, 2009 7:50 PM
 To: nsbasic...@yahoogroups.com
 Subject: [nsbasic-ce] SQL SELECT WHERE
 
 
 
 If a use this
 
  Value1 = 19
 
  Set records=db.Execute(SELECT * FROM People_DB WHERE Age = Value1 )
 
  Returt the Scripting Error SQLite3COM - Line XXX, char O no such column: 
 Value1
 
  If a use this
 
  Set records=db.Execute(SELECT * FROM People_DB WHERE Age = '19' )
 
  Work very well
 
  But I need use the variable on place '19' because this value I need get from 
 TextBox
 
  EMERSON VIER




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
nsb-ce group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~--~~~~--~~--~--~---



[nsbasic-ce] Re: SQL SELECT WHERE

2009-05-26 Thread bwolodko
--- In nsbasic...@yahoogroups.com, EMERSON VIER emersonv...@... wrote:

 I know abou error mensage, but I need the solution for this, my column is Age 
 and I need seach value for this when I make this
 
 Set records=db.Execute(SELECT * FROM People_DB WHERE Age = '19' )
 
 Work very well but I need sustitute the '19' to on variable.
 
 Thx for all
 
 EMERSON VIER
 
 
 
 --- In nsbasic...@yahoogroups.com, Harold Wood  Meyuni Gani hwoody2wood@ 
 wrote:
 
  You are encloseing value1 within quotes, so what gets passed to the sql 
  engine is the name value1 which is interpeted as the name of a column.  
  What you need to have is select * from tablename where columnname = + 
  value1 This way the engine gets passed the query along with the value in 
  value1.
  
  Harold Wood  Meyuni Gani
  
  -Original Message-
  From: EMERSON VIER emersonvier@
  Sent: Monday, May 25, 2009 7:50 PM
  To: nsbasic...@yahoogroups.com
  Subject: [nsbasic-ce] SQL SELECT WHERE
  
  
  
  If a use this
  
   Value1 = 19
  
   Set records=db.Execute(SELECT * FROM People_DB WHERE Age = Value1 )
  
   Returt the Scripting Error SQLite3COM - Line XXX, char O no such column: 
  Value1
  
   If a use this
  
   Set records=db.Execute(SELECT * FROM People_DB WHERE Age = '19' )
  
   Work very well
  
   But I need use the variable on place '19' because this value I need get 
  from TextBox
  
   EMERSON VIER
 


It would appeasr that what we need is a string

would this work?

Value1 = 19

Set records = db.Execute(SELECT * FROM People_DB WHERE Age =  CStr(Value1))

Are the ( ) braces required?

Set records = db.Execute SELECT * FROM People_DB WHERE Age =  CStr(Value1)

In the NsBasic manual, the syntax is EXECUTE(string)

But

   AddObject NSCEPictureBox.NSCEPictureBoxCtrl.1,picName,X,Y,220,90
   Execute picName  .ScaleMode = 3 ' pixels
   Execute picName  .BorderStyle = 0 ' none
   Execute picName  .hide

works well. No Braces.

Converting the number to a string and appending it.

if all the Quotes are required i.e '19' )


then Set records = db.Execute(SELECT * FROM People_DB WHERE Age =  '  
CStr(Value1)  ')

may work, just guessing 

Ben




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
nsb-ce group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~--~~~~--~~--~--~---



Re: [nsbasic-ce] Re: SQL SELECT WHERE

2009-05-26 Thread Harold Wood
Emereson
your problem is that you arent forming the query statement correctly.  the 
query statement should look like
 
Set Records = Db.Execute(Select * from People_Db where AGE =  + Value1)
 
the single quotes around a value are used for date and string columns, numbers 
dont use quotes.
 
also you might want to set up a view with AGE as a computed column, then query 
the view.
 
Woody

--- On Tue, 5/26/09, EMERSON VIER emersonv...@yahoo.com.br wrote:


From: EMERSON VIER emersonv...@yahoo.com.br
Subject: [nsbasic-ce] Re: SQL SELECT WHERE
To: nsbasic...@yahoogroups.com
Date: Tuesday, May 26, 2009, 5:31 PM








Ben,

Thx, but not work for me I test the all option.

EMERSON VIER

--- In nsbasic...@yahoogro ups.com, bwolodko ben.wolodko@ ... wrote:

 --- In nsbasic...@yahoogro ups.com, bwolodko ben.wolodko@  wrote:
 
  --- In nsbasic...@yahoogro ups.com, EMERSON VIER emersonvier@  wrote:
  
   I know abou error mensage, but I need the solution for this, my column is 
   Age and I need seach value for this when I make this
   
   Set records=db.Execute( SELECT * FROM People_DB WHERE Age = '19' )
   
   Work very well but I need sustitute the '19' to on variable.
   
   Thx for all
   
   EMERSON VIER
   
   
   
   --- In nsbasic...@yahoogro ups.com, Harold Wood  Meyuni Gani 
   hwoody2wood@  wrote:
   
You are encloseing value1 within quotes, so what gets passed to the sql 
engine is the name value1 which is interpeted as the name of a column. 
What you need to have is select * from tablename where columnname = 
+ value1 This way the engine gets passed the query along with the value 
in value1.

Harold Wood  Meyuni Gani

-Original Message-
From: EMERSON VIER emersonvier@ 
Sent: Monday, May 25, 2009 7:50 PM
To: nsbasic...@yahoogro ups.com
Subject: [nsbasic-ce] SQL SELECT WHERE



If a use this

Value1 = 19

Set records=db.Execute( SELECT * FROM People_DB WHERE Age = Value1 )

Returt the Scripting Error SQLite3COM - Line XXX, char O no such 
column: Value1

If a use this

Set records=db.Execute( SELECT * FROM People_DB WHERE Age = '19' )

Work very well

But I need use the variable on place '19' because this value I need get 
from TextBox

EMERSON VIER
   
  
  
  It would appeasr that what we need is a string
  
  would this work?
  
  Value1 = 19
  
  Set records = db.Execute( SELECT * FROM People_DB WHERE Age =  
  CStr(Value1) )
  
  Are the ( ) braces required?
  
  Set records = db.Execute SELECT * FROM People_DB WHERE Age =  
  CStr(Value1)
  
  In the NsBasic manual, the syntax is EXECUTE(string)
  
  But
  
  AddObject NSCEPictureBox. NSCEPictureBoxCt rl.1,picName, X,Y,220,90
  Execute picName  .ScaleMode = 3 ' pixels
  Execute picName  .BorderStyle = 0 ' none
  Execute picName  .hide
  
  works well. No Braces.
  
  Converting the number to a string and appending it.
  
  if all the Quotes are required i.e '19' )
  
  
  then Set records = db.Execute( SELECT * FROM People_DB WHERE Age =  ' 
   CStr(Value1)  ')
  
  may work, just guessing 
  
  Ben
 
 
 Just noticed that the web page version does not show the single quotes within 
 the double quotes to make up this string.
 
 If you open the message with a reply, the string shows correctly.
 
 Ben
















--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
nsb-ce group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~--~~~~--~~--~--~---



Re: [nsbasic-ce] Re: SQL SELECT WHERE

2009-05-26 Thread Harold Wood

Emerson
 
the code should be

Dim Value1
Value1 = 19
Set records=db.Execute (SELECT * FROM People_DB WHERE Age=  cstr(Value1))
 
the above works here great.
 
can you send me the schema you use for your people_DB?  i can write you schema 
for a view that autocalculates the age.
 
Woody
 
Tue, 5/26/09, EMERSON VIER emersonv...@yahoo.com.br wrote:


From: EMERSON VIER emersonv...@yahoo.com.br
Subject: [nsbasic-ce] Re: SQL SELECT WHERE
To: nsbasic...@yahoogroups.com
Date: Tuesday, May 26, 2009, 10:35 PM








Woody, I try your idea but not work too.

I test this now and work

Option 1 - WORK
Dim Value1
Value1 = 19
Value1 = 'Value1 '
Set records=db.Execute (SELECT * FROM People_DB WHERE Age= Value1 )

Option 1 - WORK - Now I use this
Set records=db.Execute (SELECT * FROM People_DB WHERE Age= 'tbsearch. 
Text'  )

Thx Woody and Ben for all help.

EMERSON VIER

--- In nsbasic...@yahoogro ups.com, Harold Wood hwoody2wood@ ... wrote:

 Emereson
 your problem is that you arent forming the query statement correctly.  the 
 query statement should look like
  
 Set Records = Db.Execute( Select * from People_Db where AGE =  + Value1)
  
 the single quotes around a value are used for date and string columns, 
 numbers dont use quotes.
  
 also you might want to set up a view with AGE as a computed column, then 
 query the view.
  
 Woody
 
 --- On Tue, 5/26/09, EMERSON VIER emersonvier@ ... wrote:
 
 
 From: EMERSON VIER emersonvier@ ...
 Subject: [nsbasic-ce] Re: SQL SELECT WHERE
 To: nsbasic...@yahoogro ups.com
 Date: Tuesday, May 26, 2009, 5:31 PM
 
 
 
 
 
 
 
 
 Ben,
 
 Thx, but not work for me I test the all option.
 
 EMERSON VIER
 
 --- In nsbasic...@yahoogro ups.com, bwolodko ben.wolodko@ ... wrote:
 
  --- In nsbasic...@yahoogro ups.com, bwolodko ben.wolodko@  wrote:
  
   --- In nsbasic...@yahoogro ups.com, EMERSON VIER emersonvier@  wrote:
   
I know abou error mensage, but I need the solution for this, my column 
is Age and I need seach value for this when I make this

Set records=db.Execute( SELECT * FROM People_DB WHERE Age = '19' )

Work very well but I need sustitute the '19' to on variable.

Thx for all

EMERSON VIER



--- In nsbasic...@yahoogro ups.com, Harold Wood  Meyuni Gani 
hwoody2wood@  wrote:

 You are encloseing value1 within quotes, so what gets passed to the 
 sql engine is the name value1 which is interpeted as the name of a 
 column. What you need to have is select * from tablename where 
 columnname = + value1 This way the engine gets passed the query 
 along with the value in value1.
 
 Harold Wood  Meyuni Gani
 
 -Original Message-
 From: EMERSON VIER emersonvier@ 
 Sent: Monday, May 25, 2009 7:50 PM
 To: nsbasic...@yahoogro ups.com
 Subject: [nsbasic-ce] SQL SELECT WHERE
 
 
 
 If a use this
 
 Value1 = 19
 
 Set records=db.Execute( SELECT * FROM People_DB WHERE Age = Value1 
 )
 
 Returt the Scripting Error SQLite3COM - Line XXX, char O no such 
 column: Value1
 
 If a use this
 
 Set records=db.Execute( SELECT * FROM People_DB WHERE Age = '19' )
 
 Work very well
 
 But I need use the variable on place '19' because this value I need 
 get from TextBox
 
 EMERSON VIER

   
   
   It would appeasr that what we need is a string
   
   would this work?
   
   Value1 = 19
   
   Set records = db.Execute( SELECT * FROM People_DB WHERE Age =  
   CStr(Value1) )
   
   Are the ( ) braces required?
   
   Set records = db.Execute SELECT * FROM People_DB WHERE Age =  
   CStr(Value1)
   
   In the NsBasic manual, the syntax is EXECUTE(string)
   
   But
   
   AddObject NSCEPictureBox. NSCEPictureBoxCt rl.1,picName, X,Y,220,90
   Execute picName  .ScaleMode = 3 ' pixels
   Execute picName  .BorderStyle = 0 ' none
   Execute picName  .hide
   
   works well. No Braces.
   
   Converting the number to a string and appending it.
   
   if all the Quotes are required i.e '19' )
   
   
   then Set records = db.Execute( SELECT * FROM People_DB WHERE Age =  
   '  CStr(Value1)  ')
   
   may work, just guessing 
   
   Ben
  
  
  Just noticed that the web page version does not show the single quotes 
  within the double quotes to make up this string.
  
  If you open the message with a reply, the string shows correctly.
  
  Ben
 
















--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
nsb-ce group.
To post to this group, send email to nsb-ce@googlegroups.com
To unsubscribe from this group, send email to 
nsb-ce+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nsb-ce?hl=en
-~--~~~~--~~--~--~---