![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
|
Why dont u use "" instead of null?? as informix anyway does not know which kind of null ( if u r using into clause ). This will save time over calling a function. Rgds Preetinder Fernando Nunes wrote: Jorge Vergara wrote: Hello All. The query bellow generates a sintax error: SELECT 'ADP' , '!' , null , '6.1.1.06' #^ # 201: A syntax error has occurred. # Use "null()". It's created by a script in $INFORMIXDIR/etc Regards sending to informix-list |
#2
| |||
| |||
|
|
Fernando. Which script? Jorge |
#3
| |||
| |||
|
|
If you want to return an null value constant in a select statement then your engine must support casting. Assuming your engine allows casting you can use the following if you want a null of type integer. SELECT null::integer FROM table; The database can't return a null without knowing what data type to use for the null value. If your engine does not support casting then you could simulate by creating a table with different columns for the different data types you would need null values for. You could insert one row with null values and join to this table in your queries where you need a null value returned. Gregg Walker "Jorge Vergara" <jlvergara (AT) sispro (DOT) com.br> wrote in message news:2f175445.0306200556.4ebda7f8 (AT) posting (DOT) google.com... Hello All. The query bellow generates a sintax error: SELECT 'ADP' , '!' , null , '6.1.1.06' #^ # 201: A syntax error has occurred. # , '!' , '!' , '!' , '!' , GF_CTOP_CTB.CD_CTOP_CTB FROM GF_CTOP_CTB If I replace the word "null" with "''" the statement runs without error. Is there any configuration parameter I could manipulate that would allow me to use "null" as a constant in my queries? Thanks in advance. Jorge Vergara |
#4
| |||
| |||
|
|
Do you know which engines do support casting? |
#5
| |||
| |||
|
|
Gregg. Do you know wich engines do support casting? Vergara "Gregg Walker" <gregg (AT) rrmca (DOT) com> wrote If you want to return an null value constant in a select statement then your engine must support casting. Assuming your engine allows casting you can use the following if you want a null of type integer. SELECT null::integer FROM table; The database can't return a null without knowing what data type to use for the null value. If your engine does not support casting then you could simulate by creating a table with different columns for the different data types you would need null values for. You could insert one row with null values and join to this table in your queries where you need a null value returned. Gregg Walker "Jorge Vergara" <jlvergara (AT) sispro (DOT) com.br> wrote in message news:2f175445.0306200556.4ebda7f8 (AT) posting (DOT) google.com... Hello All. The query bellow generates a sintax error: SELECT 'ADP' , '!' , null , '6.1.1.06' #^ # 201: A syntax error has occurred. # , '!' , '!' , '!' , '!' , GF_CTOP_CTB.CD_CTOP_CTB FROM GF_CTOP_CTB If I replace the word "null" with "''" the statement runs without error. Is there any configuration parameter I could manipulate that would allow me to use "null" as a constant in my queries? Thanks in advance. Jorge Vergara |
#6
| |||
| |||
|
|
"Jorge Vergara" <jlvergara (AT) sispro (DOT) com.br> wrote in message news:2f175445.0306261047.676bafe8 (AT) posting (DOT) google.com... Gregg. Do you know wich engines do support casting? I believe was first available in IDS.2000 with Universal Option which is now included in all version 9.x engines. Someone please correct me if it's available in 7.x versions. |
|
Mark D. Stock mailto:mdstock (AT) MydasSolutions (DOT) com |//////// /| Mydas Solutions Ltd http://MydasSolutions.com |///// / //| +-----------------------------------+//// / ///| |We value your comments, which have |/// / ////| |been recorded and automatically |// / /////| |emailed back to us for our records.|/ ////////| +----------------------+-----------------------------------+-----------+ |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |