[development-axapta] Re: return sqlstatement to user

2004-11-16 Thread affekatz





Thanks it works fine ... is it possible to put the data into an 
array ? I think it would be easier for mee because otherwise ill have 
to have some very defined SQL statements. 
I get a form of list ( Because i selected 2 rows in the database ) 
and as far as i can se it's not possible to those one of them like 
this getstring(1,1) ?


--- In [EMAIL PROTECTED], [EMAIL PROTECTED] 
wrote:
 HI
 
 try this
 static void SQLStmt_Demo(Args _args)
 {
 Connection Connection;
 Statement Statement;
 ResultSet ResultSet;
 str myString;
 ;
 // Create a new connection to the Axapta database
 connection = new Connection();
 // Create a statement for the new connection
 Statement = connection.createStatement();
 // Execute a select statement in the new connection
 Resultset = statement.executeQuery(select AccountNum from 
vendtable);
 // retrive a string from the first collumn in the resultset
 while (ResultSet.next())
 info(ResultSet.getString(1));
 
 }
 
 /Jesper
 
  Original Message 
 Subject: [development-axapta] Re: return sqlstatement to user (15-
Nov-2004 12:54)
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 
  
  
  
  I can't find the getstring command i can only find one called 
tostring
  
  I can't figure out how to use that one when i use it something 
like 
  this
  
  S.executeQuery( select ... );
  S.toString()
  
  If i get axapta to print the s.toString it only says: Class 
Statement 
  
  Could u give a exampel of how to do it ?
  
  --- In [EMAIL PROTECTED], 
