21
Scripting Languages / Re: ScriptBasic 3.0
« Last post by John on April 13, 2024, 06:41:15 PM »I have made some progress with the ODBC extension module on Linux. This 64-bit ODBC driver support guide was helpful to find the issue.
This allowed me to get FetchArray to work. FethchHash still isn't working and I believe it might be a type issue as well.
Code: C
- SQLLEN cbCol,cbrCol; //JRS
- // SQLINTEGER cbCol,cbrCol;
This allowed me to get FetchArray to work. FethchHash still isn't working and I believe it might be a type issue as well.
Code: ScriptBasic
- IMPORT odbc.bas
- ON ERROR GOTO Ouch
- dbh = ODBC::RealConnect("PSQL","postgres","<Password>")
- ODBC::Query(dbh, "SELECT * FROM film LIMIT 25")
- WHILE ODBC::FetchArray(dbh,column)
- ' PRINT column{"title"}," - ",column{"description"}, "\n"
- PRINT column[0],"\t",column[1],"\t",column[2],"\n"
- WEND
- Done:
- ODBC::Close(dbh)
- END
- Ouch:
- PRINT "DEBUG: ", ODBC::Error(dbh), "\n"
- GOTO Done
Code: Text
- jrs@linux-dev:~/sb/examples$ scriba sql_odbc.sb
- 133 Chamber Italian A Fateful Reflection of a Moose And a Husband who must Overcome a Monkey in Nigeria
- 384 Grosse Wonderful A Epic Drama of a Cat And a Explorer who must Redeem a Moose in Australia
- 8 Airport Pollock A Epic Tale of a Moose And a Girl who must Confront a Monkey in Ancient India
- 98 Bright Encounters A Fateful Yarn of a Lumberjack And a Feminist who must Conquer a Student in A Jet Boat
- 1 Academy Dinosaur A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies
- 2 Ace Goldfinger A Astounding Epistle of a Database Administrator And a Explorer who must Find a Car in Ancient China
- 3 Adaptation Holes A Astounding Reflection of a Lumberjack And a Car who must Sink a Lumberjack in A Baloon Factory
- 4 Affair Prejudice A Fanciful Documentary of a Frisbee And a Lumberjack who must Chase a Monkey in A Shark Tank
- 5 African Egg A Fast-Paced Documentary of a Pastry Chef And a Dentist who must Pursue a Forensic Psychologist in The Gulf of Mexico
- 6 Agent Truman A Intrepid Panorama of a Robot And a Boy who must Escape a Sumo Wrestler in Ancient China
- 7 Airplane Sierra A Touching Saga of a Hunter And a Butler who must Discover a Butler in A Jet Boat
- 9 Alabama Devil A Thoughtful Panorama of a Database Administrator And a Mad Scientist who must Outgun a Mad Scientist in A Jet Boat
- 10 Aladdin Calendar A Action-Packed Tale of a Man And a Lumberjack who must Reach a Feminist in Ancient China
- 11 Alamo Videotape A Boring Epistle of a Butler And a Cat who must Fight a Pastry Chef in A MySQL Convention
- 12 Alaska Phantom A Fanciful Saga of a Hunter And a Pastry Chef who must Vanquish a Boy in Australia
- 213 Date Speed A Touching Saga of a Composer And a Moose who must Discover a Dentist in A MySQL Convention
- 13 Ali Forever A Action-Packed Drama of a Dentist And a Crocodile who must Battle a Feminist in The Canadian Rockies
- 14 Alice Fantasia A Emotional Drama of a A Shark And a Database Administrator who must Vanquish a Pioneer in Soviet Georgia
- 15 Alien Center A Brilliant Drama of a Cat And a Mad Scientist who must Battle a Feminist in A MySQL Convention
- 16 Alley Evolution A Fast-Paced Drama of a Robot And a Composer who must Battle a Astronaut in New Orleans
- 17 Alone Trip A Fast-Paced Character Study of a Composer And a Dog who must Outgun a Boat in An Abandoned Fun House
- 18 Alter Victory A Thoughtful Drama of a Composer And a Feminist who must Meet a Secret Agent in The Canadian Rockies
- 19 Amadeus Holy A Emotional Display of a Pioneer And a Technical Writer who must Battle a Man in A Baloon
- 20 Amelie Hellfighters A Boring Drama of a Woman And a Squirrel who must Conquer a Student in A Baloon
- 21 American Circus A Insightful Drama of a Girl And a Astronaut who must Face a Database Administrator in A Shark Tank
- jrs@linux-dev:~/sb/examples$