[EMAIL PROTECTED] 
  wrote:
   You get a resultset(Class) from a statement.
   
   You extract a string with the method getstring.
   
   /Jesper
   
    Original Message 
   Subject: [development-axapta] return sqlstatement to user (12-
Nov-
  2004 13:33)
   From: [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   



Im using the command S.executeQuery(Here should the SQL 
  statement 
be);

is it possible to return the value from the statement fx. a 
  select 
statement to a string ?

something like this:

str RV;

RV = S.executeQuery(Here should the SQL statement be);

If i write this i get the error message Operand types are 
not 
compatible with the operator

I suppose it's necessary to do some data conversion ?

thank you in advance










Yahoo! Groups Links







To: [EMAIL PROTECTED]
  
  
  
  
  
  
  
  
  
  
  Yahoo! Groups Links
  
  
  
  
  
  
  
  To: [EMAIL PROTECTED]












Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










AW: [development-axapta] Re: return sqlstatement to user

2004-11-16 Thread oka




Hi,
Try:
 
str column1;
str column2;
...
while(ResultSet.next())
{
 column1 = getString(1);
 column2 = getString(2);
...
 your code...
}
 
/Otto 
 
Thanks it works fine ... is it possible to put the data into an 
array ? I think it would be easier for mee because otherwise ill have 
to have some very defined SQL statements. 
I get a form of list ( Because i selected 2 rows in the database ) 
and as far as i can se it's not possible to those one of them like 
this getstring(1,1) ?


--- In [EMAIL PROTECTED], [EMAIL PROTECTED] 
wrote:
 HI
 
 try this
 static void SQLStmt_Demo(Args _args)
 {
 Connection Connection;
 Statement Statement;
 ResultSet ResultSet;
 str myString;
 ;
 // Create a new connection to the Axapta database
 connection = new Connection();
 // Create a statement for the new connection
 Statement = connection.createStatement();
 // Execute a select statement in the new connection
 Resultset = statement.executeQuery(select AccountNum from 
vendtable);
 // retrive a string from the first collumn in the resultset
 while (ResultSet.next())
 info(ResultSet.getString(1));
 
 }
 
 /Jesper
 
  Original Message 
 Subject: [development-axapta] Re: return sqlstatement to user (15-
Nov-2004 12:54)
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 
  
  
  
  I can't find the getstring command i can only find one called 
tostring
  
  I can't figure out how to use that one when i use it something 
like 
  this
  
  S.executeQuery( select ... );
  S.toString()
  
  If i get axapta to print the s.toString it only says: Class 
Statement 
  
  Could u give a exampel of how to do it ?
  
  --- In [EMAIL PROTECTED], 
[EMAIL PROTECTED] 
  wrote:
   You get a resultset(Class) from a statement.
   
   You extract a string with the method getstring.
   
   /Jesper
   
    Original Message 
   Subject: [development-axapta] return sqlstatement to user (12-
Nov-
  2004 13:33)
   From: [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   



Im using the command S.executeQuery(Here should the SQL 
  statement 
be);

is it possible to return the value from the statement fx. a 
  select 
statement to a string ?

something like this:

str RV;

RV = S.executeQuery(Here should the SQL statement be);

If i write this i get the error message Operand types are 
not 
compatible with the operator

I suppose it's necessary to do some data conversion ?

thank you in advance










Yahoo! Groups Links







To: [EMAIL PROTECTED]
  
  
  
  
  
  
  
  
  
  
  Yahoo! Groups Links
  
  
  
  
  
  
  
  To: [EMAIL PROTECTED]





Yahoo! Groups Sponsor 

ADVERTISEMENT
 http://us.ard.yahoo.com/SIG=129h3lvho/M=298184.5584357.6650215.3001176/D=groups/S=1705006764:HM/EXP=1100678897/A=2426682/R=0/SIG=11edksnhv/*http://www.netflix.com/Default?mqso=60185402 click here 
 http://us.adserver.yahoo.com/l?M=298184.5584357.6650215.3001176/D=groups/S=:HM/A=2426682/rand=547094830  

 _ 

Yahoo! Groups Links


* To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/ http://groups.yahoo.com/group/development-axapta/ 
 

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 

* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service http://docs.yahoo.com/info/terms/ . 




[Non-text portions of this message have been removed]










Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










Re: AW: [development-axapta] Re: return sqlstatement to user

2004-11-16 Thread Thomas Jensen


I can do that but then ill get the hole column not just the value in 1,1 ( a )
 
l  1  l  2  l   
-
1  l  a  l  b  l
--
2  l  c  l  d  l
 
if i do what you told me the output would look something like this:
 
a  b
b  d
 
I want to get all the data in the rows i select in the database, and be able to 
pick one if i want to is it possible or should i make a lot of select 
statements instead ?

[EMAIL PROTECTED] wrote:
Hi,
Try:

strcolumn1;
strcolumn2;
...
while(ResultSet.next())
{
column1 = getString(1);
column2 = getString(2);
...
your code...
}

/Otto 

Thanks it works fine ... is it possible to put the data into an 
array ? I think it would be easier for mee because otherwise ill have 
to have some very defined SQL statements. 
I get a form of list ( Because i selected 2 rows in the database ) 
and as far as i can se it's not possible to those one of them like 
this getstring(1,1) ?


--- In [EMAIL PROTECTED], [EMAIL PROTECTED] 
wrote:
 HI
 
 try this
 static void SQLStmt_Demo(Args _args)
 {
 Connection  Connection;
 Statement   Statement;
 ResultSet   ResultSet;
 str myString;
 ;
 // Create a new connection to the Axapta database
 connection = new Connection();
 // Create a statement for the new connection
 Statement = connection.createStatement();
 // Execute a select statement in the new connection
 Resultset = statement.executeQuery(select AccountNum from 
vendtable);
 // retrive a string from the first collumn in the resultset
 while (ResultSet.next())
 info(ResultSet.getString(1));
 
 }
 
 /Jesper
 
  Original Message 
 Subject: [development-axapta] Re: return sqlstatement to user (15-
Nov-2004 12:54)
 From:[EMAIL PROTECTED]
 To:  [EMAIL PROTECTED]
 
  
  
  
  I can't find the getstring command i can only find one called 
tostring
  
  I can't figure out how to use that one when i use it  something 
like 
  this
  
  S.executeQuery( select ... );
  S.toString()
  
  If i get axapta to print the s.toString it only says: Class 
Statement 
  
  Could u give a exampel of how to do it ?
  
  --- In [EMAIL PROTECTED], 
[EMAIL PROTECTED] 
  wrote:
   You get a resultset(Class) from a statement.
   
   You extract a string with the method getstring.
   
   /Jesper
   
    Original Message 
   Subject: [development-axapta] return sqlstatement to user (12-
Nov-
  2004 13:33)
   From:[EMAIL PROTECTED]
   To:  [EMAIL PROTECTED]
   



Im using the command S.executeQuery(Here should the SQL 
  statement 
be);

is it possible to return the value from the statement fx. a 
  select 
statement to a string ?

something like this:

str RV;

RV = S.executeQuery(Here should the SQL statement be);

If i write this i get the error message Operand types are 
not 
compatible with the operator

I suppose it's necessary to do some data conversion ?

thank you in advance









 
Yahoo! Groups Links



 



To: [EMAIL PROTECTED]
  
  
  
  
  
  
  
  
  
   
  Yahoo! Groups Links
  
  
  
   
  
  
  
  To: [EMAIL PROTECTED]





Yahoo! Groups Sponsor  

ADVERTISEMENT
http://us.ard.yahoo.com/SIG=129h3lvho/M=298184.5584357.6650215.3001176/D=groups/S=1705006764:HM/EXP=1100678897/A=2426682/R=0/SIG=11edksnhv/*http://www.netflix.com/Default?mqso=60185402
 click here  
  
http://us.adserver.yahoo.com/l?M=298184.5584357.6650215.3001176/D=groups/S=:HM/A=2426682/rand=547094830
   

  _  

Yahoo! Groups Links


*  To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/ 
http://groups.yahoo.com/group/development-axapta/ 
  

*  To unsubscribe from this group, send an email to:
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
  

*  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
http://docs.yahoo.com/info/terms/ . 




[Non-text portions of this message have been removed]


Yahoo! Groups SponsorADVERTISEMENT


-
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



-
Do you Yahoo!?
 Discover all thatÂ’s new in My Yahoo!

[Non-text portions of this message have been removed]






 Yahoo! Groups Sponsor ~-- 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
~- 

 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/development

[development-axapta] Re: return sqlstatement to user

2004-11-15 Thread affekatz






I can't find the getstring command i can only find one called tostring

I can't figure out how to use that one when i use it something like 
this

S.executeQuery( select ... );
S.toString()

If i get axapta to print the s.toString it only says: Class Statement 

Could u give a exampel of how to do it ?

--- In [EMAIL PROTECTED], [EMAIL PROTECTED] 
wrote:
 You get a resultset(Class) from a statement.
 
 You extract a string with the method getstring.
 
 /Jesper
 
  Original Message 
 Subject: [development-axapta] return sqlstatement to user (12-Nov-
2004 13:33)
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 
  
  
  
  Im using the command S.executeQuery(Here should the SQL 
statement 
  be);
  
  is it possible to return the value from the statement fx. a 
select 
  statement to a string ?
  
  something like this:
  
  str RV;
  
  RV = S.executeQuery(Here should the SQL statement be);
  
  If i write this i get the error message Operand types are not 
  compatible with the operator
  
  I suppose it's necessary to do some data conversion ?
  
  thank you in advance
  
  
  
  
  
  
  
  
  
  
  Yahoo! Groups Links
  
  
  
  
  
  
  
  To: [EMAIL PROTECTED]















Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










Re: [development-axapta] Re: return sqlstatement to user

2004-11-15 Thread jesper.joergensen




HI

try this
static void SQLStmt_Demo(Args _args)
{
 Connection Connection;
 Statement Statement;
 ResultSet ResultSet;
 str myString;
 ;
 // Create a new connection to the Axapta database
 connection = new Connection();
 // Create a statement for the new connection
 Statement = connection.createStatement();
 // Execute a select statement in the new connection
 Resultset = statement.executeQuery(select AccountNum from vendtable);
 // retrive a string from the first collumn in the resultset
 while (ResultSet.next())
 info(ResultSet.getString(1));

}

/Jesper

 Original Message 
Subject: [development-axapta] Re: return sqlstatement to user (15-Nov-2004 12:54)
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

 
 
 
 I can't find the getstring command i can only find one called tostring
 
 I can't figure out how to use that one when i use it something like 
 this
 
 S.executeQuery( select ... );
 S.toString()
 
 If i get axapta to print the s.toString it only says: Class Statement 
 
 Could u give a exampel of how to do it ?
 
 --- In [EMAIL PROTECTED], [EMAIL PROTECTED] 
 wrote:
  You get a resultset(Class) from a statement.
  
  You extract a string with the method getstring.
  
  /Jesper
  
   Original Message 
  Subject: [development-axapta] return sqlstatement to user (12-Nov-
 2004 13:33)
  From: [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  
   
   
   
   Im using the command S.executeQuery(Here should the SQL 
 statement 
   be);
   
   is it possible to return the value from the statement fx. a 
 select 
   statement to a string ?
   
   something like this:
   
   str RV;
   
   RV = S.executeQuery(Here should the SQL statement be);
   
   If i write this i get the error message Operand types are not 
   compatible with the operator
   
   I suppose it's necessary to do some data conversion ?
   
   thank you in advance
   
   
   
   
   
   
   
   
   
   
   Yahoo! Groups Links
   
   
   
   
   
   
   
   To: [EMAIL PROTECTED]
 
 
 
 
 
 
 
 
 
 
 Yahoo! Groups Links
 
 
 
 
 
 
 
 To: [EMAIL PROTECTED]










Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/development-axapta/
To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.